summaryrefslogtreecommitdiff
path: root/CryptClass/HASHCrypt.cpp
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2015-03-11 09:51:03 +0400
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2015-03-11 09:51:03 +0400
commit783197aaa13abbfb7757ecec912dfe9cb6e52c75 (patch)
tree399f42e41babbcf697f21c30f4cabb1f121e6c34 /CryptClass/HASHCrypt.cpp
parent998745fe45c89570bd1d02e0e60199fc535da89b (diff)
Implement FileManIOFileClass, general bug correction.
Diffstat (limited to 'CryptClass/HASHCrypt.cpp')
-rw-r--r--CryptClass/HASHCrypt.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/CryptClass/HASHCrypt.cpp b/CryptClass/HASHCrypt.cpp
index 11fc04c..cd0dab6 100644
--- a/CryptClass/HASHCrypt.cpp
+++ b/CryptClass/HASHCrypt.cpp
@@ -8,10 +8,13 @@
*
*/
-
+//----- class -----
#include "HASHCrypt.hpp"
+
+
+
//Constructor
HASHCrypt::HASHCrypt(){
}
@@ -47,7 +50,7 @@ void HASHCrypt::getSHA_256(std::string chain, byte* digest, int size){
}
-
+//Check the size of the digest
void HASHCrypt::checkDigestSize(int sizeRequired, int size){
try{
if(size !=sizeRequired){
@@ -61,7 +64,7 @@ void HASHCrypt::checkDigestSize(int sizeRequired, int size){
}
}
-
+//Make the error
std::string HASHCrypt::getInvalidDigestSizeError(int sizeRequired, int size){
std::ostringstream erreurStream;
erreurStream << "Invalid digest size ! ("<< sizeRequired <<" bytes required and "<< size <<" given)";
@@ -69,6 +72,7 @@ std::string HASHCrypt::getInvalidDigestSizeError(int sizeRequired, int size){
}
+//Compare 2 digest (same size)
bool HASHCrypt::compareDigest(byte* digest1, byte* digest2, int size){
//Try is more safe
@@ -91,6 +95,7 @@ bool HASHCrypt::compareDigest(byte* digest1, byte* digest2, int size){
return true;
}
+
//Convert digest to string
std::string HASHCrypt::digestToString(byte* digest, int size){