Chromium Code Reviews
|
| OLD | NEW |
|---|---|
| (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 /* $Id: gsm.c,v 1.27 2012/04/25 14:49:43 gerv%gerv.net Exp $ */ | |
| 5 | |
| 6 #ifndef CTR_H | |
| 7 #define CTR_H 1 | |
| 8 | |
| 9 #include "blapii.h" | |
| 10 | |
| 11 struct CTRContextStr { | |
| 12 freeblCipherFunc cipher; | |
| 13 void *context; | |
| 14 unsigned char counter[MAX_BLOCK_SIZE]; | |
| 15 unsigned char buffer[MAX_BLOCK_SIZE]; | |
| 16 unsigned long counterBits; | |
| 17 unsigned int bufPtr; | |
| 18 }; | |
|
Ryan Sleevi
2012/09/11 19:34:30
In the other headers, the relevant ContextStr is f
rjrejyea
2012/09/19 21:38:00
In other headers, the structure can be opaque. In
| |
| 19 | |
| 20 typedef struct CTRContextStr CTRContext; | |
| 21 | |
| 22 SECStatus CTR_InitContext(CTRContext *ctr, void *context, | |
|
Ryan Sleevi
2012/09/11 19:34:30
nit: Does this need to be a public method? Are cal
wtc
2012/09/14 01:16:42
Exactly. gcm.c also needs struct CTRContextStr and
rjrejyea
2012/09/19 21:38:00
Yup, same reason the context isn't opaque. GCM nee
| |
| 23 freeblCipherFunc cipher, const unsigned char *param, | |
|
Ryan Sleevi
2012/09/11 19:34:30
nit/non-functional: Why the use of "const unsigned
wtc
2012/09/14 01:16:42
The const unsigned char * type comes from the
cons
rjrejyea
2012/09/19 21:38:00
I was reluctant to change the signature of AES_Cre
| |
| 24 unsigned int blocksize); | |
| 25 | |
| 26 CTRContext * CTR_CreateContext(void *context, freeblCipherFunc cipher, | |
|
Ryan Sleevi
2012/09/11 19:34:30
It would be good to document what |context| is her
| |
| 27 const unsigned char *param, unsigned int blocksize); | |
| 28 | |
| 29 void CTR_DestroyContext(CTRContext *ctr, PRBool freeit); | |
|
Ryan Sleevi
2012/09/11 19:34:30
It's worth noting that this function **does not**
| |
| 30 | |
| 31 SECStatus CTR_Update(CTRContext *context, unsigned char *outbuf, | |
| 32 unsigned int *outlen, unsigned int maxout, | |
| 33 const unsigned char *inbuf, unsigned int inlen, | |
| 34 unsigned int blocksize); | |
| 35 | |
| 36 #endif | |
| OLD | NEW |