Skip to content

Commit

Permalink
Remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
guanzhi committed Apr 14, 2024
1 parent ef03ddc commit 56f45c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/sm2_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions src/sm9_z256_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 56f45c8

Please sign in to comment.