]> pd.if.org Git - zpackage/blob - libtomcrypt/src/encauth/ocb/ocb_done_encrypt.c
remove ltc ciphers
[zpackage] / libtomcrypt / src / encauth / ocb / ocb_done_encrypt.c
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
2  *
3  * LibTomCrypt is a library that provides various cryptographic
4  * algorithms in a highly modular and flexible manner.
5  *
6  * The library is free for all purposes without any express
7  * guarantee it works.
8  */
9
10 /**
11    @file ocb_done_encrypt.c
12    OCB implementation, terminate encryption, by Tom St Denis
13 */
14 #include "tomcrypt.h"
15
16 #ifdef LTC_OCB_MODE
17
18 /**
19    Terminate an encryption OCB state
20    @param ocb       The OCB state
21    @param pt        Remaining plaintext (if any)
22    @param ptlen     The length of the plaintext (octets)
23    @param ct        [out] The ciphertext (if any)
24    @param tag       [out] The tag for the OCB stream
25    @param taglen    [in/out] The max size and resulting size of the tag
26    @return CRYPT_OK if successful
27 */
28 int ocb_done_encrypt(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen,
29                      unsigned char *ct, unsigned char *tag, unsigned long *taglen)
30 {
31    LTC_ARGCHK(ocb    != NULL);
32    LTC_ARGCHK(pt     != NULL);
33    LTC_ARGCHK(ct     != NULL);
34    LTC_ARGCHK(tag    != NULL);
35    LTC_ARGCHK(taglen != NULL);
36    return s_ocb_done(ocb, pt, ptlen, ct, tag, taglen, 0);
37 }
38
39 #endif
40
41
42 /* ref:         $Format:%D$ */
43 /* git commit:  $Format:%H$ */
44 /* commit time: $Format:%ai$ */