MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / chacha_next32

Function chacha_next32

3rd/mimalloc-2.0.9/src/random.c:85–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85static uint32_t chacha_next32(mi_random_ctx_t* ctx) {
86 if (ctx->output_available <= 0) {
87 chacha_block(ctx);
88 ctx->output_available = 16; // (assign again to suppress static analysis warning)
89 }
90 const uint32_t x = ctx->output[16 - ctx->output_available];
91 ctx->output[16 - ctx->output_available] = 0; // reset once the data is handed out
92 ctx->output_available--;
93 return x;
94}
95
96static inline uint32_t read32(const uint8_t* p, size_t idx32) {
97 const size_t i = 4*idx32;

Callers 1

_mi_random_nextFunction · 0.85

Calls 1

chacha_blockFunction · 0.85

Tested by

no test coverage detected