Update M467 AES-GCM for H/W gcm in-buffer creteria

pull/15337/head
cyliangtw 2022-05-17 12:15:00 +08:00 committed by Chun-Chieh Li
parent 655ec9098c
commit 3fe95b2fb8
1 changed files with 1 additions and 5 deletions

View File

@ -430,10 +430,7 @@ int mbedtls_gcm_update( mbedtls_gcm_context *ctx,
/* Error if length too large */ /* Error if length too large */
if( (size_t)len != input_length) if( (size_t)len != input_length)
return( MBEDTLS_ERR_GCM_BAD_INPUT ); return( MBEDTLS_ERR_GCM_BAD_INPUT );
if(len + ctx->gcm_buf_bytes > MAX_GCM_BUF)
return (MBEDTLS_ERR_GCM_BAD_INPUT);
len_aligned = (len & 0xf) ? (int32_t)(len & (~0xful))+16:len; len_aligned = (len & 0xf) ? (int32_t)(len & (~0xful))+16:len;
@ -508,7 +505,6 @@ int mbedtls_gcm_update( mbedtls_gcm_context *ctx,
memcpy(ctx->fb_buf2, ctx->fb_buf, 72); memcpy(ctx->fb_buf2, ctx->fb_buf, 72);
// ctx->firstFlag = 0; // ctx->firstFlag = 0;
CRPT->AES_CNT = u32Size; CRPT->AES_CNT = u32Size;
ctx->gcm_buf_bytes = u32Size;
if((ret = AES_Run(ctx, ctx->basicOpt | FBIN | FBOUT | DMACC))) if((ret = AES_Run(ctx, ctx->basicOpt | FBIN | FBOUT | DMACC)))
{ {