| 442 | |
| 443 | template<int len> |
| 444 | BIGNUM * Ed25519::DecodeBN (const uint8_t * buf) const |
| 445 | { |
| 446 | // buf is Little Endian convert it to Big Endian |
| 447 | uint8_t buf1[len]; |
| 448 | for (size_t i = 0; i < len/2; i++) // invert bytes |
| 449 | { |
| 450 | buf1[i] = buf[len -1 - i]; |
| 451 | buf1[len -1 - i] = buf[i]; |
| 452 | } |
| 453 | BIGNUM * res = BN_new (); |
| 454 | BN_bin2bn (buf1, len, res); |
| 455 | return res; |
| 456 | } |
| 457 | |
| 458 | void Ed25519::EncodeBN (const BIGNUM * bn, uint8_t * buf, size_t len) const |
| 459 | { |
nothing calls this directly
no outgoing calls
no test coverage detected