Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _CRYPTO_TWOFISH_H
0003 #define _CRYPTO_TWOFISH_H
0004 
0005 #include <linux/types.h>
0006 
0007 #define TF_MIN_KEY_SIZE 16
0008 #define TF_MAX_KEY_SIZE 32
0009 #define TF_BLOCK_SIZE 16
0010 
0011 struct crypto_tfm;
0012 
0013 /* Structure for an expanded Twofish key.  s contains the key-dependent
0014  * S-boxes composed with the MDS matrix; w contains the eight "whitening"
0015  * subkeys, K[0] through K[7].  k holds the remaining, "round" subkeys.  Note
0016  * that k[i] corresponds to what the Twofish paper calls K[i+8]. */
0017 struct twofish_ctx {
0018     u32 s[4][256], w[8], k[32];
0019 };
0020 
0021 int __twofish_setkey(struct twofish_ctx *ctx, const u8 *key,
0022              unsigned int key_len);
0023 int twofish_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int key_len);
0024 
0025 #endif