CRM_ED25519_SZ Macro
C
#define CRM_ED25519_SZ 57
Description
Size in bytes of a reduced value in ED25519 operations
CRM_ED25519_PT_SZ Macro
C
#define CRM_D448_PT_SZ 57
Description
Size in bytes of an encoded ED25519 point
CRM_ED25519_DGST_SZ Macro
C
#define CRM_ED25519_DGST_SZ (57 * 2)
Description
Size in bytes of a digest in ED25519 operations
crm_ed25519_pt Struct
C
struct crm_ed25519_pt {
/** Bytes array representing encoded point for ED25519 **/
char encoded[CRM_ED25519_PT_SZ];
};
Description
An encoded ED25519 point
crm_ed25519_v Struct
C
struct crm_ed25519_v {
/** Bytes array representing scalar for ED25519 **/
char bytes[CRM_ED25519_SZ];
};
Description
A ED25519 scalar value
crm_ed25519_dgst Struct
C
struct crm_ed25519_dgst {
/** Bytes array of hash digest **/
char bytes[CRM_ED25519_DGST_SZ];
};
Description
A hash digest used in the ED25519 protocol
CRM_ED25519_PTMULT
C
typedef int (*FUNC_CRM_ED25519_PTMULT)(struct crm_pk_cnx *cnx, const struct crm_ed25519_dgst *r, struct crm_ed25519_pt *pt); #define CRM_ED25519_PTMULT ((FUNC_CRM_ED25519_PTMULT)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_ED25519_PTMULT)))
Description
EDDSA point multiplication (ED25519) Compute R = r * G, where r is a scalar which can be up to twice the size of the other operands. G is the generator point for the curve. The point R is encoded in pt. When computing the public key, the scalar 'r' is the secret scalar based on the clamped hash digest of the private key.
Parameters
Param | Description |
---|---|
cnx | Connection structure obtained through CRM_PK_OPEN() at startup |
r | Secret scalar based on the clamped hash digest of the private key |
pt | Encoded resulting R point |
See
CRM_ASYNC_ED25519_PTMULT_GO() and CRM_ASYNC_ED25519_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_ED25519_PTMULT_GO
C
typedef struct crm_pk_dreq (*FUNC_CRM_ASYNC_ED25519_PTMULT_GO)(struct crm_pk_cnx *cnx, const struct crm_ed25519_dgst *r); #define CRM_ASYNC_ED25519_PTMULT_GO ((FUNC_CRM_ASYNC_ED25519_PTMULT_GO)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_ASYNC_ED25519_PTMULT_GO)))
Description
Asynchronous EDDSA point multiplication (ED25519) Start an EDDSA point multiplication on the accelerator and return immediately. When the operation finishes on the accelerator, call CRM_ASYNC_ED25519_PTMULT_END()
Parameters
Param | Description |
---|---|
cnx | Connection structure obtained through CRM_PK_OPEN() at startup |
r | Secret scalar based on the clamped hash digest of the private key |
See
CRM_ASYNC_ED25519_PTMULT_END() and CRM_ASYNC_ED25519_PTMULT()
Returns
Acquired acceleration request for this operation
CRM_ASYNC_ED25519_PTMULT_END
C
typedef void (*FUNC_CRM_ASYNC_ED25519_PTMULT_END)(crm_pk_accel *req, struct crm_ed25519_pt *pt); #define CRM_ASYNC_ED25519_PTMULT_END ((FUNC_CRM_ASYNC_ED25519_PTMULT_END)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_ASYNC_ED25519_PTMULT_END)))
Description
Collect the result of asynchronous EDDSA point multiplication (ED25519) Get the output operands of the EDDSA point multiplication and release the reserved resources. The operation on the accelerator must be finished before calling this function.
Parameters
Param | Description |
---|---|
req | The previously acquired acceleration request for this operation |
pt | Encoded resultiing R point |
See
CRM_ASYNC_ED25519_PTMULT_GO() and CRM_ED25519_PTMULT()
Returns
None
CRM_ED25519_SIGN
C
typedef int (*FUNC_CRM_ED25519_SIGN)(struct crm_pk_cnx *cnx, const struct crm_ed25519_dgst *k, const struct crm_ed25519_dgst *r, const struct crm_ed25519_v *s, struct crm_ed25519_v *sig_s); #define CRM_ED25519_SIGN ((FUNC_CRM_ED25519_SIGN)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_ED25519_SIGN)))
Description
Compute signature scalar s for pure EDDSA (ED25519). This represents the second step in computing an EDDSA signature. This step computes sig_s : sig_s = (r + k * s) % l
Parameters
Param | Description |
---|---|
cnx | Connection structure obtained through CRM_PK_OPEN() at startup |
k | Hash of the encoded point R, the public key and the message. It is interpreted as a scalar with a size double of other operands |
r | Secret nonce already used in the first signature step |
s | Secret scalar derived from the private key |
sig_s | Second part of EDDSA signature |
See
CRM_PK_ASYNC_ED25519_SIGN_GO() and CRM_ASYNC_ED25519_SIGN_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_PK_ASYNC_ED25519_SIGN_GO
C
typedef struct crm_pk_dreq (*FUNC_CRM_PK_ASYNC_ED25519_SIGN_GO)(struct crm_pk_cnx *cnx, const struct crm_ed25519_dgst *k, const struct crm_ed25519_dgst *r, const struct crm_ed25519_v *s); #define CRM_PK_ASYNC_ED25519_SIGN_GO ((FUNC_CRM_PK_ASYNC_ED25519_SIGN_GO)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_PK_ASYNC_ED25519_SIGN_GO)))
Description
Asynchronous second part signature generation for pure EDDSA (ED25519). Start an ED25519 signature generation on the accelerator and return immediately. When the operation finishes on the accelerator, call CRM_ASYNC_ED25519_SIGN_END()
Parameters
Param | Description |
---|---|
cnx | Connection structure obtained through CRM_PK_OPEN() at startup |
k | Hash of the encoded point R, the public key and the message. It is interpreted as a scalar with a size double of other operands |
r | Secret nonce already used in the first signature step |
s | Secret scalar derived from the private key |
See
CRM_ED25519_SIGN() and CRM_ASYNC_ED25519_SIGN_END()
Returns
Acquired acceleration request for this operation
CRM_ASYNC_ED25519_SIGN_END
C
typedef void (*FUNC_CRM_ASYNC_ED25519_SIGN_END)(crm_pk_accel *req, struct crm_ed25519_v *sig_s); #define CRM_ASYNC_ED25519_SIGN_END ((FUNC_CRM_ASYNC_ED25519_SIGN_END)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_ASYNC_ED25519_SIGN_END)))
Description
Collect the result of asynchronous computation of ED25519 signature scalar Get the output operands of the ED25519 signature generation and release the reserved resources. The operation on the accelerator must be finished before calling this function.
Parameters
Param | Description |
---|---|
req | The previously acquired acceleration request for this operation |
sig_s | Second part of the ED25519 signature |
See
CRM_PK_ASYNC_ED25519_SIGN_GO() and CRM_ED25519_SIGN()
Returns
None
CRM_ED25519_VERIFY
C
typedef int (*FUNC_CRM_ED25519_VERIFY)(struct crm_pk_cnx *cnx, const struct crm_ed25519_dgst *k, const struct crm_ed25519_pt *a, const struct crm_ed25519_v *sig_s, const struct crm_ed25519_pt *r); #define CRM_ED25519_VERIFY ((FUNC_CRM_ED25519_VERIFY)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_ED25519_VERIFY)))
Description
Verify an EDDSA signature (ED25519) It checks if sig_s * G - k * A matches R. sig_s and the encoded point R form the signature. The points A and R are passed in their encoded form via 'a' and 'r'.
Parameters
Param | Description |
---|---|
cnx | Connection structure obtained through CRM_PK_OPEN() at startup |
k | Hash of the encoded point R, the public key and the message. It is interpreted as a scalar with a size double of other operands |
a | Encoded public key |
sig_s | Second part of EDDSA signature |
r | Encoded first part of the signature |
See
CRM_ASYNC_ED25519_VERIFY_GO() 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_ED25519_VERIFY_GO
C
typedef struct crm_pk_dreq (*FUNC_CRM_ASYNC_ED25519_VERIFY_GO)(struct crm_pk_cnx *cnx, const struct crm_ed25519_dgst *k, const struct crm_ed25519_pt *a, const struct crm_ed25519_v *sig_s, const struct crm_ed25519_pt *r); #define CRM_ASYNC_ED25519_VERIFY_GO ((FUNC_CRM_ASYNC_ED25519_VERIFY_GO)(*(uint32_t *)(API_TABLE_BASE_ADDRESS + ATO_CRM_ASYNC_ED25519_VERIFY_GO)))
Description
Asynchronous (non-blocking) verify an ED25519 signature. Start an ED25519 signature generation on the accelerator and return immediately. When the operation finishes on the accelerator, call CRM_PK_RELEASE_REQ()
Parameters
Param | Description |
---|---|
cnx | Connection structure obtained through CRM_PK_OPEN() at startup |
k | Hash of the encoded point R, the public key and the message. It is interpreted as a scalar with a size double of other operands |
a | Encoded public key |
sig_s | Second part of EDDSA signature |
r | Encoded first part of the signature |
See
CRM_ED25519_VERIFY()
Returns
Acquired acceleration request for this operation