| 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 /* | |
| 5 * $Id: camellia.h,v 1.2 2012/04/25 14:49:43 gerv%gerv.net Exp $ | |
| 6 */ | |
| 7 | |
| 8 #ifndef _CAMELLIA_H_ | |
| 9 #define _CAMELLIA_H_ 1 | |
| 10 | |
| 11 #define CAMELLIA_BLOCK_SIZE 16 /* bytes */ | |
| 12 #define CAMELLIA_MIN_KEYSIZE 16 /* bytes */ | |
| 13 #define CAMELLIA_MAX_KEYSIZE 32 /* bytes */ | |
| 14 | |
| 15 #define CAMELLIA_MAX_EXPANDEDKEY (34*2) /* 32bit unit */ | |
| 16 | |
| 17 typedef PRUint32 KEY_TABLE_TYPE[CAMELLIA_MAX_EXPANDEDKEY]; | |
| 18 | |
| 19 typedef SECStatus CamelliaFunc(CamelliaContext *cx, unsigned char *output, | |
| 20 unsigned int *outputLen, | |
| 21 unsigned int maxOutputLen, | |
| 22 const unsigned char *input, | |
| 23 unsigned int inputLen); | |
| 24 | |
| 25 typedef SECStatus CamelliaBlockFunc(const PRUint32 *subkey, | |
| 26 unsigned char *output, | |
| 27 const unsigned char *input); | |
| 28 | |
| 29 /* CamelliaContextStr | |
| 30 * | |
| 31 * Values which maintain the state for Camellia encryption/decryption. | |
| 32 * | |
| 33 * keysize - the number of key bits | |
| 34 * worker - the encryption/decryption function to use with this context | |
| 35 * iv - initialization vector for CBC mode | |
| 36 * expandedKey - the round keys in 4-byte words | |
| 37 */ | |
| 38 struct CamelliaContextStr | |
| 39 { | |
| 40 PRUint32 keysize; /* bytes */ | |
| 41 CamelliaFunc *worker; | |
| 42 PRUint32 expandedKey[CAMELLIA_MAX_EXPANDEDKEY]; | |
| 43 PRUint8 iv[CAMELLIA_BLOCK_SIZE]; | |
| 44 }; | |
| 45 | |
| 46 #endif /* _CAMELLIA_H_ */ | |
| OLD | NEW |