added libtomcrypt-1.07
This commit is contained in:
committed by
Steffen Jaeckel
parent
72412f6dac
commit
4a1a5796de
@@ -52,7 +52,9 @@ int ctr_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s
|
||||
|
||||
/* handle acceleration only if pad is empty, accelerator is present and length is >= a block size */
|
||||
if ((ctr->padlen == ctr->blocklen) && cipher_descriptor[ctr->cipher].accel_ctr_encrypt != NULL && (len >= (unsigned long)ctr->blocklen)) {
|
||||
cipher_descriptor[ctr->cipher].accel_ctr_encrypt(pt, ct, len/ctr->blocklen, ctr->ctr, ctr->mode, &ctr->key);
|
||||
if ((err = cipher_descriptor[ctr->cipher].accel_ctr_encrypt(pt, ct, len/ctr->blocklen, ctr->ctr, ctr->mode, &ctr->key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
len %= ctr->blocklen;
|
||||
}
|
||||
|
||||
@@ -79,7 +81,9 @@ int ctr_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s
|
||||
}
|
||||
|
||||
/* encrypt it */
|
||||
cipher_descriptor[ctr->cipher].ecb_encrypt(ctr->ctr, ctr->pad, &ctr->key);
|
||||
if ((err = cipher_descriptor[ctr->cipher].ecb_encrypt(ctr->ctr, ctr->pad, &ctr->key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
ctr->padlen = 0;
|
||||
}
|
||||
#ifdef LTC_FAST
|
||||
|
||||
Reference in New Issue
Block a user