mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-07 00:46:17 +08:00
SM4_RNG_Update增加异或
This commit is contained in:
@@ -121,6 +121,9 @@ int sm4_rng_update(SM4_RNG *rng, const uint8_t seed[32])
|
||||
sm4_encrypt(&sm4_key, rng->V, rng->K);
|
||||
be_incr(rng->V);
|
||||
sm4_encrypt(&sm4_key, rng->V, rng->V);
|
||||
|
||||
memxor(rng->K, seed, 16);
|
||||
memxor(rng->V, seed + 16, 16);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user