mirror of
https://github.com/monero-project/kovri
synced 2025-10-06 08:42:45 +02:00
Crypto: remove ed25519 assertions
The verifier assertion won't allow the verifier to simply return, from which we then throw accordingly. The signer assertion should be removed because we throw on bad signing anyway.
This commit is contained in:
@@ -45,7 +45,6 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cassert>
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -844,8 +843,6 @@ class Ed25519Verifier::Ed25519VerifierImpl
|
|||||||
int const ret(CryptoPP::NaCl::crypto_sign_open(
|
int const ret(CryptoPP::NaCl::crypto_sign_open(
|
||||||
rm, &rmlen, sm.data(), sm.size(), m_Pk.data()));
|
rm, &rmlen, sm.data(), sm.size(), m_Pk.data()));
|
||||||
|
|
||||||
assert(rmlen == mlen);
|
|
||||||
|
|
||||||
return !ret;
|
return !ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -905,7 +902,6 @@ class Ed25519Signer::Ed25519SignerImpl
|
|||||||
CryptoPP::Exception::OTHER_ERROR, "could not ed25519 sign message");
|
CryptoPP::Exception::OTHER_ERROR, "could not ed25519 sign message");
|
||||||
|
|
||||||
// We only want the signature
|
// We only want the signature
|
||||||
assert(sm.size() == smlen);
|
|
||||||
std::copy(sm.begin(), sm.end() - mlen, signature);
|
std::copy(sm.begin(), sm.end() - mlen, signature);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user