/freebsd/sys/contrib/pcg-c/include/ |
H A D | pcg_variants.h | 403 static inline void pcg_oneseq_8_step_r(struct pcg_state_8* rng) in pcg_oneseq_8_step_r() argument 405 rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_8 in pcg_oneseq_8_step_r() 409 static inline void pcg_oneseq_8_advance_r(struct pcg_state_8* rng, uint8_t delta) in pcg_oneseq_8_advance_r() argument 411 rng->state = pcg_advance_lcg_8(rng->state, delta, PCG_DEFAULT_MULTIPLIER_8, in pcg_oneseq_8_advance_r() 415 static inline void pcg_mcg_8_step_r(struct pcg_state_8* rng) in pcg_mcg_8_step_r() argument 417 rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_8; in pcg_mcg_8_step_r() 420 static inline void pcg_mcg_8_advance_r(struct pcg_state_8* rng, uint8_t delta) in pcg_mcg_8_advance_r() argument 422 rng->state in pcg_mcg_8_advance_r() 423 = pcg_advance_lcg_8(rng->state, delta, PCG_DEFAULT_MULTIPLIER_8, 0u); in pcg_mcg_8_advance_r() 426 static inline void pcg_unique_8_step_r(struct pcg_state_8* rng) in pcg_unique_8_step_r() argument [all …]
|
/freebsd/sys/dev/random/fenestrasX/ |
H A D | fx_brng.c | 62 fxrng_brng_init(struct fxrng_buffered_rng *rng) in fxrng_brng_init() argument 64 fxrng_rng_init(&rng->brng_rng, rng == &fxrng_root); in fxrng_brng_init() 67 rng->brng_avail_idx = sizeof(rng->brng_buffer); in fxrng_brng_init() 91 struct fxrng_buffered_rng *rng; in fxrng_brng_src_reseed() local 93 rng = &fxrng_root; in fxrng_brng_src_reseed() 94 FXRNG_BRNG_ASSERT(rng); in fxrng_brng_src_reseed() 95 ASSERT_DEBUG(rng->brng_generation > 0, "root RNG not seeded"); in fxrng_brng_src_reseed() 97 fxrng_rng_src_reseed(&rng->brng_rng, event); in fxrng_brng_src_reseed() 98 FXRNG_BRNG_ASSERT(rng); in fxrng_brng_src_reseed() 107 rng->brng_generation++; in fxrng_brng_src_reseed() [all …]
|
H A D | fx_main.c | 145 struct fxrng_buffered_rng **pcpu_brng_p, *rng, *tmp; in _fxrng_alg_read() local 157 rng = (void *)atomic_load_acq_ptr((uintptr_t *)pcpu_brng_p); in _fxrng_alg_read() 164 if (__predict_false(rng == NULL)) { in _fxrng_alg_read() 190 rng = malloc_domainset(sizeof(*rng), M_ENTROPY, ds, in _fxrng_alg_read() 192 if (rng == NULL) { in _fxrng_alg_read() 194 rng = &fxrng_root; in _fxrng_alg_read() 198 fxrng_brng_init(rng); in _fxrng_alg_read() 211 FXRNG_BRNG_LOCK(rng); in _fxrng_alg_read() 212 FXRNG_BRNG_UNLOCK(rng); in _fxrng_alg_read() 215 sizeof(newkey), &rng->brng_generation); in _fxrng_alg_read() [all …]
|
H A D | fx_rng.h | 36 #define FXRNG_RNG_LOCK(rng) mtx_lock(&(rng)->rng_lk) argument 37 #define FXRNG_RNG_UNLOCK(rng) mtx_unlock(&(rng)->rng_lk) argument 38 #define FXRNG_RNG_ASSERT(rng) mtx_assert(&(rng)->rng_lk, MA_OWNED) argument 39 #define FXRNG_RNG_ASSERT_NOT(rng) mtx_assert(&(rng)->rng_lk, MA_NOTOWNED) argument 49 fxrng_rng_init(struct fxrng_basic_rng *rng, bool is_root_rng) in fxrng_rng_init() argument 52 mtx_init(&rng->rng_lk, "fx root brng lk", NULL, MTX_DEF); in fxrng_rng_init() 54 mtx_init(&rng->rng_lk, "fx pcpu brng lk", NULL, MTX_DEF); in fxrng_rng_init() 58 fxrng_rng_setkey(struct fxrng_basic_rng *rng, const void *newkey, size_t len) in fxrng_rng_setkey() argument 61 chacha_keysetup(&rng->rng_prf, newkey, len * 8); in fxrng_rng_setkey()
|
H A D | fx_rng.c | 118 fxrng_rng_genrandom_internal(struct fxrng_basic_rng *rng, void *buf, in fxrng_rng_genrandom_internal() argument 125 FXRNG_RNG_ASSERT(rng); in fxrng_rng_genrandom_internal() 128 fxrng_rng_keystream_internal(&rng->rng_prf, newkey, sizeof(newkey)); in fxrng_rng_genrandom_internal() 131 memcpy(&ctx_copy, &rng->rng_prf, sizeof(ctx_copy)); in fxrng_rng_genrandom_internal() 139 fxrng_chacha_nonce_add64(&rng->rng_prf, blockcount); in fxrng_rng_genrandom_internal() 142 chacha_keysetup(&rng->rng_prf, newkey, sizeof(newkey) * 8); in fxrng_rng_genrandom_internal() 145 FXRNG_RNG_UNLOCK(rng); in fxrng_rng_genrandom_internal() 147 p_ctx = &rng->rng_prf; in fxrng_rng_genrandom_internal() 154 FXRNG_RNG_ASSERT_NOT(rng); in fxrng_rng_genrandom_internal() 157 chacha_keysetup(&rng->rng_prf, newkey, sizeof(newkey) * 8); in fxrng_rng_genrandom_internal() [all …]
|
/freebsd/contrib/bc/src/ |
H A D | rand.c | 392 * @param rng The PRNG on the top of the stack. Must have been seeded. 395 bc_rand_seedZeroes(BcRNG* r, BcRNGData* rng, size_t idx) in bc_rand_seedZeroes() argument 413 bc_rand_copy(bc_vec_item_rev(&r->v, i), rng); in bc_rand_seedZeroes() 419 bc_rand_srand(BcRNGData* rng) in bc_rand_srand() argument 432 bc_rand_fill(rng, bc_rand_frand, &fd); in bc_rand_srand() 442 bc_rand_fill(rng, bc_rand_frand, &fd); in bc_rand_srand() 448 bc_rand_fill(rng, bc_rand_winrand, NULL); in bc_rand_srand() 452 while (BC_ERR(BC_RAND_ZERO(rng))) in bc_rand_srand() 454 bc_rand_fill(rng, bc_rand_rand, NULL); in bc_rand_srand() 464 * @param rng Th 467 bc_rand_propagate(BcRNG * r,BcRNGData * rng) bc_rand_propagate() argument 499 BcRNGData* rng = bc_vec_top(&r->v); bc_rand_int() local 539 BcRNGData* rng = bc_vec_top(&r->v); bc_rand_seed() local 588 BcRNGData* rng = bc_vec_top(&r->v); bc_rand_getRands() local 607 BcRNGData* rng = bc_vec_pushEmpty(&r->v); bc_rand_push() local [all...] |
/freebsd/sys/contrib/device-tree/Bindings/rng/ |
H A D | mtk-rng.txt | 6 "mediatek,mt7622-rng", "mediatek,mt7623-rng" : for MT7622 7 "mediatek,mt7629-rng", "mediatek,mt7623-rng" : for MT7629 8 "mediatek,mt7623-rng" : for MT7623 9 "mediatek,mt8516-rng", "mediatek,mt7623-rng" : for MT8516 12 - clock-names : Should contain "rng" entries; 17 rng: rng@1020f000 { 18 compatible = "mediatek,mt7623-rng"; 21 clock-names = "rng";
|
H A D | sparc_sun_oracle_rng.txt | 7 - 'SUNW,n2-rng' for Niagara 2 Platform (SUN UltraSPARC T2 CPU) 8 - 'SUNW,vf-rng' for Victoria Falls Platform (SUN UltraSPARC T2 Plus CPU) 9 …- 'SUNW,kt-rng' for Rainbow/Yosemite Falls Platform (SUN SPARC T3/T4), (UltraSPARC KT/Niagara 3 - … 11 - 'ORCL,m4-rng' for SPARC T5/M5 12 - 'ORCL,m7-rng' for SPARC T7/M7 18 rng-#units: 00000002 19 compatible: 'ORCL,m4-rng' 25 rng-#units: 00000003 26 compatible: 'ORCL,m7-rng'
|
H A D | omap_rng.txt | 7 - "ti,omap2-rng" for OMAP2. 8 - "ti,omap4-rng" for OMAP4, OMAP5 and AM33XX. 14 Used for "ti,omap4-rng" and "inside-secure,safexcel-eip76" 25 rng: rng@48310000 { 26 compatible = "ti,omap4-rng"; 27 ti,hwmods = "rng"; 33 trng: rng@f2760000 {
|
H A D | nuvoton,npcm-rng.txt | 4 - compatible : "nuvoton,npcm750-rng" for the NPCM7XX BMC. 9 rng: rng@f000b000 { 10 compatible = "nuvoton,npcm750-rng";
|
H A D | hisi-rng.txt | 4 - compatible : Should be "hisilicon,hip04-rng" or "hisilicon,hip05-rng" 9 rng@d1010000 { 10 compatible = "hisilicon,hip05-rng";
|
H A D | microchip,pic32-rng.txt | 7 - compatible : should be "microchip,pic32mzda-rng" 13 rng: rng@1f8e6000 { 14 compatible = "microchip,pic32mzda-rng";
|
H A D | apm,rng.txt | 5 - compatible : should be "apm,xgene-rng" 12 rng: rng@10520000 { 13 compatible = "apm,xgene-rng";
|
H A D | st,rng.txt | 5 compatible : Should be "st,rng" 11 rng@fee80000 { 12 compatible = "st,rng";
|
H A D | omap3_rom_rng.txt | 9 Definition: must be "nokia,n900-rom-rng" 23 rom_rng: rng { 24 compatible = "nokia,n900-rom-rng";
|
H A D | ks-sa-rng.txt | 5 - compatible: should be "ti,keystone-rng" 15 rng@24000 { 16 compatible = "ti,keystone-rng";
|
/freebsd/contrib/ntp/sntp/libopts/ |
H A D | numeric.c | 47 const struct {long const rmin, rmax;} * rng = rng_table; in optionShowRange() local 74 if (rng->rmax == LONG_MIN) in optionShowRange() 75 fprintf(option_usage_fp, zRangeExact, pz_indent, rng->rmin); in optionShowRange() 76 else if (rng->rmin == LONG_MIN) in optionShowRange() 77 fprintf(option_usage_fp, zRangeUpto, pz_indent, rng->rmax); in optionShowRange() 78 else if (rng->rmax == LONG_MAX) in optionShowRange() 79 fprintf(option_usage_fp, zRangeAbove, pz_indent, rng->rmin); in optionShowRange() 81 fprintf(option_usage_fp, zRange, pz_indent, rng->rmin, in optionShowRange() 82 rng->rmax); in optionShowRange() 89 rng++; in optionShowRange()
|
/freebsd/crypto/openssl/test/testutil/ |
H A D | fake_random.c | 174 static int check_rng(EVP_RAND_CTX *rng, const char *name) in check_rng() argument 178 if (!TEST_ptr(rng)) { in check_rng() 182 f = rng->algctx; in check_rng() 184 f->ctx = rng; in check_rng() 214 void fake_rand_set_callback(EVP_RAND_CTX *rng, in fake_rand_set_callback() argument 218 if (rng != NULL) in fake_rand_set_callback() 219 ((FAKE_RAND *)rng->algctx)->cb = cb; in fake_rand_set_callback()
|
/freebsd/contrib/bearssl/src/rsa/ |
H A D | rsa_i15_keygen.c | 32 mkrand(const br_prng_class **rng, uint16_t *x, uint32_t esize) in mkrand() argument 38 (*rng)->generate(rng, x + 1, len * sizeof(uint16_t)); in mkrand() 125 miller_rabin(const br_prng_class **rng, const uint16_t *x, int n, in miller_rabin() argument 187 mkrand(rng, a, asize); in miller_rabin() 221 mkprime(const br_prng_class **rng, uint16_t *x, uint32_t esize, in mkprime() argument 237 mkrand(rng, x, esize); in mkprime() 363 if (miller_rabin(rng, x, rounds, t, tlen)) { in mkprime() 437 br_rsa_i15_keygen(const br_prng_class **rng, in br_rsa_i15_keygen() argument 505 mkprime(rng, p, esize_p, pubexp, t, tlen); in br_rsa_i15_keygen() 517 mkprime(rng, q, esize_q, pubexp, t, tlen); in br_rsa_i15_keygen()
|
H A D | rsa_i31_keygen_inner.c | 32 mkrand(const br_prng_class **rng, uint32_t *x, uint32_t esize) in mkrand() argument 38 (*rng)->generate(rng, x + 1, len * sizeof(uint32_t)); in mkrand() 127 miller_rabin(const br_prng_class **rng, const uint32_t *x, int n, in miller_rabin() argument 190 mkrand(rng, a, asize); in miller_rabin() 235 mkprime(const br_prng_class **rng, uint32_t *x, uint32_t esize, in mkprime() argument 251 mkrand(rng, x, esize); in mkprime() 385 if (miller_rabin(rng, x, rounds, t, tlen, mp31)) { in mkprime() 458 br_rsa_i31_keygen_inner(const br_prng_class **rng, in br_rsa_i31_keygen_inner() argument 530 mkprime(rng, p, esize_p, pubexp, t, tlen, mp31); in br_rsa_i31_keygen_inner() 542 mkprime(rng, q, esize_q, pubexp, t, tlen, mp31); in br_rsa_i31_keygen_inner()
|
H A D | rsa_pss_sig_pad.c | 29 br_rsa_pss_sig_pad(const br_prng_class **rng, in br_rsa_pss_sig_pad() argument 67 (*rng)->generate(rng, salt, salt_len); in br_rsa_pss_sig_pad()
|
H A D | rsa_i31_keygen.c | 29 br_rsa_i31_keygen(const br_prng_class **rng, in br_rsa_i31_keygen() argument 34 return br_rsa_i31_keygen_inner(rng, in br_rsa_i31_keygen()
|
H A D | rsa_i32_pss_sign.c | 29 br_rsa_i32_pss_sign(const br_prng_class **rng, in br_rsa_i32_pss_sign() argument 34 if (!br_rsa_pss_sig_pad(rng, hf_data, hf_mgf1, hash, in br_rsa_i32_pss_sign()
|
/freebsd/contrib/libucl/tests/ |
H A D | test_msgpack.c | 64 pcg32_random_t rng; variable 72 uint64_t oldstate = rng.state; in pcg32_random() 74 rng.state = oldstate * 6364136223846793005ULL + (rng.inc | 1); in pcg32_random() 123 assert (read (fd, &rng, sizeof (rng)) == sizeof (rng)); in main()
|
/freebsd/contrib/wpa/src/crypto/ |
H A D | crypto_wolfssl.c | 106 static void wc_rng_deinit(WC_RNG *rng) in wc_rng_deinit() argument 109 wc_FreeRng(rng); in wc_rng_deinit() 110 os_free(rng); in wc_rng_deinit() 112 wc_rng_free(rng); in wc_rng_deinit() 932 WC_RNG rng; in dh5_init() local 948 if (wc_InitRng(&rng) != 0) { in dh5_init() 964 if (wc_DhGenerateKeyPair(dh, &rng, wpabuf_mhead(privkey), &priv_sz, in dh5_init() 984 wc_FreeRng(&rng); in dh5_init() 1077 WC_RNG rng; in crypto_dh_init() local 1089 if (wc_InitRng(&rng) != 0) { in crypto_dh_init() [all …]
|