From 56f45c8dbf333b31ffb9bd387ffef4dd5262d7cc Mon Sep 17 00:00:00 2001 From: Zhi Guan Date: Sun, 14 Apr 2024 11:20:45 +0800 Subject: [PATCH] Remove warnings --- src/sm2_ctx.c | 2 +- src/sm9_z256_lib.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sm2_ctx.c b/src/sm2_ctx.c index beecbaf4d..e38baf909 100644 --- a/src/sm2_ctx.c +++ b/src/sm2_ctx.c @@ -144,7 +144,7 @@ int sm2_verify_init(SM2_SIGN_CTX *ctx, const SM2_KEY *key, const char *id, size_ memset(ctx, 0, sizeof(*ctx)); ctx->key.public_key = key->public_key; - sm2_z256_point_from_bytes(&ctx->public_key, (const uint8_t *)&key->public_key); + sm2_z256_point_from_bytes((SM2_Z256_POINT *)&ctx->public_key, (const uint8_t *)&key->public_key); sm3_init(&ctx->sm3_ctx); diff --git a/src/sm9_z256_lib.c b/src/sm9_z256_lib.c index 02f897e26..30faa9314 100644 --- a/src/sm9_z256_lib.c +++ b/src/sm9_z256_lib.c @@ -584,8 +584,8 @@ int sm9_exch_step_1B(const SM9_EXCH_MASTER_KEY *mpk, const char *idA, size_t idA // B5: sk = KDF(ID_A || ID_B || RA || RB || g1 || g2 || g3, klen) sm3_kdf_init(&kdf_ctx, klen); - sm3_kdf_update(&kdf_ctx, idA, idAlen); - sm3_kdf_update(&kdf_ctx, idB, idBlen); + sm3_kdf_update(&kdf_ctx, (uint8_t *)idA, idAlen); + sm3_kdf_update(&kdf_ctx, (uint8_t *)idB, idBlen); sm3_kdf_update(&kdf_ctx, ta + 1, 64); sm3_kdf_update(&kdf_ctx, tb + 1, 64); sm3_kdf_update(&kdf_ctx, g1, sizeof(g1)); @@ -642,8 +642,8 @@ int sm9_exch_step_2A(const SM9_EXCH_MASTER_KEY *mpk, const char *idA, size_t idA // A7: sk = KDF(ID_A || ID_B || RA || RB || g1 || g2 || g3, klen) sm3_kdf_init(&kdf_ctx, klen); - sm3_kdf_update(&kdf_ctx, idA, idAlen); - sm3_kdf_update(&kdf_ctx, idB, idBlen); + sm3_kdf_update(&kdf_ctx, (uint8_t *)idA, idAlen); + sm3_kdf_update(&kdf_ctx, (uint8_t *)idB, idBlen); sm3_kdf_update(&kdf_ctx, ta + 1, 64); sm3_kdf_update(&kdf_ctx, tb + 1, 64); sm3_kdf_update(&kdf_ctx, g1, sizeof(g1));