/usr/src/kernels/4.18.0-553.121.1.el8_10.x86_64/include/crypto
NameSizeModeActions
internal/-0755rm
acompress.h81200644editdlrm
aead.h187290644editdlrm
aes.h10580644editdlrm
akcipher.h119890644editdlrm
algapi.h121630644editdlrm
arc4.h4840644editdlrm
authenc.h8450644editdlrm
b128ops.h24710644editdlrm
blowfish.h4150644editdlrm
cast5.h5900644editdlrm
cast6.h6360644editdlrm
cast_common.h2320644editdlrm
cbc.h35620644editdlrm
chacha20.h6380644editdlrm
cryptd.h25620644editdlrm
crypto_wq.h1610644editdlrm
ctr.h16660644editdlrm
des.h14030644editdlrm
dh.h27840644editdlrm
drbg.h91600644editdlrm
ecdh.h27330644editdlrm
engine.h42020644editdlrm
gcm.h1400644editdlrm
gf128mul.h96470644editdlrm
ghash.h3810644editdlrm
hash.h333860644editdlrm
hash_info.h11530644editdlrm
hmac.h1730644editdlrm
if_alg.h71280644editdlrm
kpp.h99260644editdlrm
md5.h4970644editdlrm
morus640_glue.h45850644editdlrm
morus1280_glue.h46470644editdlrm
morus_common.h7200644editdlrm
null.h3410644editdlrm
padlock.h6490644editdlrm
pcrypt.h14350644editdlrm
pkcs7.h13880644editdlrm
poly1305.h9200644editdlrm
public_key.h21260644editdlrm
rng.h68200644editdlrm
scatterwalk.h47320644editdlrm
serpent.h7120644editdlrm
sha.h43500644editdlrm
sha1_base.h25320644editdlrm
sha3.h8790644editdlrm
sha256_base.h26290644editdlrm
sha512_base.h32710644editdlrm
skcipher.h233810644editdlrm
sm3.h8330644editdlrm
sm3_base.h30240644editdlrm
sm4.h7540644editdlrm
speck.h13570644editdlrm
twofish.h7550644editdlrm
xts.h13850644editdlrm
Edit: /usr/src/kernels/4.18.0-553.121.1.el8_10.x86_64/include/crypto/sha256_base.h (2629B)
/* * sha256_base.h - core logic for SHA-256 implementations * * Copyright (C) 2015 Linaro Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include #include #include #include #include typedef void (sha256_block_fn)(struct sha256_state *sst, u8 const *src, int blocks); static inline int sha224_base_init(struct shash_desc *desc) { struct sha256_state *sctx = shash_desc_ctx(desc); return sha224_init(sctx); } static inline int sha256_base_init(struct shash_desc *desc) { struct sha256_state *sctx = shash_desc_ctx(desc); return sha256_init(sctx); } static inline int sha256_base_do_update(struct shash_desc *desc, const u8 *data, unsigned int len, sha256_block_fn *block_fn) { struct sha256_state *sctx = shash_desc_ctx(desc); unsigned int partial = sctx->count % SHA256_BLOCK_SIZE; sctx->count += len; if (unlikely((partial + len) >= SHA256_BLOCK_SIZE)) { int blocks; if (partial) { int p = SHA256_BLOCK_SIZE - partial; memcpy(sctx->buf + partial, data, p); data += p; len -= p; block_fn(sctx, sctx->buf, 1); } blocks = len / SHA256_BLOCK_SIZE; len %= SHA256_BLOCK_SIZE; if (blocks) { block_fn(sctx, data, blocks); data += blocks * SHA256_BLOCK_SIZE; } partial = 0; } if (len) memcpy(sctx->buf + partial, data, len); return 0; } static inline int sha256_base_do_finalize(struct shash_desc *desc, sha256_block_fn *block_fn) { const int bit_offset = SHA256_BLOCK_SIZE - sizeof(__be64); struct sha256_state *sctx = shash_desc_ctx(desc); __be64 *bits = (__be64 *)(sctx->buf + bit_offset); unsigned int partial = sctx->count % SHA256_BLOCK_SIZE; sctx->buf[partial++] = 0x80; if (partial > bit_offset) { memset(sctx->buf + partial, 0x0, SHA256_BLOCK_SIZE - partial); partial = 0; block_fn(sctx, sctx->buf, 1); } memset(sctx->buf + partial, 0x0, bit_offset - partial); *bits = cpu_to_be64(sctx->count << 3); block_fn(sctx, sctx->buf, 1); return 0; } static inline int sha256_base_finish(struct shash_desc *desc, u8 *out) { unsigned int digest_size = crypto_shash_digestsize(desc->tfm); struct sha256_state *sctx = shash_desc_ctx(desc); __be32 *digest = (__be32 *)out; int i; for (i = 0; digest_size > 0; i++, digest_size -= sizeof(__be32)) put_unaligned_be32(sctx->state[i], digest++); *sctx = (struct sha256_state){}; return 0; }