From 9cf3298360097250a1f4fa8ce7f9ada4ed3239d1 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Thu, 1 Oct 2020 16:05:47 -0600 Subject: vc/amd/fsp: Update the svc call header for the Mod Exp SVC The PSP bootloader version 0.08.0B.7B added support for the Mod Exp svc call. BUG=b:169157796 TEST=Build BRANCH=Zork Signed-off-by: Martin Roth Change-Id: I1ce69c80cec77e1692cf9713a739cc4da4677da6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/45942 Reviewed-by: Eric Peers Reviewed-by: Marshall Dawson Reviewed-by: Edward O'Callaghan Reviewed-by: Kangheui Won Tested-by: build bot (Jenkins) --- .../fsp/picasso/include/bl_uapp/bl_syscall_public.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/vendorcode/amd') diff --git a/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h b/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h index 7cc9fd4396..93f987bfaa 100644 --- a/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h +++ b/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h @@ -35,6 +35,7 @@ #define SVC_EXIT 0x00 #define SVC_MAP_USER_STACK 0x01 #define SVC_DEBUG_PRINT 0x06 +#define SVC_MODEXP 0x0C #define SVC_RSAPSS_VERIFY 0x0D #define SVC_DEBUG_PRINT_EX 0x1A #define SVC_WAIT_10NS_MULTIPLE 0x1B @@ -59,6 +60,17 @@ #define PSP_INFO_PRODUCTION_SILICON 0x00000002UL #define PSP_INFO_VALID 0x80000000UL +typedef struct MOD_EXP_PARAMS_T +{ + char *pExponent; // Exponent address + unsigned int ExpSize; // Exponent size in bytes + char *pModulus; // Modulus address + unsigned int ModulusSize; // Modulus size in bytes + char *pMessage; // Message address, same size as ModulusSize + char *pOutput; // Output address; Must be big enough to hold the + // data of ModulusSize +} MOD_EXP_PARAMS; + typedef struct _RSAPSS_VERIFY_PARAMS_T { char *pHash; // Message digest to verify the RSA signature @@ -384,6 +396,15 @@ uint32_t svc_rsa_pss_verify(const RSAPSS_VERIFY_PARAMS *params); */ uint32_t svc_rsa_pkcs_verify(const RSAPKCS_VERIFY_PARAMS *params); +/* Calculate ModEx + * + * Parameters: + * mod_exp_param - ModExp parameters + * + * Return value: BL_OK or error code + */ +uint32_t svc_modexp(MOD_EXP_PARAMS *mod_exp_param); + /* C entry point for the Bootloader Userspace Application */ void Main(void); -- cgit v1.2.3