mirror of
https://codeberg.org/scip/dbtool.git
synced 2025-12-16 19:00:58 +01:00
unitfixes (#3)
- fix regex match padding - fix key copying - add more unit tests
This commit is contained in:
@@ -56,11 +56,8 @@ void cipher::init(const string& phrase) {
|
||||
dig.initDigest();
|
||||
dig.putDigest( (unsigned char *)phrase.c_str(), phrase.length() );
|
||||
__key = dig.stringDigest(); // this is a 32 byte long string, as Rijndael:: expects
|
||||
|
||||
/* convert the key to unsigned char[] */
|
||||
for(int i=0; i<32; i++) {
|
||||
key[i] = __key[i];
|
||||
}
|
||||
|
||||
memcpy(key, __key, 32);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user