mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-07 00:46:17 +08:00
Update SM4_CBC_CTX and SM4_CTR_CTX
To support UADK and other third-party SM4 implementations
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014-2023 The GmSSL Project. All Rights Reserved.
|
* Copyright 2014-2024 The GmSSL Project. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||||
* not use this file except in compliance with the License.
|
* not use this file except in compliance with the License.
|
||||||
@@ -82,7 +82,10 @@ int sm4_gcm_decrypt(const SM4_KEY *key, const uint8_t *iv, size_t ivlen,
|
|||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
SM4_KEY sm4_key;
|
union {
|
||||||
|
SM4_KEY sm4_key;
|
||||||
|
void *handle;
|
||||||
|
};
|
||||||
uint8_t iv[SM4_BLOCK_SIZE];
|
uint8_t iv[SM4_BLOCK_SIZE];
|
||||||
uint8_t block[SM4_BLOCK_SIZE];
|
uint8_t block[SM4_BLOCK_SIZE];
|
||||||
size_t block_nbytes;
|
size_t block_nbytes;
|
||||||
@@ -98,7 +101,10 @@ int sm4_cbc_decrypt_finish(SM4_CBC_CTX *ctx, uint8_t *out, size_t *outlen);
|
|||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
SM4_KEY sm4_key;
|
union {
|
||||||
|
SM4_KEY sm4_key;
|
||||||
|
void *handle;
|
||||||
|
};
|
||||||
uint8_t ctr[SM4_BLOCK_SIZE];
|
uint8_t ctr[SM4_BLOCK_SIZE];
|
||||||
uint8_t block[SM4_BLOCK_SIZE];
|
uint8_t block[SM4_BLOCK_SIZE];
|
||||||
size_t block_nbytes;
|
size_t block_nbytes;
|
||||||
|
|||||||
Reference in New Issue
Block a user