-
Notifications
You must be signed in to change notification settings - Fork 18
Add support for Hacl_AES_128_GCM_NI and Hacl_AES_128_GCM_M32 #418
New issue
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
base: dev
Are you sure you want to change the base?
Changes from 4 commits
0b35736
28e382e
5d40ece
bcf5962
ff14158
d67a8b4
d93469e
720a2a7
e2db26a
4b5f3ed
4abdd02
943cad6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,262 @@ | ||||||
| /* | ||||||
| * Copyright 2023 Cryspen Sarl | ||||||
| * | ||||||
| * Licensed under the Apache License, Version 2.0 or MIT. | ||||||
| * - http://www.apache.org/licenses/LICENSE-2.0 | ||||||
| * - http://opensource.org/licenses/MIT | ||||||
| */ | ||||||
|
|
||||||
| #include "util.h" | ||||||
|
|
||||||
| #include "krml/internal/target.h" | ||||||
| #ifdef HACL_CAN_COMPILE_AESNI_PCLMUL | ||||||
| #include "Hacl_AES_128_GCM_NI.h" | ||||||
| #endif | ||||||
| #include "Hacl_AES_128_GCM_M32.h" | ||||||
| #include "EverCrypt_AEAD.h" | ||||||
| #include "../third-party/bearssl/bearssl_block.h" | ||||||
| #include "../third-party/bearssl/bearssl_hash.h" | ||||||
| #include "../third-party/bearssl/bearssl_aead.h" | ||||||
|
|
||||||
| static bytes key(16, 7); | ||||||
| static bytes nonce(12, 9); | ||||||
| static bytes mac(16, 0); | ||||||
|
|
||||||
| #ifdef HACL_CAN_COMPILE_AESNI_PCLMUL | ||||||
| static void | ||||||
| HACL_AES_128_GCM_NI_encrypt(benchmark::State& state) | ||||||
| { | ||||||
| bytes plaintext(state.range(0), 0x37); | ||||||
| bytes ciphertext(state.range(0) + 16, 0); | ||||||
|
|
||||||
| for (auto _ : state) { | ||||||
| Lib_IntVector_Intrinsics_vec128 *ctx = (Lib_IntVector_Intrinsics_vec128 *)KRML_HOST_CALLOC((uint32_t)352U, sizeof (uint8_t)); | ||||||
|
||||||
| Hacl_Streaming_Keccak_state *Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_hash_alg a) |
hacl-packages/src/Hacl_Hash_Blake2s_128.c
Line 480 in 81303b8
| Lib_IntVector_Intrinsics_vec128 *Hacl_Blake2s_128_blake2s_malloc(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented malloc/free for AES_GCM context on hacl side mamonet/hacl-star@c9880f1
I will update it for this library once the issue of verifying changes of EverCrypt.AEAD is solved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly to the alloc, do we need a free function here.
Uh oh!
There was an error while loading. Please reload this page.