Upgrade libtomcrypt

This commit is contained in:
2025-10-24 19:33:21 +03:00
parent d770dd8df3
commit acc69bb8ad
157 changed files with 922 additions and 761 deletions

View File

@@ -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);
}
/**