1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/lib/freebl/gcm.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,31 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef GCM_H 1.9 +#define GCM_H 1 1.10 + 1.11 +#include "blapii.h" 1.12 + 1.13 +typedef struct GCMContextStr GCMContext; 1.14 + 1.15 +/* 1.16 + * The context argument is the inner cipher context to use with cipher. The 1.17 + * GCMContext does not own context. context needs to remain valid for as long 1.18 + * as the GCMContext is valid. 1.19 + * 1.20 + * The cipher argument is a block cipher in the ECB encrypt mode. 1.21 + */ 1.22 +GCMContext * GCM_CreateContext(void *context, freeblCipherFunc cipher, 1.23 + const unsigned char *params, unsigned int blocksize); 1.24 +void GCM_DestroyContext(GCMContext *gcm, PRBool freeit); 1.25 +SECStatus GCM_EncryptUpdate(GCMContext *gcm, unsigned char *outbuf, 1.26 + unsigned int *outlen, unsigned int maxout, 1.27 + const unsigned char *inbuf, unsigned int inlen, 1.28 + unsigned int blocksize); 1.29 +SECStatus GCM_DecryptUpdate(GCMContext *gcm, unsigned char *outbuf, 1.30 + unsigned int *outlen, unsigned int maxout, 1.31 + const unsigned char *inbuf, unsigned int inlen, 1.32 + unsigned int blocksize); 1.33 + 1.34 +#endif