From 7d2c4734224eb7f6cf699bc84f505c06c4394b35 Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Mon, 9 Mar 2015 12:51:23 +0400 Subject: AES first release. Add method to HASHCrypt class. --- CryptClass/HASHCrypt.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'CryptClass/HASHCrypt.cpp') diff --git a/CryptClass/HASHCrypt.cpp b/CryptClass/HASHCrypt.cpp index 4c42ef3..11fc04c 100644 --- a/CryptClass/HASHCrypt.cpp +++ b/CryptClass/HASHCrypt.cpp @@ -42,6 +42,8 @@ void HASHCrypt::getSHA_256(std::string chain, byte* digest, int size){ //Create the SHA-256 on digest parameter CryptoPP::SHA256 hash; hash.CalculateDigest( digest, (byte*) chain.c_str(), chain.length() ); + + } @@ -66,3 +68,37 @@ std::string HASHCrypt::getInvalidDigestSizeError(int sizeRequired, int size){ return erreurStream.str(); } + +bool HASHCrypt::compareDigest(byte* digest1, byte* digest2, int size){ + + //Try is more safe + try + { + //Compare the two digest + for(int i=0; i