5 static int tom_encrypt(void *pt, int ptlen, void *key, int keylen,
9 unsigned char iv[16] = {0};
12 if ((index = register_cipher(&aes_desc)) == -1) return -1;
13 // if ((index = find_cipher("aes")) == -1) return -1;
14 // cipher = cipher_descriptor[index];
15 if ((err = cbc_start(index, iv, key, keylen, 0, &cbc)) != CRYPT_OK)
17 if ((err = cbc_encrypt(pt, ct, ptlen, &cbc)) != CRYPT_OK)
19 if ((err = cbc_done(&cbc)) != CRYPT_OK)
21 if ((err = unregister_cipher(&aes_desc)) != CRYPT_OK)
26 static int tom_decrypt()
41 struct crypto_interface tom_crypto_if = {
43 .encrypt = tom_encrypt,
44 .decrypt = tom_decrypt,