| 534 | } |
| 535 | |
| 536 | int hex2bin(uchar *d, const char *s, int maxlen) |
| 537 | { |
| 538 | memset(d, 0, maxlen); |
| 539 | int len; |
| 540 | for(len = 0; s[len] && len < maxlen * 2; len++) |
| 541 | { |
| 542 | const char *hd = strchr(hexdigits, tolower(s[len])); |
| 543 | if(!hd) break; // -> not a hex digit |
| 544 | d[len / 2] |= (hd - hexdigits) << ((len & 1) ? 0 : 4); |
| 545 | } |
| 546 | return len / 2; |
| 547 | } |
| 548 | |
| 549 | /////////////////////////////////////////////// Ed25519: high-speed high-security signatures ////////////////////////////////////////////////////// |
| 550 |
no outgoing calls
no test coverage detected