![]() |
API参考
|
types of crypto 更多...

类 | |
| struct | CRYPT_Data |
| struct | CRYPT_ConstData |
| struct | CRYPT_Range |
| struct | CRYPT_RSA_PkcsV15Para |
| Pkcsv15 padding mode, when RSA is used for signature. 更多... | |
| struct | CRYPT_RSA_PssPara |
| struct | CRYPT_RsaPrv |
| struct | CRYPT_EccPara |
| struct | CRYPT_PaillierPrv |
| struct | CRYPT_ElGamalPrv |
| struct | CRYPT_RsaPub |
| struct | CRYPT_PaillierPub |
| struct | CRYPT_ElGamalPub |
| struct | CRYPT_RsaPara |
| struct | CRYPT_DsaPara |
| struct | CRYPT_DhPara |
| struct | CRYPT_PaillierPara |
| struct | CRYPT_ElGamalPara |
| struct | CRYPT_RandSeedMethod |
类型定义 | |
| typedef uint32_t(* | CRYPT_EAL_EntropyGet) (void *ctx, uint8_t *buf, uint32_t bufLen) |
| Entropy source callback for obtaining entropy data. | |
| typedef CRYPT_Data | CRYPT_DsaPrv |
| typedef CRYPT_Data | CRYPT_EccPrv |
| typedef CRYPT_Data | CRYPT_EcdsaPrv |
| typedef CRYPT_Data | CRYPT_Sm2Prv |
| typedef CRYPT_Data | CRYPT_DhPrv |
| typedef CRYPT_Data | CRYPT_EcdhPrv |
| typedef CRYPT_Data | CRYPT_Curve25519Prv |
| typedef CRYPT_Data | CRYPT_KemDecapsKey |
| typedef CRYPT_Data | CRYPT_MlDsaPrv |
| typedef CRYPT_Data | CRYPT_DsaPub |
| typedef CRYPT_Data | CRYPT_EccPub |
| typedef CRYPT_Data | CRYPT_EcdsaPub |
| typedef CRYPT_Data | CRYPT_Sm2Pub |
| typedef CRYPT_Data | CRYPT_DhPub |
| typedef CRYPT_Data | CRYPT_EcdhPub |
| typedef CRYPT_Data | CRYPT_Curve25519Pub |
| typedef CRYPT_Data | CRYPT_KemEncapsKey |
| typedef CRYPT_Data | CRYPT_MlDsaPub |
| typedef int32_t(* | CRYPT_EAL_GetEntropyCb) (void *ctx, CRYPT_Data *entropy, uint32_t strength, CRYPT_Range *lenRange) |
| typedef void(* | CRYPT_EAL_CleanEntropyCb) (void *ctx, CRYPT_Data *entropy) |
| The entropy source memory is cleared, this API is optional. | |
| typedef int32_t(* | CRYPT_EAL_GetNonceCb) (void *ctx, CRYPT_Data *nonce, uint32_t strength, CRYPT_Range *lenRange) |
| Obtain the random number. This API is not need to registered. For registration, the output data must meet requirements such as the length. The HiTLS does not check the entropy source, but will implement if provide the function. | |
| typedef void(* | CRYPT_EAL_CleanNonceCb) (void *ctx, CRYPT_Data *nonce) |
| Random number memory clearance. this API is optional. | |
| typedef void(* | EventReport) (CRYPT_EVENT_TYPE oper, CRYPT_ALGO_TYPE type, int32_t id, int32_t err) |
| event report. | |
枚举 | |
| enum | CRYPT_RSA_SaltLenType { CRYPT_RSA_SALTLEN_TYPE_HASHLEN = -1 , CRYPT_RSA_SALTLEN_TYPE_MAXLEN = -2 , CRYPT_RSA_SALTLEN_TYPE_AUTOLEN = -3 } |
| enum | CRYPT_ECC_Flag { CRYPT_ECC_CACHE_PUBKEY = 0x00000001 , CRYPT_ECC_PRIKEY_NO_PUBKEY = 0x00000002 , CRYPT_ECC_MAXFLAG } |
| enum | CRYPT_EVENT_TYPE { CRYPT_EVENT_ENC , CRYPT_EVENT_DEC , CRYPT_EVENT_GEN , CRYPT_EVENT_SIGN , CRYPT_EVENT_VERIFY , CRYPT_EVENT_MD , CRYPT_EVENT_MAC , CRYPT_EVENT_KDF , CRYPT_EVENT_KEYAGGREMENT , CRYPT_EVENT_RANDGEN , CRYPT_EVENT_ZERO , CRYPT_EVENT_ERR , CRYPT_EVENT_SETSSP , CRYPT_EVENT_GETSSP , CRYPT_EVENT_ENCAPS , CRYPT_EVENT_DECAPS , CRYPT_EVENT_BLIND , CRYPT_EVENT_UNBLIND , CRYPT_EVENT_PARAM_CHECK , CRYPT_EVENT_PCT_TEST , CRYPT_EVENT_KAT_TEST , CRYPT_EVENT_ES_HEALTH_TEST , CRYPT_EVENT_INTEGRITY_TEST , CRYPT_EVENT_GET_VERSION , CRYPT_EVENT_MAX } |
| enum | CRYPT_ALGO_TYPE { CRYPT_ALGO_CIPHER = 0 , CRYPT_ALGO_PKEY , CRYPT_ALGO_MD , CRYPT_ALGO_MAC , CRYPT_ALGO_KDF , CRYPT_ALGO_RAND } |
函数 | |
| void | CRYPT_EAL_RegEventReport (EventReport func) |
types of crypto
| typedef CRYPT_Data CRYPT_Curve25519Prv |
ed25519/x25519 private key parameter structure
| typedef CRYPT_Data CRYPT_Curve25519Pub |
ed25519/x25519 public key parameter structure
| typedef CRYPT_Data CRYPT_DhPrv |
DH private key parameter structure
| typedef CRYPT_Data CRYPT_DhPub |
DH public key parameter structure
| typedef CRYPT_Data CRYPT_DsaPrv |
DSA private key parameter structure
| typedef CRYPT_Data CRYPT_DsaPub |
DSA public key parameter structure
| typedef void(* CRYPT_EAL_CleanEntropyCb) (void *ctx, CRYPT_Data *entropy) |
The entropy source memory is cleared, this API is optional.
| ctx | [IN] Context used by the caller |
| entropy | [OUT] Entropy source data |
| void |
| typedef void(* CRYPT_EAL_CleanNonceCb) (void *ctx, CRYPT_Data *nonce) |
Random number memory clearance. this API is optional.
| ctx | [IN] Context used by the caller |
| nonce | [OUT] random number |
| void |
| typedef uint32_t(* CRYPT_EAL_EntropyGet) (void *ctx, uint8_t *buf, uint32_t bufLen) |
Entropy source callback for obtaining entropy data.
| ctx | [IN] the entropy source handle. |
| buf | [OUT] buffer. |
| bufLen | [IN] the length of buffer. |
| typedef int32_t(* CRYPT_EAL_GetEntropyCb) (void *ctx, CRYPT_Data *entropy, uint32_t strength, CRYPT_Range *lenRange) |
Obtain the entropy source. If the default entropy source provided by HiTLS is not used,
the API must be registered. the output data must meet requirements such as the length.
The HiTLS does not check the entropy source. The data must be provided by the entropy source.
@param ctx [IN] Context used by the caller.
@param entropy [OUT] Indicates the obtained entropy source data. The length of the entropy source data
must meet the following requirements: lenRange->min <= len <= lenRange->max.
@param strength [IN] Entropy source strength.
@param lenRange [IN] Entropy source length range.
@retval 0 indicates success, and other values indicate failure.
| typedef int32_t(* CRYPT_EAL_GetNonceCb) (void *ctx, CRYPT_Data *nonce, uint32_t strength, CRYPT_Range *lenRange) |
Obtain the random number. This API is not need to registered. For registration, the output data must meet requirements such as the length. The HiTLS does not check the entropy source, but will implement if provide the function.
| ctx | [IN] Context used by the caller |
| nonce | [OUT] Obtained random number. The length of the random number must be lenRange->min <= len <= lenRange->max. |
| strength | [IN]: Random number strength |
| lenRange | [IN] Random number length range. |
| 0 | indicates success, and other values indicate failure. |
| typedef CRYPT_Data CRYPT_EccPrv |
ECC private key parameter structure.
| typedef CRYPT_Data CRYPT_EccPub |
ECC public key parameter structure
| typedef CRYPT_Data CRYPT_EcdhPrv |
ECDH private key parameter structure
| typedef CRYPT_Data CRYPT_EcdhPub |
ECDH public key parameter structure
| typedef CRYPT_Data CRYPT_EcdsaPrv |
ECDSA private key parameter structure.
| typedef CRYPT_Data CRYPT_EcdsaPub |
ECDSA public key parameter structure.
| typedef CRYPT_Data CRYPT_KemDecapsKey |
kem decaps key parameter structure
| typedef CRYPT_Data CRYPT_KemEncapsKey |
kem encaps key parameter structure
| typedef CRYPT_Data CRYPT_MlDsaPrv |
MLDSA private key parameter structure
| typedef CRYPT_Data CRYPT_MlDsaPub |
MLDSA public key parameter structure
| typedef CRYPT_Data CRYPT_Sm2Prv |
SM2 private key parameter structure
| typedef CRYPT_Data CRYPT_Sm2Pub |
SM2 public key parameter structure
| typedef void(* EventReport) (CRYPT_EVENT_TYPE oper, CRYPT_ALGO_TYPE type, int32_t id, int32_t err) |
event report.
| oper | [IN] Operation type. |
| type | [IN] Algorithm type. |
| id | [IN] Algorithm ID. |
| err | [IN] CRYPT_SUCCESS, if successful. For other error codes, see crypt_errno.h. |
| None |
| enum CRYPT_ALGO_TYPE |
Algorithm type
| enum CRYPT_ECC_Flag |
| enum CRYPT_EVENT_TYPE |
Operation type
RSA salt length type, when rsa pss mode is used for signature and verify
| void CRYPT_EAL_RegEventReport | ( | EventReport | func | ) |
Event reporting callback registration interface, the EAL reports an event when the service is executed
and an error is reported. If the CMVP feature is enabled, the default implementation is provided and registration is not allowed. Note that Multi-threading is not supported.
| func | [IN] Event reporting and processing callback |
| NONE |