security/nss/lib/freebl/camellia.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #ifndef _CAMELLIA_H_
michael@0 6 #define _CAMELLIA_H_ 1
michael@0 7
michael@0 8 #define CAMELLIA_BLOCK_SIZE 16 /* bytes */
michael@0 9 #define CAMELLIA_MIN_KEYSIZE 16 /* bytes */
michael@0 10 #define CAMELLIA_MAX_KEYSIZE 32 /* bytes */
michael@0 11
michael@0 12 #define CAMELLIA_MAX_EXPANDEDKEY (34*2) /* 32bit unit */
michael@0 13
michael@0 14 typedef PRUint32 KEY_TABLE_TYPE[CAMELLIA_MAX_EXPANDEDKEY];
michael@0 15
michael@0 16 typedef SECStatus CamelliaFunc(CamelliaContext *cx, unsigned char *output,
michael@0 17 unsigned int *outputLen,
michael@0 18 unsigned int maxOutputLen,
michael@0 19 const unsigned char *input,
michael@0 20 unsigned int inputLen);
michael@0 21
michael@0 22 typedef SECStatus CamelliaBlockFunc(const PRUint32 *subkey,
michael@0 23 unsigned char *output,
michael@0 24 const unsigned char *input);
michael@0 25
michael@0 26 /* CamelliaContextStr
michael@0 27 *
michael@0 28 * Values which maintain the state for Camellia encryption/decryption.
michael@0 29 *
michael@0 30 * keysize - the number of key bits
michael@0 31 * worker - the encryption/decryption function to use with this context
michael@0 32 * iv - initialization vector for CBC mode
michael@0 33 * expandedKey - the round keys in 4-byte words
michael@0 34 */
michael@0 35 struct CamelliaContextStr
michael@0 36 {
michael@0 37 PRUint32 keysize; /* bytes */
michael@0 38 CamelliaFunc *worker;
michael@0 39 PRUint32 expandedKey[CAMELLIA_MAX_EXPANDEDKEY];
michael@0 40 PRUint8 iv[CAMELLIA_BLOCK_SIZE];
michael@0 41 };
michael@0 42
michael@0 43 #endif /* _CAMELLIA_H_ */

mercurial