SX_X25519_PT_SZ Macro
C
#define SX_X25519_PT_SZ 32
Description
Size in bytes of a X25519 point
SX_X448_PT_SZ Macro
C
#define SX_X448_PT_SZ 56
Description
Size in bytes of a point in X448 operations
sx_x25519_pt Struct
C
struct sx_x25519_pt {
/** Bytes array representing encoded point for X25519 **/
char bytes[SX_X25519_PT_SZ];
};
Description
An encoded X25519 point
sx_x448_pt Struct
C
struct sx_x448_pt {
/** Bytes array representing scalar for ED448 **/
char bytes[SX_ED448_SZ];
};
Description
A X448 point
SX_X25519_PTMULT
C
typedef int (*FUNC_SX_X25519_PTMULT)(struct sx_pk_cnx *cnx, const struct sx_x25519_pt *k, const struct sx_x25519_pt *pt, struct sx_x25519_pt *r); #define SX_X25519_PTMULT ((FUNC_SX_X25519_PTMULT)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_SX_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 SX_PK_OPEN() at startup |
k | Scalar |
pt | Point on the X25519 curve |
r | Multiplication result of k and pt |
See
SX_ASYNC_X25519_PTMULT_GO() and SX_ASYNC_X25519_PTMULT_END() for an asynchronous version
Returns
SX_OK SX_ERR_INVALID_PARAM SX_ERR_UNKNOWN_ERROR SX_ERR_BUSY SX_ERR_NOT_IMPLEMENTED SX_ERR_OPERAND_TOO_LARGE SX_ERR_PLATFORM_ERROR SX_ERR_EXPIRED
SX_ASYNC_X25519_PTMULT_GO
C
typedef struct sx_pk_dreq (*FUNC_SX_ASYNC_X25519_PTMULT_GO)(struct sx_pk_cnx *cnx, const struct sx_x25519_pt *k, const struct sx_x25519_pt *pt); #define SX_ASYNC_X25519_PTMULT_GO ((FUNC_SX_ASYNC_X25519_PTMULT_GO)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_SX_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 SX_ASYNC_X25519_PTMULT_END()
Parameters
Param | Description |
---|---|
cnx | Connection structure obtained through SX_PK_OPEN() at startup |
k | Scalar |
pt | Point on the X25519 curve |
See
SX_ASYNC_X25519_PTMULT_END() and SX_X25519_PTMULT()
Returns
Acquired acceleration request for this operation
SX_ASYNC_X25519_PTMULT_END
C
typedef void (*FUNC_SX_ASYNC_X25519_PTMULT_END)(sx_pk_accel *req, struct sx_x25519_pt *r); #define SX_ASYNC_X25519_PTMULT_END ((FUNC_SX_ASYNC_X25519_PTMULT_END)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_SX_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
SX_ASYNC_X25519_PTMULT_GO() and sx_async_x25519_ptmult()
Returns
Acquired acceleration request for this operation
SX_X448_PTMULT
C
typedef int (*FUNC_SX_X448_PTMULT)(struct sx_pk_cnx *cnx, const struct sx_x448_pt *k, const struct sx_x448_pt *pt, struct sx_x448_pt *r); #define SX_X448_PTMULT ((FUNC_SX_X448_PTMULT)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_SX_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 SX_PK_OPEN() at startup |
k | Scalar |
pt | Point on the X448 curve |
r | Multiplication result of k and pt |
See
SX_ASYNC_X448_PTMULT_GO() and SX_ASYNC_X448_PTMULT_END() for an asynchronous version
Returns
SX_OK SX_ERR_INVALID_PARAM SX_ERR_UNKNOWN_ERROR SX_ERR_BUSY SX_ERR_NOT_IMPLEMENTED SX_ERR_OPERAND_TOO_LARGE SX_ERR_PLATFORM_ERROR SX_ERR_EXPIRED
SX_ASYNC_X448_PTMULT_GO
C
typedef struct sx_pk_dreq (*FUNC_SX_ASYNC_X448_PTMULT_GO)(struct sx_pk_cnx *cnx, const struct sx_x448_pt *k, const struct sx_x448_pt *pt); #define SX_ASYNC_X448_PTMULT_GO ((FUNC_SX_ASYNC_X448_PTMULT_GO)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_SX_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 SX_ASYNC_X448_PTMULT_END()
Parameters
Param | Description |
---|---|
cnx | Connection structure obtained through SX_PK_OPEN() at startup |
k | Scalar |
pt | Point on the X448 curve |
See
SX_ASYNC_X448_PTMULT_END() and SX_X448_PTMULT()
Returns
Acquired acceleration request for this operation
SX_ASYNC_X448_PTMULT_END
C
typedef void (*FUNC_SX_ASYNC_X448_PTMULT_END)(sx_pk_accel *req, struct sx_x448_pt *r); #define SX_ASYNC_X448_PTMULT_END ((FUNC_SX_ASYNC_X448_PTMULT_END)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_SX_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
SX_ASYNC_X448_PTMULT_GO() and sx_async_x448_ptmult()
Returns
Acquired acceleration request for this operation