Added POWER8 implementation for AES/CTR+CBC-MAC (for CCM and EAX modes).

This commit is contained in:
Thomas Pornin 2018-08-12 23:53:23 +02:00
parent ffe3c9166b
commit f8e38c231d
10 changed files with 1105 additions and 3 deletions

View file

@ -3664,6 +3664,19 @@ test_AES_CTRCBC_x86ni(void)
}
}
static void
test_AES_CTRCBC_pwr8(void)
{
const br_block_ctrcbc_class *vt;
vt = br_aes_pwr8_ctrcbc_get_vtable();
if (vt != NULL) {
test_AES_CTRCBC_inner("pwr8", vt);
} else {
printf("Test AES CTR/CBC-MAC pwr8: UNAVAILABLE\n");
}
}
/*
* DES known-answer tests. Order: plaintext, key, ciphertext.
* (mostly from NIST SP 800-20).
@ -6839,6 +6852,13 @@ test_EAX(void)
} else {
printf("Test EAX aes_x86ni: UNAVAILABLE\n");
}
x_ctrcbc = br_aes_pwr8_ctrcbc_get_vtable();
if (x_ctrcbc != NULL) {
test_EAX_inner("aes_pwr8", x_ctrcbc);
} else {
printf("Test EAX aes_pwr8: UNAVAILABLE\n");
}
}
/*
@ -7051,6 +7071,13 @@ test_CCM(void)
} else {
printf("Test CCM aes_x86ni: UNAVAILABLE\n");
}
x_ctrcbc = br_aes_pwr8_ctrcbc_get_vtable();
if (x_ctrcbc != NULL) {
test_CCM_inner("aes_pwr8", x_ctrcbc);
} else {
printf("Test CCM aes_pwr8: UNAVAILABLE\n");
}
}
static void
@ -8253,6 +8280,7 @@ static const struct {
STU(AES_CTRCBC_ct),
STU(AES_CTRCBC_ct64),
STU(AES_CTRCBC_x86ni),
STU(AES_CTRCBC_pwr8),
STU(DES_tab),
STU(DES_ct),
STU(ChaCha20_ct),

View file

@ -518,16 +518,19 @@ SPEED_EAX(AES, aes, 128, small)
SPEED_EAX(AES, aes, 128, ct)
SPEED_EAX(AES, aes, 128, ct64)
SPEED_EAX(AES, aes, 128, x86ni)
SPEED_EAX(AES, aes, 128, pwr8)
SPEED_EAX(AES, aes, 192, big)
SPEED_EAX(AES, aes, 192, small)
SPEED_EAX(AES, aes, 192, ct)
SPEED_EAX(AES, aes, 192, ct64)
SPEED_EAX(AES, aes, 192, x86ni)
SPEED_EAX(AES, aes, 192, pwr8)
SPEED_EAX(AES, aes, 256, big)
SPEED_EAX(AES, aes, 256, small)
SPEED_EAX(AES, aes, 256, ct)
SPEED_EAX(AES, aes, 256, ct64)
SPEED_EAX(AES, aes, 256, x86ni)
SPEED_EAX(AES, aes, 256, pwr8)
static const unsigned char RSA_N[] = {
0xE9, 0xF2, 0x4A, 0x2F, 0x96, 0xDF, 0x0A, 0x23,
@ -1477,6 +1480,9 @@ static const struct {
STU(eax_aes128_x86ni),
STU(eax_aes192_x86ni),
STU(eax_aes256_x86ni),
STU(eax_aes128_pwr8),
STU(eax_aes192_pwr8),
STU(eax_aes256_pwr8),
STU(rsa_i15),
STU(rsa_i31),