1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2014 Freescale Semiconductor, Inc
4  * Author: Ruchika Gupta <ruchika.gupta@freescale.com>
5  */
6 
7 #define LOG_CATEGORY UCLASS_MOD_EXP
8 
9 #include <dm.h>
10 #include <asm/global_data.h>
11 #include <u-boot/rsa-mod-exp.h>
12 #include <errno.h>
13 #include <fdtdec.h>
14 #include <malloc.h>
15 #include <asm/io.h>
16 #include <linux/list.h>
17 
rsa_mod_exp(struct udevice * dev,const uint8_t * sig,uint32_t sig_len,struct key_prop * node,uint8_t * out)18 int rsa_mod_exp(struct udevice *dev, const uint8_t *sig, uint32_t sig_len,
19 		struct key_prop *node, uint8_t *out)
20 {
21 	struct mod_exp_ops *ops = (struct mod_exp_ops *)device_get_ops(dev);
22 
23 	if (!ops->mod_exp)
24 		return -ENOSYS;
25 
26 	return ops->mod_exp(dev, sig, sig_len, node, out);
27 }
28 
29 UCLASS_DRIVER(mod_exp) = {
30 	.id		= UCLASS_MOD_EXP,
31 	.name		= "rsa_mod_exp",
32 };
33