Skip to content

Commit

Permalink
Update SM4_CBC_CTX and SM4_CTR_CTX
Browse files Browse the repository at this point in the history
To support UADK and other third-party SM4 implementations
  • Loading branch information
guanzhi committed Jan 3, 2024
1 parent f53f69d commit 92818b3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions include/gmssl/sm4.h
Original file line number Diff line number Diff line change
@@ -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
* not use this file except in compliance with the License.
Expand Down Expand Up @@ -82,7 +82,10 @@ int sm4_gcm_decrypt(const SM4_KEY *key, const uint8_t *iv, size_t ivlen,


typedef struct {
SM4_KEY sm4_key;
union {
SM4_KEY sm4_key;
void *handle;
};
uint8_t iv[SM4_BLOCK_SIZE];
uint8_t block[SM4_BLOCK_SIZE];
size_t block_nbytes;
Expand All @@ -98,7 +101,10 @@ int sm4_cbc_decrypt_finish(SM4_CBC_CTX *ctx, uint8_t *out, size_t *outlen);


typedef struct {
SM4_KEY sm4_key;
union {
SM4_KEY sm4_key;
void *handle;
};
uint8_t ctr[SM4_BLOCK_SIZE];
uint8_t block[SM4_BLOCK_SIZE];
size_t block_nbytes;
Expand Down

0 comments on commit 92818b3

Please sign in to comment.