Skip to content
Snippets Groups Projects
  1. Feb 19, 2019
  2. Feb 14, 2019
    • Nick Mathewson's avatar
      Implement a fast aes-ctr prng · f3cbd642
      Nick Mathewson authored
      This module is currently implemented to use the same technique as
      libottery (later used by the bsds' arc4random replacement), using
      AES-CTR-256 as its underlying stream cipher.  It's backtracking-
      resistant immediately after each call, and prediction-resistant
      after a while.
      
      Here's how it works:
      
      We generate psuedorandom bytes using AES-CTR-256.  We generate BUFLEN bytes
      at a time.  When we do this, we keep the first SEED_LEN bytes as the key
      and the IV for our next invocation of AES_CTR, and yield the remaining
      BUFLEN - SEED_LEN bytes to the user as they invoke the PRNG.  As we yield
      bytes to the user, we clear them from the buffer.
      
      Every RESEED_AFTER times we refill the buffer, we mix in an additional
      SEED_LEN bytes from our strong PRNG into the seed.
      
      If the user ever asks for a huge number of bytes at once, we pull SEED_LEN
      bytes from the PRNG and use them with our stream cipher to fill the user's
      request.
      f3cbd642
    • Nick Mathewson's avatar
      Extract the common body of our random-int functions into a macro · 622a9a8a
      Nick Mathewson authored
      This is the second part of refactoring the random-int-in-range code.
      622a9a8a
  3. Feb 08, 2019
  4. Feb 07, 2019
  5. Jan 23, 2019
  6. Jan 22, 2019
  7. Jan 16, 2019
  8. Jan 11, 2019
  9. Jan 10, 2019
  10. Jan 09, 2019
    • Kris Katterjohn's avatar
      Fix (and make consistent) the use of OpenBSD preprocessor macro tests · c13a81f7
      Kris Katterjohn authored and Nick Mathewson's avatar Nick Mathewson committed
      
      Prior to this commit, the testsuite was failing on OpenBSD.  After
      this commit the testsuite runs fine on OpenBSD.
      
      It was previously decided to test for the OpenBSD macro (rather than
      __OpenBSD__, etc.) because OpenBSD forks seem to have the former
      macro defined.  sys/param.h must be included for the OpenBSD macro
      definition; however, many files tested for the OpenBSD macro without
      having this header included.
      
      This commit includes sys/param.h in the files where the OpenBSD macro
      is used (and sys/param.h is not already included), and it also
      changes some instances of the __OpenBSD__ macro to OpenBSD.
      
      See commit 27df23ab which changed
      everything to use OpenBSD instead of __OpenBSD__ or OPENBSD.  See
      also tickets #6982 and #20980 (the latter ticket is where it was
      decided to use the OpenBSD macro).
      
      Signed-off-by: default avatarKris Katterjohn <katterjohn@gmail.com>
      c13a81f7
  11. Jan 08, 2019
  12. Jan 07, 2019
  13. Jan 03, 2019
  14. Jan 02, 2019
  15. Dec 21, 2018
  16. Dec 20, 2018
Loading