Upgrade libtomcrypt
This commit is contained in:
@@ -34,7 +34,7 @@ static void s_ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *no
|
||||
|
||||
/* Ktop = ENCIPHER(K, Nonce[1..122] || zeros(6)) */
|
||||
iNonce[ocb->block_len-1] = iNonce[ocb->block_len-1] & 0xC0;
|
||||
if ((cipher_descriptor[ocb->cipher].ecb_encrypt(iNonce, iKtop, &ocb->key)) != CRYPT_OK) {
|
||||
if ((ecb_encrypt_block(iNonce, iKtop, &ocb->key)) != CRYPT_OK) {
|
||||
zeromem(ocb->Offset_current, ocb->block_len);
|
||||
return;
|
||||
}
|
||||
@@ -100,7 +100,6 @@ int ocb3_init(ocb3_state *ocb, int cipher,
|
||||
if ((err = cipher_is_valid(cipher)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
ocb->cipher = cipher;
|
||||
|
||||
/* Valid Nonce?
|
||||
* As of RFC7253: "string of no more than 120 bits" */
|
||||
@@ -121,7 +120,7 @@ int ocb3_init(ocb3_state *ocb, int cipher,
|
||||
|
||||
/* determine which polys to use */
|
||||
ocb->block_len = cipher_descriptor[cipher].block_length;
|
||||
x = (int)(sizeof(polys)/sizeof(polys[0]));
|
||||
x = (int)LTC_ARRAY_SIZE(polys);
|
||||
for (poly = 0; poly < x; poly++) {
|
||||
if (polys[poly].len == ocb->block_len) {
|
||||
break;
|
||||
@@ -135,13 +134,13 @@ int ocb3_init(ocb3_state *ocb, int cipher,
|
||||
}
|
||||
|
||||
/* schedule the key */
|
||||
if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, &ocb->key)) != CRYPT_OK) {
|
||||
if ((err = ecb_start(cipher, key, keylen, 0, &ocb->key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* L_* = ENCIPHER(K, zeros(128)) */
|
||||
zeromem(ocb->L_star, ocb->block_len);
|
||||
if ((err = cipher_descriptor[cipher].ecb_encrypt(ocb->L_star, ocb->L_star, &ocb->key)) != CRYPT_OK) {
|
||||
if ((err = ecb_encrypt_block(ocb->L_star, ocb->L_star, &ocb->key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user