We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not sure you intended this, but the encryption and decryption function are not symmetrical. (i.e. the ct length is not encoded in the padding)
Basic code sample follows.
` uint8_t msg[7] = "Simola"; size_t pad = (sizeof(msg) + 15) & 0xFFFFFFF0; uint8_t enc[16 + pad]; aead_encrypt(enc, msg, 7, NULL, 0, 0, key_bytes); uint8_t dec[16]; int rc = aead_decrypt(dec, enc, sizeof(enc), NULL, 0, 0, key_bytes);
assert(crypto_equal(msg, dec, 7) && rc == 1);`
The assertion fails, but If I call the decryption function with srclen = 16+7 then the decryption is successfull.
srclen = 16+7
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Not sure you intended this, but the encryption and decryption function are not symmetrical. (i.e. the ct length is not encoded in the padding)
Basic code sample follows.
` uint8_t msg[7] = "Simola";
size_t pad = (sizeof(msg) + 15) & 0xFFFFFFF0;
uint8_t enc[16 + pad];
aead_encrypt(enc, msg, 7, NULL, 0, 0, key_bytes);
uint8_t dec[16];
int rc = aead_decrypt(dec, enc, sizeof(enc), NULL, 0, 0, key_bytes);
The assertion fails, but If I call the decryption function with
srclen = 16+7
then the decryption is successfull.The text was updated successfully, but these errors were encountered: