CRM_X25519_PT_SZ Macro
C
#define CRM_X25519_PT_SZ 32
Description
Size in bytes of a X25519 point
CRM_X448_PT_SZ Macro
C
#define CRM_X448_PT_SZ 56
Description
Size in bytes of a point in X448 operations
crm_x25519_pt Struct
C
struct crm_x25519_pt {
/** Bytes array representing encoded point for X25519 **/
char bytes[CRM_X25519_PT_SZ];
};
Description
An encoded X25519 point
crm_x448_pt Struct
C
struct crm_x448_pt {
/** Bytes array representing scalar for ED448 **/
char bytes[CRM_ED448_SZ];
};
Description
A X448 point
CRM_X25519_PTMULT
C
typedef int (*FUNC_CRM_X25519_PTMULT)(struct crm_pk_cnx *cnx, const struct crm_x25519_pt *k, const struct crm_x25519_pt *pt, struct crm_x25519_pt *r); #define CRM_X25519_PTMULT ((FUNC_CRM_X25519_PTMULT)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_X25519_PTMULT)))
Description
Montgomery point multiplication (X25519) Compute r = ptk The operands must be decoded and clamped as defined in specifications for X25519 and X448.
Parameters
Param | Description |
---|---|
cnx | Connection structure obtained through CRM_PK_OPEN() at startup |
k | Scalar |
pt | Point on the X25519 curve |
r | Multiplication result of k and pt |
See
CRM_ASYNC_X25519_PTMULT_GO() and CRM_ASYNC_X25519_PTMULT_END() for an asynchronous version
Returns
CRM_OK CRM_ERR_INVALID_PARAM CRM_ERR_UNKNOWN_ERROR CRM_ERR_BUSY CRM_ERR_NOT_IMPLEMENTED CRM_ERR_OPERAND_TOO_LARGE CRM_ERR_PLATFORM_ERROR CRM_ERR_EXPIRED
CRM_ASYNC_X25519_PTMULT_GO
C
typedef struct crm_pk_dreq (*FUNC_CRM_ASYNC_X25519_PTMULT_GO)(struct crm_pk_cnx *cnx, const struct crm_x25519_pt *k, const struct crm_x25519_pt *pt); #define CRM_ASYNC_X25519_PTMULT_GO ((FUNC_CRM_ASYNC_X25519_PTMULT_GO)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_ASYNC_X25519_PTMULT_GO)))
Description
Asynchronous Montgomery point multiplication (X25519) Start a montgomery point multiplication on the accelerator and return immediately. When the operation finishes on the accelerator, call CRM_ASYNC_X25519_PTMULT_END()
Parameters
Param | Description |
---|---|
cnx | Connection structure obtained through CRM_PK_OPEN() at startup |
k | Scalar |
pt | Point on the X25519 curve |
See
CRM_ASYNC_X25519_PTMULT_END() and CRM_X25519_PTMULT()
Returns
Acquired acceleration request for this operation
CRM_ASYNC_X25519_PTMULT_END
C
typedef void (*FUNC_CRM_ASYNC_X25519_PTMULT_END)(crm_pk_accel *req, struct crm_x25519_pt *r); #define CRM_ASYNC_X25519_PTMULT_END ((FUNC_CRM_ASYNC_X25519_PTMULT_END)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_ASYNC_X25519_PTMULT_END)))
Description
Collect the result of asynchronous Montgomery point multiplication (X25519) Get the output operand of the Montgomery point multiplication and release accelerator. The operation on the accelerator must be finished before calling this function.
Parameters
Param | Description |
---|---|
req | The previously acquired acceleration request for this operation |
r | Multiplication result of k and pt |
See
CRM_ASYNC_X25519_PTMULT_GO() and crm_async_x25519_ptmult()
Returns
Acquired acceleration request for this operation
CRM_X448_PTMULT
C
typedef int (*FUNC_CRM_X448_PTMULT)(struct crm_pk_cnx *cnx, const struct crm_x448_pt *k, const struct crm_x448_pt *pt, struct crm_x448_pt *r); #define CRM_X448_PTMULT ((FUNC_CRM_X448_PTMULT)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_X448_PTMULT)))
Description
Montgomery point multiplication (X448) Compute r = ptk The operands must be decoded and clamped as defined in specifications for X25519 and X448.
Parameters
Param | Description |
---|---|
cnx | Connection structure obtained through CRM_PK_OPEN() at startup |
k | Scalar |
pt | Point on the X448 curve |
r | Multiplication result of k and pt |
See
CRM_ASYNC_X448_PTMULT_GO() and CRM_ASYNC_X448_PTMULT_END() for an asynchronous version
Returns
CRM_OK CRM_ERR_INVALID_PARAM CRM_ERR_UNKNOWN_ERROR CRM_ERR_BUSY CRM_ERR_NOT_IMPLEMENTED CRM_ERR_OPERAND_TOO_LARGE CRM_ERR_PLATFORM_ERROR CRM_ERR_EXPIRED
CRM_ASYNC_X448_PTMULT_GO
C
typedef struct crm_pk_dreq (*FUNC_CRM_ASYNC_X448_PTMULT_GO)(struct crm_pk_cnx *cnx, const struct crm_x448_pt *k, const struct crm_x448_pt *pt); #define CRM_ASYNC_X448_PTMULT_GO ((FUNC_CRM_ASYNC_X448_PTMULT_GO)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_ASYNC_X448_PTMULT_GO)))
Description
Asynchronous Montgomery point multiplication (X448) Start a montgomery point multiplication on the accelerator and return immediately. When the operation finishes on the accelerator, call CRM_ASYNC_X448_PTMULT_END()
Parameters
Param | Description |
---|---|
cnx | Connection structure obtained through CRM_PK_OPEN() at startup |
k | Scalar |
pt | Point on the X448 curve |
See
CRM_ASYNC_X448_PTMULT_END() and CRM_X448_PTMULT()
Returns
Acquired acceleration request for this operation
CRM_ASYNC_X448_PTMULT_END
C
typedef void (*FUNC_CRM_ASYNC_X448_PTMULT_END)(crm_pk_accel *req, struct crm_x448_pt *r); #define CRM_ASYNC_X448_PTMULT_END ((FUNC_CRM_ASYNC_X448_PTMULT_END)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_ASYNC_X448_PTMULT_END)))
Description
Collect the result of asynchronous Montgomery point multiplication (X448) Get the output operand of the Montgomery point multiplication and release accelerator. The operation on the accelerator must be finished before calling this function.
Parameters
Param | Description |
---|---|
req | The previously acquired acceleration request for this operation |
r | Multiplication result of k and pt |
See
CRM_ASYNC_X448_PTMULT_GO() and crm_async_x448_ptmult()
Returns
Acquired acceleration request for this operation