security/nss/lib/freebl/camellia.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/lib/freebl/camellia.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#ifndef _CAMELLIA_H_
     1.9 +#define _CAMELLIA_H_ 1
    1.10 +
    1.11 +#define CAMELLIA_BLOCK_SIZE 16  /* bytes */
    1.12 +#define CAMELLIA_MIN_KEYSIZE 16 /* bytes */
    1.13 +#define CAMELLIA_MAX_KEYSIZE 32 /* bytes */
    1.14 +
    1.15 +#define CAMELLIA_MAX_EXPANDEDKEY (34*2) /* 32bit unit */
    1.16 +
    1.17 +typedef PRUint32 KEY_TABLE_TYPE[CAMELLIA_MAX_EXPANDEDKEY];
    1.18 +
    1.19 +typedef SECStatus CamelliaFunc(CamelliaContext *cx, unsigned char *output,
    1.20 +			       unsigned int *outputLen,
    1.21 +			       unsigned int maxOutputLen,
    1.22 +			       const unsigned char *input,
    1.23 +			       unsigned int inputLen);
    1.24 +
    1.25 +typedef SECStatus CamelliaBlockFunc(const PRUint32 *subkey, 
    1.26 +				    unsigned char *output,
    1.27 +				    const unsigned char *input);
    1.28 +
    1.29 +/* CamelliaContextStr
    1.30 + *
    1.31 + * Values which maintain the state for Camellia encryption/decryption.
    1.32 + *
    1.33 + * keysize     - the number of key bits
    1.34 + * worker      - the encryption/decryption function to use with this context
    1.35 + * iv          - initialization vector for CBC mode
    1.36 + * expandedKey - the round keys in 4-byte words
    1.37 + */
    1.38 +struct CamelliaContextStr
    1.39 +{
    1.40 +    PRUint32  keysize; /* bytes */
    1.41 +    CamelliaFunc  *worker;
    1.42 +    PRUint32      expandedKey[CAMELLIA_MAX_EXPANDEDKEY];
    1.43 +    PRUint8 iv[CAMELLIA_BLOCK_SIZE];
    1.44 +};
    1.45 +
    1.46 +#endif /* _CAMELLIA_H_ */

mercurial