KeyDerivationFunction for NTCP2

This commit is contained in:
orignal 2018-06-05 15:37:08 -04:00
parent 86c1984982
commit 8c9eaccc11
4 changed files with 41 additions and 0 deletions

View file

@ -411,6 +411,14 @@ namespace crypto
}
}
void Ed25519::Mul (const uint8_t * p, const uint8_t * e, uint8_t * buf, BN_CTX * ctx) const
{
auto P = DecodePublicKey (p, ctx);
BIGNUM * e1 = DecodeBN<32> (e);
EncodePublicKey (Mul (P, e1, ctx), buf, ctx);
BN_free (e1);
}
void Ed25519::ExpandPrivateKey (const uint8_t * key, uint8_t * expandedKey)
{
SHA512 (key, EDDSA25519_PRIVATE_KEY_LENGTH, expandedKey);