mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
use ElGamalEncrypt
This commit is contained in:
parent
ffaabe8674
commit
9da984b866
4 changed files with 11 additions and 35 deletions
16
Crypto.h
16
Crypto.h
|
@ -47,21 +47,7 @@ namespace crypto
|
|||
};
|
||||
|
||||
// ElGamal
|
||||
class ElGamalEncryption
|
||||
{
|
||||
public:
|
||||
|
||||
ElGamalEncryption (const uint8_t * key);
|
||||
~ElGamalEncryption ();
|
||||
|
||||
void Encrypt (const uint8_t * data, uint8_t * encrypted, bool zeroPadding = false) const;
|
||||
|
||||
private:
|
||||
|
||||
BN_CTX * ctx;
|
||||
BIGNUM * a, * b1;
|
||||
};
|
||||
|
||||
void ElGamalEncrypt (const uint8_t * key, const uint8_t * data, uint8_t * encrypted, bool zeroPadding = false);
|
||||
bool ElGamalDecrypt (const uint8_t * key, const uint8_t * encrypted, uint8_t * data, bool zeroPadding = false);
|
||||
void GenerateElGamalKeyPair (uint8_t * priv, uint8_t * pub);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue