Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: nss/mozilla/security/nss/lib/freebl/ctr.h

Issue 10919163: Add GCM, CTR, and CTS modes to AES. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #ifndef CTR_H
6 #define CTR_H 1
7
8 #include "blapii.h"
9
10 /* This structure is defined in this header because both ctr.c and gcm.c
11 * need it. */
12 struct CTRContextStr {
13 freeblCipherFunc cipher;
14 void *context;
15 unsigned char counter[MAX_BLOCK_SIZE];
16 unsigned char buffer[MAX_BLOCK_SIZE];
17 unsigned long counterBits;
18 unsigned int bufPtr;
19 };
20
21 typedef struct CTRContextStr CTRContext;
22
23 SECStatus CTR_InitContext(CTRContext *ctr, void *context,
24 freeblCipherFunc cipher, const unsigned char *param,
25 unsigned int blocksize);
26
27 /*
28 * The context argument is the inner cipher context to use with cipher. The
29 * CTRContext does not own context. context needs to remain valid for as long
30 * as the CTRContext is valid.
31 *
32 * The cipher argument is a block cipher in the ECB encrypt mode.
33 * SECStatus cipher(void *cx, unsigned char *output,
34 * unsigned int *outputLen, unsigned int maxOutputLen,
35 * const unsigned char *input, unsigned int inputLen,
36 * unsigned int blocksize);
Ryan Sleevi 2012/09/17 22:57:26 I'm not sure it's necessary to copy the typedef of
wtc 2012/09/18 01:03:40 I have removed the freeblCipherFunc typedef that I
37 * inputLen is always a multiple of blocksize and never 0.
38 * XXX rijndael_encryptECB does not set the *outputLen output argument.
39 */
40 CTRContext * CTR_CreateContext(void *context, freeblCipherFunc cipher,
41 const unsigned char *param, unsigned int blocksize);
42
43 void CTR_DestroyContext(CTRContext *ctr, PRBool freeit);
44
45 SECStatus CTR_Update(CTRContext *ctr, unsigned char *outbuf,
46 unsigned int *outlen, unsigned int maxout,
47 const unsigned char *inbuf, unsigned int inlen,
48 unsigned int blocksize);
49
50 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698