linux/arch/x86/include/asm/crypto/twofish.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2#ifndef ASM_X86_TWOFISH_H
   3#define ASM_X86_TWOFISH_H
   4
   5#include <linux/crypto.h>
   6#include <crypto/twofish.h>
   7#include <crypto/lrw.h>
   8#include <crypto/b128ops.h>
   9
  10struct twofish_lrw_ctx {
  11        struct lrw_table_ctx lrw_table;
  12        struct twofish_ctx twofish_ctx;
  13};
  14
  15struct twofish_xts_ctx {
  16        struct twofish_ctx tweak_ctx;
  17        struct twofish_ctx crypt_ctx;
  18};
  19
  20/* regular block cipher functions from twofish_x86_64 module */
  21asmlinkage void twofish_enc_blk(struct twofish_ctx *ctx, u8 *dst,
  22                                const u8 *src);
  23asmlinkage void twofish_dec_blk(struct twofish_ctx *ctx, u8 *dst,
  24                                const u8 *src);
  25
  26/* 3-way parallel cipher functions */
  27asmlinkage void __twofish_enc_blk_3way(struct twofish_ctx *ctx, u8 *dst,
  28                                       const u8 *src, bool xor);
  29asmlinkage void twofish_dec_blk_3way(struct twofish_ctx *ctx, u8 *dst,
  30                                     const u8 *src);
  31
  32/* helpers from twofish_x86_64-3way module */
  33extern void twofish_dec_blk_cbc_3way(void *ctx, u128 *dst, const u128 *src);
  34extern void twofish_enc_blk_ctr(void *ctx, u128 *dst, const u128 *src,
  35                                le128 *iv);
  36extern void twofish_enc_blk_ctr_3way(void *ctx, u128 *dst, const u128 *src,
  37                                     le128 *iv);
  38
  39extern int lrw_twofish_setkey(struct crypto_tfm *tfm, const u8 *key,
  40                              unsigned int keylen);
  41
  42extern void lrw_twofish_exit_tfm(struct crypto_tfm *tfm);
  43
  44extern int xts_twofish_setkey(struct crypto_tfm *tfm, const u8 *key,
  45                              unsigned int keylen);
  46
  47#endif /* ASM_X86_TWOFISH_H */
  48