security/nss/lib/freebl/camellia.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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