/usr/src/linux-headers-5.15.0-190/include/crypto
NameSizeModeActions
internal/-0755rm
acompress.h90730644editdlrm
aead.h188320644editdlrm
aes.h25630644editdlrm
akcipher.h132320644editdlrm
algapi.h75450644editdlrm
arc4.h4840644editdlrm
asym_tpm_subtype.h5210644editdlrm
authenc.h6350644editdlrm
b128ops.h24710644editdlrm
blake2b.h16370644editdlrm
blake2s.h26800644editdlrm
blowfish.h4150644editdlrm
cast5.h5900644editdlrm
cast6.h6070644editdlrm
cast_common.h2320644editdlrm
chacha.h33950644editdlrm
chacha20poly1305.h16990644editdlrm
cryptd.h20500644editdlrm
ctr.h14560644editdlrm
curve25519.h20650644editdlrm
des.h17240644editdlrm
dh.h25740644editdlrm
drbg.h92090644editdlrm
ecc_curve.h13370644editdlrm
ecdh.h24870644editdlrm
engine.h42090644editdlrm
gcm.h8670644editdlrm
gf128mul.h96470644editdlrm
ghash.h3880644editdlrm
hash.h348590644editdlrm
hash_info.h9980644editdlrm
hmac.h1730644editdlrm
if_alg.h68440644editdlrm
kpp.h101440644editdlrm
md5.h4970644editdlrm
nhpoly1305.h22360644editdlrm
null.h3460644editdlrm
padlock.h4380644editdlrm
pcrypt.h8150644editdlrm
pkcs7.h11810644editdlrm
poly1305.h25000644editdlrm
public_key.h24400644editdlrm
rng.h67480644editdlrm
scatterwalk.h39890644editdlrm
serpent.h6960644editdlrm
sha1.h12100644editdlrm
sha1_base.h25120644editdlrm
sha2.h38490644editdlrm
sha3.h8790644editdlrm
sha256_base.h26210644editdlrm
sha512_base.h32550644editdlrm
skcipher.h204280644editdlrm
sm2.h7490644editdlrm
sm3.h8970644editdlrm
sm3_base.h26080644editdlrm
sm4.h11440644editdlrm
streebog.h9490644editdlrm
twofish.h7430644editdlrm
xts.h11250644editdlrm
Edit: /usr/src/linux-headers-5.15.0-190/include/crypto/nhpoly1305.h (2236B)
/* SPDX-License-Identifier: GPL-2.0 */ /* * Common values and helper functions for the NHPoly1305 hash function. */ #ifndef _NHPOLY1305_H #define _NHPOLY1305_H #include #include /* NH parameterization: */ /* Endianness: little */ /* Word size: 32 bits (works well on NEON, SSE2, AVX2) */ /* Stride: 2 words (optimal on ARM32 NEON; works okay on other CPUs too) */ #define NH_PAIR_STRIDE 2 #define NH_MESSAGE_UNIT (NH_PAIR_STRIDE * 2 * sizeof(u32)) /* Num passes (Toeplitz iteration count): 4, to give ε = 2^{-128} */ #define NH_NUM_PASSES 4 #define NH_HASH_BYTES (NH_NUM_PASSES * sizeof(u64)) /* Max message size: 1024 bytes (32x compression factor) */ #define NH_NUM_STRIDES 64 #define NH_MESSAGE_WORDS (NH_PAIR_STRIDE * 2 * NH_NUM_STRIDES) #define NH_MESSAGE_BYTES (NH_MESSAGE_WORDS * sizeof(u32)) #define NH_KEY_WORDS (NH_MESSAGE_WORDS + \ NH_PAIR_STRIDE * 2 * (NH_NUM_PASSES - 1)) #define NH_KEY_BYTES (NH_KEY_WORDS * sizeof(u32)) #define NHPOLY1305_KEY_SIZE (POLY1305_BLOCK_SIZE + NH_KEY_BYTES) struct nhpoly1305_key { struct poly1305_core_key poly_key; u32 nh_key[NH_KEY_WORDS]; }; struct nhpoly1305_state { /* Running total of polynomial evaluation */ struct poly1305_state poly_state; /* Partial block buffer */ u8 buffer[NH_MESSAGE_UNIT]; unsigned int buflen; /* * Number of bytes remaining until the current NH message reaches * NH_MESSAGE_BYTES. When nonzero, 'nh_hash' holds the partial NH hash. */ unsigned int nh_remaining; __le64 nh_hash[NH_NUM_PASSES]; }; typedef void (*nh_t)(const u32 *key, const u8 *message, size_t message_len, __le64 hash[NH_NUM_PASSES]); int crypto_nhpoly1305_setkey(struct crypto_shash *tfm, const u8 *key, unsigned int keylen); int crypto_nhpoly1305_init(struct shash_desc *desc); int crypto_nhpoly1305_update(struct shash_desc *desc, const u8 *src, unsigned int srclen); int crypto_nhpoly1305_update_helper(struct shash_desc *desc, const u8 *src, unsigned int srclen, nh_t nh_fn); int crypto_nhpoly1305_final(struct shash_desc *desc, u8 *dst); int crypto_nhpoly1305_final_helper(struct shash_desc *desc, u8 *dst, nh_t nh_fn); #endif /* _NHPOLY1305_H */