/trusted-firmware-m-3.7.0/lib/ext/cryptocell-312-runtime/codesafe/src/crypto_api/pki/common/ |
D | pki_modular_arithmetic.c | 44 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, PKA_REG_A, 0, stat); /*if(a==0) r = 0*/ in PkiCalcJacobiSymbol() 50 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, PKA_REG_A, 1, stat); /*if(a==0) r = 0*/ in PkiCalcJacobiSymbol() 67 PKA_SHR_FILL0(LEN_ID_N_PKA_REG_BITS, PKA_REG_A, PKA_REG_A, 32-1); in PkiCalcJacobiSymbol() 77 PKA_SHR_FILL0(LEN_ID_N_PKA_REG_BITS, PKA_REG_A, PKA_REG_A, (t & 0x1F) - 1); in PkiCalcJacobiSymbol() 93 PKA_COPY(LEN_ID_N_PKA_REG_BITS, PKA_REG_C, PKA_REG_A); in PkiCalcJacobiSymbol() 94 PKA_COPY(LEN_ID_N_PKA_REG_BITS, PKA_REG_A, PKA_REG_B); in PkiCalcJacobiSymbol() 95 PKA_DIV(LEN_ID_N_PKA_REG_BITS, PKA_REG_B, PKA_REG_A, PKA_REG_C); /* a = b mod a */ in PkiCalcJacobiSymbol() 96 PKA_COPY(LEN_ID_N_PKA_REG_BITS, PKA_REG_B, PKA_REG_C); /* b = a prev. */ in PkiCalcJacobiSymbol() 98 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, PKA_REG_A, 0, stat); in PkiCalcJacobiSymbol() 127 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, PKA_REG_Y2, 0, stat); in PkiIsModSquareRootExists() [all …]
|
D | pka.c | 989 PKA_COMPARE_STATUS(LEN_ID_N_PKA_REG_BITS, regTmp1, regTmp2, status); in PkaIsRegModEqual() 1091 PKA_READ_BIT0(LEN_ID_N_PKA_REG_BITS, PKA_REG_N/*N*/, bitVal); in PkaExecFullModInv() 1100 PKA_READ_BIT0(LEN_ID_N_PKA_REG_BITS, OpB, bitVal); in PkaExecFullModInv() 1144 PKA_SUB_IM(LEN_ID_N_PKA_REG_BITS, rT2/*Result*/, rT2/*numerat*/, 1/*OpB*/); in PkaExecFullModInv() 1145 PKA_DIV(LEN_ID_N_PKA_REG_BITS, rT0/*Result*/, rT2/*numerat*/, OpB/*divider*/); in PkaExecFullModInv() 1148 PKA_ADD(LEN_ID_N_PKA_REG_BITS, Res, Res, rT0); in PkaExecFullModInv() 1151 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, rT2/*OpA*/, 0/*OpB*/, status); in PkaExecFullModInv() 1153 PKA_ADD_IM(LEN_ID_N_PKA_REG_BITS, Res, Res, 1 ); in PkaExecFullModInv() 1156 PKA_SUB(LEN_ID_N_PKA_REG_BITS, Res, N, Res); in PkaExecFullModInv()
|
D | pka_defs.h | 53 LEN_ID_N_PKA_REG_BITS, // 1 - for operation size (RSA, EC) enumerator
|
D | pki.c | 141 PKA_ADD_IM( LEN_ID_N_PKA_REG_BITS/*LenID*/, rT4/*Res*/, rT3/*OpA*/, 0/*Imm OpB*/); in PkiLongNumDiv() 149 PKA_DIV( LEN_ID_N_PKA_REG_BITS/*LenID*/, rT4/*Res*/, rT2/*OpA*/, rT3/*OpB*/); in PkiLongNumDiv() 224 PKA_MUL_LOW(LEN_ID_N_PKA_REG_BITS/*lenId*/, rT4/*Res*/, rT2/*OpA*/, rT3/*OpB*/); in PkiLongNumMul()
|
D | pka.h | 222 PKA_SUB_IM(LEN_ID_N_PKA_REG_BITS,(nm2), 0/*n*/, 2); \ 227 PKA_AND_IM(LEN_ID_N_PKA_REG_BITS,a,a,0); \ 228 PKA_OR_IM( LEN_ID_N_PKA_REG_BITS,a,a,v); \
|
/trusted-firmware-m-3.7.0/lib/ext/cryptocell-312-runtime/codesafe/src/crypto_api/pki/ec_wrst/ |
D | pka_ec_wrst_dsa_verify.c | 50 PKA_FLIP_BIT0(LEN_ID_N_PKA_REG_BITS, ECC_REG_N, ECC_REG_N); in PkaEcdsaVerify() 53 PKA_SUB_IM(LEN_ID_N_PKA_REG_BITS, RES_DISCARD, EC_VERIFY_REG_C, 1/*imm*/); in PkaEcdsaVerify() 55 PKA_SUB(LEN_ID_N_PKA_REG_BITS, RES_DISCARD, ECC_REG_N, EC_VERIFY_REG_C); in PkaEcdsaVerify() 63 PKA_SUB_IM(LEN_ID_N_PKA_REG_BITS, RES_DISCARD, EC_VERIFY_REG_D, 1/*imm*/); in PkaEcdsaVerify() 65 PKA_SUB(LEN_ID_N_PKA_REG_BITS, RES_DISCARD, ECC_REG_N, EC_VERIFY_REG_D); in PkaEcdsaVerify() 73 PKA_FLIP_BIT0(LEN_ID_N_PKA_REG_BITS, ECC_REG_N, ECC_REG_N); in PkaEcdsaVerify() 79 PKA_DIV(LEN_ID_N_PKA_REG_BITS, EC_VERIFY_REG_TMP, EC_VERIFY_REG_F/*rem*/, ECC_REG_N/*div*/); in PkaEcdsaVerify() 86 PKA_CLEAR(LEN_ID_N_PKA_REG_BITS, PKA_REG_T0); in PkaEcdsaVerify() 87 PKA_CLEAR(LEN_ID_N_PKA_REG_BITS, PKA_REG_T1); in PkaEcdsaVerify() 90 PKA_COPY(LEN_ID_N_PKA_REG_BITS, EC_VERIFY_REG_TMP, ECC_REG_N); in PkaEcdsaVerify() [all …]
|
D | pka_ec_wrst.c | 35 PKA_ADD(LEN_ID_N_PKA_REG_BITS, ECC_REG_T4, y1, y1); in PkaDoubleMdf2Mdf() 38 PKA_ADD(LEN_ID_N_PKA_REG_BITS, ECC_REG_T4, x1, x1); in PkaDoubleMdf2Mdf() 39 PKA_ADD(LEN_ID_N_PKA_REG_BITS, ECC_REG_T4, ECC_REG_T4, ECC_REG_T4); in PkaDoubleMdf2Mdf() 42 PKA_ADD(LEN_ID_N_PKA_REG_BITS, x, ECC_REG_T2, ECC_REG_T2); in PkaDoubleMdf2Mdf() 43 PKA_ADD(LEN_ID_N_PKA_REG_BITS, ECC_REG_T2, ECC_REG_T2, x); in PkaDoubleMdf2Mdf() 44 PKA_ADD(LEN_ID_N_PKA_REG_BITS, ECC_REG_T2, t1, ECC_REG_T2); in PkaDoubleMdf2Mdf() 45 PKA_SUB(LEN_ID_N_PKA_REG_BITS, ECC_REG_T4, ECC_REG_N4, ECC_REG_T4); in PkaDoubleMdf2Mdf() 47 PKA_ADD(LEN_ID_N_PKA_REG_BITS, x, ECC_REG_T4, x); in PkaDoubleMdf2Mdf() 48 PKA_ADD(LEN_ID_N_PKA_REG_BITS, ECC_REG_T4, x, ECC_REG_T4); in PkaDoubleMdf2Mdf() 49 PKA_SUB(LEN_ID_N_PKA_REG_BITS, ECC_REG_T3, ECC_REG_N12, ECC_REG_T4); in PkaDoubleMdf2Mdf() [all …]
|
D | pka_ec_wrst_smul_scap.c | 38 PKA_ADD(LEN_ID_N_PKA_REG_BITS, t, y1, y1); in DoubleMdf2Mdf() 41 PKA_ADD(LEN_ID_N_PKA_REG_BITS, t, x1, x1); in DoubleMdf2Mdf() 42 PKA_ADD(LEN_ID_N_PKA_REG_BITS, t, t, t); in DoubleMdf2Mdf() 45 PKA_ADD(LEN_ID_N_PKA_REG_BITS, x, ECC_REG_T2, ECC_REG_T2); in DoubleMdf2Mdf() 46 PKA_ADD(LEN_ID_N_PKA_REG_BITS, ECC_REG_T2, ECC_REG_T2, x); in DoubleMdf2Mdf() 47 PKA_ADD(LEN_ID_N_PKA_REG_BITS, ECC_REG_T2, t1, ECC_REG_T2); in DoubleMdf2Mdf() 48 PKA_SUB(LEN_ID_N_PKA_REG_BITS, t, ECC_REG_N4, t); in DoubleMdf2Mdf() 50 PKA_ADD(LEN_ID_N_PKA_REG_BITS, x, t, x); in DoubleMdf2Mdf() 51 PKA_ADD(LEN_ID_N_PKA_REG_BITS, t, x, t); in DoubleMdf2Mdf() 52 PKA_SUB(LEN_ID_N_PKA_REG_BITS, ECC_REG_T3, ECC_REG_N12, t); in DoubleMdf2Mdf() [all …]
|
D | pka_ec_wrst_smul_no_scap.c | 98 PKA_ADD(LEN_ID_N_PKA_REG_BITS, ECC_REG_N4 , ECC_REG_N, ECC_REG_N ); in PkaScalarMultAff() 99 PKA_ADD(LEN_ID_N_PKA_REG_BITS, ECC_REG_N4 , ECC_REG_N4, ECC_REG_N4); in PkaScalarMultAff() 100 PKA_ADD(LEN_ID_N_PKA_REG_BITS, ECC_REG_N8 , ECC_REG_N4, ECC_REG_N4); in PkaScalarMultAff() 101 PKA_ADD(LEN_ID_N_PKA_REG_BITS, ECC_REG_N12, ECC_REG_N8, ECC_REG_N4); in PkaScalarMultAff() 103 PKA_SUB(LEN_ID_N_PKA_REG_BITS, tp, ECC_REG_N4, yp); // ry of -p in PkaScalarMultAff() 107 PKA_COPY(LEN_ID_N_PKA_REG_BITS, xr, xp); in PkaScalarMultAff() 108 PKA_COPY(LEN_ID_N_PKA_REG_BITS, yr, yp); // r = p in PkaScalarMultAff() 110 PKA_COPY(LEN_ID_N_PKA_REG_BITS, tr, ECC_REG_EC_A); in PkaScalarMultAff()
|
D | ec_wrst.c | 76 PKA_MOD_ADD(LEN_ID_N_PKA_REG_BITS, PKA_REG_T/*Res*/, PKA_REG_T/*OpA*/, PKA_REG_EC_A/*OpB*/); in EcWrstInitPubKey() 78 …PKA_MOD_ADD(LEN_ID_N_PKA_REG_BITS, PKA_REG_Y2/*=PKA_REG_EC_A*/, PKA_REG_T/*OpA*/, PKA_REG_EC_B/*Op… in EcWrstInitPubKey() 85 PKA_COMPARE_STATUS(LEN_ID_N_PKA_REG_BITS, PKA_REG_Y2, PKA_REG_T, w/*stat*/); in EcWrstInitPubKey() 108 PKA_SUB(LEN_ID_N_PKA_REG_BITS, PKA_REG_Y, PKA_REG_N, PKA_REG_Y); in EcWrstInitPubKey()
|
D | ec_wrst_dsa.c | 112 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, rKinv, 0, status); in CalcSignature() 119 PKA_MOD_ADD(LEN_ID_N_PKA_REG_BITS, rD, rD, rM); in CalcSignature() 122 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, rD, 0, status); in CalcSignature()
|
/trusted-firmware-m-3.7.0/lib/ext/cryptocell-312-runtime/codesafe/src/crypto_api/pki/ec_edw/ |
D | pka_ec_edw.c | 48 PKA_SUB(LEN_ID_N_PKA_REG_BITS, EDW_REG_T3, EDW_REG_N_4,rX1); in PkaEcEdwAddExtExtExt() 49 PKA_ADD(LEN_ID_N_PKA_REG_BITS, EDW_REG_T3, EDW_REG_T3, rY1); in PkaEcEdwAddExtExtExt() 50 PKA_SUB(LEN_ID_N_PKA_REG_BITS, EDW_REG_T4, EDW_REG_N_4,rX2); in PkaEcEdwAddExtExtExt() 51 PKA_ADD(LEN_ID_N_PKA_REG_BITS, EDW_REG_T4, EDW_REG_T4, rY2); in PkaEcEdwAddExtExtExt() 53 PKA_ADD(LEN_ID_N_PKA_REG_BITS, EDW_REG_T3, rY1, rX1); in PkaEcEdwAddExtExtExt() 54 PKA_ADD(LEN_ID_N_PKA_REG_BITS, EDW_REG_T4, rY2, rX2); in PkaEcEdwAddExtExtExt() 58 PKA_ADD(LEN_ID_N_PKA_REG_BITS, EDW_REG_T4, rZ1, rZ1); in PkaEcEdwAddExtExtExt() 60 PKA_SUB(LEN_ID_N_PKA_REG_BITS, rT, EDW_REG_N_4, EDW_REG_T5); in PkaEcEdwAddExtExtExt() 61 PKA_ADD(LEN_ID_N_PKA_REG_BITS, rT, rT, EDW_REG_T6); in PkaEcEdwAddExtExtExt() 62 PKA_ADD(LEN_ID_N_PKA_REG_BITS, EDW_REG_T6, EDW_REG_T6, EDW_REG_T5); in PkaEcEdwAddExtExtExt() [all …]
|
D | ec_edw.c | 288 PKA_ADD(LEN_ID_N_PKA_REG_BITS, EDW_REG_N_4, EDW_REG_N, EDW_REG_N); in EcEdwSpecialScalarMultBase() 289 PKA_ADD(LEN_ID_N_PKA_REG_BITS, EDW_REG_N_4, EDW_REG_N_4, EDW_REG_N_4); in EcEdwSpecialScalarMultBase() 449 PkaCopyDataIntoPkaReg(EDW_REG_N, LEN_ID_N_PKA_REG_BITS, pEcDomain->ecOrdN, edwSizeWords); in EcEdwSign() 450 PkaCopyDataIntoPkaReg(EDW_REG_EPH_PRIV, LEN_ID_N_PKA_REG_BITS, pEphPriv, hashSizeWords); in EcEdwSign() 451 PKA_DIV(LEN_ID_N_PKA_REG_BITS, EDW_REG_T5/*4*/, EDW_REG_EPH_PRIV/*24*/, EDW_REG_N/*0*/); in EcEdwSign() 528 PkaCopyDataIntoPkaReg(EDW_REG_N, LEN_ID_N_PKA_REG_BITS, pEcDomain->ecOrdN, edwSizeWords); in EcEdwSign() 529 PkaCopyDataIntoPkaReg(EDW_REG_INTEGR, LEN_ID_N_PKA_REG_BITS, pIntegrVal, hashSizeWords); in EcEdwSign() 530 PkaCopyDataIntoPkaReg(EDW_REG_USER_PRIV, LEN_ID_N_PKA_REG_BITS, pPrivKey, edwSizeWords); in EcEdwSign() 531 PkaCopyDataIntoPkaReg(EDW_REG_EPH_PRIV, LEN_ID_N_PKA_REG_BITS, pEphPriv, edwSizeWords); in EcEdwSign() 532 PkaCopyDataIntoPkaReg(EDW_REG_NP, LEN_ID_N_PKA_REG_BITS, pEcDomain->ecOrdBarrTag, in EcEdwSign() [all …]
|
/trusted-firmware-m-3.7.0/lib/ext/cryptocell-312-runtime/codesafe/src/crypto_api/pki/ec_mont/ |
D | pka_ec_mont.c | 61 PkaClearBlockOfRegs(rX2/*firstReg*/, 4/*countOfRegs*/, LEN_ID_N_PKA_REG_BITS); in EcMontPkaScalarMultWithLadderExe() 63 PKA_SET_BIT0(LEN_ID_N_PKA_REG_BITS, rX2, rX2); in EcMontPkaScalarMultWithLadderExe() 64 PKA_COPY(LEN_ID_N_PKA_REG_BITS, rX3, EC_MONT_REG_X1); in EcMontPkaScalarMultWithLadderExe() 65 PKA_SET_BIT0(LEN_ID_N_PKA_REG_BITS, rZ3, rZ3); in EcMontPkaScalarMultWithLadderExe() 68 PKA_ADD(LEN_ID_N_PKA_REG_BITS, EC_MONT_REG_N4, EC_MONT_REG_N, EC_MONT_REG_N); in EcMontPkaScalarMultWithLadderExe() 69 PKA_ADD(LEN_ID_N_PKA_REG_BITS, EC_MONT_REG_N4, EC_MONT_REG_N4, EC_MONT_REG_N4); in EcMontPkaScalarMultWithLadderExe() 92 …PKA_SUB(LEN_ID_N_PKA_REG_BITS, EC_MONT_REG_T2, EC_MONT_REG_N4, rZ3); // PkiDbgPrintReg(… in EcMontPkaScalarMultWithLadderExe() 93 …PKA_ADD(LEN_ID_N_PKA_REG_BITS, EC_MONT_REG_T, rX3, EC_MONT_REG_T2); // PkiDbgPrintReg(… in EcMontPkaScalarMultWithLadderExe() 94 …PKA_SUB(LEN_ID_N_PKA_REG_BITS, EC_MONT_REG_T2, EC_MONT_REG_N4, rZ2); // PkiDbgPrintReg(… in EcMontPkaScalarMultWithLadderExe() 95 …PKA_ADD(LEN_ID_N_PKA_REG_BITS, EC_MONT_REG_T1, rX2, EC_MONT_REG_T2); // PkiDbgPrintReg(… in EcMontPkaScalarMultWithLadderExe() [all …]
|
/trusted-firmware-m-3.7.0/lib/ext/cryptocell-312-runtime/codesafe/src/crypto_api/pki/srp/ |
D | srp.c | 113 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, rT4, 0, status); in SrpHostSharedSecretCalc() 119 PKA_SUB(LEN_ID_N_PKA_REG_BITS, RES_DISCARD, rT4, rN); in SrpHostSharedSecretCalc() 132 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, rT4, 0, status); in SrpHostSharedSecretCalc() 138 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, rT4, 1, status); in SrpHostSharedSecretCalc() 145 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, rT2, 0, status); in SrpHostSharedSecretCalc() 212 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, rT4, 0, status); in SrpUserSharedSecretCalc() 218 PKA_SUB(LEN_ID_N_PKA_REG_BITS, RES_DISCARD, rT4, rN); in SrpUserSharedSecretCalc() 302 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, rT5, 0, status); in SrpHostPublicKeyCalc() 362 PKA_COMPARE_IM_STATUS(LEN_ID_N_PKA_REG_BITS, rT3, 0, status); in SrpUserPublicKeyCalc()
|
/trusted-firmware-m-3.7.0/lib/ext/cryptocell-312-runtime/codesafe/src/crypto_api/pki/rsa/ |
D | rsa_private.c | 174 PKA_DIV(LEN_ID_N_PKA_REG_BITS/*LenID*/, rQ/*6 Res not used*/, rT/*3 OpA*/, rN/*0 OpB=rN=Q*/); in RsaExecPrivKeyExpCrt() 203 …PKA_DIV(LEN_ID_N_PKA_REG_BITS/*LenID*/, rT/*3 res not used*/, rT1/*4 OpA and remainder*/, rN/*0 Op… in RsaExecPrivKeyExpCrt() 235 PKA_MUL_LOW(LEN_ID_N_PKA_REG_BITS/*LenID*/, rT/*Res*/, rT/*OpA*/, rQ/*OpB*/); in RsaExecPrivKeyExpCrt()
|
D | rsa_genkey.c | 1455 …PKA_MUL_LOW(LEN_ID_N_PKA_REG_BITS, rT/*Res*/, rT/*OpA*/, rLcm/*OpB*/); /* Note: size of result < r… in RsaCalculateNandD() 1456 PKA_SUB_IM(LEN_ID_N_PKA_REG_BITS, rT/*Res*/, rT/*OpA*/, 1/*OpB*/); in RsaCalculateNandD() 1457 PKA_DIV(LEN_ID_N_PKA_REG_BITS, rD/*Res*/, rT/*OpA*/, r0/*OpB*/); /*rT = rT / e*/ in RsaCalculateNandD() 1458 PKA_SUB(LEN_ID_N_PKA_REG_BITS, rD/*Res*/, rLcm/*OpA*/, rD/*OpB*/); in RsaCalculateNandD() 1662 PKA_FLIP_BIT0(LEN_ID_N_PKA_REG_BITS, r0/*res*/, rQ/*opA*/); in RsaCalculateCrtParams() 1672 PKA_FLIP_BIT0(LEN_ID_N_PKA_REG_BITS, r0/*res*/, rP/*dst*/); in RsaCalculateCrtParams() 1681 PKA_FLIP_BIT0(LEN_ID_N_PKA_REG_BITS, r0/*Res*/, r0/*OpA*/); /* r0= P */ in RsaCalculateCrtParams()
|