-
Notifications
You must be signed in to change notification settings - Fork 28
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
59 add hmac support #93
Conversation
src/src_main/crypto_tc.c
Outdated
status = cryptography_if->cryptography_aead_encrypt(&p_new_enc_frame[index], // ciphertext output | ||
(size_t)tf_payload_len, // length of data | ||
(uint8_t*)(p_in_frame + TC_FRAME_HEADER_SIZE + segment_hdr_len), // plaintext input | ||
(size_t)tf_payload_len, // in data length | ||
NULL, // Using SA key reference, key is null | ||
KEY_SIZE, // Length of key. TODO - why is this hard-coded? | ||
ek_ring[sa_ptr->ekid].key_len, // Length of key derived from sa_ptr key_ref |
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 thought we agreed in our weekly meetings that key length would be a function of the ECS/ACS algorithm enums being chosen -- EG, if ecs is CRYPTO_CIPHER_AES256_GCM, then that means we have a 32 byte key. (256/8 = 32). AES256 must have a 32 byte key, since we know that's the algorithm, we don't need to reference the ek_ring.
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.
<not duplicating my comments for all new key_len functions in this PR, this applies anywhere key_len is referenced>
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.
Pretty good... Just a few changes required, see my comments.
Codecov Report
@@ Coverage Diff @@
## dev #93 +/- ##
==========================================
+ Coverage 83.51% 84.59% +1.07%
==========================================
Files 18 18
Lines 4229 4954 +725
==========================================
+ Hits 3532 4191 +659
- Misses 697 763 +66
Continue to review full report at Codecov.
|
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.
Very good 👍
No description provided.