Branch: refs/heads/yves/caret_rng_hook
  Home:   https://github.com/Perl/perl5
  Commit: 1b94c38982f61fae96fd06c4c57f4b6c93981291
      
https://github.com/Perl/perl5/commit/1b94c38982f61fae96fd06c4c57f4b6c93981291
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M pod/perlfunc.pod
    M pod/perlrun.pod
    M t/run/runenv_randseed.t

  Log Message:
  -----------
  PERL_RAND_SEED: document zero as automatic seeding

PERL_RAND_SEED only enables the deterministic no-argument srand() sequence
when its parsed seed is nonzero. A parsed zero leaves the override disabled,
so srand() obtains an automatic seed.

This is the existing implementation. Documenting it is less surprising than
changing zero into a special deterministic state, and avoids a new zero-state
rule for the xorshift sequence.

Add a regression test for the documented behaviour.


  Commit: 89c8664d958ca23b31460e2935d53b36ffb69a6a
      
https://github.com/Perl/perl5/commit/89c8664d958ca23b31460e2935d53b36ffb69a6a
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M MANIFEST
    M Porting/config_H
    M config_h.SH
    A t/porting/win32_config.t
    M win32/config.gc
    M win32/config.vc
    M win32/config_H.gc
    M win32/config_H.vc
    M win32/config_sh.PL

  Log Message:
  -----------
  config: expose the U64 unsigned decimal format

Configure already finds the printf conversion for an unsigned U64. Export it
as U64uf, next to UVuf, so code which stores a U64 does not have to assume
that UV is wide enough or that a particular C format spelling works.

Keep the definition conditional on d_PRIu64. Win32 records I64 conversions
when IV and UV are 32 bits because U64 is still a quad in that configuration.


  Commit: 5671da005ec8292e81ff87995802e7570d3ed201
      
https://github.com/Perl/perl5/commit/5671da005ec8292e81ff87995802e7570d3ed201
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M embed.fnc
    M embed.h
    M perl.c
    M perl.h
    M proto.h
    M util.c

  Log Message:
  -----------
  util: extract portable entropy acquisition

Make the operating-system entropy path available to callers that need more
than one U64. Perl_get_entropy_portable() fills an arbitrary number of octets
and makes the weak-versus-strong failure policy explicit.

The helper tries getentropy(), the configured random device, and
SystemFunction036. A weak caller falls back to mixed process state. A strong
caller gets its supplied error if no operating-system source succeeds.
Perl_seed() stays as the U64 compatibility wrapper for existing XS users.

Use the weak interface for Perl internal random initialization. This keeps its
previous fallback policy while giving new code one portable entry point.


  Commit: 0a13b997b805d48e1499f2fb604fc36027ac9cc7
      
https://github.com/Perl/perl5/commit/0a13b997b805d48e1499f2fb604fc36027ac9cc7
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M MANIFEST
    M Makefile.SH
    M Porting/Maintainers.pl
    M Porting/config.sh
    A dist/RNG/Changes
    A dist/RNG/MANIFEST
    A dist/RNG/Makefile.PL
    A dist/RNG/README
    A dist/RNG/RNG.xs
    A dist/RNG/lib/RNG.pm
    A dist/RNG/lib/RNG/Drand48.pm
    A dist/RNG/lib/RNG/HMAC_DRBG.pm
    A dist/RNG/lib/RNG/PCG.pm
    A dist/RNG/lib/RNG/Provider.pm
    A dist/RNG/lib/RNG/Seed.pm
    A dist/RNG/lib/RNG/SeedBase.pm
    A dist/RNG/lib/RNG/Wyrand.pm
    A dist/RNG/lib/RNG/Xoshiro.pm
    A dist/RNG/t/compat.t
    A dist/RNG/t/distributions.t
    A dist/RNG/t/drand48.t
    A dist/RNG/t/hmac_drbg.t
    A dist/RNG/t/pcg.t
    A dist/RNG/t/seed.t
    A dist/RNG/t/wyrand.t
    A dist/RNG/t/xoshiro.t
    M lib/.gitignore
    M win32/GNUmakefile
    M win32/Makefile

  Log Message:
  -----------
  dist/RNG: add random providers and distributions

Add RNG as the common layer for byte-oriented random generators and the
distribution helpers built on top of them. A provider supplies rand_bytes()
and srand(). The helpers use those octets for bounded integers, dice, and
weighted choices without knowing a provider state format.

RNG::SeedBase identifies exact raw state material. Ordinary seed values stay
UTF-8 strings, while a SeedBase object lets a caller replay a provider state
without deriving it again. This keeps the portable interface separate from
each generator implementation.

Bundle Drand48, PCG, Wyrand, Xoshiro, and HMAC_DRBG. Their XS code keeps state
in scalar storage and may publish a native U64 callback. That callback is
optional. rand_bytes() is the portable contract.

The module shim supports the same contract on supported older Perls without
requiring the later core ${^RNG} hook.


  Commit: 8d4a8702f38f0cd345c74c196a7776d28236835a
      
https://github.com/Perl/perl5/commit/8d4a8702f38f0cd345c74c196a7776d28236835a
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M MANIFEST
    M builtin.c
    M embed.fnc
    M embed.h
    M embedvar.h
    M gv.c
    M intrpvar.h
    M lib/builtin.pm
    M mg.c
    M perl.c
    M perl.h
    M pod/perl.pod
    M pod/perldelta.pod
    M pod/perldiag.pod
    M pod/perlfunc.pod
    A pod/perlrng.pod
    M pod/perlvar.pod
    M pp.c
    M proto.h
    M sv.c
    M t/harness
    M t/lib/warnings/9uninit
    M t/lib/warnings/pp
    A t/op/rng/contract.t
    M t/op/srand.t
    M t/perf/benchmarks
    A t/perf/rng-benchmarks
    M t/porting/known_pod_issues.dat
    M util.h
    M win32/pod.mak

  Log Message:
  -----------
  rng: let rand use selected providers

Make ${^RNG} select the generator used by rand(), srand(), and
builtin::rand_bytes(). The variable accepts an RNG::Provider object or undef.
It is dynamically scoped, but selecting a provider does not copy its state.

The core calls rand_bytes() for the portable path. XS providers can publish a
U64 callback and state pointer for rand() so the common case does not pay for
method dispatch. Assignment to ${^RNG}, and provider srand(), refresh the
cache before it is used again.

srand() now turns ordinary defined arguments into UTF-8 strings. Built-in
Drand48 retains its historical numeric handling and reports when it discards
bits above 32. SeedBase supplies exact raw state material. Redacted seeds fail
before their material is requested.

Add diagnostics, documentation, and core tests for the protocol, seed rules,
callback cache, and byte-count validation.


  Commit: 0d9fdccc534e5ac49eb4827040bdce0cd0d488d5
      
https://github.com/Perl/perl5/commit/0d9fdccc534e5ac49eb4827040bdce0cd0d488d5
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M .github/workflows/testsuite.yml
    M Porting/test-dist-modules.pl

  Log Message:
  -----------
  Porting: test RNG on supported older Perls

RNG supports Perl 5.24 and later, but the List::Util bundled with 5.24 is
older than RNG requires. Let the external-distribution test runner skip RNG
below that floor.

For the 5.24 test job, install a current List::Util and put its site
directories before the core library paths which MakeMaker prepends. Check the
installed version before running the distribution tests so this compatibility
requirement cannot silently regress.


  Commit: 1ff85710a03c394a0f6afd6235e7f40757774cdb
      
https://github.com/Perl/perl5/commit/1ff85710a03c394a0f6afd6235e7f40757774cdb
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M dist/RNG/RNG.xs
    M dist/RNG/t/drand48.t

  Log Message:
  -----------
  fixup! dist/RNG: add random providers and distributions

Document why the Drand48 byte adapter keeps the high 32 bits of each
48-bit transition. Compare its byte stream with the core implementation
across various lengths that end within and between four-byte chunks.


  Commit: 492bb04825e23ccf14479f1f2b0afda8f4dc9481
      
https://github.com/Perl/perl5/commit/492bb04825e23ccf14479f1f2b0afda8f4dc9481
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M pp.c

  Log Message:
  -----------
  fixup! rng: let rand use selected providers

Use newSVpvs("") to create an empty string.


  Commit: ae89f6a671bffe5f72e4f257eedb3ab0a94e976d
      
https://github.com/Perl/perl5/commit/ae89f6a671bffe5f72e4f257eedb3ab0a94e976d
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M pp.c

  Log Message:
  -----------
  fixup! rng: let rand use selected providers

The provider's srand callback can grow Perl's stack. Refresh SP before
popping the original arguments or pushing the result.


  Commit: 0b1ed7370347f0ca039b69b1d02ab707eecf651e
      
https://github.com/Perl/perl5/commit/0b1ed7370347f0ca039b69b1d02ab707eecf651e
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M t/op/rng/contract.t

  Log Message:
  -----------
  fixup! rng: let rand use selected providers

Exercise a provider callback that grows the Perl stack before returning.
This covers the stack refresh required before pp_srand pushes the result.


  Commit: 87be658a16920990cdeb9efe6e1635206bc76877
      
https://github.com/Perl/perl5/commit/87be658a16920990cdeb9efe6e1635206bc76877
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M embed.fnc
    M embed.h
    M pp.c
    M proto.h
    M t/op/rng/contract.t
    M util.c

  Log Message:
  -----------
  fixup! rng: let rand use selected providers

Return the advanced 48-bit Drand48 state so rand_bytes can select its
high 32 bits without converting through NV. Emit that word least
significant byte first and handle a partial final word in the switch.

Test the default generator for the requested length and seeded
repeatability.


  Commit: 292c8006436600e27a7a092e0fbf4c54f8ee1304
      
https://github.com/Perl/perl5/commit/292c8006436600e27a7a092e0fbf4c54f8ee1304
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M dist/RNG/RNG.xs
    M dist/RNG/t/drand48.t

  Log Message:
  -----------
  fixup! dist/RNG: add random providers and distributions

Emit each Drand48 word least significant byte first, matching the
builtin rand_bytes byte stream. Keep the copy switch layout aligned
with the builtin implementation.

Check a seeded byte sequence and compare provider output with the
builtin across full and partial words.


  Commit: fc08212cc581da2f6b3692f7ace3c464ff77b847
      
https://github.com/Perl/perl5/commit/fc08212cc581da2f6b3692f7ace3c464ff77b847
  Author: Yves Orton <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M t/op/rng/contract.t
    M util.c

  Log Message:
  -----------
  fixup! util: extract portable entropy acquisition

Add a DEBUGGING-only environment override that skips native entropy sources so
the weak entropy fallback can be exercised on ordinary hosts. Strong entropy
requests continue to report failure instead of using the fallback.

Test weak seeding and verify secure HMAC_DRBG construction fails under
the override.


Compare: https://github.com/Perl/perl5/compare/d6fd88a36c20...fc08212cc581

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to