Remove warnings on Windows

This commit is contained in:
Zhi Guan
2026-05-28 09:00:50 +08:00
parent a1257f5347
commit 388a91a51e
4 changed files with 3 additions and 8 deletions

View File

@@ -885,11 +885,11 @@ int lms_signature_to_merkle_root(const uint8_t I[16], size_t h, int q,
size_t i;
n = (size_t)1 << h;
if (q >= n) {
if (q < 0 || (size_t)q >= n) {
error_print();
return -1;
}
r = n + q;
r = n + (size_t)q;
PUTU32(rbytes, r);
lmots_signature_to_public_hash(I, q, y, dgst, root);

View File

@@ -389,7 +389,6 @@ int sdf_generate_key(SDF_DEVICE *dev, SDF_KEY *key,
ECCrefPublicKey eccPublicKey;
ECCCipher eccCipher;
SM2_CIPHERTEXT ciphertext;
int ret;
if (!dev || !key || !sm2_key || !wrappedkey_len) {
error_print();
@@ -748,7 +747,6 @@ int sdf_export_encrypt_public_key(SDF_DEVICE *dev, int key_index, SM2_KEY *sm2_k
int sdf_load_private_key(SDF_DEVICE *dev, SDF_PRIVATE_KEY *key, int key_index, const char *pass)
{
void *hSession = NULL;
ECCrefPublicKey eccPublicKey;
if (!dev || !key || !pass) {
error_print();

View File

@@ -95,9 +95,6 @@ int secp256r1_public_key_to_bytes(const SECP256R1_KEY *key, uint8_t **out, size_
int secp256r1_public_key_from_bytes(SECP256R1_KEY *key, const uint8_t **in, size_t *inlen)
{
secp256r1_t x;
secp256r1_t y;
if (!key || !in || !(*in) || !inlen) {
error_print();
return -1;

View File

@@ -1878,7 +1878,7 @@ int xmssmt_build_auth_path(const xmss_hash256_t *tree, size_t height, size_t lay
for (i = 0; i < layers; i++) {
uint64_t local_index = index & (((uint64_t)1 << (height/layers)) - 1);
xmss_build_auth_path(tree, height/layers, local_index, auth_path);
xmss_build_auth_path(tree, height/layers, (uint32_t)local_index, auth_path);
auth_path += height/layers;
index >>= height/layers;
tree += xmss_num_tree_nodes(height/layers);