mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-30 20:52:30 +02:00
Add tests for EdDSA25519, fix Verifier.
This commit is contained in:
parent
99b2ca860d
commit
eabf434a48
5 changed files with 108 additions and 5 deletions
|
@ -14,7 +14,7 @@ EDDSA25519Verifier::EDDSA25519Verifier(const uint8_t* signingKey)
|
|||
|
||||
bool EDDSA25519Verifier::Verify(const uint8_t* buf, size_t len, const uint8_t* signature) const
|
||||
{
|
||||
return ed25519_ref10_open(signature, buf, len, m_PublicKey) > 0;
|
||||
return ed25519_ref10_open(signature, buf, len, m_PublicKey) >= 0;
|
||||
}
|
||||
|
||||
size_t EDDSA25519Verifier::GetPublicKeyLen() const
|
||||
|
@ -35,7 +35,7 @@ EDDSA25519Signer::EDDSA25519Signer(const uint8_t* signingPrivateKey)
|
|||
ed25519_ref10_pubkey(m_PublicKey, m_PrivateKey);
|
||||
}
|
||||
|
||||
void EDDSA25519Signer::Sign(CryptoPP::RandomNumberGenerator& rnd, const uint8_t* buf, int len, uint8_t* signature) const
|
||||
void EDDSA25519Signer::Sign(CryptoPP::RandomNumberGenerator&, const uint8_t* buf, int len, uint8_t* signature) const
|
||||
{
|
||||
ed25519_ref10_sign(signature, buf, len, m_PrivateKey, m_PublicKey);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue