From 0e0943051c31895c4d00de0ed1dec2a96bb6c19e Mon Sep 17 00:00:00 2001 From: GGSuchao <1500062807@pku.edu.cn> Date: Sun, 25 Jun 2017 02:30:39 +0800 Subject: [PATCH] Update sm2_standard_exch.c --- crypto/sm2/sm2_standard_exch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/sm2/sm2_standard_exch.c b/crypto/sm2/sm2_standard_exch.c index dbc3b26f..a503e8fc 100644 --- a/crypto/sm2/sm2_standard_exch.c +++ b/crypto/sm2/sm2_standard_exch.c @@ -90,8 +90,8 @@ void SM3_z(unsigned char ID[], unsigned short int ELAN, epoint* pubKey, unsigned epoint_get(pubKey, x, y); big_to_bytes(SM2_NUMWORD, x, Px, 1); big_to_bytes(SM2_NUMWORD, y, Py, 1); - memcpy(IDlen, &ELAN + 1, 1); - memcpy(IDlen + 1, &ELAN, 1); + memcpy(IDlen, &(unsigned char)ELAN + 1, 1); + memcpy(IDlen + 1, &(unsigned char)ELAN, 1); SM3_init(&md); SM3_process(&md, IDlen, 2); SM3_process(&md, ID, ELAN / 8);