mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-07 00:46:17 +08:00
Update SM4 OpenCL implementation
This commit is contained in:
@@ -10,34 +10,31 @@
|
||||
#ifndef GMSSL_SM4_CL_H
|
||||
#define GMSSL_SM4_CL_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <gmssl/sm4.h>
|
||||
|
||||
|
||||
#ifdef APPLE
|
||||
#ifdef MACOS
|
||||
#include <OpenCL/OpenCL.h>
|
||||
#else
|
||||
#include <CL/cl.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint32_t rk[32];
|
||||
size_t workgroup_size;
|
||||
cl_context context;
|
||||
cl_command_queue queue;
|
||||
cl_program program;
|
||||
cl_kernel kernel;
|
||||
cl_mem mem_rk;
|
||||
cl_mem mem_io;
|
||||
size_t workgroup_size;
|
||||
} SM4_CL_CTX;
|
||||
|
||||
|
||||
@@ -46,8 +43,6 @@ 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);
|
||||
void sm4_cl_cleanup(SM4_CL_CTX *ctx);
|
||||
|
||||
int test_sm4_cl_encrypt(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user