
High-performance, bias-free cryptographic engine in Ada/SPARK leveraging native OS entropy pools.
A high-performance, bias-free cryptographic stream engine written in Ada and formally verified with SPARK. The engine guarantees zero statistical bias when mapping raw entropy into custom alphabets by discarding modulo-biased values, drawing security bytes directly from native OS kernel pools.
The engine interfaces directly with low-level OS APIs via Interfaces.C to eliminate abstraction layers and latency:
ProcessPrng) as the main source of raw security bytes.bcrypt.dll).-- Formula applied to enforce uniform distribution without modulo bias:
-- Formul = Charset'Length * (256 / Charset'Length) - 1
-- Any extracted byte > Formula'result = it is ruled out
src/ProcessPrng_Wrapper.ad[s|b]: Binding for the primary modern Windows Kernel PRNG.src/BcryptGenRandom_Wrapper.ad[s|b]: Secondary cryptographic fallback binding.src/Chain_Generator.ad[s|b]: Main state machine orchestrating bias-free extraction.src/Math_Functions.ad[s|b]: Formal pre/postconditions for mapping operations.alr run