diff --git a/include/fc/crypto/elliptic.hpp b/include/fc/crypto/elliptic.hpp index 401c132..6730a19 100644 --- a/include/fc/crypto/elliptic.hpp +++ b/include/fc/crypto/elliptic.hpp @@ -99,6 +99,12 @@ namespace fc { bool verify( const fc::sha256& digest, const signature& sig ); public_key get_public_key()const; + + + inline friend bool operator==( const private_key& a, const private_key& b ) + { + return a.get_secret() == b.get_secret(); + } private: fc::fwd my; }; diff --git a/src/crypto/aes.cpp b/src/crypto/aes.cpp index 7459c93..72315f3 100644 --- a/src/crypto/aes.cpp +++ b/src/crypto/aes.cpp @@ -256,6 +256,7 @@ std::vector aes_encrypt( const fc::sha512& key, const std::vector& p auto cipher_len = aes_encrypt( (unsigned char*)plain_text.data(), plain_text.size(), (unsigned char*)&key, ((unsigned char*)&key)+32, (unsigned char*)cipher_text.data() ); + FC_ASSERT( cipher_len <= cipher_text.size() ); cipher_text.resize(cipher_len); return cipher_text;