mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-06-17 02:14:01 +08:00
Use SDF as the crypto provider in SM2/3/4 CTX API
cmake .. -DENABLE_CRYPTO_SDF=ON
This commit is contained in:
@@ -34,6 +34,27 @@ typedef struct {
|
||||
int index;
|
||||
} SDF_KEY;
|
||||
|
||||
typedef struct {
|
||||
void *hSession;
|
||||
} SDF_SM3_CTX;
|
||||
|
||||
typedef struct {
|
||||
void *hSession;
|
||||
void *hKey;
|
||||
} SDF_SM4_KEY;
|
||||
|
||||
typedef struct {
|
||||
uint32_t index;
|
||||
uint8_t passlen;
|
||||
unsigned char pass[26 + 1];
|
||||
} SDF_ENC_PRIVATE_KEY;
|
||||
|
||||
typedef struct {
|
||||
uint32_t index;
|
||||
uint8_t passlen;
|
||||
unsigned char pass[26 + 1];
|
||||
} SDF_PRIVATE_KEY;
|
||||
|
||||
|
||||
int sdf_load_library(const char *so_path, const char *vendor);
|
||||
int sdf_open_device(SDF_DEVICE *dev);
|
||||
|
||||
@@ -75,7 +75,6 @@ typedef struct {
|
||||
union {
|
||||
SM3_CTX sm3_ctx;
|
||||
SM3_HMAC_CTX hmac_ctx;
|
||||
void *handle;
|
||||
};
|
||||
int state;
|
||||
} SM3_DIGEST_CTX;
|
||||
|
||||
@@ -51,10 +51,7 @@ void sm4_ctr32_encrypt(const SM4_KEY *key, uint8_t ctr[16], const uint8_t *in, s
|
||||
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
SM4_KEY sm4_key;
|
||||
void *handle;
|
||||
};
|
||||
SM4_KEY sm4_key;
|
||||
uint8_t iv[SM4_BLOCK_SIZE];
|
||||
uint8_t block[SM4_BLOCK_SIZE];
|
||||
size_t block_nbytes;
|
||||
|
||||
Reference in New Issue
Block a user