dragontamer/AESRand
View on GitHub ↗ ★ 62 C++
Random Number Generator based on hardware-accelerated AES instructions
9 mentions on Hacker News by 1 person: 1 story, 8 comments · first 2018-11-07 · latest 2025-07-24
20082026
-
As far as fast RNGs available, Imma just plug an old, incomplete, weekend project for ya.... https://github.com/dragontamer/AESRand Especially because you are already in the AVX domain, a fast AVX RNG that uses like 3 registers should be…
comment by dragontamer · 2025-07-24 · in SIMD Perlin Noise: Beating the Compiler with SSE (2014) -
Imma just leave this here... https://github.com/dragontamer/AESRand/blob/master/AESRand_L... Algorithm: void AESRand_increment(__m128i& state){ state += increment; } std::array<__m128i, 2> AESRand_rand(const __m128i state){ __m128i…
comment by dragontamer · 2022-08-05 · in Plan B for UUIDs: double AES-128 -
…integer->float conversion with some smart AND / OR instructions. (See the "toFloats" routine here: https://github.com/dragontamer/AESRand/blob/master/AESRand_P... ) Oh right, and you can also use the AES circuits to make random numbers,…
comment by dragontamer · 2021-12-10 · in Better, cheaper, more abundant random numbers -
Cool stuff! I'll give it a lookover later. A few years ago, I wrote AESRAND ( https://github.com/dragontamer/AESRand ). I managed to get some well-known programmers to look into it, and their advice helped me write some pretty neat…
comment by dragontamer · 2021-03-08 · in MIPS Becomes RISC-V -
…I just happen to have studied the AES instructions to a ridiculous degree a few years ago... ( https://github.com/dragontamer/AESRand ) You don't come up with 32-bytes of random numbers every 4-clock ticks unless you understand this stuff.…
comment by dragontamer · 2020-12-18 · in The Ampere Altra Review: 2x 80 Cores Arm Server Performance Monster -
…a pretty fast generator myself. The coding was done in a weekend, but it took some weeks to test: https://github.com/dragontamer/AESRand For AESRand: "counterFunction" is a SIMD 2x64-bit Add over the XMM register. I chose an odd number…
comment by dragontamer · 2020-10-15 · in A Family of Better Random Number Generators -
https://github.com/dragontamer/AESRand Yes, it is possible but its difficult to do it right. I ran into at least 3 or 4 "roadblocks" while designing this algorithm, fortunately I managed to get through all of them. I've got an unrolled…
comment by dragontamer · 2019-10-18 · in Really Fixing Getrandom() -
…have a Skylake-X machine to test this idea with. See here for my experiment on AES functionality: https://github.com/dragontamer/AESRand
comment by dragontamer · 2019-03-16 · in XXH3 – a new speed-optimized hash algorithm