MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / DecodeBN

Method DecodeBN

libi2pd/Ed25519.cpp:444–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected