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.

     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/. */
     5 #ifndef _CAMELLIA_H_
     6 #define _CAMELLIA_H_ 1
     8 #define CAMELLIA_BLOCK_SIZE 16  /* bytes */
     9 #define CAMELLIA_MIN_KEYSIZE 16 /* bytes */
    10 #define CAMELLIA_MAX_KEYSIZE 32 /* bytes */
    12 #define CAMELLIA_MAX_EXPANDEDKEY (34*2) /* 32bit unit */
    14 typedef PRUint32 KEY_TABLE_TYPE[CAMELLIA_MAX_EXPANDEDKEY];
    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);
    22 typedef SECStatus CamelliaBlockFunc(const PRUint32 *subkey, 
    23 				    unsigned char *output,
    24 				    const unsigned char *input);
    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 {
    37     PRUint32  keysize; /* bytes */
    38     CamelliaFunc  *worker;
    39     PRUint32      expandedKey[CAMELLIA_MAX_EXPANDEDKEY];
    40     PRUint8 iv[CAMELLIA_BLOCK_SIZE];
    41 };
    43 #endif /* _CAMELLIA_H_ */

mercurial