]> git.ipfire.org Git - people/ms/u-boot.git/blob - drivers/crypto/rsa_mod_exp/mod_exp_sw.c
Merge branch 'master' of git://git.denx.de/u-boot-sunxi
[people/ms/u-boot.git] / drivers / crypto / rsa_mod_exp / mod_exp_sw.c
1 /*
2 * (C) Copyright 2014 Freescale Semiconductor, Inc.
3 * Author: Ruchika Gupta <ruchika.gupta@freescale.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8 #include <config.h>
9 #include <common.h>
10 #include <dm.h>
11 #include <u-boot/rsa-mod-exp.h>
12
13 int mod_exp_sw(struct udevice *dev, const uint8_t *sig, uint32_t sig_len,
14 struct key_prop *prop, uint8_t *out)
15 {
16 int ret = 0;
17
18 ret = rsa_mod_exp_sw(sig, sig_len, prop, out);
19 if (ret) {
20 debug("%s: RSA failed to verify: %d\n", __func__, ret);
21 return ret;
22 }
23
24 return 0;
25 }
26
27 static const struct mod_exp_ops mod_exp_ops_sw = {
28 .mod_exp = mod_exp_sw,
29 };
30
31 U_BOOT_DRIVER(mod_exp_sw) = {
32 .name = "mod_exp_sw",
33 .id = UCLASS_MOD_EXP,
34 .ops = &mod_exp_ops_sw,
35 };
36
37 U_BOOT_DEVICE(mod_exp_sw) = {
38 .name = "mod_exp_sw",
39 };