Mercurial > dropbear
comparison libtomcrypt/src/encauth/eax/eax_decrypt.c @ 1511:5916af64acd4 fuzz
merge from main
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 17 Feb 2018 19:29:51 +0800 |
parents | 6dba84798cd5 |
children |
comparison
equal
deleted
inserted
replaced
1457:32f990cc96b1 | 1511:5916af64acd4 |
---|---|
3 * LibTomCrypt is a library that provides various cryptographic | 3 * LibTomCrypt is a library that provides various cryptographic |
4 * algorithms in a highly modular and flexible manner. | 4 * algorithms in a highly modular and flexible manner. |
5 * | 5 * |
6 * The library is free for all purposes without any express | 6 * The library is free for all purposes without any express |
7 * guarantee it works. | 7 * guarantee it works. |
8 * | |
9 * Tom St Denis, [email protected], http://libtom.org | |
10 */ | 8 */ |
11 | 9 |
12 /** | 10 /** |
13 @file eax_decrypt.c | 11 @file eax_decrypt.c |
14 EAX implementation, decrypt block, by Tom St Denis | 12 EAX implementation, decrypt block, by Tom St Denis |
15 */ | 13 */ |
16 #include "tomcrypt.h" | 14 #include "tomcrypt.h" |
17 | 15 |
18 #ifdef LTC_EAX_MODE | 16 #ifdef LTC_EAX_MODE |
19 | 17 |
20 /** | 18 /** |
21 Decrypt data with the EAX protocol | 19 Decrypt data with the EAX protocol |
22 @param eax The EAX state | 20 @param eax The EAX state |
23 @param ct The ciphertext | 21 @param ct The ciphertext |
24 @param pt [out] The plaintext | 22 @param pt [out] The plaintext |
25 @param length The length (octets) of the ciphertext | 23 @param length The length (octets) of the ciphertext |
26 @return CRYPT_OK if successful | 24 @return CRYPT_OK if successful |
27 */ | 25 */ |
28 int eax_decrypt(eax_state *eax, const unsigned char *ct, unsigned char *pt, | 26 int eax_decrypt(eax_state *eax, const unsigned char *ct, unsigned char *pt, |
29 unsigned long length) | 27 unsigned long length) |
30 { | 28 { |
31 int err; | 29 int err; |
32 | 30 |
33 LTC_ARGCHK(eax != NULL); | 31 LTC_ARGCHK(eax != NULL); |
34 LTC_ARGCHK(pt != NULL); | 32 LTC_ARGCHK(pt != NULL); |
35 LTC_ARGCHK(ct != NULL); | 33 LTC_ARGCHK(ct != NULL); |
36 | 34 |
37 /* omac ciphertext */ | 35 /* omac ciphertext */ |
43 return ctr_decrypt(ct, pt, length, &eax->ctr); | 41 return ctr_decrypt(ct, pt, length, &eax->ctr); |
44 } | 42 } |
45 | 43 |
46 #endif | 44 #endif |
47 | 45 |
48 /* $Source$ */ | 46 /* ref: $Format:%D$ */ |
49 /* $Revision$ */ | 47 /* git commit: $Format:%H$ */ |
50 /* $Date$ */ | 48 /* commit time: $Format:%ai$ */ |