@@ -31,12 +31,15 @@ static void CHACHA20_POLY1305_AEAD(benchmark::Bench& bench, size_t buffersize, b
31
31
uint32_t len = 0 ;
32
32
bench.batch (buffersize).unit (" byte" ).run ([&] {
33
33
// encrypt or decrypt the buffer with a static key
34
- assert (aead.Crypt (seqnr_payload, seqnr_aad, aad_pos, out.data (), out.size (), in.data (), buffersize, true ));
34
+ const bool crypt_ok_1 = aead.Crypt (seqnr_payload, seqnr_aad, aad_pos, out.data (), out.size (), in.data (), buffersize, true );
35
+ assert (crypt_ok_1);
35
36
36
37
if (include_decryption) {
37
38
// if we decrypt, include the GetLength
38
- assert (aead.GetLength (&len, seqnr_aad, aad_pos, in.data ()));
39
- assert (aead.Crypt (seqnr_payload, seqnr_aad, aad_pos, out.data (), out.size (), in.data (), buffersize, true ));
39
+ const bool get_length_ok = aead.GetLength (&len, seqnr_aad, aad_pos, in.data ());
40
+ assert (get_length_ok);
41
+ const bool crypt_ok_2 = aead.Crypt (seqnr_payload, seqnr_aad, aad_pos, out.data (), out.size (), in.data (), buffersize, true );
42
+ assert (crypt_ok_2);
40
43
}
41
44
42
45
// increase main sequence number
0 commit comments