Lines Matching refs:ctx

133 int crypto_sha_init(struct udevice *dev, sha_context *ctx)  in crypto_sha_init()  argument
137 if (ctx && !ctx->length) in crypto_sha_init()
143 return ops->sha_init(dev, ctx); in crypto_sha_init()
159 int crypto_sha_final(struct udevice *dev, sha_context *ctx, u8 *output) in crypto_sha_final() argument
165 if (ctx && !ctx->length && output) { in crypto_sha_final()
166 switch (ctx->algo) { in crypto_sha_final()
199 return ops->sha_final(dev, ctx, output); in crypto_sha_final()
202 int crypto_hmac_init(struct udevice *dev, sha_context *ctx, in crypto_hmac_init() argument
207 if (ctx && !ctx->length) in crypto_hmac_init()
213 return ops->hmac_init(dev, ctx, key, key_len); in crypto_hmac_init()
229 int crypto_hmac_final(struct udevice *dev, sha_context *ctx, u8 *output) in crypto_hmac_final() argument
236 return ops->hmac_final(dev, ctx, output); in crypto_hmac_final()
239 int crypto_sha_csum(struct udevice *dev, sha_context *ctx, in crypto_sha_csum() argument
244 ret = crypto_sha_init(dev, ctx); in crypto_sha_csum()
252 ret = crypto_sha_final(dev, ctx, output); in crypto_sha_csum()
257 int crypto_sha_regions_csum(struct udevice *dev, sha_context *ctx, in crypto_sha_regions_csum() argument
263 ctx->length = 0; in crypto_sha_regions_csum()
265 ctx->length += region[i].size; in crypto_sha_regions_csum()
267 ret = crypto_sha_init(dev, ctx); in crypto_sha_regions_csum()
278 return crypto_sha_final(dev, ctx, output); in crypto_sha_regions_csum()
281 int crypto_rsa_verify(struct udevice *dev, rsa_key *ctx, u8 *sign, u8 *output) in crypto_rsa_verify() argument
288 if (!ctx || !ctx->n || !ctx->e || !sign || !output) in crypto_rsa_verify()
291 return ops->rsa_verify(dev, ctx, sign, output); in crypto_rsa_verify()
294 int crypto_ec_verify(struct udevice *dev, ec_key *ctx, u8 *hash, u32 hash_len, u8 *sign) in crypto_ec_verify() argument
301 if (!ctx || !ctx->x || !ctx->y || !ctx->y || !hash || hash_len == 0 || !sign) in crypto_ec_verify()
304 return ops->ec_verify(dev, ctx, hash, hash_len, sign); in crypto_ec_verify()
307 int crypto_cipher(struct udevice *dev, cipher_context *ctx, in crypto_cipher() argument
315 if (!ctx || !ctx->key || ctx->key_len == 0) in crypto_cipher()
318 return ops->cipher_crypt(dev, ctx, in, out, len, enc); in crypto_cipher()
321 int crypto_mac(struct udevice *dev, cipher_context *ctx, in crypto_mac() argument
329 if (!ctx || !ctx->key || ctx->key_len == 0) in crypto_mac()
332 return ops->cipher_mac(dev, ctx, in, len, tag); in crypto_mac()
335 int crypto_ae(struct udevice *dev, cipher_context *ctx, in crypto_ae() argument
344 if (!ctx || !ctx->key || ctx->key_len == 0) in crypto_ae()
347 return ops->cipher_ae(dev, ctx, in, len, aad, aad_len, out, tag); in crypto_ae()
350 int crypto_fw_cipher(struct udevice *dev, cipher_fw_context *ctx, in crypto_fw_cipher() argument
372 ctx->fw_keyid, ctx->key_len)) { in crypto_fw_cipher()
377 return ops->cipher_fw_crypt(dev, ctx, in, out, len, enc); in crypto_fw_cipher()