MCPcopy Create free account
hub / github.com/assaultcube/AC / entropy_add_block

Function entropy_add_block

source/src/crypto.cpp:440–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438}
439
440void entropy_add_block(const uchar *s, int len)
441{
442 for( ; len > 0; s += 128, len -= 128)
443 {
444 int bl = min(len, 128);
445 xor_block(entpool + rnd(ENTPOOLSIZE / 8 - 16) * 8, s, bl); // use pseudorandom to mix entropy into the pool in a hard to predict fashion
446 mix_block(entpool + rnd(ENTPOOLSIZE - bl), s, bl);
447 }
448}
449
450void entropy_get(uchar *buf, int len)
451{

Callers 3

loadMethod · 0.85
entropy_initFunction · 0.85
mapscreenshotFunction · 0.85

Calls 3

minFunction · 0.85
xor_blockFunction · 0.85
mix_blockFunction · 0.85

Tested by

no test coverage detected