Lines Matching refs:desc
49 int crypto_shash_update(struct shash_desc *desc, const u8 *data, in crypto_shash_update() argument
52 return crypto_shash_alg(desc->tfm)->update(desc, data, len); in crypto_shash_update()
56 int crypto_shash_final(struct shash_desc *desc, u8 *out) in crypto_shash_final() argument
58 return crypto_shash_alg(desc->tfm)->final(desc, out); in crypto_shash_final()
62 static int shash_default_finup(struct shash_desc *desc, const u8 *data, in shash_default_finup() argument
65 struct shash_alg *shash = crypto_shash_alg(desc->tfm); in shash_default_finup()
67 return shash->update(desc, data, len) ?: in shash_default_finup()
68 shash->final(desc, out); in shash_default_finup()
71 int crypto_shash_finup(struct shash_desc *desc, const u8 *data, in crypto_shash_finup() argument
74 return crypto_shash_alg(desc->tfm)->finup(desc, data, len, out); in crypto_shash_finup()
78 static int shash_default_digest(struct shash_desc *desc, const u8 *data, in shash_default_digest() argument
81 struct shash_alg *shash = crypto_shash_alg(desc->tfm); in shash_default_digest()
83 return shash->init(desc) ?: in shash_default_digest()
84 shash->finup(desc, data, len, out); in shash_default_digest()
87 int crypto_shash_digest(struct shash_desc *desc, const u8 *data, in crypto_shash_digest() argument
90 struct crypto_shash *tfm = desc->tfm; in crypto_shash_digest()
95 return crypto_shash_alg(tfm)->digest(desc, data, len, out); in crypto_shash_digest()
102 SHASH_DESC_ON_STACK(desc, tfm); in crypto_shash_tfm_digest()
105 desc->tfm = tfm; in crypto_shash_tfm_digest()
107 err = crypto_shash_digest(desc, data, len, out); in crypto_shash_tfm_digest()
109 shash_desc_zero(desc); in crypto_shash_tfm_digest()
115 int crypto_shash_export(struct shash_desc *desc, void *out) in crypto_shash_export() argument
117 struct crypto_shash *tfm = desc->tfm; in crypto_shash_export()
121 return shash->export(desc, out); in crypto_shash_export()
123 memcpy(out, shash_desc_ctx(desc), crypto_shash_descsize(tfm)); in crypto_shash_export()
128 int crypto_shash_import(struct shash_desc *desc, const void *in) in crypto_shash_import() argument
130 struct crypto_shash *tfm = desc->tfm; in crypto_shash_import()
137 return shash->import(desc, in); in crypto_shash_import()
139 memcpy(shash_desc_ctx(desc), in, crypto_shash_descsize(tfm)); in crypto_shash_import()