API参考
载入中...
搜索中...
未找到
Crypt_types

types of crypto 更多...

Crypt_types 的协作图:

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

类型定义说明

◆ CRYPT_Curve25519Prv

ed25519/x25519 private key parameter structure

◆ CRYPT_Curve25519Pub

ed25519/x25519 public key parameter structure

◆ CRYPT_DhPrv

DH private key parameter structure

◆ CRYPT_DhPub

DH public key parameter structure

◆ CRYPT_DsaPrv

DSA private key parameter structure

◆ CRYPT_DsaPub

DSA public key parameter structure

◆ CRYPT_EAL_CleanEntropyCb

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

◆ CRYPT_EAL_CleanNonceCb

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

◆ CRYPT_EAL_EntropyGet

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.
返回
0, success Other error codes

◆ CRYPT_EAL_GetEntropyCb

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.

◆ CRYPT_EAL_GetNonceCb

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.
返回值
0indicates success, and other values indicate failure.

◆ CRYPT_EccPrv

ECC private key parameter structure.

◆ CRYPT_EccPub

ECC public key parameter structure

◆ CRYPT_EcdhPrv

ECDH private key parameter structure

◆ CRYPT_EcdhPub

ECDH public key parameter structure

◆ CRYPT_EcdsaPrv

ECDSA private key parameter structure.

◆ CRYPT_EcdsaPub

ECDSA public key parameter structure.

◆ CRYPT_KemDecapsKey

kem decaps key parameter structure

◆ CRYPT_KemEncapsKey

kem encaps key parameter structure

◆ CRYPT_MlDsaPrv

MLDSA private key parameter structure

◆ CRYPT_MlDsaPub

MLDSA public key parameter structure

◆ CRYPT_Sm2Prv

SM2 private key parameter structure

◆ CRYPT_Sm2Pub

SM2 public key parameter structure

◆ EventReport

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

枚举类型说明

◆ CRYPT_ALGO_TYPE

Algorithm type

◆ CRYPT_ECC_Flag

ECC flag bits for encode behaviors

枚举值
CRYPT_ECC_PRIKEY_NO_PUBKEY 

ECPrivateKey omit publicKey[1]

◆ CRYPT_EVENT_TYPE

Operation type

枚举值
CRYPT_EVENT_ENC 

Encryption.

CRYPT_EVENT_DEC 

Decryption.

CRYPT_EVENT_GEN 

Generate the key.

CRYPT_EVENT_SIGN 

Signature.

CRYPT_EVENT_VERIFY 

Verify the signature.

CRYPT_EVENT_MD 

Hash.

CRYPT_EVENT_MAC 

MAC.

CRYPT_EVENT_KDF 

KDF.

CRYPT_EVENT_KEYAGGREMENT 

Key negotiation.

CRYPT_EVENT_RANDGEN 

Generating a random number.

CRYPT_EVENT_ZERO 

sensitive information to zero.

CRYPT_EVENT_ERR 

An error occurred.

CRYPT_EVENT_SETSSP 

Adding and Modifying Password Data and SSP.

CRYPT_EVENT_GETSSP 

Access password data and SSP.

CRYPT_EVENT_ENCAPS 

Key encapsulation.

CRYPT_EVENT_DECAPS 

Key decapsulation.

CRYPT_EVENT_BLIND 

Message blinding.

CRYPT_EVENT_UNBLIND 

Signature unblinding.

CRYPT_EVENT_PARAM_CHECK 

Parameter check.

CRYPT_EVENT_PCT_TEST 

PCT test.

CRYPT_EVENT_KAT_TEST 

KAT test.

CRYPT_EVENT_ES_HEALTH_TEST 

Entropy source health test.

CRYPT_EVENT_INTEGRITY_TEST 

Integrity test.

CRYPT_EVENT_GET_VERSION 

Get the version of the provider.

◆ CRYPT_RSA_SaltLenType

RSA salt length type, when rsa pss mode is used for signature and verify

函数说明

◆ CRYPT_EAL_RegEventReport()

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