mynd-math 0.1.0

Checked no_std arithmetic primitives for the mynd ecosystem.
Documentation
  • Coverage
  • 100%
    26 out of 26 items documented0 out of 0 items with examples
  • Size
  • Source code size: 42.4 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 409.8 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • valkyoth/mynd
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • eldryoth

mynd-math

Support crate for mynd: small, audited, format-neutral arithmetic primitives used before untrusted image values become offsets, lengths, ranges, or platform-sized indexes.

Most applications should depend on the facade crate:

[dependencies]
mynd = { version = "0.3.0", default-features = false }

Expert users can depend directly on mynd-math:

[dependencies]
mynd-math = { version = "0.1.0", default-features = false }

Capability

  • checked signed, fixed-width, and platform-width integer conversions;
  • checked u64 and usize addition and multiplication;
  • checked upward alignment for any nonzero multiple;
  • checked half-open ranges against an exclusive upper bound;
  • structured, allocation-free errors identifying conversion, overflow, alignment, and range failures.

Operations never wrap, saturate, silently truncate, allocate, inspect external state, or use unsafe code. Alignment does not imply a power-of-two memory-layout guarantee. Range functions accept an empty range at the exclusive upper bound.

Verification

The crate is covered by extrema matrices, exhaustive reduced-domain tests, cross-operation consistency tests, all supported Rust and platform targets, and Kani proofs over full-width and explicitly bounded domains. See the arithmetic contract for exact invariants and evidence mapping.

Compatibility

The supported MSRV is Rust 1.90.0. Rust 1.90.0 through 1.97.1 are covered by the workspace compatibility matrix, with 1.97.1 used for development and release verification.

License

Licensed under either Apache-2.0 or MIT, at your option.