Skip to content

C++ implementation of JP Aumasson's BlaBla Crypto PRNG

Notifications You must be signed in to change notification settings

gahtan-syarif/blabla.h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

BlaBla PRNG

C++ implementation of JP Aumasson's BlaBla PRNG (64-bit version of ChaCha based on Blake2b). Should run faster than ChaCha for 64-bit systems.

This code is a modification of Orson Peters' C++ ChaCha PRNG implementation.

Example Usage

#include <iostream>
#include <random>
#include "blabla.h"

int main() {
    // Instantiate generator and seed with random entropy
    std::random_device rd;
    BlaBlaPRNG::BlaBla<> gen(rd());

    // Define a uniform integer distribution in the range [1, 100]
    std::uniform_int_distribution<> dist(1, 100);

    // Generate and print 10 random numbers in the range [1, 100]
    for (int i = 0; i < 10; ++i) {
        std::cout << dist(gen) << " ";
    }

    return 0;
}