mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-06 16:36:16 +08:00
Remove ZUC warnings
This commit is contained in:
@@ -112,7 +112,7 @@ typedef struct ZUC256_MAC_CTX_st {
|
|||||||
ZUC_UINT32 T[4];
|
ZUC_UINT32 T[4];
|
||||||
ZUC_UINT32 K0[4];
|
ZUC_UINT32 K0[4];
|
||||||
uint8_t buf[4];
|
uint8_t buf[4];
|
||||||
int buflen;
|
size_t buflen;
|
||||||
int macbits;
|
int macbits;
|
||||||
} ZUC256_MAC_CTX;
|
} ZUC256_MAC_CTX;
|
||||||
|
|
||||||
|
|||||||
28
src/zuc.c
28
src/zuc.c
@@ -88,20 +88,20 @@ static const uint8_t S1[256] = {
|
|||||||
{int j; for (j=0; j<15;j++) LFSR[j]=LFSR[j+1];} \
|
{int j; for (j=0; j<15;j++) LFSR[j]=LFSR[j+1];} \
|
||||||
LFSR[15] = V
|
LFSR[15] = V
|
||||||
|
|
||||||
#define LFSRWithWorkMode() \
|
#define LFSRWithWorkMode() \
|
||||||
{ \
|
{ \
|
||||||
int j; \
|
int j; \
|
||||||
uint64_t a = LFSR[0]; \
|
uint64_t a = LFSR[0]; \
|
||||||
a += ((uint64_t)LFSR[0]) << 8; \
|
a += ((uint64_t)LFSR[0]) << 8; \
|
||||||
a += ((uint64_t)LFSR[4]) << 20; \
|
a += ((uint64_t)LFSR[4]) << 20; \
|
||||||
a += ((uint64_t)LFSR[10]) << 21; \
|
a += ((uint64_t)LFSR[10]) << 21; \
|
||||||
a += ((uint64_t)LFSR[13]) << 17; \
|
a += ((uint64_t)LFSR[13]) << 17; \
|
||||||
a += ((uint64_t)LFSR[15]) << 15; \
|
a += ((uint64_t)LFSR[15]) << 15; \
|
||||||
a = (a & 0x7fffffff) + (a >> 31); \
|
a = (a & 0x7fffffff) + (a >> 31); \
|
||||||
V = (a & 0x7fffffff) + (a >> 31); \
|
V = (uint32_t)((a & 0x7fffffff) + (a >> 31)); \
|
||||||
for (j = 0; j < 15; j++) \
|
for (j = 0; j < 15; j++) \
|
||||||
LFSR[j] = LFSR[j+1]; \
|
LFSR[j] = LFSR[j+1]; \
|
||||||
LFSR[15] = V; \
|
LFSR[15] = V; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define BitReconstruction2(X1,X2) \
|
#define BitReconstruction2(X1,X2) \
|
||||||
|
|||||||
@@ -131,7 +131,6 @@ int zuc_encrypt_update(ZUC_CTX *ctx, const uint8_t *in, size_t inlen, uint8_t *o
|
|||||||
|
|
||||||
int zuc_encrypt_finish(ZUC_CTX *ctx, uint8_t *out, size_t *outlen)
|
int zuc_encrypt_finish(ZUC_CTX *ctx, uint8_t *out, size_t *outlen)
|
||||||
{
|
{
|
||||||
size_t left;
|
|
||||||
if (ctx->block_nbytes >= ZUC_BLOCK_SIZE) {
|
if (ctx->block_nbytes >= ZUC_BLOCK_SIZE) {
|
||||||
error_print();
|
error_print();
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user