Change sm4_cl_encrypt to sm4_cl_ctr32_encrypt

This commit is contained in:
Zhi Guan
2024-04-23 22:39:43 +08:00
parent 2e45b3fbe1
commit 2e6cef2999
3 changed files with 88 additions and 69 deletions

View File

@@ -28,7 +28,7 @@ extern "C" {
typedef struct {
uint32_t rk[32];
size_t workgroup_size;
//size_t workgroup_size;
cl_context context;
cl_command_queue queue;
cl_program program;
@@ -40,7 +40,7 @@ typedef struct {
int sm4_cl_set_encrypt_key(SM4_CL_CTX *ctx, const uint8_t key[16]);
int sm4_cl_set_decrypt_key(SM4_CL_CTX *ctx, const uint8_t key[16]);
int sm4_cl_encrypt(SM4_CL_CTX *ctx, const uint8_t *in, size_t nblocks, uint8_t *out);
int sm4_cl_ctr32_encrypt(SM4_CL_CTX *ctx, uint8_t iv[16], const uint8_t *in, size_t nblocks, uint8_t *out);
void sm4_cl_cleanup(SM4_CL_CTX *ctx);