mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-23 17:36:37 +02:00
Add interface for edddsa key generation.
This commit is contained in:
parent
93d60152d5
commit
99b2ca860d
2 changed files with 11 additions and 0 deletions
|
@ -40,5 +40,13 @@ void EDDSA25519Signer::Sign(CryptoPP::RandomNumberGenerator& rnd, const uint8_t*
|
||||||
ed25519_ref10_sign(signature, buf, len, m_PrivateKey, m_PublicKey);
|
ed25519_ref10_sign(signature, buf, len, m_PrivateKey, m_PublicKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CreateEDDSARandomKeys(CryptoPP::RandomNumberGenerator& rnd, uint8_t* privateKey,
|
||||||
|
uint8_t* publicKey)
|
||||||
|
{
|
||||||
|
rnd.GenerateBlock(privateKey, EDDSA25519_PRIVATE_KEY_LENGTH);
|
||||||
|
ed25519_ref10_pubkey(publicKey, privateKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,9 @@ public:
|
||||||
uint8_t m_PublicKey[EDDSA25519_PUBLIC_KEY_LENGTH];
|
uint8_t m_PublicKey[EDDSA25519_PUBLIC_KEY_LENGTH];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void CreateEDDSARandomKeys(CryptoPP::RandomNumberGenerator& rnd, uint8_t* privateKey,
|
||||||
|
uint8_t* publicKey);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue