unitfixes (#3)

- fix regex match padding
- fix key copying
- add more unit tests
This commit is contained in:
T. von Dein
2025-11-21 22:10:52 +01:00
parent bb967c68c6
commit f2137627d7
8 changed files with 74 additions and 24 deletions

View File

@@ -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);
}