1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2014 Freescale Semiconductor, Inc
4 * Author: Ruchika Gupta <ruchika.gupta@freescale.com>
7 #define LOG_CATEGORY UCLASS_MOD_EXP
11 #include <asm/global_data.h>
12 #include <u-boot/rsa-mod-exp.h>
17 #include <linux/list.h>
19 #if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC)
20 DECLARE_GLOBAL_DATA_PTR;
23 int rsa_mod_exp(struct udevice *dev, const uint8_t *sig, uint32_t sig_len,
24 struct key_prop *node, uint8_t *out)
26 struct mod_exp_ops *ops = (struct mod_exp_ops *)device_get_ops(dev);
28 #if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC)
33 ops->mod_exp += gd->reloc_off;
40 return ops->mod_exp(dev, sig, sig_len, node, out);
43 UCLASS_DRIVER(mod_exp) = {
45 .name = "rsa_mod_exp",