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
11 @file ocb_done_encrypt.c
12 OCB implementation, terminate encryption, by Tom St Denis
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
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)
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);
42 /* ref: $Format:%D$ */
43 /* git commit: $Format:%H$ */
44 /* commit time: $Format:%ai$ */