2. CMOX_ECC_CUSTOM_CURVES

2.1. CMOX ECC CUSTOM CURVES METHODS

group CMOX_ECC_CUSTOM_CURVES_METHODS

Functions

cmox_ecc_retval_t cmox_ecc_customCurveConstruct ( cmox_ecc_handle_t * P_pEccCtx , cmox_ecc_impl_t * P_pCurve , cmox_ecc_customCurve_opt_t P_OptLevel , const uint8_t * P_pP , size_t P_PLen , const uint8_t * P_pN , size_t P_NLen , const uint8_t * P_pA , size_t P_ALen , const uint8_t * P_pB , size_t P_BLen , const uint8_t * P_pGx , size_t P_GxLen , const uint8_t * P_pGy , size_t P_GyLen )

Function to create a custom Short-Weierstrass curve.

Note

All the array parameters are big-endian arrays, where the first byte is the most significant one.

Warning

This function does not check if the parameters effectively form an elliptic curve, so the user must be sure about the parameters that are passed to the function

Parameters :
  • P_pEccCtx[in] Context for ECC operations

  • P_pCurve[out] Pointer to a curve that will be built and filled

  • P_OptLevel[in] Optimization level (speed vs. RAM usage) This parameter can be one of the following:

    • cmox_ecc_customCurve_opt_low

    • cmox_ecc_customCurve_opt_mid

    • cmox_ecc_customCurve_opt_high

  • P_pP[in] Modulus of the curve

  • P_PLen[in] Byte length of the modulus

  • P_pN[in] Order of the curve

  • P_NLen[in] Byte length of the order

  • P_pA[in] Parameter A of the curve

  • P_ALen[in] Byte length of the parameter A

  • P_pB[in] Parameter B of the curve

  • P_BLen[in] Byte length of the parameter B

  • P_pGx[in] X coordinate of the Generator Point

  • P_GxLen[in] Byte length of the X coordinate

  • P_pGy[in] Y coordinate of the Generator Point

  • P_GyLen[in] Byte length of the Y coordinate

Return values :
  • CMOX_ECC_SUCCESS

  • CMOX_ECC_ERR_BAD_PARAMETERS

  • CMOX_ECC_ERR_MEMORY_FAIL

void cmox_ecc_customCurveCleanup ( cmox_ecc_handle_t * P_pEccCtx , cmox_ecc_impl_t * P_pCurve )

Destroy (and release the allocated memory) a custom curve.

Parameters :
  • P_pEccCtx[in] Context for ECC operations

  • P_pCurve[inout] Pointer to the curve to destroy

2.2. CMOX ECC CUSTOM CURVES OPT

group CMOX_ECC_CUSTOM_CURVES_OPT

Typedefs

typedef const struct cmox_ecc_customCurve_optStr_st * cmox_ecc_customCurve_opt_t

struct for speed/RAM optimizations struct ptr for speed/RAM opt

Variables

const cmox_ecc_customCurve_opt_t cmox_ecc_customCurve_opt_low

Low RAM usage (slowest).

const cmox_ecc_customCurve_opt_t cmox_ecc_customCurve_opt_mid

Mid RAM usage.

const cmox_ecc_customCurve_opt_t cmox_ecc_customCurve_opt_high

High RAM usage (fastest).