Skip to content

Instantly share code, notes, and snippets.

@ruescasd
Created February 7, 2025 17:57
Show Gist options
  • Save ruescasd/1982568f4274b0371b0e38b815ffd9c9 to your computer and use it in GitHub Desktop.
Save ruescasd/1982568f4274b0371b0e38b815ffd9c9 to your computer and use it in GitHub Desktop.
PRG_DDH_Test.cry
/**
* Test of Pseudo-random Generator from the DDH Assumption
* Section 10.1 of the EVS Draft, February 3, 2024.
*
* @author Frank Zeyda ([email protected])
* @copyright Free & Fair 2025
* @version 0.1
*/
module Primitives::PRG_DDH_Test where
import Primitives::PRG_DDH as RNG where
// Pair of safe / Sophie Germain prime numbers
type p'p = 167
type q'p = 83
// Generator of the subgroup of quadratic residues
g'p = 11
// Number of blocks per generated random number
type k'p = 4
// Auxiliary Security Parameter
type n_r'p = 1
/*****************************/
/* Testing with a fixed seed */
/*****************************/
testSeed : RNG::seed
testSeed = { r1 = 2, x = [3, 4, 5, 6]}
initState : RNG::state
initState = RNG::init testSeed
main = RNG::nextN`{10} initState
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment