CC26xx Driver Library
[pka.h] Public Key Accelerator

Data Structures

union  PKA_EccParam224
 
union  PKA_EccParam256
 
union  PKA_EccParam384
 
union  PKA_EccParam512
 
union  PKA_EccParam521
 
struct  PKA_EccPoint224_
 
struct  PKA_EccPoint256_
 
struct  PKA_EccPoint384_
 
struct  PKA_EccPoint512_
 
struct  PKA_EccPoint521_
 

Functions

void PKAClearPkaRam (void)
 Zeroizes PKA RAM. More...
 
uint32_t PKAGetOpsStatus (void)
 Gets the PKA operation status. More...
 
bool PKAArrayAllZeros (const uint8_t *array, uint32_t arrayLength)
 Checks whether and array only consists of zeros. More...
 
void PKAZeroOutArray (const uint8_t *array, uint32_t arrayLength)
 Zeros-out an array. More...
 
uint32_t PKABigNumModStart (const uint8_t *bigNum, uint32_t bigNumLength, const uint8_t *modulus, uint32_t modulusLength, uint32_t *resultPKAMemAddr)
 Starts a big number modulus operation. More...
 
uint32_t PKABigNumModGetResult (uint8_t *resultBuf, uint32_t length, uint32_t resultPKAMemAddr)
 Gets the result of the big number modulus operation. More...
 
uint32_t PKABigNumDivideStart (const uint8_t *dividend, uint32_t dividendLength, const uint8_t *divisor, uint32_t divisorLength, uint32_t *resultQuotientMemAddr, uint32_t *resultRemainderMemAddr)
 Starts a big number divide operation. More...
 
uint32_t PKABigNumDivideGetQuotient (uint8_t *resultBuf, uint32_t *length, uint32_t resultQuotientMemAddr)
 Gets the quotient of the big number divide operation. More...
 
uint32_t PKABigNumDivideGetRemainder (uint8_t *resultBuf, uint32_t *length, uint32_t resultRemainderMemAddr)
 Gets the remainder of the big number divide operation. More...
 
uint32_t PKABigNumCmpStart (const uint8_t *bigNum1, const uint8_t *bigNum2, uint32_t length)
 Starts the comparison of two big numbers. More...
 
uint32_t PKABigNumCmpGetResult (void)
 Gets the result of the comparison operation of two big numbers. More...
 
uint32_t PKABigNumInvModStart (const uint8_t *bigNum, uint32_t bigNumLength, const uint8_t *modulus, uint32_t modulusLength, uint32_t *resultPKAMemAddr)
 Starts a big number inverse modulo operation. More...
 
uint32_t PKABigNumInvModGetResult (uint8_t *resultBuf, uint32_t length, uint32_t resultPKAMemAddr)
 Gets the result of the big number inverse modulo operation. More...
 
uint32_t PKABigNumExpModStart (const uint8_t *base, uint32_t baseLength, const uint8_t *exponent, uint32_t exponentLength, const uint8_t *modulus, uint32_t modulusLength, uint32_t *resultPKAMemAddr)
 Starts a big number modular exponentiation operation. More...
 
uint32_t PKABigNumExpModGetResult (uint8_t *resultBuf, uint32_t length, uint32_t resultPKAMemAddr)
 Gets the result of the big number modular exponentiation operation. More...
 
uint32_t PKABigNumMultiplyStart (const uint8_t *multiplicand, uint32_t multiplicandLength, const uint8_t *multiplier, uint32_t multiplierLength, uint32_t *resultPKAMemAddr)
 Starts the multiplication of two big numbers. More...
 
uint32_t PKABigNumMultGetResult (uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
 Gets the result of the big number multiplication. More...
 
uint32_t PKABigNumAddStart (const uint8_t *bigNum1, uint32_t bigNum1Length, const uint8_t *bigNum2, uint32_t bigNum2Length, uint32_t *resultPKAMemAddr)
 Starts the addition of two big numbers. More...
 
uint32_t PKABigNumAddGetResult (uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
 Gets the result of the addition operation on two big numbers. More...
 
uint32_t PKABigNumSubStart (const uint8_t *minuend, uint32_t minuendLength, const uint8_t *subtrahend, uint32_t subtrahendLength, uint32_t *resultPKAMemAddr)
 Starts the subtraction of one big number from another. More...
 
uint32_t PKABigNumSubGetResult (uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
 Gets the result of the subtraction operation on two big numbers. More...
 
uint32_t PKAEccMultiplyStart (const uint8_t *scalar, const uint8_t *curvePointX, const uint8_t *curvePointY, const uint8_t *prime, const uint8_t *a, const uint8_t *b, uint32_t length, uint32_t *resultPKAMemAddr)
 Starts ECC multiplication. More...
 
uint32_t PKAEccMontgomeryMultiplyStart (const uint8_t *scalar, const uint8_t *curvePointX, const uint8_t *prime, const uint8_t *a, uint32_t length, uint32_t *resultPKAMemAddr)
 Starts ECC Montgomery multiplication. More...
 
uint32_t PKAEccMultiplyGetResult (uint8_t *curvePointX, uint8_t *curvePointY, uint32_t resultPKAMemAddr, uint32_t length)
 Gets the result of ECC multiplication. More...
 
uint32_t PKAEccAddStart (const uint8_t *curvePoint1X, const uint8_t *curvePoint1Y, const uint8_t *curvePoint2X, const uint8_t *curvePoint2Y, const uint8_t *prime, const uint8_t *a, uint32_t length, uint32_t *resultPKAMemAddr)
 Starts the ECC addition. More...
 
uint32_t PKAEccAddGetResult (uint8_t *curvePointX, uint8_t *curvePointY, uint32_t resultPKAMemAddr, uint32_t length)
 Gets the result of the ECC addition. More...
 
uint32_t PKAEccVerifyPublicKeyWeierstrassStart (const uint8_t *curvePointX, const uint8_t *curvePointY, const uint8_t *prime, const uint8_t *a, const uint8_t *b, const uint8_t *order, uint32_t length)
 Begins the validation of a public key against a Short-Weierstrass curve. More...
 

Variables

const PKA_EccPoint224 NISTP224_generator
 X coordinate of the generator point of the NISTP224 curve. More...
 
const PKA_EccParam224 NISTP224_prime
 Prime of the NISTP224 curve. More...
 
const PKA_EccParam224 NISTP224_a
 a constant of the NISTP224 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam224 NISTP224_b
 b constant of the NISTP224 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam224 NISTP224_order
 Order of the NISTP224 curve. More...
 
const PKA_EccPoint256 NISTP256_generator
 X coordinate of the generator point of the NISTP256 curve. More...
 
const PKA_EccParam256 NISTP256_prime
 Prime of the NISTP256 curve. More...
 
const PKA_EccParam256 NISTP256_a
 a constant of the NISTP256 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam256 NISTP256_b
 b constant of the NISTP256 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam256 NISTP256_order
 Order of the NISTP256 curve. More...
 
const PKA_EccPoint384 NISTP384_generator
 X coordinate of the generator point of the NISTP384 curve. More...
 
const PKA_EccParam384 NISTP384_prime
 Prime of the NISTP384 curve. More...
 
const PKA_EccParam384 NISTP384_a
 a constant of the NISTP384 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam384 NISTP384_b
 b constant of the NISTP384 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam384 NISTP384_order
 Order of the NISTP384 curve. More...
 
const PKA_EccPoint521 NISTP521_generator
 X coordinate of the generator point of the NISTP521 curve. More...
 
const PKA_EccParam521 NISTP521_prime
 Prime of the NISTP521 curve. More...
 
const PKA_EccParam521 NISTP521_a
 a constant of the NISTP521 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam521 NISTP521_b
 b constant of the NISTP521 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam521 NISTP521_order
 Order of the NISTP521 curve. More...
 
const PKA_EccPoint256 BrainpoolP256R1_generator
 X coordinate of the generator point of the BrainpoolP256R1 curve. More...
 
const PKA_EccParam256 BrainpoolP256R1_prime
 Prime of the BrainpoolP256R1 curve. More...
 
const PKA_EccParam256 BrainpoolP256R1_a
 a constant of the BrainpoolP256R1 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam256 BrainpoolP256R1_b
 b constant of the BrainpoolP256R1 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam256 BrainpoolP256R1_order
 Order of the BrainpoolP256R1 curve. More...
 
const PKA_EccPoint384 BrainpoolP384R1_generator
 X coordinate of the generator point of the BrainpoolP384R1 curve. More...
 
const PKA_EccParam384 BrainpoolP384R1_prime
 Prime of the BrainpoolP384R1 curve. More...
 
const PKA_EccParam384 BrainpoolP384R1_a
 a constant of the BrainpoolP384R1 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam384 BrainpoolP384R1_b
 b constant of the BrainpoolP384R1 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam384 BrainpoolP384R1_order
 Order of the BrainpoolP384R1 curve. More...
 
const PKA_EccPoint512 BrainpoolP512R1_generator
 X coordinate of the generator point of the BrainpoolP512R1 curve. More...
 
const PKA_EccParam512 BrainpoolP512R1_prime
 Prime of the BrainpoolP512R1 curve. More...
 
const PKA_EccParam512 BrainpoolP512R1_a
 a constant of the BrainpoolP512R1 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam512 BrainpoolP512R1_b
 b constant of the BrainpoolP512R1 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b). More...
 
const PKA_EccParam512 BrainpoolP512R1_order
 Order of the BrainpoolP512R1 curve. More...
 
const PKA_EccPoint256 Curve25519_generator
 X coordinate of the generator point of the Curve25519 curve. More...
 
const PKA_EccParam256 Curve25519_prime
 Prime of the Curve25519 curve. More...
 
const PKA_EccParam256 Curve25519_a
 a constant of the Curve25519 curve when expressed in Montgomery form (By^2 = x^3 + a*x^2 + x). More...
 
const PKA_EccParam256 Curve25519_b
 b constant of the Curve25519 curve when expressed in Montgomery form (By^2 = x^3 + a*x^2 + x). More...
 
const PKA_EccParam256 Curve25519_order
 Order of the Curve25519 curve. More...
 

Detailed Description

Introduction

The PKA (Public Key Accelerator) API provides access to the Large Number Engine (LNME). The LNME allows for efficient math operations on numbers larger than those that fit within the ALU of the system CPU. It is significantly faster to perform these operations using the LNME than implementing the same functionality in software using regular word-wise math operations. While the LNME runs in the background, the system CPU may perform other operations or be turned off.

The LNME supports both primitive math operations and serialized primitive operations (sequencer operations).

These primitives and sequencer operations can be used to implement various public key encryption schemes. It is possible to implement the following schemes using the operations mentioned above:

The DriverLib PKA functions copy the relevant parameters into the dedicated PKA RAM. The LNME requires these parameters be present and correctly formatted in the PKA RAM and not system RAM. They are copied word-wise as the PKA RAM does not support byte-wise access. The CPU handles the alignment differences during the memory copy operation. Forcing buffer alignment in system RAM results in a significant speedup of the copy operation compared to unaligned buffers.

When the operation completes, the result is copied back into a buffer in system RAM specified by the application. The PKA RAM is then cleared to prevent sensitive keying material from remaining in PKA RAM.

Function Documentation

bool PKAArrayAllZeros ( const uint8_t *  array,
uint32_t  arrayLength 
)

Checks whether and array only consists of zeros.

Parameters
[in]arrayis the array to check.
[in]arrayLengthis the length of the array.
Returns
Returns true if the array contains only zeros and false if one or more bits are set.
872 {
873  uint32_t i;
874  uint8_t arrayBits = 0;
875 
876  // We could speed things up by comparing word-wise rather than byte-wise.
877  // However, this extra overhead is inconsequential compared to running an
878  // actual PKA operation. Especially ECC operations.
879  for (i = 0; i < arrayLength; i++) {
880  arrayBits |= array[i];
881  }
882 
883  if (arrayBits) {
884  return false;
885  }
886  else {
887  return true;
888  }
889 
890 }
uint32_t PKABigNumAddGetResult ( uint8_t *  resultBuf,
uint32_t *  resultLength,
uint32_t  resultPKAMemAddr 
)

Gets the result of the addition operation on two big numbers.

Parameters
[out]resultBufis the pointer to buffer where the result needs to be stored.
[in,out]resultLengthis the address of the variable containing the length of the buffer. After the operation the actual length of the resultant is stored at this address.
[in]resultPKAMemAddris the address of the result location which was provided by the start function PKABigNumAddStart().
Returns
Returns a status code.
See also
PKABigNumAddStart()

Referenced by PKAEccVerifyPublicKeyWeierstrassStart().

1330 {
1331  return PKAGetBigNumResult(resultBuf, resultLength, resultPKAMemAddr);
1332 }
static uint32_t PKAGetBigNumResult(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
Definition: pka.c:630

Here is the call graph for this function:

uint32_t PKABigNumAddStart ( const uint8_t *  bigNum1,
uint32_t  bigNum1Length,
const uint8_t *  bigNum2,
uint32_t  bigNum2Length,
uint32_t *  resultPKAMemAddr 
)

Starts the addition of two big numbers.

Parameters
[in]bigNum1is the pointer to the buffer containing the first big number.
[in]bigNum1Lengthis the size of the first big number in bytes.
[in]bigNum2is the pointer to the buffer containing the second big number.
[in]bigNum2Lengthis the size of the second big number in bytes.
[out]resultPKAMemAddris the pointer to the result vector location which will be set by this function.
Returns
Returns a status code.
See also
PKABigNumAddGetResult()

Referenced by PKAEccVerifyPublicKeyWeierstrassStart().

1249 {
1250  uint32_t offset = 0;
1251 
1252  // Check for arguments.
1253  ASSERT(bigNum1);
1254  ASSERT(bigNum2);
1255  ASSERT(resultPKAMemAddr);
1256 
1257  // Make sure no operation is in progress.
1258  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN) {
1260  }
1261 
1262  offset = PKAWritePkaParam(bigNum1, bigNum1Length, offset, PKA_O_APTR);
1263 
1264  offset = PKAWritePkaParam(bigNum2, bigNum2Length, offset, PKA_O_BPTR);
1265 
1266  // Copy the result vector address location.
1267  *resultPKAMemAddr = PKA_RAM_BASE + offset;
1268 
1269  // Load C pointer with the result location in PKA RAM.
1270  HWREG(PKA_BASE + PKA_O_CPTR) = offset >> 2;
1271 
1272  // Set the function for the add operation and start the operation.
1274 
1275  return PKA_STATUS_SUCCESS;
1276 }
static uint32_t PKAWritePkaParam(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:549
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_SUCCESS
Success.
Definition: pka.h:123
#define ASSERT(expr)
Definition: debug.h:73

Here is the call graph for this function:

uint32_t PKABigNumCmpGetResult ( void  )

Gets the result of the comparison operation of two big numbers.

This function provides the results of the comparison of two big numbers which was started using the PKABigNumCmpStart().

Returns
Returns a status code.
See also
PKABigNumCmpStart()

Referenced by PKAEccVerifyPublicKeyWeierstrassStart().

1068 {
1069  uint32_t status;
1070 
1071  // verify that the operation is complete.
1072  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN) {
1074  }
1075 
1076  // Check the COMPARE register.
1077  switch(HWREG(PKA_BASE + PKA_O_COMPARE)) {
1079  status = PKA_STATUS_EQUAL;
1080  break;
1081 
1083  status = PKA_STATUS_A_GREATER_THAN_B;
1084  break;
1085 
1087  status = PKA_STATUS_A_LESS_THAN_B;
1088  break;
1089 
1090  default:
1091  status = PKA_STATUS_FAILURE;
1092  break;
1093  }
1094 
1095  return status;
1096 }
#define PKA_STATUS_FAILURE
Failure.
Definition: pka.h:124
#define PKA_STATUS_EQUAL
Big number compare return status if the first big number is equal to the second.
Definition: pka.h:130
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_A_LESS_THAN_B
Big number compare return status if the first big number is less than the second. ...
Definition: pka.h:129
#define PKA_STATUS_A_GREATER_THAN_B
Big number compare return status if the first big number is greater than the second.
Definition: pka.h:128
uint32_t PKABigNumCmpStart ( const uint8_t *  bigNum1,
const uint8_t *  bigNum2,
uint32_t  length 
)

Starts the comparison of two big numbers.

This function starts the comparison of two big numbers pointed by bigNum1 and bigNum2.

Note
bigNum1 and bigNum2 must have same size.
Parameters
[in]bigNum1is the pointer to the first big number.
[in]bigNum2is the pointer to the second big number.
[in]lengthis the size of the big numbers in bytes.
Returns
Returns a status code.
See also
PKABigNumCmpGetResult()

Referenced by PKAEccVerifyPublicKeyWeierstrassStart().

1039 {
1040  uint32_t offset = 0;
1041 
1042  // Check the arguments.
1043  ASSERT(bigNum1);
1044  ASSERT(bigNum2);
1045 
1046  // Make sure no operation is in progress.
1047  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN) {
1049  }
1050 
1051  offset = PKAWritePkaParam(bigNum1, length, offset, PKA_O_APTR);
1052 
1053  offset = PKAWritePkaParam(bigNum2, length, offset, PKA_O_BPTR);
1054 
1055  // Set the PKA Function register for the Compare operation
1056  // and start the operation.
1058 
1059  return PKA_STATUS_SUCCESS;
1060 }
static uint32_t PKAWritePkaParam(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:549
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_SUCCESS
Success.
Definition: pka.h:123
#define ASSERT(expr)
Definition: debug.h:73

Here is the call graph for this function:

uint32_t PKABigNumDivideGetQuotient ( uint8_t *  resultBuf,
uint32_t *  length,
uint32_t  resultQuotientMemAddr 
)

Gets the quotient of the big number divide operation.

This function gets the quotient of the big number divide operation which was previously started using the function PKABigNumDivideStart().

Parameters
[out]resultBufis the pointer to buffer where the result needs to be stored.
[in]lengthis the size of the provided buffer in bytes.
[in]resultQuotientMemAddris the address of the result location which was provided by the start function PKABigNumDivideStart().
Returns
Returns a status code.
See also
PKABigNumDivideStart()
1018 {
1019  return PKAGetBigNumResult(resultBuf, length, resultQuotientMemAddr);
1020 }
static uint32_t PKAGetBigNumResult(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
Definition: pka.c:630

Here is the call graph for this function:

uint32_t PKABigNumDivideGetRemainder ( uint8_t *  resultBuf,
uint32_t *  length,
uint32_t  resultRemainderMemAddr 
)

Gets the remainder of the big number divide operation.

This function gets the remainder of the big number divide operation which was previously started using the function PKABigNumDivideStart().

Parameters
[out]resultBufis the pointer to buffer where the result needs to be stored.
[in]lengthis the size of the provided buffer in bytes.
[in]resultRemainderMemAddris the address of the result location which was provided by the start function PKABigNumDivideStart().
Returns
Returns a status code.
See also
PKABigNumDivideStart()
1028 {
1029  return PKAGetBigNumResultRemainder(resultBuf, length, resultQuotientMemAddr);
1030 }
static uint32_t PKAGetBigNumResultRemainder(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
Definition: pka.c:704

Here is the call graph for this function:

uint32_t PKABigNumDivideStart ( const uint8_t *  dividend,
uint32_t  dividendLength,
const uint8_t *  divisor,
uint32_t  divisorLength,
uint32_t *  resultQuotientMemAddr,
uint32_t *  resultRemainderMemAddr 
)

Starts a big number divide operation.

This function starts the dive operation on the big number bigNum using the divisor. The PKA RAM location where the result will be available is stored in resultPKAMemAddr.

Parameters
[in]dividendis the pointer to the big number to be divided.
[in]dividendLengthis the size of the big number dividend in bytes.
[in]divisoris the pointer to the divisor.
[in]divisorLengthis the size of the divisor in bytes.
[out]resultQuotientMemAddris the pointer to the quotient vector location which will be set by this function.
[out]resultRemainderMemAddris the pointer to the remainder vector location which will be set by this function.
Returns
Returns a status code.
See also
PKABigNumDivideGetResult()
971 {
972  uint32_t offset = 0;
973 
974  // Check the arguments.
975  ASSERT(dividend);
976  ASSERT(divisor);
977  ASSERT(resultQuotientMemAddr);
978  ASSERT(resultRemainderMemAddr);
979 
980  // Make sure no operation is in progress.
981  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN) {
983  }
984 
985  offset = PKAWritePkaParam(dividend, dividendLength, offset, PKA_O_APTR);
986 
987  offset = PKAWritePkaParamExtraOffset(divisor, divisorLength, offset, PKA_O_BPTR);
988 
989  // Copy the remainder result vector address location.
990  if (resultRemainderMemAddr) {
991  *resultRemainderMemAddr = PKA_RAM_BASE + offset;
992  }
993 
994  // The remainder cannot ever be larger than the divisor. It should fit inside
995  // a buffer of that size.
996  offset = PKAWritePkaParamExtraOffset(0, divisorLength, offset, PKA_O_CPTR);
997 
998  // Copy the remainder result vector address location.
999  if (resultQuotientMemAddr) {
1000  *resultQuotientMemAddr = PKA_RAM_BASE + offset;
1001  }
1002 
1003  // Load D pointer with the quotient location in PKA RAM
1004  HWREG(PKA_BASE + PKA_O_DPTR) = offset >> 2;
1005 
1006  // Start the PKCP modulo operation by setting the PKA Function register.
1008 
1009  return PKA_STATUS_SUCCESS;
1010 }
static uint32_t PKAWritePkaParam(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:549
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_SUCCESS
Success.
Definition: pka.h:123
static uint32_t PKAWritePkaParamExtraOffset(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:619
#define ASSERT(expr)
Definition: debug.h:73

Here is the call graph for this function:

uint32_t PKABigNumExpModGetResult ( uint8_t *  resultBuf,
uint32_t  length,
uint32_t  resultPKAMemAddr 
)

Gets the result of the big number modular exponentiation operation.

This function gets the result of the big number modular exponentiation operation previously started using the function PKABigNumExpModStart(). The function will zero-out resultBuf prior to copying in the result of the modular exponentiation operation.

Parameters
[out]resultBufis the pointer to buffer where the result needs to be stored.
[in]lengthis the size of the provided buffer in bytes.
[in]resultPKAMemAddris the address of the result location which was provided by the start function PKABigNumExpModStart().
Returns
Returns a status code.
See also
PKABigNumExpModStart()
1190 {
1191  // Zero-out array in case modulo result is shorter than length
1192  PKAZeroOutArray(resultBuf, length);
1193 
1194  return PKAGetBigNumResult(resultBuf, &length, resultPKAMemAddr);
1195 }
static uint32_t PKAGetBigNumResult(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
Definition: pka.c:630
void PKAZeroOutArray(const uint8_t *array, uint32_t arrayLength)
Zeros-out an array.
Definition: pka.c:897

Here is the call graph for this function:

uint32_t PKABigNumExpModStart ( const uint8_t *  base,
uint32_t  baseLength,
const uint8_t *  exponent,
uint32_t  exponentLength,
const uint8_t *  modulus,
uint32_t  modulusLength,
uint32_t *  resultPKAMemAddr 
)

Starts a big number modular exponentiation operation.

This function starts the exponentiation operation on base with exponent and modulo modulus.

Parameters
[in]baseis the pointer to the buffer containing the big number to exponentiate.
[in]baseLengthis the size of the base in bytes.
[in]exponentis the pointer to the buffer containing the big number that exponentiates.
[in]exponentLengthis the size of the exponent in bytes.
[in]modulusis the pointer to the buffer containing the divisor.
[in]modulusLengthis the size of the divisor in bytes.
[out]resultPKAMemAddris the pointer to the result vector location which will be set by this function.
Returns
Returns a status code.
See also
PKABigNumExpModGetResult()
1152 {
1153  uint32_t offset = 0;
1154 
1155  // Check the arguments.
1156  ASSERT(base);
1157  ASSERT(exponent);
1158  ASSERT(modulus);
1159  ASSERT(resultPKAMemAddr);
1160 
1161  // Make sure no operation is in progress.
1162  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN) {
1164  }
1165 
1166  offset = PKAWritePkaParam(exponent, exponentLength, offset, PKA_O_APTR);
1167 
1168  offset = PKAWritePkaParamExtraOffset(modulus, modulusLength, offset, PKA_O_BPTR);
1169 
1170  offset = PKAWritePkaParam(base, baseLength, offset, PKA_O_CPTR);
1171 
1172  // Copy the result vector address location.
1173  *resultPKAMemAddr = PKA_RAM_BASE + offset;
1174 
1175  // Load D pointer with the result location in PKA RAM.
1176  HWREG(PKA_BASE + PKA_O_DPTR) = offset >> 2;
1177 
1178  // set the PKA function to ExpMod operation and the start the operation.
1180 
1181  return PKA_STATUS_SUCCESS;
1182 }
static uint32_t PKAWritePkaParam(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:549
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_SUCCESS
Success.
Definition: pka.h:123
static uint32_t PKAWritePkaParamExtraOffset(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:619
#define ASSERT(expr)
Definition: debug.h:73

Here is the call graph for this function:

uint32_t PKABigNumInvModGetResult ( uint8_t *  resultBuf,
uint32_t  length,
uint32_t  resultPKAMemAddr 
)

Gets the result of the big number inverse modulo operation.

This function gets the result of the big number inverse modulo operation previously started using the function PKABigNumInvModStart(). The function will zero-out resultBuf prior to copying in the result of the inverse modulo operation.

Parameters
[out]resultBufis the pointer to buffer where the result needs to be stored.
[in]lengthis the size of the provided buffer in bytes.
[in]resultPKAMemAddris the address of the result location which was provided by the start function PKABigNumInvModStart().
Returns
Returns a status code.
See also
PKABigNumInvModStart()
1139 {
1140  // Zero-out array in case modulo result is shorter than length
1141  PKAZeroOutArray(resultBuf, length);
1142 
1143  return PKAGetBigNumResult(resultBuf, &length, resultPKAMemAddr);
1144 }
static uint32_t PKAGetBigNumResult(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
Definition: pka.c:630
void PKAZeroOutArray(const uint8_t *array, uint32_t arrayLength)
Zeros-out an array.
Definition: pka.c:897

Here is the call graph for this function:

uint32_t PKABigNumInvModStart ( const uint8_t *  bigNum,
uint32_t  bigNumLength,
const uint8_t *  modulus,
uint32_t  modulusLength,
uint32_t *  resultPKAMemAddr 
)

Starts a big number inverse modulo operation.

This function starts the inverse modulo operation on bigNum using the divisor modulus.

Parameters
[in]bigNumis the pointer to the buffer containing the big number (dividend).
[in]bigNumLengthis the size of the bigNum in bytes.
[in]modulusis the pointer to the buffer containing the divisor.
[in]modulusLengthis the size of the divisor in bytes.
[out]resultPKAMemAddris the pointer to the result vector location which will be set by this function.
Returns
Returns a status code.
See also
PKABigNumInvModGetResult()
1104 {
1105  uint32_t offset = 0;
1106 
1107  // Check the arguments.
1108  ASSERT(bigNum);
1109  ASSERT(modulus);
1110  ASSERT(resultPKAMemAddr);
1111 
1112  // Make sure no operation is in progress.
1113  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN) {
1115  }
1116 
1117  offset = PKAWritePkaParam(bigNum, bigNumLength, offset, PKA_O_APTR);
1118 
1119  offset = PKAWritePkaParam(modulus, modulusLength, offset, PKA_O_BPTR);
1120 
1121  // Copy the result vector address location.
1122  *resultPKAMemAddr = PKA_RAM_BASE + offset;
1123 
1124  // Load D pointer with the result location in PKA RAM.
1125  HWREG(PKA_BASE + PKA_O_DPTR) = offset >> 2;
1126 
1127  // set the PKA function to InvMod operation and the start the operation.
1128  HWREG(PKA_BASE + PKA_O_FUNCTION) = 0x0000F000;
1129 
1130  return PKA_STATUS_SUCCESS;
1131 }
static uint32_t PKAWritePkaParam(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:549
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_SUCCESS
Success.
Definition: pka.h:123
#define ASSERT(expr)
Definition: debug.h:73

Here is the call graph for this function:

uint32_t PKABigNumModGetResult ( uint8_t *  resultBuf,
uint32_t  length,
uint32_t  resultPKAMemAddr 
)

Gets the result of the big number modulus operation.

This function gets the result of the big number modulus operation which was previously started using the function PKABigNumModStart(). The function will zero-out resultBuf prior to copying in the result of the modulo operation.

Parameters
[out]resultBufis the pointer to buffer where the result needs to be stored.
[in]lengthis the size of the provided buffer in bytes.
[in]resultPKAMemAddris the address of the result location which was provided by the start function PKABigNumModStart().
Returns
Returns a status code.
See also
PKABigNumModStart()

Referenced by PKAEccVerifyPublicKeyWeierstrassStart().

958 {
959  // Zero-out array in case modulo result is shorter than length
960  PKAZeroOutArray(resultBuf, length);
961 
962  return PKAGetBigNumResultRemainder(resultBuf, &length, resultPKAMemAddr);
963 }
static uint32_t PKAGetBigNumResultRemainder(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
Definition: pka.c:704
void PKAZeroOutArray(const uint8_t *array, uint32_t arrayLength)
Zeros-out an array.
Definition: pka.c:897

Here is the call graph for this function:

uint32_t PKABigNumModStart ( const uint8_t *  bigNum,
uint32_t  bigNumLength,
const uint8_t *  modulus,
uint32_t  modulusLength,
uint32_t *  resultPKAMemAddr 
)

Starts a big number modulus operation.

This function starts the modulo operation on the big number bigNum using the divisor modulus. The PKA RAM location where the result will be available is stored in resultPKAMemAddr.

Parameters
[in]bigNumis the pointer to the big number on which modulo operation needs to be carried out.
[in]bigNumLengthis the size of the big number bigNum in bytes.
[in]modulusis the pointer to the divisor.
[in]modulusLengthis the size of the divisor modulus in bytes.
[out]resultPKAMemAddris the pointer to the result vector location which will be set by this function.
Returns
Returns a status code.
See also
PKABigNumModGetResult()

Referenced by PKAEccVerifyPublicKeyWeierstrassStart().

923 {
924  uint32_t offset = 0;
925 
926  // Check the arguments.
927  ASSERT(bigNum);
928  ASSERT(modulus);
929  ASSERT(resultPKAMemAddr);
930 
931  // Make sure no operation is in progress.
932  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN) {
934  }
935 
936  offset = PKAWritePkaParam(bigNum, bigNumLength, offset, PKA_O_APTR);
937 
938  offset = PKAWritePkaParamExtraOffset(modulus, modulusLength, offset, PKA_O_BPTR);
939 
940  // Copy the result vector address location.
941  *resultPKAMemAddr = PKA_RAM_BASE + offset;
942 
943  // Load C pointer with the result location in PKA RAM
944  HWREG(PKA_BASE + PKA_O_CPTR) = offset >> 2;
945 
946  // Start the PKCP modulo operation by setting the PKA Function register.
948 
949  return PKA_STATUS_SUCCESS;
950 }
static uint32_t PKAWritePkaParam(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:549
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_SUCCESS
Success.
Definition: pka.h:123
static uint32_t PKAWritePkaParamExtraOffset(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:619
#define ASSERT(expr)
Definition: debug.h:73

Here is the call graph for this function:

uint32_t PKABigNumMultGetResult ( uint8_t *  resultBuf,
uint32_t *  resultLength,
uint32_t  resultPKAMemAddr 
)

Gets the result of the big number multiplication.

This function gets the result of the multiplication of two big numbers operation previously started using the function PKABigNumMultiplyStart().

Parameters
[out]resultBufis the pointer to buffer where the result needs to be stored.
[in,out]resultLengthis the address of the variable containing the length of the buffer in bytes. After the operation, the actual length of the resultant is stored at this address.
[in]resultPKAMemAddris the address of the result location which was provided by the start function PKABigNumMultiplyStart().
Returns
Returns a status code.
See also
PKABigNumMultiplyStart()

Referenced by PKAEccVerifyPublicKeyWeierstrassStart().

1239 {
1240  return PKAGetBigNumResult(resultBuf, resultLength, resultPKAMemAddr);
1241 }
static uint32_t PKAGetBigNumResult(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
Definition: pka.c:630

Here is the call graph for this function:

uint32_t PKABigNumMultiplyStart ( const uint8_t *  multiplicand,
uint32_t  multiplicandLength,
const uint8_t *  multiplier,
uint32_t  multiplierLength,
uint32_t *  resultPKAMemAddr 
)

Starts the multiplication of two big numbers.

Parameters
[in]multiplicandis the pointer to the buffer containing the big number multiplicand.
[in]multiplicandLengthis the size of the multiplicand in bytes.
[in]multiplieris the pointer to the buffer containing the big number multiplier.
[in]multiplierLengthis the size of the multiplier in bytes.
[out]resultPKAMemAddris the pointer to the result vector location which will be set by this function.
Returns
Returns a status code.
See also
PKABigNumMultGetResult()

Referenced by PKAEccVerifyPublicKeyWeierstrassStart().

1203 {
1204  uint32_t offset = 0;
1205 
1206  // Check for the arguments.
1207  ASSERT(multiplicand);
1208  ASSERT(multiplier);
1209  ASSERT(resultPKAMemAddr);
1210 
1211  // Make sure no operation is in progress.
1212  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN) {
1214  }
1215 
1216  offset = PKAWritePkaParam(multiplicand, multiplicandLength, offset, PKA_O_APTR);
1217 
1218  offset = PKAWritePkaParam(multiplier, multiplierLength, offset, PKA_O_BPTR);
1219 
1220 
1221  // Copy the result vector address location.
1222  *resultPKAMemAddr = PKA_RAM_BASE + offset;
1223 
1224  // Load C pointer with the result location in PKA RAM.
1225  HWREG(PKA_BASE + PKA_O_CPTR) = offset >> 2;
1226 
1227  // Set the PKA function to the multiplication and start it.
1229 
1230  return PKA_STATUS_SUCCESS;
1231 }
static uint32_t PKAWritePkaParam(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:549
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_SUCCESS
Success.
Definition: pka.h:123
#define ASSERT(expr)
Definition: debug.h:73

Here is the call graph for this function:

uint32_t PKABigNumSubGetResult ( uint8_t *  resultBuf,
uint32_t *  resultLength,
uint32_t  resultPKAMemAddr 
)

Gets the result of the subtraction operation on two big numbers.

Parameters
[out]resultBufis the pointer to buffer where the result needs to be stored.
[in,out]resultLengthis the address of the variable containing the length of the buffer. After the operation the actual length of the resultant is stored at this address.
[in]resultPKAMemAddris the address of the result location which was provided by the start function PKABigNumAddStart().
Returns
Returns a status code.
See also
PKABigNumSubStart()
1284 {
1285  return PKAGetBigNumResult(resultBuf, resultLength, resultPKAMemAddr);
1286 }
static uint32_t PKAGetBigNumResult(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
Definition: pka.c:630

Here is the call graph for this function:

uint32_t PKABigNumSubStart ( const uint8_t *  minuend,
uint32_t  minuendLength,
const uint8_t *  subtrahend,
uint32_t  subtrahendLength,
uint32_t *  resultPKAMemAddr 
)

Starts the subtraction of one big number from another.

Parameters
[in]minuendis the pointer to the buffer containing the big number to be subtracted from.
[in]minuendLengthis the size of the minuend in bytes.
[in]subtrahendis the pointer to the buffer containing the big number to subtract from the minuend.
[in]subtrahendLengthis the size of the subtrahend in bytes.
[out]resultPKAMemAddris the pointer to the result vector location which will be set by this function.
Returns
Returns a status code.
See also
PKABigNumSubGetResult()
1294 {
1295  uint32_t offset = 0;
1296 
1297  // Check for arguments.
1298  ASSERT(minuend);
1299  ASSERT(subtrahend);
1300  ASSERT(resultPKAMemAddr);
1301 
1302 
1303  // Make sure no operation is in progress.
1304  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN) {
1306  }
1307 
1308  offset = PKAWritePkaParam(minuend, minuendLength, offset, PKA_O_APTR);
1309 
1310  offset = PKAWritePkaParam(subtrahend, subtrahendLength, offset, PKA_O_BPTR);
1311 
1312  // Copy the result vector address location.
1313  *resultPKAMemAddr = PKA_RAM_BASE + offset;
1314 
1315  // Load C pointer with the result location in PKA RAM.
1316  HWREG(PKA_BASE + PKA_O_CPTR) = offset >> 2;
1317 
1318  // Set the function for the add operation and start the operation.
1320 
1321  return PKA_STATUS_SUCCESS;
1322 }
static uint32_t PKAWritePkaParam(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:549
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_SUCCESS
Success.
Definition: pka.h:123
#define ASSERT(expr)
Definition: debug.h:73

Here is the call graph for this function:

void PKAClearPkaRam ( void  )

Zeroizes PKA RAM.

This function uses the zeroization function in PRCM to clear the PKA RAM.

527  {
528  // Get initial state
529  uint32_t secdmaclkgr = HWREG(PRCM_BASE + PRCM_O_SECDMACLKGR);
530 
531  // OR in zeroize bit
533 
534  // Start zeroization
535  HWREG(PRCM_BASE + PRCM_O_SECDMACLKGR) = secdmaclkgr;
536 
537  // Wait 256 cycles for PKA RAM to be cleared
538  CPUdelay(256 / 4);
539 
540  // Turn off zeroization
542 }
void CPUdelay(uint32_t ui32Count)
Provide a small non-zero delay using a simple loop counter.
Definition: cpu.c:343

Here is the call graph for this function:

uint32_t PKAEccAddGetResult ( uint8_t *  curvePointX,
uint8_t *  curvePointY,
uint32_t  resultPKAMemAddr,
uint32_t  length 
)

Gets the result of the ECC addition.

This function gets the result of ECC point addition operation on the on the two given EC points, previously started using the function PKAEccAddStart().

Parameters
[out]curvePointXis the pointer to the structure where the X coordinate of the resultant EC point will be stored.
[out]curvePointYis the pointer to the structure where the Y coordinate of the resultant EC point will be stored.
[in]resultPKAMemAddris the address of the result location which was provided by the start function PKAEccAddGetResult().
[in]lengthis the length of the curve parameters in bytes.
Returns
Returns a status code.
See also
PKAEccAddStart()
1490 {
1491  return PKAGetECCResult(curvePointX, curvePointY, resultPKAMemAddr, length);
1492 }
static uint32_t PKAGetECCResult(uint8_t *curvePointX, uint8_t *curvePointY, uint32_t resultPKAMemAddr, uint32_t length)
Definition: pka.c:768

Here is the call graph for this function:

uint32_t PKAEccAddStart ( const uint8_t *  curvePoint1X,
const uint8_t *  curvePoint1Y,
const uint8_t *  curvePoint2X,
const uint8_t *  curvePoint2Y,
const uint8_t *  prime,
const uint8_t *  a,
uint32_t  length,
uint32_t *  resultPKAMemAddr 
)

Starts the ECC addition.

Parameters
[in]curvePoint1Xis the pointer to the buffer containing the X coordinate of the first elliptic curve point to be added. The point must be on the given curve.
[in]curvePoint1Yis the pointer to the buffer containing the Y coordinate of the first elliptic curve point to be added. The point must be on the given curve.
[in]curvePoint2Xis the pointer to the buffer containing the X coordinate of the second elliptic curve point to be added. The point must be on the given curve.
[in]curvePoint2Yis the pointer to the buffer containing the Y coordinate of the second elliptic curve point to be added. The point must be on the given curve.
[in]primeis the prime of the curve.
[in]ais the a constant of the curve when the curve equation is expressed in short Weierstrass form (y^3 = x^2 + a*x + b).
[in]lengthis the length of the curve parameters in bytes.
[out]resultPKAMemAddris the pointer to the result vector location which will be set by this function.
Returns
Returns a status code.
See also
PKAEccAddGetResult()
1445 {
1446  uint32_t offset = 0;
1447 
1448  // Check for the arguments.
1449  ASSERT(curvePoint1X);
1450  ASSERT(curvePoint1Y);
1451  ASSERT(curvePoint2X);
1452  ASSERT(curvePoint2Y);
1453  ASSERT(prime);
1454  ASSERT(a);
1455  ASSERT(resultPKAMemAddr);
1456 
1457  // Make sure no operation is in progress.
1458  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN) {
1460  }
1461 
1462  offset = PKAWritePkaParamExtraOffset(curvePoint1X, length, offset, PKA_O_APTR);
1463  offset = PKAWritePkaParamExtraOffset(curvePoint1Y, length, offset, PKA_NO_POINTER_REG);
1464 
1465 
1466  offset = PKAWritePkaParamExtraOffset(prime, length, offset, PKA_O_BPTR);
1467  offset = PKAWritePkaParamExtraOffset(a, length, offset, PKA_NO_POINTER_REG);
1468 
1469  offset = PKAWritePkaParamExtraOffset(curvePoint2X, length, offset, PKA_O_CPTR);
1470  offset = PKAWritePkaParamExtraOffset(curvePoint2Y, length, offset, PKA_NO_POINTER_REG);
1471 
1472  // Copy the result vector location.
1473  *resultPKAMemAddr = PKA_RAM_BASE + offset;
1474 
1475  // Load D pointer with the result location in PKA RAM.
1476  HWREG(PKA_BASE + PKA_O_DPTR) = offset >> 2;
1477 
1478  // Set the PKA Function to ECC-ADD and start the operation.
1480 
1481  return PKA_STATUS_SUCCESS;
1482 }
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_SUCCESS
Success.
Definition: pka.h:123
static uint32_t PKAWritePkaParamExtraOffset(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:619
#define ASSERT(expr)
Definition: debug.h:73
#define PKA_NO_POINTER_REG
Definition: pka.c:135

Here is the call graph for this function:

uint32_t PKAEccMontgomeryMultiplyStart ( const uint8_t *  scalar,
const uint8_t *  curvePointX,
const uint8_t *  prime,
const uint8_t *  a,
uint32_t  length,
uint32_t *  resultPKAMemAddr 
)

Starts ECC Montgomery multiplication.

Parameters
[in]scalaris pointer to the buffer containing the scalar value to be multiplied.
[in]curvePointXis the pointer to the buffer containing the X coordinate of the elliptic curve point to be multiplied. The point must be on the given curve.
[in]primeis the prime of the curve.
[in]ais the a constant of the curve when the curve equation is expressed in short Weierstrass form (y^3 = x^2 + a*x + b).
[in]lengthis the length of the curve parameters in bytes.
[out]resultPKAMemAddris the pointer to the result vector location which will be set by this function.
Returns
Returns a status code.
See also
PKAEccMultiplyGetResult()
1390 {
1391  uint32_t offset = 0;
1392 
1393  // Check for the arguments.
1394  ASSERT(scalar);
1395  ASSERT(curvePointX);
1396  ASSERT(prime);
1397  ASSERT(a);
1398  ASSERT(length <= PKA_MAX_CURVE_SIZE_32_BIT_WORD * sizeof(uint32_t));
1399  ASSERT(resultPKAMemAddr);
1400 
1401  // Make sure no PKA operation is in progress.
1402  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN) {
1404  }
1405 
1406  offset = PKAWritePkaParam(scalar, length, offset, PKA_O_APTR);
1407 
1408  offset = PKAWritePkaParamExtraOffset(prime, length, offset, PKA_O_BPTR);
1409  offset = PKAWritePkaParamExtraOffset(a, length, offset, PKA_NO_POINTER_REG);
1410 
1411  offset = PKAWritePkaParamExtraOffset(curvePointX, length, offset, PKA_O_CPTR);
1412 
1413  // Update the result location.
1414  // The resultPKAMemAddr may be 0 if we only want to check that we generated the point at infinity
1415  if (resultPKAMemAddr) {
1416  *resultPKAMemAddr = PKA_RAM_BASE + offset;
1417  }
1418 
1419  // Load D pointer with the result location in PKA RAM.
1420  HWREG(PKA_BASE + PKA_O_DPTR) = offset >> 2;
1421 
1422  // Set the PKA function to Montgomery ECC-MULT and start the operation.
1424 
1425  return PKA_STATUS_SUCCESS;
1426 }
static uint32_t PKAWritePkaParam(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:549
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_SUCCESS
Success.
Definition: pka.h:123
static uint32_t PKAWritePkaParamExtraOffset(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:619
#define ASSERT(expr)
Definition: debug.h:73
#define PKA_NO_POINTER_REG
Definition: pka.c:135
#define PKA_MAX_CURVE_SIZE_32_BIT_WORD
Definition: pka.c:119

Here is the call graph for this function:

uint32_t PKAEccMultiplyGetResult ( uint8_t *  curvePointX,
uint8_t *  curvePointY,
uint32_t  resultPKAMemAddr,
uint32_t  length 
)

Gets the result of ECC multiplication.

This function gets the result of ECC point multiplication operation on the EC point and the scalar value, previously started using the function PKAEccMultiplyStart().

Parameters
[out]curvePointXis the pointer to the structure where the X coordinate of the resultant EC point will be stored.
[out]curvePointYis the pointer to the structure where the Y coordinate of the resultant EC point will be stored.
[in]resultPKAMemAddris the address of the result location which was provided by the start function PKAEccMultiplyStart().
[in]lengthis the length of the curve parameters in bytes.
Returns
Returns a status code.
See also
PKAEccMultiplyStart()
1435 {
1436  return PKAGetECCResult(curvePointX, curvePointY, resultPKAMemAddr, length);
1437 }
static uint32_t PKAGetECCResult(uint8_t *curvePointX, uint8_t *curvePointY, uint32_t resultPKAMemAddr, uint32_t length)
Definition: pka.c:768

Here is the call graph for this function:

uint32_t PKAEccMultiplyStart ( const uint8_t *  scalar,
const uint8_t *  curvePointX,
const uint8_t *  curvePointY,
const uint8_t *  prime,
const uint8_t *  a,
const uint8_t *  b,
uint32_t  length,
uint32_t *  resultPKAMemAddr 
)

Starts ECC multiplication.

Parameters
[in]scalaris pointer to the buffer containing the scalar value to be multiplied.
[in]curvePointXis the pointer to the buffer containing the X coordinate of the elliptic curve point to be multiplied. The point must be on the given curve.
[in]curvePointYis the pointer to the buffer containing the Y coordinate of the elliptic curve point to be multiplied. The point must be on the given curve.
[in]primeis the prime of the curve.
[in]ais the a constant of the curve when the curve equation is expressed in short Weierstrass form (y^3 = x^2 + a*x + b).
[in]bis the b constant of the curve when the curve equation is expressed in short Weierstrass form (y^3 = x^2 + a*x + b).
[in]lengthis the length of the curve parameters in bytes.
[out]resultPKAMemAddris the pointer to the result vector location which will be set by this function.
Returns
Returns a status code.
See also
PKAEccMultiplyGetResult()
1341 {
1342  uint32_t offset = 0;
1343 
1344  // Check for the arguments.
1345  ASSERT(scalar);
1346  ASSERT(curvePointX);
1347  ASSERT(curvePointY);
1348  ASSERT(prime);
1349  ASSERT(a);
1350  ASSERT(b);
1351  ASSERT(length <= PKA_MAX_CURVE_SIZE_32_BIT_WORD * sizeof(uint32_t));
1352  ASSERT(resultPKAMemAddr);
1353 
1354  // Make sure no PKA operation is in progress.
1355  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN) {
1357  }
1358 
1359  offset = PKAWritePkaParam(scalar, length, offset, PKA_O_APTR);
1360 
1361  offset = PKAWritePkaParamExtraOffset(prime, length, offset, PKA_O_BPTR);
1362  offset = PKAWritePkaParamExtraOffset(a, length, offset, PKA_NO_POINTER_REG);
1363  offset = PKAWritePkaParamExtraOffset(b, length, offset, PKA_NO_POINTER_REG);
1364 
1365  offset = PKAWritePkaParamExtraOffset(curvePointX, length, offset, PKA_O_CPTR);
1366  offset = PKAWritePkaParamExtraOffset(curvePointY, length, offset, PKA_NO_POINTER_REG);
1367 
1368  // Update the result location.
1369  // The resultPKAMemAddr may be 0 if we only want to check that we generated the point at infinity
1370  if (resultPKAMemAddr) {
1371  *resultPKAMemAddr = PKA_RAM_BASE + offset;
1372  }
1373 
1374  // Load D pointer with the result location in PKA RAM.
1375  HWREG(PKA_BASE + PKA_O_DPTR) = offset >> 2;
1376 
1377  // Set the PKA function to ECC-MULT and start the operation.
1379 
1380  return PKA_STATUS_SUCCESS;
1381 }
static uint32_t PKAWritePkaParam(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:549
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_SUCCESS
Success.
Definition: pka.h:123
static uint32_t PKAWritePkaParamExtraOffset(const uint8_t *param, uint32_t paramLength, uint32_t paramOffset, uint32_t ptrRegOffset)
Definition: pka.c:619
#define ASSERT(expr)
Definition: debug.h:73
#define PKA_NO_POINTER_REG
Definition: pka.c:135
#define PKA_MAX_CURVE_SIZE_32_BIT_WORD
Definition: pka.c:119

Here is the call graph for this function:

uint32_t PKAEccVerifyPublicKeyWeierstrassStart ( const uint8_t *  curvePointX,
const uint8_t *  curvePointY,
const uint8_t *  prime,
const uint8_t *  a,
const uint8_t *  b,
const uint8_t *  order,
uint32_t  length 
)

Begins the validation of a public key against a Short-Weierstrass curve.

This function validates a public key against a curve. After performing multiple smaller PKA operations in polling mode, it starts an ECC scalar multiplication.

The function verifies that:

  • X and Y are in the range [1, prime - 1]
  • The point is not the point at infinity
  • X and Y satisfy the Short-Weierstrass curve equation Y^2 = X^3 + a*X + b mod P
  • Multiplying the point by the order of the curve yields the point at infinity
Parameters
[in]curvePointXis the pointer to the buffer containing the X coordinate of the elliptic curve point to verify.
[in]curvePointYis the pointer to the buffer containing the Y coordinate of the elliptic curve point to verify.
[in]primeis the prime of the curve.
[in]ais the a constant of the curve when the curve equation is expressed in Short-Weierstrass form (y^3 = x^2 + a*x + b).
[in]bis the b constant of the curve when the curve equation is expressed in Short-Weierstrass form (y^3 = x^2 + a*x + b).
[in]orderis the order of the curve.
[in]lengthis the length of the curve parameters in bytes.
Returns
Returns a status code.
See also
PKAEccVerifyPublicKeyGetResult()
1500 {
1501  uint32_t pkaResult;
1502  uint32_t resultAddress;
1503  uint32_t resultLength;
1504  uint8_t *scratchBuffer = (uint8_t *)(PKA_RAM_BASE + PKA_RAM_TOT_BYTE_SIZE / 2);
1505  uint8_t *scratchBuffer2 = scratchBuffer + 512;
1506 
1507 
1508  // Verify X in range [0, prime - 1]
1509  PKABigNumCmpStart(curvePointX,
1510  prime,
1511  length);
1512 
1514 
1515  pkaResult = PKABigNumCmpGetResult();
1516 
1517  if (pkaResult != PKA_STATUS_A_LESS_THAN_B) {
1519  }
1520 
1521  // Verify Y in range [0, prime - 1]
1522  PKABigNumCmpStart(curvePointY,
1523  prime,
1524  length);
1525 
1527 
1528  pkaResult = PKABigNumCmpGetResult();
1529 
1530  if (pkaResult != PKA_STATUS_A_LESS_THAN_B) {
1532  }
1533 
1534  // Verify point on curve
1535  // Short-Weierstrass equation: Y ^ 2 = X ^3 + a * X + b mod P
1536  // Reduced: Y ^ 2 = X * (X ^ 2 + a) + b
1537 
1538  // tmp = X ^ 2
1539  PKABigNumMultiplyStart(curvePointX, length, curvePointX, length, &resultAddress);
1540 
1542 
1543  resultLength = 200;
1544  pkaResult = PKABigNumMultGetResult(scratchBuffer, &resultLength, resultAddress);
1545 
1546  if (pkaResult != PKA_STATUS_SUCCESS) {
1547  return PKA_STATUS_FAILURE;
1548  }
1549 
1550  // tmp += a
1551  PKABigNumAddStart(scratchBuffer, resultLength, a, length, &resultAddress);
1552 
1554 
1555  resultLength = 200;
1556  pkaResult = PKABigNumAddGetResult(scratchBuffer, &resultLength, resultAddress);
1557 
1558  if (pkaResult != PKA_STATUS_SUCCESS) {
1559  return PKA_STATUS_FAILURE;
1560  }
1561 
1562  // tmp *= x
1563  PKABigNumMultiplyStart(scratchBuffer, resultLength, curvePointX, length, &resultAddress);
1564 
1566 
1567  resultLength = 200;
1568  pkaResult = PKABigNumMultGetResult(scratchBuffer, &resultLength, resultAddress);
1569 
1570  if (pkaResult != PKA_STATUS_SUCCESS) {
1571  return PKA_STATUS_FAILURE;
1572  }
1573 
1574  // tmp += b
1575  PKABigNumAddStart(scratchBuffer, resultLength, b, length, &resultAddress);
1576 
1578 
1579  resultLength = 200;
1580  pkaResult = PKABigNumAddGetResult(scratchBuffer, &resultLength, resultAddress);
1581 
1582  if (pkaResult != PKA_STATUS_SUCCESS) {
1583  return PKA_STATUS_FAILURE;
1584  }
1585 
1586 
1587  // tmp2 = tmp % prime to ensure we have no fraction in the division.
1588  // The number will only shrink from here on out.
1589  PKABigNumModStart(scratchBuffer, resultLength, prime, length, &resultAddress);
1590 
1592 
1593  // If the result is not a multiple of the word-length, the PKA HW will round up
1594  // because it deals in words only. That means that using 'length' directly
1595  // would cause and underflow, since length refers to the actual length in bytes of
1596  // the curve parameters while the PKA HW reports that rounded up to the next
1597  // word boundary.
1598  // Use 200 as the resultLength instead since we are copying to the scratch buffer
1599  // anyway.
1600  // Practically, this only happens with curves such as NIST-P521 that are not word
1601  // multiples.
1602  resultLength = 200;
1603  pkaResult = PKABigNumModGetResult(scratchBuffer2, resultLength, resultAddress);
1604 
1605  if (pkaResult != PKA_STATUS_SUCCESS) {
1606  return PKA_STATUS_FAILURE;
1607  }
1608 
1609  // tmp = y^2
1610  PKABigNumMultiplyStart(curvePointY, length, curvePointY, length, &resultAddress);
1611 
1613 
1614  resultLength = 200;
1615  pkaResult = PKABigNumMultGetResult(scratchBuffer, &resultLength, resultAddress);
1616 
1617  if (pkaResult != PKA_STATUS_SUCCESS) {
1618  return PKA_STATUS_FAILURE;
1619  }
1620 
1621  // tmp %= prime
1622  PKABigNumModStart(scratchBuffer, resultLength, prime, length, &resultAddress);
1623 
1625 
1626  // If the result is not a multiple of the word-length, the PKA HW will round up
1627  // because it deals in words only. That means that using 'length' directly
1628  // would cause and underflow, since length refers to the actual length in bytes of
1629  // the curve parameters while the PKA HW reports that rounded up to the next
1630  // word boundary.
1631  // Use 200 as the resultLength instead since we are copying to the scratch buffer
1632  // anyway.
1633  // Practically, this only happens with curves such as NIST-P521 that are not word
1634  // multiples.
1635  resultLength = 200;
1636  pkaResult = PKABigNumModGetResult(scratchBuffer, resultLength, resultAddress);
1637 
1638  if (pkaResult != PKA_STATUS_SUCCESS) {
1639  return PKA_STATUS_FAILURE;
1640  }
1641 
1642  // tmp ?= tmp2
1643  PKABigNumCmpStart(scratchBuffer,
1644  scratchBuffer2,
1645  length);
1646 
1648 
1649  pkaResult = PKABigNumCmpGetResult();
1650 
1651  if (pkaResult != PKA_STATUS_EQUAL) {
1653  }
1654  else {
1655  return PKA_STATUS_SUCCESS;
1656  }
1657 }
#define PKA_STATUS_POINT_NOT_ON_CURVE
The public key is not on the specified elliptic curve.
Definition: pka.h:138
uint32_t PKABigNumModGetResult(uint8_t *resultBuf, uint32_t length, uint32_t resultPKAMemAddr)
Gets the result of the big number modulus operation.
Definition: pka.c:957
uint32_t PKABigNumAddGetResult(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
Gets the result of the addition operation on two big numbers.
Definition: pka.c:1329
uint32_t PKABigNumAddStart(const uint8_t *bigNum1, uint32_t bigNum1Length, const uint8_t *bigNum2, uint32_t bigNum2Length, uint32_t *resultPKAMemAddr)
Starts the addition of two big numbers.
Definition: pka.c:1248
uint32_t PKABigNumCmpStart(const uint8_t *bigNum1, const uint8_t *bigNum2, uint32_t length)
Starts the comparison of two big numbers.
Definition: pka.c:1038
#define PKA_STATUS_FAILURE
Failure.
Definition: pka.h:124
#define PKA_STATUS_Y_LARGER_THAN_PRIME
Y coordinate of public key is larger than the curve prime.
Definition: pka.h:137
#define PKA_STATUS_EQUAL
Big number compare return status if the first big number is equal to the second.
Definition: pka.h:130
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_X_LARGER_THAN_PRIME
X coordinate of public key is larger than the curve prime.
Definition: pka.h:136
#define PKA_STATUS_SUCCESS
Success.
Definition: pka.h:123
uint32_t PKABigNumMultGetResult(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)
Gets the result of the big number multiplication.
Definition: pka.c:1238
uint32_t PKABigNumModStart(const uint8_t *bigNum, uint32_t bigNumLength, const uint8_t *modulus, uint32_t modulusLength, uint32_t *resultPKAMemAddr)
Starts a big number modulus operation.
Definition: pka.c:922
uint32_t PKABigNumMultiplyStart(const uint8_t *multiplicand, uint32_t multiplicandLength, const uint8_t *multiplier, uint32_t multiplierLength, uint32_t *resultPKAMemAddr)
Starts the multiplication of two big numbers.
Definition: pka.c:1202
#define PKA_STATUS_A_LESS_THAN_B
Big number compare return status if the first big number is less than the second. ...
Definition: pka.h:129
uint32_t PKAGetOpsStatus(void)
Gets the PKA operation status.
Definition: pka.c:856
uint32_t PKABigNumCmpGetResult(void)
Gets the result of the comparison operation of two big numbers.
Definition: pka.c:1067

Here is the call graph for this function:

uint32_t PKAGetOpsStatus ( void  )

Gets the PKA operation status.

This function gets information on whether any PKA operation is in progress or not. This function allows to check the PKA operation status before starting any new PKA operation.

Returns
Returns a status code.

Referenced by PKAEccVerifyPublicKeyWeierstrassStart().

857 {
858  if (HWREG(PKA_BASE + PKA_O_FUNCTION) & PKA_FUNCTION_RUN_M) {
860  }
861  else {
863  }
864 }
#define PKA_STATUS_OPERATION_BUSY
PKA operation is in progress.
Definition: pka.h:131
#define PKA_STATUS_OPERATION_RDY
No PKA operation is in progress.
Definition: pka.h:132
void PKAZeroOutArray ( const uint8_t *  array,
uint32_t  arrayLength 
)

Zeros-out an array.

Parameters
[in]arrayis the array to zero-out.
[in]arrayLengthis the length of the array.

Referenced by PKABigNumExpModGetResult(), PKABigNumInvModGetResult(), and PKABigNumModGetResult().

898 {
899  uint32_t i;
900  // Take the floor of paramLength in 32-bit words
901  uint32_t arrayLengthInWords = arrayLength / sizeof(uint32_t);
902 
903  // Zero-out the array word-wise until i >= arrayLength
904  for (i = 0; i < arrayLengthInWords * sizeof(uint32_t); i += 4) {
905  HWREG(array + i) = 0;
906  }
907 
908  // If i != arrayLength, there are some remaining bytes to zero-out
909  if (arrayLength % sizeof(uint32_t)) {
910  // Subtract 4 from i, since i has already overshot the array
911  for (i -= 4; i < arrayLength; i++) {
912  HWREGB(array + i * sizeof(uint32_t));
913  }
914  }
915 }

Macro Definition Documentation

#define BrainpoolP256R1_PARAM_SIZE_BYTES   32
#define BrainpoolP384R1_PARAM_SIZE_BYTES   48
#define BrainpoolP512R1_PARAM_SIZE_BYTES   64
#define Curve25519_PARAM_SIZE_BYTES   32
#define NISTP224_PARAM_SIZE_BYTES   28
#define NISTP256_PARAM_SIZE_BYTES   32
#define NISTP384_PARAM_SIZE_BYTES   48
#define NISTP521_PARAM_SIZE_BYTES   66
#define PKA_STATUS_A_GREATER_THAN_B   5

Big number compare return status if the first big number is greater than the second.

Referenced by PKABigNumCmpGetResult().

#define PKA_STATUS_A_LESS_THAN_B   6

Big number compare return status if the first big number is less than the second.

Referenced by PKABigNumCmpGetResult(), and PKAEccVerifyPublicKeyWeierstrassStart().

#define PKA_STATUS_BUF_UNDERFLOW   3

Buffer underflow.

Referenced by PKAGetBigNumResult(), and PKAGetBigNumResultRemainder().

#define PKA_STATUS_EQUAL   7

Big number compare return status if the first big number is equal to the second.

Referenced by PKABigNumCmpGetResult(), and PKAEccVerifyPublicKeyWeierstrassStart().

#define PKA_STATUS_FAILURE   1
#define PKA_STATUS_INVALID_PARAM   2

Invalid parameter.

#define PKA_STATUS_LOCATION_IN_USE   10

Location in PKA RAM is not available.

#define PKA_STATUS_OPERATION_RDY   9

No PKA operation is in progress.

Referenced by PKAGetOpsStatus().

#define PKA_STATUS_POINT_AT_INFINITY   17

The ECC operation resulted in the point at infinity.

Referenced by PKAGetECCResult().

#define PKA_STATUS_POINT_NOT_ON_CURVE   15

The public key is not on the specified elliptic curve.

Referenced by PKAEccVerifyPublicKeyWeierstrassStart().

#define PKA_STATUS_RESULT_0   4

Result is all zeros.

#define PKA_STATUS_RESULT_ADDRESS_INCORRECT   16

The address of the result passed into one of the PKA*GetResult functions is incorrect.

Referenced by PKAGetBigNumResult().

#define PKA_STATUS_X_LARGER_THAN_PRIME   13

X coordinate of public key is larger than the curve prime.

Referenced by PKAEccVerifyPublicKeyWeierstrassStart().

#define PKA_STATUS_X_ZERO   11

X coordinate of public key is 0.

#define PKA_STATUS_Y_LARGER_THAN_PRIME   14

Y coordinate of public key is larger than the curve prime.

Referenced by PKAEccVerifyPublicKeyWeierstrassStart().

#define PKA_STATUS_Y_ZERO   12

Y coordinate of public key is 0.

Variable Documentation

const PKA_EccParam256 BrainpoolP256R1_a

a constant of the BrainpoolP256R1 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccParam256 BrainpoolP256R1_b

b constant of the BrainpoolP256R1 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccPoint256 BrainpoolP256R1_generator

X coordinate of the generator point of the BrainpoolP256R1 curve.

const PKA_EccParam256 BrainpoolP256R1_order

Order of the BrainpoolP256R1 curve.

const PKA_EccParam256 BrainpoolP256R1_prime

Prime of the BrainpoolP256R1 curve.

const PKA_EccParam384 BrainpoolP384R1_a

a constant of the BrainpoolP384R1 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccParam384 BrainpoolP384R1_b

b constant of the BrainpoolP384R1 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccPoint384 BrainpoolP384R1_generator

X coordinate of the generator point of the BrainpoolP384R1 curve.

const PKA_EccParam384 BrainpoolP384R1_order

Order of the BrainpoolP384R1 curve.

const PKA_EccParam384 BrainpoolP384R1_prime

Prime of the BrainpoolP384R1 curve.

const PKA_EccParam512 BrainpoolP512R1_a

a constant of the BrainpoolP512R1 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccParam512 BrainpoolP512R1_b

b constant of the BrainpoolP512R1 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccPoint512 BrainpoolP512R1_generator

X coordinate of the generator point of the BrainpoolP512R1 curve.

const PKA_EccParam512 BrainpoolP512R1_order

Order of the BrainpoolP512R1 curve.

const PKA_EccParam512 BrainpoolP512R1_prime

Prime of the BrainpoolP512R1 curve.

const PKA_EccParam256 Curve25519_a

a constant of the Curve25519 curve when expressed in Montgomery form (By^2 = x^3 + a*x^2 + x).

const PKA_EccParam256 Curve25519_b

b constant of the Curve25519 curve when expressed in Montgomery form (By^2 = x^3 + a*x^2 + x).

const PKA_EccPoint256 Curve25519_generator

X coordinate of the generator point of the Curve25519 curve.

const PKA_EccParam256 Curve25519_order

Order of the Curve25519 curve.

const PKA_EccParam256 Curve25519_prime

Prime of the Curve25519 curve.

const PKA_EccParam224 NISTP224_a

a constant of the NISTP224 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccParam224 NISTP224_b

b constant of the NISTP224 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccPoint224 NISTP224_generator

X coordinate of the generator point of the NISTP224 curve.

const PKA_EccParam224 NISTP224_order

Order of the NISTP224 curve.

const PKA_EccParam224 NISTP224_prime

Prime of the NISTP224 curve.

const PKA_EccParam256 NISTP256_a

a constant of the NISTP256 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccParam256 NISTP256_b

b constant of the NISTP256 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccPoint256 NISTP256_generator

X coordinate of the generator point of the NISTP256 curve.

const PKA_EccParam256 NISTP256_order

Order of the NISTP256 curve.

const PKA_EccParam256 NISTP256_prime

Prime of the NISTP256 curve.

const PKA_EccParam384 NISTP384_a

a constant of the NISTP384 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccParam384 NISTP384_b

b constant of the NISTP384 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccPoint384 NISTP384_generator

X coordinate of the generator point of the NISTP384 curve.

const PKA_EccParam384 NISTP384_order

Order of the NISTP384 curve.

const PKA_EccParam384 NISTP384_prime

Prime of the NISTP384 curve.

const PKA_EccParam521 NISTP521_a

a constant of the NISTP521 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccParam521 NISTP521_b

b constant of the NISTP521 curve when expressed in short Weierstrass form (y^3 = x^2 + a*x + b).

const PKA_EccPoint521 NISTP521_generator

X coordinate of the generator point of the NISTP521 curve.

const PKA_EccParam521 NISTP521_order

Order of the NISTP521 curve.

const PKA_EccParam521 NISTP521_prime

Prime of the NISTP521 curve.