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