Contiki-NG

Driver for the cc2538 ECC mode of the PKC engine. More...

Modules

 cc2538 ECC Algorithms
 This is a implementation of ECDH, ECDSA sign and ECDSA verify.
 
 cc2538 NIST curves
 NIST curves for various key sizes.
 

Files

file  ecc-driver.c
 Implementation of the cc2538 ECC driver.
 
file  ecc-driver.h
 Header file for the cc2538 ECC driver.
 

ECC functions

Note
Not all sequencer functions are implemented in this driver look at the CC2538 manual for a complete list.
uint8_t ecc_mul_start (uint32_t *scalar, ec_point_t *ec_point, ecc_curve_info_t *curve, uint32_t *result_vector, struct process *process)
 Starts ECC Multiplication. More...
 
uint8_t ecc_mul_get_result (ec_point_t *ec_point, uint32_t result_vector)
 Gets the result of ECC Multiplication. More...
 
uint8_t ecc_mul_gen_pt_start (uint32_t *scalar, ecc_curve_info_t *curve, uint32_t *result_vector, struct process *process)
 Starts the ECC Multiplication with Generator point. More...
 
uint8_t ecc_mul_gen_pt_get_result (ec_point_t *ec_point, uint32_t result_vector)
 Gets the result of ECC Multiplication with Generator point. More...
 
uint8_t ecc_add_start (ec_point_t *ec_point1, ec_point_t *ec_point2, ecc_curve_info_t *curve, uint32_t *result_vector, struct process *process)
 Starts the ECC Addition. More...
 
uint8_t ecc_add_get_result (ec_point_t *ptOutEcPt, uint32_t ui32ResultLoc)
 Gets the result of the ECC Addition. More...
 

Detailed Description

Driver for the cc2538 ECC mode of the PKC engine.

Function Documentation

◆ ecc_add_get_result()

uint8_t ecc_add_get_result ( ec_point_t *  ptOutEcPt,
uint32_t  ui32ResultLoc 
)

Gets the result of the ECC Addition.

Parameters
ptOutEcPtPointer to the structure where the resultant point will be stored. The callee is responsible to allocate memory, for the ec point structure including the memory for x and y co-ordinate values.
ui32ResultLocAddress of the result location which was provided by the function
See also
PKAECCAddStart().

This function gets the result of ecc point addition operation on the on the two given ec points, previously started using the function

See also
PKAECCAddStart().
Return values
PKA_STATUS_SUCCESSif the operation is successful.
PKA_STATUS_OPERATION_INPRGif the PKA hw module is busy performing the operation.
PKA_STATUS_RESULT_0if the result is all zeroes.
PKA_STATUS_FAILUREif the operation is not successful.

Definition at line 503 of file ecc-driver.c.

References addr.

◆ ecc_add_start()

uint8_t ecc_add_start ( ec_point_t *  ec_point1,
ec_point_t *  ec_point2,
ecc_curve_info_t *  curve,
uint32_t *  result_vector,
struct process *  process 
)

Starts the ECC Addition.

Parameters
ec_point1Pointer to the structure containing the first ecc point.
ec_point2Pointer to the structure containing the second ecc point.
curvePointer to the structure containing the curve info.
result_vectorPointer to the result vector location which will be set by this function.
processProcess to be polled upon completion of the operation, or NULL

This function starts the ecc point addition operation on the two given ec points and generates the resultant ecc point.

Return values
PKA_STATUS_SUCCESSif successful in starting the operation.
PKA_STATUS_OPERATION_INPRGif the PKA hw module is busy doing some other operation.

Definition at line 391 of file ecc-driver.c.

◆ ecc_mul_gen_pt_get_result()

uint8_t ecc_mul_gen_pt_get_result ( ec_point_t *  ec_point,
uint32_t  result_vector 
)

Gets the result of ECC Multiplication with Generator point.

Parameters
ec_pointPointer to the structure where the resultant EC point will be stored. The callee is responsible to allocate the space for the ec point structure and the x and y co-ordinate as well.
result_vectorAddress of the result location which was provided by the start function
See also
PKAECCMultGenPtStart().

This function gets the result of ecc point multiplication operation on the scalar point and the known generator point on the curve, previously started using the function

See also
PKAECCMultGenPtStart().
Return values
PKA_STATUS_SUCCESSif the operation is successful.
PKA_STATUS_OPERATION_INPRGif the PKA hw module is busy performing the operation.
PKA_STATUS_RESULT_0if the result is all zeroes.
PKA_STATUS_FAILUREif the operation is not successful.

Definition at line 330 of file ecc-driver.c.

◆ ecc_mul_gen_pt_start()

uint8_t ecc_mul_gen_pt_start ( uint32_t *  scalar,
ecc_curve_info_t *  curve,
uint32_t *  result_vector,
struct process *  process 
)

Starts the ECC Multiplication with Generator point.

Parameters
scalarPointer to the buffer containing the scalar value.
curvePointer to the structure containing the curve info.
result_vectorPointer to the result vector location which will be set by this function.
processProcess to be polled upon completion of the operation, or NULL

This function starts the ecc point multiplication operation of the scalar value with the well known generator point of the given curve.

Return values
PKA_STATUS_SUCCESSif successful in starting the operation.
PKA_STATUS_OPERATION_INPRGif the PKA hw module is busy doing some other operation.

Definition at line 223 of file ecc-driver.c.

◆ ecc_mul_get_result()

uint8_t ecc_mul_get_result ( ec_point_t *  ec_point,
uint32_t  result_vector 
)

Gets the result of ECC Multiplication.

Parameters
ec_pointPointer to the structure where the resultant EC point will be stored. The callee is responsible to allocate the space for the ec point structure and the x and y co-ordinate as well.
result_vectorAddress of the result location which was provided by the start function
See also
PKAECCMultiplyStart().

This function gets the result of ecc point multiplication operation on the ec point and the scalar value, previously started using the function

See also
PKAECCMultiplyStart().
Return values
PKA_STATUS_SUCCESSif the operation is successful.
PKA_STATUS_OPERATION_INPRGif the PKA hw module is busy performing the operation.
PKA_STATUS_RESULT_0if the result is all zeroes.
PKA_STATUS_FAILUREif the operation is not successful.

Definition at line 163 of file ecc-driver.c.

◆ ecc_mul_start()

uint8_t ecc_mul_start ( uint32_t *  scalar,
ec_point_t *  ec_point,
ecc_curve_info_t *  curve,
uint32_t *  result_vector,
struct process *  process 
)

Starts ECC Multiplication.

Parameters
scalarPointer to the buffer containing the scalar value to be multiplied.
ec_pointPointer to the structure containing the elliptic curve point to be multiplied. The point should be on the given curve.
curvePointer to the structure containing the curve info.
result_vectorPointer to the result vector location which will be set by this function.
processProcess to be polled upon completion of the operation, or NULL

This function starts the Elliptical curve cryptography (ECC) point multiplication operation on the EC point and the scalar value.

Return values
PKA_STATUS_SUCCESSif successful in starting the operation.
PKA_STATUS_OPERATION_INPRGif the PKA hw module is busy doing some other operation.

Definition at line 50 of file ecc-driver.c.