Upgrade libtomcrypt
This commit is contained in:
@@ -24,7 +24,7 @@ static int s_tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned ch
|
||||
}
|
||||
#endif
|
||||
|
||||
err = cipher_descriptor[xts->cipher].ecb_decrypt(P, P, &xts->key1);
|
||||
err = ecb_decrypt_block(P, P, &xts->key1);
|
||||
|
||||
#ifdef LTC_FAST
|
||||
for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) {
|
||||
@@ -53,7 +53,7 @@ static int s_tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned ch
|
||||
int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt, unsigned char *tweak,
|
||||
const symmetric_xts *xts)
|
||||
{
|
||||
unsigned char PP[16], CC[16], T[16];
|
||||
unsigned char PP[16] = {0}, CC[16], T[16];
|
||||
unsigned long i, m, mo, lim;
|
||||
int err;
|
||||
|
||||
@@ -86,7 +86,7 @@ int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt,
|
||||
if (cipher_descriptor[xts->cipher].accel_xts_decrypt && lim > 0) {
|
||||
|
||||
/* use accelerated decryption for whole blocks */
|
||||
if ((err = cipher_descriptor[xts->cipher].accel_xts_decrypt(ct, pt, lim, tweak, &xts->key1, &xts->key2)) !=
|
||||
if ((err = cipher_descriptor[xts->cipher].accel_xts_decrypt(ct, pt, lim, tweak, &xts->key1.key, &xts->key2.key)) !=
|
||||
CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt,
|
||||
XMEMCPY(T, tweak, sizeof(T));
|
||||
} else {
|
||||
/* encrypt the tweak */
|
||||
if ((err = cipher_descriptor[xts->cipher].ecb_encrypt(tweak, T, &xts->key2)) != CRYPT_OK) {
|
||||
if ((err = ecb_encrypt_block(tweak, T, &xts->key2)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt,
|
||||
}
|
||||
|
||||
/* Decrypt the tweak back */
|
||||
if ((err = cipher_descriptor[xts->cipher].ecb_decrypt(T, tweak, &xts->key2)) != CRYPT_OK) {
|
||||
if ((err = ecb_decrypt_block(T, tweak, &xts->key2)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user