Created
February 7, 2014 22:20
-
-
Save ewust/8873193 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (key) | |
{ do { | |
#ifdef BSAES_CAPABLE | |
if (BSAES_CAPABLE) | |
{ | |
AES_set_encrypt_key(key,ctx->key_len*8,&gctx->ks); | |
CRYPTO_gcm128_init(&gctx->gcm,&gctx->ks, | |
(block128_f)AES_encrypt); | |
gctx->ctr = (ctr128_f)bsaes_ctr32_encrypt_blocks; | |
break; | |
} | |
else | |
#endif | |
#ifdef VPAES_CAPABLE | |
if (VPAES_CAPABLE) | |
{ | |
vpaes_set_encrypt_key(key,ctx->key_len*8,&gctx->ks); | |
CRYPTO_gcm128_init(&gctx->gcm,&gctx->ks, | |
(block128_f)vpaes_encrypt); | |
gctx->ctr = NULL; | |
break; | |
} | |
else | |
#endif | |
(void)0; /* terminate potentially open 'else' */ | |
AES_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks); | |
CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks, (block128_f)AES_encrypt); | |
#ifdef AES_CTR_ASM | |
gctx->ctr = (ctr128_f)AES_ctr32_encrypt; | |
#else | |
gctx->ctr = NULL; | |
#endif | |
} while (0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment