Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-random/getrandom
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.7
Choose a base ref
...
head repository: rust-random/getrandom
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.2.8
Choose a head ref
  • 13 commits
  • 7 files changed
  • 6 contributors

Commits on Jul 8, 2022

  1. use $crate in macro (#270)

    This is the recommended way of referring to the current crate in a macro.
    leoyvens authored Jul 8, 2022
    Configuration menu
    Copy the full SHA
    3d818a6 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2022

  1. Add/Rework benchmarks to track initialization cost (#272)

    This PR adds more benchmarks so we can get and accurate idea about two
    things:
    
      - What is the cost of having to zero the buffer before calling
        `getrandom`?
      - What is the performance on aligned, 32-byte buffers?
        - This is by far the most common use, as its used to seed
          usersapce CSPRNGs.
    
    I ran the benchmarks on my system:
      - CPU: AMD Ryzen 7 5700G
      - OS: Linux 5.15.52-1-lts
      - Rust Version: 1.62.0-nightly (ea92b0838 2022-05-07)
    
    I got the following results:
    ```
    test bench_large      ... bench:   3,759,323 ns/iter (+/- 177,100) = 557 MB/s
    test bench_large_init ... bench:   3,821,229 ns/iter (+/- 39,132) = 548 MB/s
    test bench_page       ... bench:       7,281 ns/iter (+/- 59) = 562 MB/s
    test bench_page_init  ... bench:       7,290 ns/iter (+/- 69) = 561 MB/s
    test bench_seed       ... bench:         206 ns/iter (+/- 3) = 155 MB/s
    test bench_seed_init  ... bench:         206 ns/iter (+/- 1) = 155 MB/s
    ```
    
    These results were very consistent across multiple runs, and roughtly
    behave as we would expect:
      - The thoughput is highest with a buffer large enough to amoritize the
        syscall overhead, but small enough to stay in the L1D cache.
      - There is a _very_ small cost to zeroing the buffer beforehand.
      - This cost is imperceptible in the common 32-byte usecase, where the
        syscall overhead dominates.
      - The cost is slightly higher (1%) with multi-megabyte buffers as the
        data gets evicted from the L1 cache between the `memset` and the
        call to `getrandom`.
    
    I would love to see results for other platforms. Could we get someone to
    run this on an M1 Mac?
    
    Signed-off-by: Joe Richey <joerichey@google.com>
    josephlr authored Jul 13, 2022
    Configuration menu
    Copy the full SHA
    7089766 View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2022

  1. Configuration menu
    Copy the full SHA
    9a64857 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2022

  1. Configuration menu
    Copy the full SHA
    0b71d50 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2022

  1. Add description about Cargo js feature for WebAssembly section (#280)

    * add description about Cargo js feature
    * add note about different crate types
    * clean up
    * Fix wording/grammer
    * Remove "Indirect Depenencies" section
    * Note that libraries shouldn't add their own JS feature
    
    Signed-off-by: Joe Richey <joerichey@google.com>
    Co-authored-by: Mauri Mustonen <mauri.mustonen@hotmail.com>
    Co-authored-by: Joe Richey <joerichey@google.com>
    3 people authored Aug 30, 2022
    Configuration menu
    Copy the full SHA
    d3aa089 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2022

  1. Rework JS feature detection

    Now we look for the standard Web Cryptography API before attempting to
    check for Node.js support. This allows Node.js ES6 module users to add
    a polyfill like:
    ```js
    import {webcrypto} from 'crypto'
    globalThis.crypto = webcrypto
    ```
    as described in #256 (comment)
    
    Signed-off-by: Joe Richey <joerichey@google.com>
    josephlr committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    d69e8e0 View commit details
    Browse the repository at this point in the history
  2. Update documentation and error messages

    This allows users to get an actionable error message about this
    particular problem. We also add detection for this problem.
    
    Signed-off-by: Joe Richey <joerichey@google.com>
    josephlr committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    0579fe3 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2022

  1. Fix link typo

    Signed-off-by: Joe Richey <joerichey@google.com>
    josephlr committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    0503000 View commit details
    Browse the repository at this point in the history
  2. Catch call to module.require

    This call throws an exception if module isn't defined.
    
    Signed-off-by: Joe Richey <joerichey@google.com>
    josephlr committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    e0c93b1 View commit details
    Browse the repository at this point in the history
  3. Update Module::require internal comments

    Signed-off-by: Joe Richey <joerichey@google.com>
    josephlr committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    9962c70 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #284 from rust-random/webcrypto

    Rework JS feature detection
    josephlr authored Oct 6, 2022
    Configuration menu
    Copy the full SHA
    cfdad53 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2022

  1. Update docs for wasm32-unknown-unknown implementation (#295)

    Signed-off-by: Joe Richey <joerichey@google.com>
    josephlr authored Oct 20, 2022
    Configuration menu
    Copy the full SHA
    353d0ca View commit details
    Browse the repository at this point in the history
  2. Release v0.2.8 (#294)

    Also updates the changelog
    
    Signed-off-by: Joe Richey <joerichey@google.com>
    josephlr authored Oct 20, 2022
    Configuration menu
    Copy the full SHA
    5c1bb00 View commit details
    Browse the repository at this point in the history
Loading