Skip to content

Commit 789c8b8

Browse files
update TODO comments for Chacha20 implementation regarding block length and nonce handling
1 parent 16c802e commit 789c8b8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pkg/driver_cryptocell_310/psa_cryptocell_310/cipher_chacha20.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ psa_status_t psa_cipher_chacha20_update(psa_cipher_chacha20_ctx_t *ctx,
156156
CRYS_CHACHA_BLOCK_SIZE_IN_BYTES) * CRYS_CHACHA_BLOCK_SIZE_IN_BYTES;
157157
/* xcrypt full blocks */
158158

159+
/* IoT-TODO: if blocks_length == 0: CRYS_CHACHA_Block returns PSA_INVALID_ARGUMENT (CRYS_CHACHA_DATA_IN_SIZE_ILLEGAL) */
159160
if(blocks_length > 0) {
160161
periph_status = CRYS_CHACHA_Block( &ctx->ctx.post_setup,
161162
(uint8_t *)&input[input_index],

sys/crypto/psa_riot_cipher/chacha20.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ psa_status_t psa_cipher_chacha20_set_iv(psa_cipher_chacha20_ctx_t *ctx,
6363
/* See PSA Specification */
6464
switch (iv_length) {
6565
case 8:
66-
/* IoT-TODO: have to implement this? */
66+
/* IoT-TODO: Chacha20 implementation only handles 12byte nonce */
6767
/* 8 bytes: the cipher operation uses the original [CHACHA20] definition
6868
of ChaCha20: the provided IV is used as the 64-bit nonce, and the 64-bit
6969
counter value is set to zero. */

0 commit comments

Comments
 (0)