|
|
@ -22,6 +22,7 @@ namespace crypto |
|
|
|
|
|
|
|
|
|
|
|
virtual ~CryptoKeyDecryptor () {}; |
|
|
|
virtual ~CryptoKeyDecryptor () {}; |
|
|
|
virtual bool Decrypt (const uint8_t * encrypted, uint8_t * data, BN_CTX * ctx, bool zeroPadding) = 0; // 512/514 bytes encrypted, 222 bytes data
|
|
|
|
virtual bool Decrypt (const uint8_t * encrypted, uint8_t * data, BN_CTX * ctx, bool zeroPadding) = 0; // 512/514 bytes encrypted, 222 bytes data
|
|
|
|
|
|
|
|
virtual size_t GetPublicKeyLen () const = 0; // we need it to set key in LS2
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// ElGamal
|
|
|
|
// ElGamal
|
|
|
@ -43,6 +44,7 @@ namespace crypto |
|
|
|
|
|
|
|
|
|
|
|
ElGamalDecryptor (const uint8_t * priv); |
|
|
|
ElGamalDecryptor (const uint8_t * priv); |
|
|
|
bool Decrypt (const uint8_t * encrypted, uint8_t * data, BN_CTX * ctx, bool zeroPadding); |
|
|
|
bool Decrypt (const uint8_t * encrypted, uint8_t * data, BN_CTX * ctx, bool zeroPadding); |
|
|
|
|
|
|
|
size_t GetPublicKeyLen () const { return 256; }; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
|
|
|
|
|
|
|
@ -73,6 +75,7 @@ namespace crypto |
|
|
|
ECIESP256Decryptor (const uint8_t * priv); |
|
|
|
ECIESP256Decryptor (const uint8_t * priv); |
|
|
|
~ECIESP256Decryptor (); |
|
|
|
~ECIESP256Decryptor (); |
|
|
|
bool Decrypt (const uint8_t * encrypted, uint8_t * data, BN_CTX * ctx, bool zeroPadding); |
|
|
|
bool Decrypt (const uint8_t * encrypted, uint8_t * data, BN_CTX * ctx, bool zeroPadding); |
|
|
|
|
|
|
|
size_t GetPublicKeyLen () const { return 64; }; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
|
|
|
|
|
|
|
@ -105,6 +108,7 @@ namespace crypto |
|
|
|
ECIESGOSTR3410Decryptor (const uint8_t * priv); |
|
|
|
ECIESGOSTR3410Decryptor (const uint8_t * priv); |
|
|
|
~ECIESGOSTR3410Decryptor (); |
|
|
|
~ECIESGOSTR3410Decryptor (); |
|
|
|
bool Decrypt (const uint8_t * encrypted, uint8_t * data, BN_CTX * ctx, bool zeroPadding); |
|
|
|
bool Decrypt (const uint8_t * encrypted, uint8_t * data, BN_CTX * ctx, bool zeroPadding); |
|
|
|
|
|
|
|
size_t GetPublicKeyLen () const { return 64; }; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
|
|
|
|
|
|
|
|