Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef CTS_H |
michael@0 | 6 | #define CTS_H 1 |
michael@0 | 7 | |
michael@0 | 8 | #include "blapii.h" |
michael@0 | 9 | |
michael@0 | 10 | typedef struct CTSContextStr CTSContext; |
michael@0 | 11 | |
michael@0 | 12 | /* |
michael@0 | 13 | * The context argument is the inner cipher context to use with cipher. The |
michael@0 | 14 | * CTSContext does not own context. context needs to remain valid for as long |
michael@0 | 15 | * as the CTSContext is valid. |
michael@0 | 16 | * |
michael@0 | 17 | * The cipher argument is a block cipher in the CBC mode. |
michael@0 | 18 | */ |
michael@0 | 19 | CTSContext *CTS_CreateContext(void *context, freeblCipherFunc cipher, |
michael@0 | 20 | const unsigned char *iv, unsigned int blocksize); |
michael@0 | 21 | |
michael@0 | 22 | void CTS_DestroyContext(CTSContext *cts, PRBool freeit); |
michael@0 | 23 | |
michael@0 | 24 | SECStatus CTS_EncryptUpdate(CTSContext *cts, unsigned char *outbuf, |
michael@0 | 25 | unsigned int *outlen, unsigned int maxout, |
michael@0 | 26 | const unsigned char *inbuf, unsigned int inlen, |
michael@0 | 27 | unsigned int blocksize); |
michael@0 | 28 | SECStatus CTS_DecryptUpdate(CTSContext *cts, unsigned char *outbuf, |
michael@0 | 29 | unsigned int *outlen, unsigned int maxout, |
michael@0 | 30 | const unsigned char *inbuf, unsigned int inlen, |
michael@0 | 31 | unsigned int blocksize); |
michael@0 | 32 | |
michael@0 | 33 | #endif |