[openssl/openssl] 3fe56b: rand: implement an unbiased random integer from a ...

Pauli noreply at github.com
Wed Nov 1 11:09:09 UTC 2023


  Branch: refs/heads/openssl-3.2
  Home:   https://github.com/openssl/openssl
  Commit: 3fe56baf936373daa39b944e3194a6f234fbe8bf
      https://github.com/openssl/openssl/commit/3fe56baf936373daa39b944e3194a6f234fbe8bf
  Author: Pauli <pauli at openssl.org>
  Date:   2023-11-01 (Wed, 01 Nov 2023)

  Changed paths:
    M crypto/rand/build.info
    A crypto/rand/rand_uniform.c
    M include/crypto/rand.h

  Log Message:
  -----------
  rand: implement an unbiased random integer from a range

Refer: https://github.com/apple/swift/pull/39143 for a description
of the algorithm.

It is optimal in the sense of having:

* no divisions
* minimal number of blocks of random bits from the generator

Reviewed-by: Tom Cosgrove <tom.cosgrove at arm.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22499)

(cherry picked from commit 55755fbf42ec073e86651065c5cce6f64662c9e6)


  Commit: 2bdf45d875234a9b203a60e2143e4fe977ec5ff9
      https://github.com/openssl/openssl/commit/2bdf45d875234a9b203a60e2143e4fe977ec5ff9
  Author: Pauli <pauli at openssl.org>
  Date:   2023-11-01 (Wed, 01 Nov 2023)

  Changed paths:
    M test/build.info
    M test/rand_test.c

  Log Message:
  -----------
  Add test case for uniform random generators

Reviewed-by: Tom Cosgrove <tom.cosgrove at arm.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22499)

(cherry picked from commit d05e0e40d712b9246c6e9db5b579fcce69dafa98)


  Commit: 7a78528bc540db41ca6834810766a62b640a09c7
      https://github.com/openssl/openssl/commit/7a78528bc540db41ca6834810766a62b640a09c7
  Author: Pauli <pauli at openssl.org>
  Date:   2023-11-01 (Wed, 01 Nov 2023)

  Changed paths:
    M crypto/rand/rand_uniform.c

  Log Message:
  -----------
  rand uniform: add comments outlining the algorithm

Reviewed-by: Tom Cosgrove <tom.cosgrove at arm.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22499)

(cherry picked from commit dfb26e03c26b9234d04cb9fcaf6391d6bfb44dc4)


Compare: https://github.com/openssl/openssl/compare/b4a33ba9aaf8...7a78528bc540


More information about the openssl-commits mailing list