18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Common values for serpent algorithms 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef _CRYPTO_SERPENT_H 78c2ecf20Sopenharmony_ci#define _CRYPTO_SERPENT_H 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#include <linux/types.h> 108c2ecf20Sopenharmony_ci#include <linux/crypto.h> 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#define SERPENT_MIN_KEY_SIZE 0 138c2ecf20Sopenharmony_ci#define SERPENT_MAX_KEY_SIZE 32 148c2ecf20Sopenharmony_ci#define SERPENT_EXPKEY_WORDS 132 158c2ecf20Sopenharmony_ci#define SERPENT_BLOCK_SIZE 16 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_cistruct serpent_ctx { 188c2ecf20Sopenharmony_ci u32 expkey[SERPENT_EXPKEY_WORDS]; 198c2ecf20Sopenharmony_ci}; 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ciint __serpent_setkey(struct serpent_ctx *ctx, const u8 *key, 228c2ecf20Sopenharmony_ci unsigned int keylen); 238c2ecf20Sopenharmony_ciint serpent_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen); 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_civoid __serpent_encrypt(const void *ctx, u8 *dst, const u8 *src); 268c2ecf20Sopenharmony_civoid __serpent_decrypt(const void *ctx, u8 *dst, const u8 *src); 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci#endif 29