/crypto/ |
D | shash.c | 80 static int shash_update_unaligned(struct shash_desc *desc, const u8 *data, in shash_update_unaligned() argument 83 struct crypto_shash *tfm = desc->tfm; in shash_update_unaligned() 103 err = shash->update(desc, buf, unaligned_len); in shash_update_unaligned() 107 shash->update(desc, data + unaligned_len, len - unaligned_len); in shash_update_unaligned() 110 int crypto_shash_update(struct shash_desc *desc, const u8 *data, in crypto_shash_update() argument 113 struct crypto_shash *tfm = desc->tfm; in crypto_shash_update() 118 return shash_update_unaligned(desc, data, len); in crypto_shash_update() 120 return shash->update(desc, data, len); in crypto_shash_update() 124 static int shash_final_unaligned(struct shash_desc *desc, u8 *out) in shash_final_unaligned() argument 126 struct crypto_shash *tfm = desc->tfm; in shash_final_unaligned() [all …]
|
D | sha256_generic.c | 36 static int crypto_sha256_init(struct shash_desc *desc) in crypto_sha256_init() argument 38 return sha256_init(shash_desc_ctx(desc)); in crypto_sha256_init() 41 static int crypto_sha224_init(struct shash_desc *desc) in crypto_sha224_init() argument 43 return sha224_init(shash_desc_ctx(desc)); in crypto_sha224_init() 46 int crypto_sha256_update(struct shash_desc *desc, const u8 *data, in crypto_sha256_update() argument 49 return sha256_update(shash_desc_ctx(desc), data, len); in crypto_sha256_update() 53 static int crypto_sha256_final(struct shash_desc *desc, u8 *out) in crypto_sha256_final() argument 55 if (crypto_shash_digestsize(desc->tfm) == SHA224_DIGEST_SIZE) in crypto_sha256_final() 56 return sha224_final(shash_desc_ctx(desc), out); in crypto_sha256_final() 58 return sha256_final(shash_desc_ctx(desc), out); in crypto_sha256_final() [all …]
|
D | blkcipher.c | 34 static int blkcipher_walk_next(struct blkcipher_desc *desc, 36 static int blkcipher_walk_first(struct blkcipher_desc *desc, 95 int blkcipher_walk_done(struct blkcipher_desc *desc, in blkcipher_walk_done() argument 123 crypto_yield(desc->flags); in blkcipher_walk_done() 124 return blkcipher_walk_next(desc, walk); in blkcipher_walk_done() 129 if (walk->iv != desc->info) in blkcipher_walk_done() 130 memcpy(desc->info, walk->iv, walk->ivsize); in blkcipher_walk_done() 139 static inline int blkcipher_next_slow(struct blkcipher_desc *desc, in blkcipher_next_slow() argument 158 return blkcipher_walk_done(desc, walk, -ENOMEM); in blkcipher_next_slow() 189 static inline int blkcipher_next_fast(struct blkcipher_desc *desc, in blkcipher_next_fast() argument [all …]
|
D | crc32_generic.c | 71 static int crc32_init(struct shash_desc *desc) in crc32_init() argument 73 u32 *mctx = crypto_shash_ctx(desc->tfm); in crc32_init() 74 u32 *crcp = shash_desc_ctx(desc); in crc32_init() 81 static int crc32_update(struct shash_desc *desc, const u8 *data, in crc32_update() argument 84 u32 *crcp = shash_desc_ctx(desc); in crc32_update() 98 static int crc32_finup(struct shash_desc *desc, const u8 *data, in crc32_finup() argument 101 return __crc32_finup(shash_desc_ctx(desc), data, len, out); in crc32_finup() 104 static int crc32_final(struct shash_desc *desc, u8 *out) in crc32_final() argument 106 u32 *crcp = shash_desc_ctx(desc); in crc32_final() 112 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() 85 static int chksum_update(struct shash_desc *desc, const u8 *data, in chksum_update() argument 88 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_update() 94 static int chksum_final(struct shash_desc *desc, u8 *out) in chksum_final() argument 96 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_final() 108 static int chksum_finup(struct shash_desc *desc, const u8 *data, in chksum_finup() argument 111 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_finup() 116 static int chksum_digest(struct shash_desc *desc, const u8 *data, in chksum_digest() argument [all …]
|
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 | xxhash_generic.c | 33 static int xxhash64_init(struct shash_desc *desc) in xxhash64_init() argument 35 struct xxhash64_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in xxhash64_init() 36 struct xxhash64_desc_ctx *dctx = shash_desc_ctx(desc); in xxhash64_init() 43 static int xxhash64_update(struct shash_desc *desc, const u8 *data, in xxhash64_update() argument 46 struct xxhash64_desc_ctx *dctx = shash_desc_ctx(desc); in xxhash64_update() 53 static int xxhash64_final(struct shash_desc *desc, u8 *out) in xxhash64_final() argument 55 struct xxhash64_desc_ctx *dctx = shash_desc_ctx(desc); in xxhash64_final() 62 static int xxhash64_digest(struct shash_desc *desc, const u8 *data, in xxhash64_digest() argument 65 struct xxhash64_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in xxhash64_digest()
|
D | sha1_generic.c | 43 int crypto_sha1_update(struct shash_desc *desc, const u8 *data, in crypto_sha1_update() argument 46 return sha1_base_do_update(desc, data, len, sha1_generic_block_fn); in crypto_sha1_update() 50 static int sha1_final(struct shash_desc *desc, u8 *out) in sha1_final() argument 52 sha1_base_do_finalize(desc, sha1_generic_block_fn); in sha1_final() 53 return sha1_base_finish(desc, out); in sha1_final() 56 int crypto_sha1_finup(struct shash_desc *desc, const u8 *data, in crypto_sha1_finup() argument 59 sha1_base_do_update(desc, data, len, sha1_generic_block_fn); in crypto_sha1_finup() 60 return sha1_final(desc, out); in crypto_sha1_finup()
|
D | hmac.c | 85 struct shash_desc *desc = shash_desc_ctx(pdesc); in hmac_export() local 87 return crypto_shash_export(desc, out); in hmac_export() 92 struct shash_desc *desc = shash_desc_ctx(pdesc); in hmac_import() local 95 desc->tfm = ctx->hash; in hmac_import() 97 return crypto_shash_import(desc, in); in hmac_import() 108 struct shash_desc *desc = shash_desc_ctx(pdesc); in hmac_update() local 110 return crypto_shash_update(desc, data, nbytes); in hmac_update() 119 struct shash_desc *desc = shash_desc_ctx(pdesc); in hmac_final() local 121 return crypto_shash_final(desc, out) ?: in hmac_final() 122 crypto_shash_import(desc, opad) ?: in hmac_final() [all …]
|
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() 80 static int ghash_update(struct shash_desc *desc, in ghash_update() argument 83 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); in ghash_update() 84 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_update() 133 static int ghash_final(struct shash_desc *desc, u8 *dst) in ghash_final() argument 135 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); in ghash_final() 136 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_final()
|
D | nhpoly1305.c | 143 int crypto_nhpoly1305_init(struct shash_desc *desc) in crypto_nhpoly1305_init() argument 145 struct nhpoly1305_state *state = shash_desc_ctx(desc); in crypto_nhpoly1305_init() 154 int crypto_nhpoly1305_update_helper(struct shash_desc *desc, in crypto_nhpoly1305_update_helper() argument 158 struct nhpoly1305_state *state = shash_desc_ctx(desc); in crypto_nhpoly1305_update_helper() 159 const struct nhpoly1305_key *key = crypto_shash_ctx(desc->tfm); in crypto_nhpoly1305_update_helper() 190 int crypto_nhpoly1305_update(struct shash_desc *desc, in crypto_nhpoly1305_update() argument 193 return crypto_nhpoly1305_update_helper(desc, src, srclen, nh_generic); in crypto_nhpoly1305_update() 197 int crypto_nhpoly1305_final_helper(struct shash_desc *desc, u8 *dst, nh_t nh_fn) in crypto_nhpoly1305_final_helper() argument 199 struct nhpoly1305_state *state = shash_desc_ctx(desc); in crypto_nhpoly1305_final_helper() 200 const struct nhpoly1305_key *key = crypto_shash_ctx(desc->tfm); in crypto_nhpoly1305_final_helper() [all …]
|
D | tgr192.c | 493 static int tgr192_init(struct shash_desc *desc) in tgr192_init() argument 495 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_init() 509 static int tgr192_update(struct shash_desc *desc, const u8 *inbuf, in tgr192_update() argument 512 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_update() 526 tgr192_update(desc, NULL, 0); in tgr192_update() 550 static int tgr192_final(struct shash_desc *desc, u8 * out) in tgr192_final() argument 552 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_final() 558 tgr192_update(desc, NULL, 0); /* flush */ ; in tgr192_final() 586 tgr192_update(desc, NULL, 0); /* flush */ ; in tgr192_final() 604 static int tgr160_final(struct shash_desc *desc, u8 * out) in tgr160_final() argument [all …]
|
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() 100 static int michael_final(struct shash_desc *desc, u8 *out) in michael_final() argument 102 struct michael_mic_desc_ctx *mctx = shash_desc_ctx(desc); in michael_final()
|
D | sm3_generic.c | 145 int crypto_sm3_update(struct shash_desc *desc, const u8 *data, in crypto_sm3_update() argument 148 return sm3_base_do_update(desc, data, len, sm3_generic_block_fn); in crypto_sm3_update() 152 static int sm3_final(struct shash_desc *desc, u8 *out) in sm3_final() argument 154 sm3_base_do_finalize(desc, sm3_generic_block_fn); in sm3_final() 155 return sm3_base_finish(desc, out); in sm3_final() 158 int crypto_sm3_finup(struct shash_desc *desc, const u8 *data, in crypto_sm3_finup() argument 161 sm3_base_do_update(desc, data, len, sm3_generic_block_fn); in crypto_sm3_finup() 162 return sm3_final(desc, hash); in crypto_sm3_finup()
|
D | sha512_generic.c | 160 int crypto_sha512_update(struct shash_desc *desc, const u8 *data, in crypto_sha512_update() argument 163 return sha512_base_do_update(desc, data, len, sha512_generic_block_fn); in crypto_sha512_update() 167 static int sha512_final(struct shash_desc *desc, u8 *hash) in sha512_final() argument 169 sha512_base_do_finalize(desc, sha512_generic_block_fn); in sha512_final() 170 return sha512_base_finish(desc, hash); in sha512_final() 173 int crypto_sha512_finup(struct shash_desc *desc, const u8 *data, in crypto_sha512_finup() argument 176 sha512_base_do_update(desc, data, len, sha512_generic_block_fn); in crypto_sha512_finup() 177 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 | 132 static int md5_init(struct shash_desc *desc) in md5_init() argument 134 struct md5_state *mctx = shash_desc_ctx(desc); in md5_init() 145 static int md5_update(struct shash_desc *desc, const u8 *data, unsigned int len) in md5_update() argument 147 struct md5_state *mctx = shash_desc_ctx(desc); in md5_update() 177 static int md5_final(struct shash_desc *desc, u8 *out) in md5_final() argument 179 struct md5_state *mctx = shash_desc_ctx(desc); in md5_final() 205 static int md5_export(struct shash_desc *desc, void *out) in md5_export() argument 207 struct md5_state *ctx = shash_desc_ctx(desc); in md5_export() 213 static int md5_import(struct shash_desc *desc, const void *in) in md5_import() argument 215 struct md5_state *ctx = shash_desc_ctx(desc); in md5_import()
|
D | wp512.c | 989 static int wp512_init(struct shash_desc *desc) { in wp512_init() argument 990 struct wp512_ctx *wctx = shash_desc_ctx(desc); in wp512_init() 1003 static int wp512_update(struct shash_desc *desc, const u8 *source, in wp512_update() argument 1006 struct wp512_ctx *wctx = shash_desc_ctx(desc); in wp512_update() 1065 static int wp512_final(struct shash_desc *desc, u8 *out) in wp512_final() argument 1067 struct wp512_ctx *wctx = shash_desc_ctx(desc); in wp512_final() 1100 static int wp384_final(struct shash_desc *desc, u8 *out) in wp384_final() argument 1104 wp512_final(desc, D); in wp384_final() 1111 static int wp256_final(struct shash_desc *desc, u8 *out) in wp256_final() argument 1115 wp512_final(desc, D); in wp256_final()
|
D | testmgr.c | 127 int (*test)(const struct alg_test_desc *desc, const char *driver, 1091 struct shash_desc *desc, in test_shash_vec_cfg() argument 1095 struct crypto_shash *tfm = desc->tfm; in test_shash_vec_cfg() 1132 testmgr_poison(desc->__ctx, crypto_shash_descsize(tfm)); in test_shash_vec_cfg() 1142 err = crypto_shash_digest(desc, sg_data(&tsgl->sgl[0]), in test_shash_vec_cfg() 1166 err = crypto_shash_init(desc); in test_shash_vec_cfg() 1178 err = crypto_shash_finup(desc, sg_data(&tsgl->sgl[i]), in test_shash_vec_cfg() 1190 err = crypto_shash_update(desc, sg_data(&tsgl->sgl[i]), in test_shash_vec_cfg() 1201 err = crypto_shash_export(desc, hashstate); in test_shash_vec_cfg() 1212 testmgr_poison(desc->__ctx, crypto_shash_descsize(tfm)); in test_shash_vec_cfg() [all …]
|
D | streebog_generic.c | 908 static int streebog_init(struct shash_desc *desc) in streebog_init() argument 910 struct streebog_state *ctx = shash_desc_ctx(desc); in streebog_init() 911 unsigned int digest_size = crypto_shash_digestsize(desc->tfm); in streebog_init() 1002 static int streebog_update(struct shash_desc *desc, const u8 *data, in streebog_update() argument 1005 struct streebog_state *ctx = shash_desc_ctx(desc); in streebog_update() 1036 static int streebog_final(struct shash_desc *desc, u8 *digest) in streebog_final() argument 1038 struct streebog_state *ctx = shash_desc_ctx(desc); in streebog_final() 1042 if (crypto_shash_digestsize(desc->tfm) == STREEBOG256_DIGEST_SIZE) in streebog_final()
|
D | crypto_null.c | 37 static int null_init(struct shash_desc *desc) in null_init() argument 42 static int null_update(struct shash_desc *desc, const u8 *data, in null_update() argument 48 static int null_final(struct shash_desc *desc, u8 *out) in null_final() argument 53 static int null_digest(struct shash_desc *desc, const u8 *data, in null_digest() argument
|
D | cryptd.c | 81 struct shash_desc desc; member 540 struct shash_desc *desc = &rctx->desc; in cryptd_hash_init() local 545 desc->tfm = child; in cryptd_hash_init() 547 err = crypto_shash_init(desc); in cryptd_hash_init() 570 err = shash_ahash_update(req, &rctx->desc); in cryptd_hash_update() 591 err = crypto_shash_final(&rctx->desc, req->result); in cryptd_hash_final() 612 err = shash_ahash_finup(req, &rctx->desc); in cryptd_hash_finup() 631 struct shash_desc *desc = &rctx->desc; in cryptd_hash_digest() local 636 desc->tfm = child; in cryptd_hash_digest() 638 err = shash_ahash_digest(req, desc); in cryptd_hash_digest() [all …]
|
/crypto/asymmetric_keys/ |
D | x509_public_key.c | 27 struct shash_desc *desc; in x509_get_sig_params() local 63 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in x509_get_sig_params() 71 desc = kzalloc(desc_size, GFP_KERNEL); in x509_get_sig_params() 72 if (!desc) in x509_get_sig_params() 75 desc->tfm = tfm; in x509_get_sig_params() 77 ret = crypto_shash_digest(desc, cert->tbs, cert->tbs_size, sig->digest); in x509_get_sig_params() 90 kfree(desc); in x509_get_sig_params() 162 char *desc = NULL, *p; in x509_key_preparse() local 206 desc = kmalloc(sulen + 2 + srlen * 2 + 1, GFP_KERNEL); in x509_key_preparse() 207 if (!desc) in x509_key_preparse() [all …]
|
D | verify_pefile.c | 243 struct shash_desc *desc) in pefile_digest_pe_contents() argument 251 ret = crypto_shash_update(desc, pebuf, ctx->image_checksum_offset); in pefile_digest_pe_contents() 256 ret = crypto_shash_update(desc, pebuf + tmp, in pefile_digest_pe_contents() 262 ret = crypto_shash_update(desc, pebuf + tmp, ctx->header_size - tmp); in pefile_digest_pe_contents() 291 ret = crypto_shash_update(desc, in pefile_digest_pe_contents() 304 ret = crypto_shash_update(desc, in pefile_digest_pe_contents() 322 struct shash_desc *desc; in pefile_digest_pe() local 336 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in pefile_digest_pe() 348 desc = kzalloc(desc_size + digest_size, GFP_KERNEL); in pefile_digest_pe() 349 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()
|