Upgrade libtomcrypt
This commit is contained in:
@@ -52,23 +52,19 @@ int cfb_start_ex(int cipher, const unsigned char *IV, const unsigned char *key,
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
||||
/* copy data */
|
||||
cfb->cipher = cipher;
|
||||
cfb->width = width;
|
||||
cfb->blocklen = cipher_descriptor[cipher].block_length;
|
||||
for (x = 0; x < cfb->blocklen; x++) {
|
||||
cfb->pad[x] = IV[x];
|
||||
}
|
||||
|
||||
/* init the cipher */
|
||||
if ((err = cipher_descriptor[cipher].setup(key, keylen, num_rounds, &cfb->key)) != CRYPT_OK) {
|
||||
if ((err = ecb_start(cipher, key, keylen, num_rounds, &cfb->ecb)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
/* copy data */
|
||||
for (x = 0; x < cfb->ecb.blocklen; x++) {
|
||||
cfb->pad[x] = IV[x];
|
||||
}
|
||||
|
||||
/* encrypt the IV */
|
||||
cfb->padlen = 0;
|
||||
return cipher_descriptor[cfb->cipher].ecb_encrypt(cfb->pad, cfb->IV, &cfb->key);
|
||||
return ecb_encrypt_block(cfb->pad, cfb->IV, &cfb->ecb);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user