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 | |
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 | 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... | |
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.
bool PKAArrayAllZeros | ( | const uint8_t * | array, |
uint32_t | arrayLength | ||
) |
Checks whether and array only consists of zeros.
[in] | array | is the array to check. |
[in] | arrayLength | is the length of the array. |
uint32_t PKABigNumAddGetResult | ( | uint8_t * | resultBuf, |
uint32_t * | resultLength, | ||
uint32_t | resultPKAMemAddr | ||
) |
Gets the result of the addition operation on two big numbers.
[out] | resultBuf | is the pointer to buffer where the result needs to be stored. |
[in,out] | resultLength | is 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] | resultPKAMemAddr | is the address of the result location which was provided by the start function PKABigNumAddStart(). |
Referenced by PKAEccVerifyPublicKeyWeierstrassStart().
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.
[in] | bigNum1 | is the pointer to the buffer containing the first big number. |
[in] | bigNum1Length | is the size of the first big number in bytes. |
[in] | bigNum2 | is the pointer to the buffer containing the second big number. |
[in] | bigNum2Length | is the size of the second big number in bytes. |
[out] | resultPKAMemAddr | is the pointer to the result vector location which will be set by this function. |
Referenced by PKAEccVerifyPublicKeyWeierstrassStart().
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().
Referenced by PKAEccVerifyPublicKeyWeierstrassStart().
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
.
bigNum1
and bigNum2
must have same size.[in] | bigNum1 | is the pointer to the first big number. |
[in] | bigNum2 | is the pointer to the second big number. |
[in] | length | is the size of the big numbers in bytes. |
Referenced by PKAEccVerifyPublicKeyWeierstrassStart().
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().
[out] | resultBuf | is the pointer to buffer where the result needs to be stored. |
[in] | length | is the size of the provided buffer in bytes. |
[in] | resultQuotientMemAddr | is the address of the result location which was provided by the start function PKABigNumDivideStart(). |
length
is less than the length of the result.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().
[out] | resultBuf | is the pointer to buffer where the result needs to be stored. |
[in] | length | is the size of the provided buffer in bytes. |
[in] | resultRemainderMemAddr | is the address of the result location which was provided by the start function PKABigNumDivideStart(). |
length
is less than the length of the result.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
.
[in] | dividend | is the pointer to the big number to be divided. |
[in] | dividendLength | is the size of the big number dividend in bytes. |
[in] | divisor | is the pointer to the divisor. |
[in] | divisorLength | is the size of the divisor in bytes. |
[out] | resultQuotientMemAddr | is the pointer to the quotient vector location which will be set by this function. |
[out] | resultRemainderMemAddr | is the pointer to the remainder vector location which will be set by 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.
[out] | resultBuf | is the pointer to buffer where the result needs to be stored. |
[in] | length | is the size of the provided buffer in bytes. |
[in] | resultPKAMemAddr | is the address of the result location which was provided by the start function PKABigNumInvModStart(). |
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
.
[in] | bigNum | is the pointer to the buffer containing the big number (dividend). |
[in] | bigNumLength | is the size of the bigNum in bytes. |
[in] | modulus | is the pointer to the buffer containing the divisor. |
[in] | modulusLength | is the size of the divisor in bytes. |
[out] | resultPKAMemAddr | is the pointer to the result vector location which will be set by 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.
[out] | resultBuf | is the pointer to buffer where the result needs to be stored. |
[in] | length | is the size of the provided buffer in bytes. |
[in] | resultPKAMemAddr | is the address of the result location which was provided by the start function PKABigNumModStart(). |
length
is less than the length of the result.Referenced by PKAEccVerifyPublicKeyWeierstrassStart().
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
.
[in] | bigNum | is the pointer to the big number on which modulo operation needs to be carried out. |
[in] | bigNumLength | is the size of the big number bigNum in bytes. |
[in] | modulus | is the pointer to the divisor. |
[in] | modulusLength | is the size of the divisor modulus in bytes. |
[out] | resultPKAMemAddr | is the pointer to the result vector location which will be set by this function. |
Referenced by PKAEccVerifyPublicKeyWeierstrassStart().
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().
[out] | resultBuf | is the pointer to buffer where the result needs to be stored. |
[in,out] | resultLength | is 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] | resultPKAMemAddr | is the address of the result location which was provided by the start function PKABigNumMultiplyStart(). |
Referenced by PKAEccVerifyPublicKeyWeierstrassStart().
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.
[in] | multiplicand | is the pointer to the buffer containing the big number multiplicand. |
[in] | multiplicandLength | is the size of the multiplicand in bytes. |
[in] | multiplier | is the pointer to the buffer containing the big number multiplier. |
[in] | multiplierLength | is the size of the multiplier in bytes. |
[out] | resultPKAMemAddr | is the pointer to the result vector location which will be set by this function. |
Referenced by PKAEccVerifyPublicKeyWeierstrassStart().
uint32_t PKABigNumSubGetResult | ( | uint8_t * | resultBuf, |
uint32_t * | resultLength, | ||
uint32_t | resultPKAMemAddr | ||
) |
Gets the result of the subtraction operation on two big numbers.
[out] | resultBuf | is the pointer to buffer where the result needs to be stored. |
[in,out] | resultLength | is 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] | resultPKAMemAddr | is the address of the result location which was provided by the start function PKABigNumAddStart(). |
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.
[in] | minuend | is the pointer to the buffer containing the big number to be subtracted from. |
[in] | minuendLength | is the size of the minuend in bytes. |
[in] | subtrahend | is the pointer to the buffer containing the big number to subtract from the minuend . |
[in] | subtrahendLength | is the size of the subtrahend in bytes. |
[out] | resultPKAMemAddr | is the pointer to the result vector location which will be set by 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().
[out] | curvePointX | is the pointer to the structure where the X coordinate of the resultant EC point will be stored. |
[out] | curvePointY | is the pointer to the structure where the Y coordinate of the resultant EC point will be stored. |
[in] | resultPKAMemAddr | is the address of the result location which was provided by the start function PKAEccAddGetResult(). |
[in] | length | is the length of the curve parameters in bytes. |
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.
[in] | curvePoint1X | is 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] | curvePoint1Y | is 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] | curvePoint2X | is 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] | curvePoint2Y | is 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] | prime | is the prime of the curve. |
[in] | a | is the a constant of the curve when the curve equation is expressed in short Weierstrass form (y^3 = x^2 + a*x + b). |
[in] | length | is the length of the curve parameters in bytes. |
[out] | resultPKAMemAddr | is the pointer to the result vector location which will be set by 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.
[in] | scalar | is pointer to the buffer containing the scalar value to be multiplied. |
[in] | curvePointX | is 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] | prime | is the prime of the curve. |
[in] | a | is the a constant of the curve when the curve equation is expressed in short Weierstrass form (y^3 = x^2 + a*x + b). |
[in] | length | is the length of the curve parameters in bytes. |
[out] | resultPKAMemAddr | is the pointer to the result vector location which will be set by 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().
[out] | curvePointX | is the pointer to the structure where the X coordinate of the resultant EC point will be stored. |
[out] | curvePointY | is the pointer to the structure where the Y coordinate of the resultant EC point will be stored. |
[in] | resultPKAMemAddr | is the address of the result location which was provided by the start function PKAEccMultiplyStart(). |
[in] | length | is the length of the curve parameters in bytes. |
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.
[in] | scalar | is pointer to the buffer containing the scalar value to be multiplied. |
[in] | curvePointX | is 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] | curvePointY | is 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] | prime | is the prime of the curve. |
[in] | a | is the a constant of the curve when the curve equation is expressed in short Weierstrass form (y^3 = x^2 + a*x + b). |
[in] | b | is the b constant of the curve when the curve equation is expressed in short Weierstrass form (y^3 = x^2 + a*x + b). |
[in] | length | is the length of the curve parameters in bytes. |
[out] | resultPKAMemAddr | is the pointer to the result vector location which will be set by 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:
[in] | curvePointX | is the pointer to the buffer containing the X coordinate of the elliptic curve point to verify. |
[in] | curvePointY | is the pointer to the buffer containing the Y coordinate of the elliptic curve point to verify. |
[in] | prime | is the prime of the curve. |
[in] | a | is the a constant of the curve when the curve equation is expressed in Short-Weierstrass form (y^3 = x^2 + a*x + b). |
[in] | b | is the b constant of the curve when the curve equation is expressed in Short-Weierstrass form (y^3 = x^2 + a*x + b). |
[in] | order | is the order of the curve. |
[in] | length | is the length of the curve parameters in bytes. |
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.
Referenced by PKAEccVerifyPublicKeyWeierstrassStart().
void PKAZeroOutArray | ( | const uint8_t * | array, |
uint32_t | arrayLength | ||
) |
Zeros-out an array.
[in] | array | is the array to zero-out. |
[in] | arrayLength | is the length of the array. |
Referenced by PKABigNumInvModGetResult(), and PKABigNumModGetResult().
#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 |
Failure.
Referenced by PKABigNumCmpGetResult(), PKAEccVerifyPublicKeyWeierstrassStart(), and PKAGetECCResult().
#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_BUSY 8 |
PKA operation is in progress.
Referenced by PKABigNumAddStart(), PKABigNumCmpGetResult(), PKABigNumCmpStart(), PKABigNumDivideStart(), PKABigNumInvModStart(), PKABigNumModStart(), PKABigNumMultiplyStart(), PKABigNumSubStart(), PKAEccAddStart(), PKAEccMontgomeryMultiplyStart(), PKAEccMultiplyStart(), PKAEccVerifyPublicKeyWeierstrassStart(), PKAGetBigNumResult(), PKAGetBigNumResultRemainder(), PKAGetECCResult(), and PKAGetOpsStatus().
#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_SUCCESS 0 |
Success.
Referenced by PKABigNumAddStart(), PKABigNumCmpStart(), PKABigNumDivideStart(), PKABigNumInvModStart(), PKABigNumModStart(), PKABigNumMultiplyStart(), PKABigNumSubStart(), PKAEccAddStart(), PKAEccMontgomeryMultiplyStart(), PKAEccMultiplyStart(), PKAEccVerifyPublicKeyWeierstrassStart(), PKAGetBigNumResult(), PKAGetBigNumResultRemainder(), and PKAGetECCResult().
#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.
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.