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