Remove cl building warnings

This commit is contained in:
Zhi Guan
2024-05-13 15:52:59 +08:00
parent 623fe136b3
commit e17df320be
16 changed files with 20 additions and 42 deletions

View File

@@ -49,7 +49,7 @@ static int test_sm2_ciphertext(void)
}
sm2_z256_point_to_bytes(&sm2_key.public_key, (uint8_t *)&(C.point));
C.ciphertext_size = tests[i].ciphertext_size;
C.ciphertext_size = (uint8_t)tests[i].ciphertext_size;
if (sm2_ciphertext_to_der(&C, &p, &len) != 1) {
error_print();
@@ -176,7 +176,6 @@ static int test_sm2_encrypt_fixlen(void)
};
SM2_KEY sm2_key;
size_t point_size;
uint8_t plaintext[SM2_MAX_PLAINTEXT_SIZE];
uint8_t encrypted[SM2_MAX_CIPHERTEXT_SIZE];
uint8_t decrypted[SM2_MAX_PLAINTEXT_SIZE];

View File

@@ -103,9 +103,7 @@ static int test_sm4_ccm_test_vectors(void)
SM4_KEY sm4_key;
uint8_t *encrypted;
size_t encrypted_len;
uint8_t *decrypted;
size_t decrypted_len;
uint8_t mac[16];
size_t i;

View File

@@ -107,9 +107,7 @@ static int test_sm4_cfb_test_vectors(void)
SM4_KEY sm4_key;
uint8_t *encrypted;
size_t encrypted_len;
uint8_t *decrypted;
size_t decrypted_len;
size_t i;
for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) {

View File

@@ -98,9 +98,7 @@ static int test_sm4_ofb_test_vectors(void)
SM4_KEY sm4_key;
uint8_t *encrypted;
size_t encrypted_len;
uint8_t *decrypted;
size_t decrypted_len;
size_t i;
for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) {

View File

@@ -93,19 +93,13 @@ static int test_sm4_xts_test_vectors(void)
size_t key_len;
uint8_t iv[16];
size_t iv_len;
uint8_t *aad;
size_t aad_len;
uint8_t tag[16];
size_t tag_len;
uint8_t *plaintext;
size_t plaintext_len;
uint8_t *ciphertext;
size_t ciphertext_len;
uint8_t *encrypted;
size_t encrypted_len;
uint8_t *decrypted;
size_t decrypted_len;
size_t i;
for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) {

View File

@@ -799,7 +799,7 @@ int test_sm9_z256_exchange()
SM9_Z256_TWIST_POINT de;
SM9_Z256_POINT RA, RB;
sm9_z256_t rA;
int i, j = 1;
size_t i, j = 1;
uint8_t idA[5] = {0x41, 0x6C, 0x69, 0x63, 0x65};
uint8_t idB[3] = {0x42, 0x6F, 0x62};