Sfoglia il codice sorgente

Drop some unused bsaes to aes_nohw dependencies.

When the CBC and CTR EVP_CIPHER implementations use bsaes, they never
call dat->block. Note this is *not* true of aes_ctr_set_key which is
used in contexts where it needs single-block operations.

Bug: 256
Change-Id: Ibea4f2117a2220cd5cb09f6cf12b7a50c28bf794
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/35168
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 5 anni fa
committed by Adam Langley
parent
commit
fdb48f9861
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. +4
    -2
      crypto/fipsmodule/cipher/e_aes.c

+ 4
- 2
crypto/fipsmodule/cipher/e_aes.c Vedi File

@@ -111,7 +111,8 @@ static int aes_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key,
}
} else if (bsaes_capable() && mode == EVP_CIPH_CBC_MODE) {
ret = aes_nohw_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks);
dat->block = aes_nohw_decrypt;
// If |dat->stream.cbc| is provided, |dat->block| is never used.
dat->block = NULL;
dat->stream.cbc = bsaes_cbc_encrypt;
} else if (vpaes_capable()) {
ret = vpaes_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks);
@@ -138,7 +139,8 @@ static int aes_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key,
}
} else if (bsaes_capable() && mode == EVP_CIPH_CTR_MODE) {
ret = aes_nohw_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks);
dat->block = aes_nohw_encrypt;
// If |dat->stream.ctr| is provided, |dat->block| is never used.
dat->block = NULL;
dat->stream.ctr = bsaes_ctr32_encrypt_blocks;
} else if (vpaes_capable()) {
ret = vpaes_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks);


Caricamento…
Annulla
Salva