armv8crypto: fix AES-XTS regression introduced by ed9b7f44

Initialization of the XTS key schedule was accidentally dropped
when adding AES-GCM support so all-zero schedule was used instead.
This rendered previously created GELI partitions unusable.
This change restores proper XTS key schedule initialization.

Reported by:	Peter Jeremy <peter@rulingia.com>
MFC after:	immediately
This commit is contained in:
Oleksandr Tymoshenko 2021-03-07 12:03:47 -08:00
parent f7bfe31019
commit 748be78e60

View File

@ -305,6 +305,9 @@ armv8_crypto_cipher_setup(struct armv8_crypto_session *ses,
aes_v8_set_decrypt_key(key,
keylen * 8, &ses->dec_schedule);
if (csp->csp_cipher_alg == CRYPTO_AES_XTS)
aes_v8_set_encrypt_key(key + keylen, keylen * 8, &ses->xts_schedule);
if (csp->csp_cipher_alg == CRYPTO_AES_NIST_GCM_16) {
memset(H.c, 0, sizeof(H.c));
aes_v8_encrypt(H.c, H.c, &ses->enc_schedule);