mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-30 20:52:30 +02:00
Add eddsa from ref10 implementation (with some modifications).
This commit is contained in:
parent
2fcc91a755
commit
93d60152d5
84 changed files with 5798 additions and 567 deletions
29
core/crypto/SignatureBase.h
Normal file
29
core/crypto/SignatureBase.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
#ifndef SIGNATUREBASE_H__
|
||||
#define SIGNATUREBASE_H__
|
||||
|
||||
#include <cryptopp/osrng.h>
|
||||
|
||||
namespace i2p {
|
||||
namespace crypto {
|
||||
|
||||
class Verifier {
|
||||
public:
|
||||
|
||||
virtual ~Verifier() {};
|
||||
virtual bool Verify(const uint8_t * buf, size_t len, const uint8_t * signature) const = 0;
|
||||
virtual size_t GetPublicKeyLen() const = 0;
|
||||
virtual size_t GetSignatureLen() const = 0;
|
||||
virtual size_t GetPrivateKeyLen() const { return GetSignatureLen()/2; };
|
||||
};
|
||||
|
||||
class Signer {
|
||||
public:
|
||||
|
||||
virtual ~Signer() {};
|
||||
virtual void Sign(CryptoPP::RandomNumberGenerator& rnd, const uint8_t * buf, int len, uint8_t * signature) const = 0;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#endif // SIGNATUREBASE_H__
|
Loading…
Add table
Add a link
Reference in a new issue