Skip to content

Commit

Permalink
removeme, test
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Philipoom <[email protected]>
  • Loading branch information
jadephilipoom committed Jan 5, 2024
1 parent 338b813 commit 2058e5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sw/device/lib/crypto/impl/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static_assert(sizeof(crypto_key_config_t) % sizeof(uint32_t) == 0,
static inline void gcm_context_save(aes_gcm_context_t *internal_ctx,
aes_gcm_ctx_t *api_ctx) {
hardened_memcpy(api_ctx->data, (uint32_t *)internal_ctx,
ARRAYSIZE(api_ctx->data));
ARRAYSIZE(internal_ctx->data));
}

/**
Expand All @@ -61,7 +61,7 @@ static inline void gcm_context_save(aes_gcm_context_t *internal_ctx,
static inline void gcm_context_restore(aes_gcm_ctx_t *api_ctx,
aes_gcm_context_t *internal_ctx) {
hardened_memcpy((uint32_t *)internal_ctx, api_ctx->data,
ARRAYSIZE(api_ctx->data));
ARRAYSIZE(internal_ctx->data));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion sw/device/lib/crypto/impl/aes_gcm/aes_gcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef struct aes_gcm_context {
* Current context for the tag's ongoing GHASH computation.
*/
ghash_context_t ghash_ctx;
} aes_gcm_context_t;
} __attribute__((aligned(sizeof(uint32_t)))) aes_gcm_context_t;

/**
* AES-GCM authenticated encryption as defined in NIST SP800-38D, algorithm 4.
Expand Down
2 changes: 1 addition & 1 deletion sw/device/lib/crypto/include/aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ typedef enum aes_padding {
* change.
 */
typedef struct aes_gcm_ctx {
uint32_t data[92];
uint32_t data[120];
} aes_gcm_ctx_t;

/**
Expand Down

0 comments on commit 2058e5d

Please sign in to comment.