Skip to content

Commit

Permalink
Clarify VPAES/BSAES logic.
Browse files Browse the repository at this point in the history
Make the #ifdef logic the same between the `aes_set_key()` and
`aes_block()`.
  • Loading branch information
briansmith committed May 14, 2018
1 parent 730f7a9 commit 21c98d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crypto/fipsmodule/cipher/e_aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,20 @@ typedef int (*aes_set_key_f)(const uint8_t *userKey, unsigned bits,
AES_KEY *key);

static aes_set_key_f aes_set_key(void) {
// Keep this in sync with |aes_block| and |aes_ctr|.

#if defined(HWAES)
if (hwaes_capable()) {
return GFp_aes_hw_set_encrypt_key;
}
#endif

#if defined(VPAES)
#if defined(BSAES)
if (bsaes_capable()) {
return GFp_AES_set_encrypt_key;
}
#endif

#if defined(VPAES)
if (vpaes_capable()) {
return GFp_vpaes_set_encrypt_key;
}
Expand Down

0 comments on commit 21c98d8

Please sign in to comment.