Cipher: test multiple cycles
GCM-cipher: just trust the user to call update_ad at the right time
This commit is contained in:
parent
45125bc160
commit
1af50a240b
2 changed files with 34 additions and 32 deletions
|
@ -445,13 +445,6 @@ int cipher_update_ad( cipher_context_t *ctx,
|
|||
#if defined(POLARSSL_GCM_C)
|
||||
if( POLARSSL_MODE_GCM == ctx->cipher_info->mode )
|
||||
{
|
||||
/* Make sure we're called right after cipher_reset() */
|
||||
if( ((gcm_context *) ctx->cipher_ctx)->len != 0 ||
|
||||
((gcm_context *) ctx->cipher_ctx)->add_len != 0 )
|
||||
{
|
||||
return POLARSSL_ERR_CIPHER_FEATURE_UNAVAILABLE;
|
||||
}
|
||||
|
||||
return gcm_starts( ctx->cipher_ctx, ctx->operation,
|
||||
ctx->iv, ctx->iv_size, ad, ad_len );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue