1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner.
6 * The library is free for all purposes without any express
12 EAX implementation, decrypt block, by Tom St Denis
19 Decrypt data with the EAX protocol
20 @param eax The EAX state
21 @param ct The ciphertext
22 @param pt [out] The plaintext
23 @param length The length (octets) of the ciphertext
24 @return CRYPT_OK if successful
26 int eax_decrypt(eax_state *eax, const unsigned char *ct, unsigned char *pt,
31 LTC_ARGCHK(eax != NULL);
32 LTC_ARGCHK(pt != NULL);
33 LTC_ARGCHK(ct != NULL);
36 if ((err = omac_process(&eax->ctomac, ct, length)) != CRYPT_OK) {
41 return ctr_decrypt(ct, pt, length, &eax->ctr);
46 /* ref: $Format:%D$ */
47 /* git commit: $Format:%H$ */
48 /* commit time: $Format:%ai$ */