[openssl/openssl] 55755f: rand: implement an unbiased random integer from a ...

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


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 55755fbf42ec073e86651065c5cce6f64662c9e6
      https://github.com/openssl/openssl/commit/55755fbf42ec073e86651065c5cce6f64662c9e6
  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)


  Commit: d05e0e40d712b9246c6e9db5b579fcce69dafa98
      https://github.com/openssl/openssl/commit/d05e0e40d712b9246c6e9db5b579fcce69dafa98
  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)


  Commit: dfb26e03c26b9234d04cb9fcaf6391d6bfb44dc4
      https://github.com/openssl/openssl/commit/dfb26e03c26b9234d04cb9fcaf6391d6bfb44dc4
  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)


Compare: https://github.com/openssl/openssl/compare/74ff15e1a198...dfb26e03c26b


More information about the openssl-commits mailing list