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, encrypt block by Tom St Denis
19 Encrypt with EAX a block of data.
20 @param eax The EAX state
21 @param pt The plaintext to encrypt
22 @param ct [out] The ciphertext as encrypted
23 @param length The length of the plaintext (octets)
24 @return CRYPT_OK if successful
26 int eax_encrypt(eax_state *eax, const unsigned char *pt, unsigned char *ct,
31 LTC_ARGCHK(eax != NULL);
32 LTC_ARGCHK(pt != NULL);
33 LTC_ARGCHK(ct != NULL);
36 if ((err = ctr_encrypt(pt, ct, length, &eax->ctr)) != CRYPT_OK) {
41 return omac_process(&eax->ctomac, ct, length);
47 /* ref: $Format:%D$ */
48 /* git commit: $Format:%H$ */
49 /* commit time: $Format:%ai$ */