/crypto/ |
D | shash.c | 90 static int shash_update_unaligned(struct shash_desc *desc, const u8 *data, in shash_update_unaligned() argument 93 struct crypto_shash *tfm = desc->tfm; in shash_update_unaligned() 113 err = shash->update(desc, buf, unaligned_len); in shash_update_unaligned() 117 shash->update(desc, data + unaligned_len, len - unaligned_len); in shash_update_unaligned() 120 int crypto_shash_update(struct shash_desc *desc, const u8 *data, in crypto_shash_update() argument 123 struct crypto_shash *tfm = desc->tfm; in crypto_shash_update() 132 err = shash_update_unaligned(desc, data, len); in crypto_shash_update() 134 err = shash->update(desc, data, len); in crypto_shash_update() 140 static int shash_final_unaligned(struct shash_desc *desc, u8 *out) in shash_final_unaligned() argument 142 struct crypto_shash *tfm = desc->tfm; in shash_final_unaligned() [all …]
|
D | crc32_generic.c | 47 static int crc32_init(struct shash_desc *desc) in crc32_init() argument 49 u32 *mctx = crypto_shash_ctx(desc->tfm); in crc32_init() 50 u32 *crcp = shash_desc_ctx(desc); in crc32_init() 57 static int crc32_update(struct shash_desc *desc, const u8 *data, in crc32_update() argument 60 u32 *crcp = shash_desc_ctx(desc); in crc32_update() 74 static int crc32_finup(struct shash_desc *desc, const u8 *data, in crc32_finup() argument 77 return __crc32_finup(shash_desc_ctx(desc), data, len, out); in crc32_finup() 80 static int crc32_final(struct shash_desc *desc, u8 *out) in crc32_final() argument 82 u32 *crcp = shash_desc_ctx(desc); in crc32_final() 88 static int crc32_digest(struct shash_desc *desc, const u8 *data, in crc32_digest() argument [all …]
|
D | crc32c_generic.c | 57 static int chksum_init(struct shash_desc *desc) in chksum_init() argument 59 struct chksum_ctx *mctx = crypto_shash_ctx(desc->tfm); in chksum_init() 60 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_init() 83 static int chksum_update(struct shash_desc *desc, const u8 *data, in chksum_update() argument 86 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_update() 92 static int chksum_final(struct shash_desc *desc, u8 *out) in chksum_final() argument 94 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_final() 106 static int chksum_finup(struct shash_desc *desc, const u8 *data, in chksum_finup() argument 109 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_finup() 114 static int chksum_digest(struct shash_desc *desc, const u8 *data, in chksum_digest() argument [all …]
|
D | crc64_rocksoft_generic.c | 8 static int chksum_init(struct shash_desc *desc) in chksum_init() argument 10 u64 *crc = shash_desc_ctx(desc); in chksum_init() 17 static int chksum_update(struct shash_desc *desc, const u8 *data, in chksum_update() argument 20 u64 *crc = shash_desc_ctx(desc); in chksum_update() 27 static int chksum_final(struct shash_desc *desc, u8 *out) in chksum_final() argument 29 u64 *crc = shash_desc_ctx(desc); in chksum_final() 42 static int chksum_finup(struct shash_desc *desc, const u8 *data, in chksum_finup() argument 45 u64 *crc = shash_desc_ctx(desc); in chksum_finup() 50 static int chksum_digest(struct shash_desc *desc, const u8 *data, in chksum_digest() argument
|
D | crct10dif_generic.c | 42 static int chksum_init(struct shash_desc *desc) in chksum_init() argument 44 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_init() 51 static int chksum_update(struct shash_desc *desc, const u8 *data, in chksum_update() argument 54 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_update() 60 static int chksum_final(struct shash_desc *desc, u8 *out) in chksum_final() argument 62 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_final() 74 static int chksum_finup(struct shash_desc *desc, const u8 *data, in chksum_finup() argument 77 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_finup() 82 static int chksum_digest(struct shash_desc *desc, const u8 *data, in chksum_digest() argument
|
D | sha256_generic.c | 36 int crypto_sha256_update(struct shash_desc *desc, const u8 *data, in crypto_sha256_update() argument 39 sha256_update(shash_desc_ctx(desc), data, len); in crypto_sha256_update() 44 static int crypto_sha256_final(struct shash_desc *desc, u8 *out) in crypto_sha256_final() argument 46 if (crypto_shash_digestsize(desc->tfm) == SHA224_DIGEST_SIZE) in crypto_sha256_final() 47 sha224_final(shash_desc_ctx(desc), out); in crypto_sha256_final() 49 sha256_final(shash_desc_ctx(desc), out); in crypto_sha256_final() 53 int crypto_sha256_finup(struct shash_desc *desc, const u8 *data, in crypto_sha256_finup() argument 56 sha256_update(shash_desc_ctx(desc), data, len); in crypto_sha256_finup() 57 return crypto_sha256_final(desc, hash); in crypto_sha256_finup()
|
D | xxhash_generic.c | 31 static int xxhash64_init(struct shash_desc *desc) in xxhash64_init() argument 33 struct xxhash64_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in xxhash64_init() 34 struct xxhash64_desc_ctx *dctx = shash_desc_ctx(desc); in xxhash64_init() 41 static int xxhash64_update(struct shash_desc *desc, const u8 *data, in xxhash64_update() argument 44 struct xxhash64_desc_ctx *dctx = shash_desc_ctx(desc); in xxhash64_update() 51 static int xxhash64_final(struct shash_desc *desc, u8 *out) in xxhash64_final() argument 53 struct xxhash64_desc_ctx *dctx = shash_desc_ctx(desc); in xxhash64_final() 60 static int xxhash64_digest(struct shash_desc *desc, const u8 *data, in xxhash64_digest() argument 63 struct xxhash64_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in xxhash64_digest()
|
D | sha1_generic.c | 42 int crypto_sha1_update(struct shash_desc *desc, const u8 *data, in crypto_sha1_update() argument 45 return sha1_base_do_update(desc, data, len, sha1_generic_block_fn); in crypto_sha1_update() 49 static int sha1_final(struct shash_desc *desc, u8 *out) in sha1_final() argument 51 sha1_base_do_finalize(desc, sha1_generic_block_fn); in sha1_final() 52 return sha1_base_finish(desc, out); in sha1_final() 55 int crypto_sha1_finup(struct shash_desc *desc, const u8 *data, in crypto_sha1_finup() argument 58 sha1_base_do_update(desc, data, len, sha1_generic_block_fn); in crypto_sha1_finup() 59 return sha1_final(desc, out); in crypto_sha1_finup()
|
D | jitterentropy-kcapi.c | 99 SHASH_DESC_ON_STACK(desc, hash_state_desc->tfm); in jent_hash_time() 104 desc->tfm = hash_state_desc->tfm; in jent_hash_time() 106 if (sizeof(intermediary) != crypto_shash_digestsize(desc->tfm)) { in jent_hash_time() 125 ret = crypto_shash_init(desc) ?: in jent_hash_time() 126 crypto_shash_update(desc, intermediary, in jent_hash_time() 128 crypto_shash_finup(desc, addtl, addtl_len, intermediary); in jent_hash_time() 137 ret = crypto_shash_update(desc, intermediary, sizeof(intermediary)); in jent_hash_time() 156 shash_desc_zero(desc); in jent_hash_time() 323 SHASH_DESC_ON_STACK(desc, tfm); in jent_mod_init() 335 desc->tfm = tfm; in jent_mod_init() [all …]
|
D | kdf_sp800108.c | 21 SHASH_DESC_ON_STACK(desc, kmd); in crypto_kdf108_ctr_generate() 28 desc->tfm = kmd; in crypto_kdf108_ctr_generate() 31 err = crypto_shash_init(desc); in crypto_kdf108_ctr_generate() 35 err = crypto_shash_update(desc, (u8 *)&counter, sizeof(__be32)); in crypto_kdf108_ctr_generate() 40 err = crypto_shash_update(desc, info[i].iov_base, in crypto_kdf108_ctr_generate() 49 err = crypto_shash_final(desc, tmpbuffer); in crypto_kdf108_ctr_generate() 57 err = crypto_shash_final(desc, dst); in crypto_kdf108_ctr_generate() 69 shash_desc_zero(desc); in crypto_kdf108_ctr_generate()
|
D | hmac.c | 89 struct shash_desc *desc = shash_desc_ctx(pdesc); in hmac_export() local 91 return crypto_shash_export(desc, out); in hmac_export() 96 struct shash_desc *desc = shash_desc_ctx(pdesc); in hmac_import() local 99 desc->tfm = ctx->hash; in hmac_import() 101 return crypto_shash_import(desc, in); in hmac_import() 112 struct shash_desc *desc = shash_desc_ctx(pdesc); in hmac_update() local 114 return crypto_shash_update(desc, data, nbytes); in hmac_update() 123 struct shash_desc *desc = shash_desc_ctx(pdesc); in hmac_final() local 125 return crypto_shash_final(desc, out) ?: in hmac_final() 126 crypto_shash_import(desc, opad) ?: in hmac_final() [all …]
|
D | sm2.c | 27 const char *desc; /* Description of the curve. */ member 52 .desc = "sm2p256v1", 113 ec->name = ecp->desc; in sm2_ec_ctx_init() 222 static int sm2_z_digest_update(struct shash_desc *desc, in sm2_z_digest_update() argument 236 err = crypto_shash_update(desc, zero, pbytes - inlen) ?: in sm2_z_digest_update() 237 crypto_shash_update(desc, in, inlen); in sm2_z_digest_update() 240 err = crypto_shash_update(desc, in + inlen - pbytes, pbytes); in sm2_z_digest_update() 242 err = crypto_shash_update(desc, in, inlen); in sm2_z_digest_update() 249 static int sm2_z_digest_update_point(struct shash_desc *desc, in sm2_z_digest_update_point() argument 260 sm2_z_digest_update(desc, x, pbytes) ?: in sm2_z_digest_update_point() [all …]
|
D | sm3_generic.c | 30 static int crypto_sm3_update(struct shash_desc *desc, const u8 *data, in crypto_sm3_update() argument 33 sm3_update(shash_desc_ctx(desc), data, len); in crypto_sm3_update() 37 static int crypto_sm3_final(struct shash_desc *desc, u8 *out) in crypto_sm3_final() argument 39 sm3_final(shash_desc_ctx(desc), out); in crypto_sm3_final() 43 static int crypto_sm3_finup(struct shash_desc *desc, const u8 *data, in crypto_sm3_finup() argument 46 struct sm3_state *sctx = shash_desc_ctx(desc); in crypto_sm3_finup()
|
D | ghash-generic.c | 46 static int ghash_init(struct shash_desc *desc) in ghash_init() argument 48 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); in ghash_init() 78 static int ghash_update(struct shash_desc *desc, in ghash_update() argument 81 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); in ghash_update() 82 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_update() 131 static int ghash_final(struct shash_desc *desc, u8 *dst) in ghash_final() argument 133 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); in ghash_final() 134 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_final()
|
D | nhpoly1305.c | 144 int crypto_nhpoly1305_init(struct shash_desc *desc) in crypto_nhpoly1305_init() argument 146 struct nhpoly1305_state *state = shash_desc_ctx(desc); in crypto_nhpoly1305_init() 155 int crypto_nhpoly1305_update_helper(struct shash_desc *desc, in crypto_nhpoly1305_update_helper() argument 159 struct nhpoly1305_state *state = shash_desc_ctx(desc); in crypto_nhpoly1305_update_helper() 160 const struct nhpoly1305_key *key = crypto_shash_ctx(desc->tfm); in crypto_nhpoly1305_update_helper() 191 int crypto_nhpoly1305_update(struct shash_desc *desc, in crypto_nhpoly1305_update() argument 194 return crypto_nhpoly1305_update_helper(desc, src, srclen, nh_generic); in crypto_nhpoly1305_update() 198 int crypto_nhpoly1305_final_helper(struct shash_desc *desc, u8 *dst, nh_t nh_fn) in crypto_nhpoly1305_final_helper() argument 200 struct nhpoly1305_state *state = shash_desc_ctx(desc); in crypto_nhpoly1305_final_helper() 201 const struct nhpoly1305_key *key = crypto_shash_ctx(desc->tfm); in crypto_nhpoly1305_final_helper() [all …]
|
D | polyval-generic.c | 143 static int polyval_init(struct shash_desc *desc) in polyval_init() argument 145 struct polyval_desc_ctx *dctx = shash_desc_ctx(desc); in polyval_init() 152 static int polyval_update(struct shash_desc *desc, in polyval_update() argument 155 struct polyval_desc_ctx *dctx = shash_desc_ctx(desc); in polyval_update() 156 const struct polyval_tfm_ctx *ctx = crypto_shash_ctx(desc->tfm); in polyval_update() 193 static int polyval_final(struct shash_desc *desc, u8 *dst) in polyval_final() argument 195 struct polyval_desc_ctx *dctx = shash_desc_ctx(desc); in polyval_final() 196 const struct polyval_tfm_ctx *ctx = crypto_shash_ctx(desc->tfm); in polyval_final()
|
D | michael_mic.c | 47 static int michael_init(struct shash_desc *desc) in michael_init() argument 49 struct michael_mic_desc_ctx *mctx = shash_desc_ctx(desc); in michael_init() 50 struct michael_mic_ctx *ctx = crypto_shash_ctx(desc->tfm); in michael_init() 59 static int michael_update(struct shash_desc *desc, const u8 *data, in michael_update() argument 62 struct michael_mic_desc_ctx *mctx = shash_desc_ctx(desc); in michael_update() 97 static int michael_final(struct shash_desc *desc, u8 *out) in michael_final() argument 99 struct michael_mic_desc_ctx *mctx = shash_desc_ctx(desc); in michael_final()
|
D | poly1305_generic.c | 22 static int crypto_poly1305_init(struct shash_desc *desc) in crypto_poly1305_init() argument 24 struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc); in crypto_poly1305_init() 72 static int crypto_poly1305_update(struct shash_desc *desc, in crypto_poly1305_update() argument 75 struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc); in crypto_poly1305_update() 106 static int crypto_poly1305_final(struct shash_desc *desc, u8 *dst) in crypto_poly1305_final() argument 108 struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc); in crypto_poly1305_final()
|
D | cryptd.c | 86 struct shash_desc desc; member 510 return &rctx->desc; in cryptd_hash_prepare() 537 struct shash_desc *desc; in cryptd_hash_init() local 539 desc = cryptd_hash_prepare(req, err); in cryptd_hash_init() 540 if (unlikely(!desc)) in cryptd_hash_init() 543 desc->tfm = child; in cryptd_hash_init() 545 err = crypto_shash_init(desc); in cryptd_hash_init() 559 struct shash_desc *desc; in cryptd_hash_update() local 561 desc = cryptd_hash_prepare(req, err); in cryptd_hash_update() 562 if (likely(desc)) in cryptd_hash_update() [all …]
|
D | sha512_generic.c | 157 int crypto_sha512_update(struct shash_desc *desc, const u8 *data, in crypto_sha512_update() argument 160 return sha512_base_do_update(desc, data, len, sha512_generic_block_fn); in crypto_sha512_update() 164 static int sha512_final(struct shash_desc *desc, u8 *hash) in sha512_final() argument 166 sha512_base_do_finalize(desc, sha512_generic_block_fn); in sha512_final() 167 return sha512_base_finish(desc, hash); in sha512_final() 170 int crypto_sha512_finup(struct shash_desc *desc, const u8 *data, in crypto_sha512_finup() argument 173 sha512_base_do_update(desc, data, len, sha512_generic_block_fn); in crypto_sha512_finup() 174 return sha512_final(desc, hash); in crypto_sha512_finup()
|
D | sha3_generic.c | 161 int crypto_sha3_init(struct shash_desc *desc) in crypto_sha3_init() argument 163 struct sha3_state *sctx = shash_desc_ctx(desc); in crypto_sha3_init() 164 unsigned int digest_size = crypto_shash_digestsize(desc->tfm); in crypto_sha3_init() 175 int crypto_sha3_update(struct shash_desc *desc, const u8 *data, in crypto_sha3_update() argument 178 struct sha3_state *sctx = shash_desc_ctx(desc); in crypto_sha3_update() 213 int crypto_sha3_final(struct shash_desc *desc, u8 *out) in crypto_sha3_final() argument 215 struct sha3_state *sctx = shash_desc_ctx(desc); in crypto_sha3_final() 217 unsigned int digest_size = crypto_shash_digestsize(desc->tfm); in crypto_sha3_final()
|
D | md5.c | 129 static int md5_init(struct shash_desc *desc) in md5_init() argument 131 struct md5_state *mctx = shash_desc_ctx(desc); in md5_init() 142 static int md5_update(struct shash_desc *desc, const u8 *data, unsigned int len) in md5_update() argument 144 struct md5_state *mctx = shash_desc_ctx(desc); in md5_update() 174 static int md5_final(struct shash_desc *desc, u8 *out) in md5_final() argument 176 struct md5_state *mctx = shash_desc_ctx(desc); in md5_final() 202 static int md5_export(struct shash_desc *desc, void *out) in md5_export() argument 204 struct md5_state *ctx = shash_desc_ctx(desc); in md5_export() 210 static int md5_import(struct shash_desc *desc, const void *in) in md5_import() argument 212 struct md5_state *ctx = shash_desc_ctx(desc); in md5_import()
|
/crypto/asymmetric_keys/ |
D | x509_public_key.c | 29 struct shash_desc *desc; in x509_get_sig_params() local 53 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in x509_get_sig_params() 61 desc = kzalloc(desc_size, GFP_KERNEL); in x509_get_sig_params() 62 if (!desc) in x509_get_sig_params() 65 desc->tfm = tfm; in x509_get_sig_params() 69 crypto_shash_init(desc) ?: in x509_get_sig_params() 70 sm2_compute_z_digest(desc, cert->pub->key, in x509_get_sig_params() 72 crypto_shash_init(desc) ?: in x509_get_sig_params() 73 crypto_shash_update(desc, sig->digest, in x509_get_sig_params() 75 crypto_shash_finup(desc, cert->tbs, cert->tbs_size, in x509_get_sig_params() [all …]
|
D | verify_pefile.c | 247 struct shash_desc *desc) in pefile_digest_pe_contents() argument 255 ret = crypto_shash_update(desc, pebuf, ctx->image_checksum_offset); in pefile_digest_pe_contents() 260 ret = crypto_shash_update(desc, pebuf + tmp, in pefile_digest_pe_contents() 266 ret = crypto_shash_update(desc, pebuf + tmp, ctx->header_size - tmp); in pefile_digest_pe_contents() 295 ret = crypto_shash_update(desc, in pefile_digest_pe_contents() 308 ret = crypto_shash_update(desc, in pefile_digest_pe_contents() 326 struct shash_desc *desc; in pefile_digest_pe() local 340 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in pefile_digest_pe() 352 desc = kzalloc(desc_size + digest_size, GFP_KERNEL); in pefile_digest_pe() 353 if (!desc) in pefile_digest_pe() [all …]
|
D | pkcs7_verify.c | 27 struct shash_desc *desc; in pkcs7_digest() local 47 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in pkcs7_digest() 55 desc = kzalloc(desc_size, GFP_KERNEL); in pkcs7_digest() 56 if (!desc) in pkcs7_digest() 59 desc->tfm = tfm; in pkcs7_digest() 62 ret = crypto_shash_digest(desc, pkcs7->data, pkcs7->data_len, in pkcs7_digest() 103 ret = crypto_shash_init(desc); in pkcs7_digest() 107 ret = crypto_shash_update(desc, &tag, 1); in pkcs7_digest() 110 ret = crypto_shash_finup(desc, sinfo->authattrs, in pkcs7_digest() 118 kfree(desc); in pkcs7_digest()
|