Skip to content

std.crypto: switch testing strategy from unit tests to mainly based on oracle-based fuzzing #22899

@andrewrk

Description

@andrewrk

Once Zig's integrated fuzzing is viable, we can kill two birds with one stone:

  1. Reduce the amount of time that std lib unit tests take by deleting some of the worst offenders, which all live in std.crypto.
  2. Actually increase robustness and test coverage by using oracle-based fuzz testing. This is where you run a fuzzer against two different implementations and makes sure they match. If they don't then at least one of the two has a bug for that input.

The branching in std.crypto is extremely shallow, by design, making it one of the best use cases for this strategy of testing.

This same idea can be applied to many other kinds of testing in the standard library. In general, I'd like the zig standard library to embrace fuzzing to a degree that is only possible when the toolchain integration is exemplary, and this issue will lead the charge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fuzzingstandard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions