diff options
Diffstat (limited to 'crypto_aead/lilliputaei128v1/ref/test')
| -rw-r--r-- | crypto_aead/lilliputaei128v1/ref/test/test-ae-roundtrip.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/crypto_aead/lilliputaei128v1/ref/test/test-ae-roundtrip.c b/crypto_aead/lilliputaei128v1/ref/test/test-ae-roundtrip.c index 4b03efb..a7bd8ed 100644 --- a/crypto_aead/lilliputaei128v1/ref/test/test-ae-roundtrip.c +++ b/crypto_aead/lilliputaei128v1/ref/test/test-ae-roundtrip.c @@ -81,24 +81,22 @@ int main() for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { uint8_t ciphertext[v->message_len+BLOCK_BYTES]; - size_t ciphertext_len; uint8_t tag[TAG_BYTES]; lilliput_ae_encrypt( v->message_len, v->message, v->auth_len, v->auth, v->key, v->nonce, - &ciphertext_len, ciphertext, + ciphertext, tag ); uint8_t deciphered[v->message_len]; - size_t deciphered_len; bool valid = lilliput_ae_decrypt( - ciphertext_len, ciphertext, + v->message_len, ciphertext, v->auth_len, v->auth, v->key, v->nonce, tag, - &deciphered_len, deciphered + deciphered ); if (!valid) @@ -108,14 +106,7 @@ int main() continue; } - if (deciphered_len != v->message_len) - { - REPORT_DIFFERENCE(v->name, "deciphered plaintext length"); - diff++; - continue; - } - - if (memcmp(deciphered, v->message, deciphered_len) != 0) + if (memcmp(deciphered, v->message, v->message_len) != 0) { REPORT_DIFFERENCE(v->name, "deciphered plaintext"); diff++; |
