Skip to content

Mikeo/lowmem improvements - #136

Closed
ounsworth wants to merge 249 commits into
bcgit:release/0.1.3alphafrom
ounsworth:mikeo/lowmem_bench_tweaks
Closed

ounsworth wants to merge 249 commits into
bcgit:release/0.1.3alphafrom
ounsworth:mikeo/lowmem_bench_tweaks

Conversation

@ounsworth

@ounsworth ounsworth commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

In short, I had Claude do a review for silent copies in the mlkem and mldsa lowmemory crates and it found a couple of instance of:

  • moves that were being compiled as a pass-by-value copy
  • .try_into() that created a copy as a result of needing an intermediate owned copy.
    And similar patterns.
  • Adjusted the size of the SHAKE pre-buffer in SampleNTT() / RejNTTPoly() to match exactly a SHAKE block size boundary.

The net result is about a 2 - 4 kb reduction across the whole lowmemory suite, and also some tightening up in the non-optimized implementation.

dghgit and others added 30 commits September 6, 2026 12:02
…locks8, SymmetricCipherEncryptor/Decryptor (from feature/sm4); CFB follows suit
…cb CLI subcommands; block-mode CLI generic over INIT_DATA_LEN
…S_PADS; SymmetricCipherEncryptor::do_final reports its output length
…rams/HashMLDSAParams/MLKEMParams traits, one impl per parameter set (bcgit#117)
…eamCipherDecryptor pair, shaped like the block cipher pair (in place, any length, generated init data); TestFrameworkStreamCipher implemented in place of its todo!()
… and Cfb8 (SP 800-38A Sec 6.3, s = 8) is added, with AES_CFB8_* aliases, aes*-cfb8 CLI subcommands and a shared stream-mode CLI
…, CFB8 is added, and the StreamCipher trait is replaced by the split encryptor/decryptor pair; re-measured throughput and mutation figures
…inst real AES at all three key lengths, not only the toy permutation
…th picks the counter width (max 4 bytes) and which errors rather than repeat a counter, with AES_CTR_* aliases and aes*-ctr CLI subcommands
… the nonce-plus-counter construction, pinning the 1, 2 and 3-byte counter widths that the ACVP and OpenSSL vectors cannot reach
ounsworth and others added 21 commits September 29, 2026 17:44
…eing held in a Polynomial [i32; 256], it's now bit-packed into a [u8; 32].
…LVM lays out stack frames and give slightly better numbers
…pansion so that it doesn't get sucked into the caller's stack frame.
…skill

The Architecture paragraph introducing memory hygiene already names the
skill; the stand-alone sentence under Stack Usage Benchmarks repeated it.
Also "cast" -> "cost" in that paragraph.

Assisted-by: Claude:claude-fable-5-1
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@dghgit
dghgit force-pushed the mikeo/lowmem_bench_tweaks branch from 367fc40 to 681ead7 Compare September 29, 2026 07:51
@dghgit
dghgit changed the base branch from release/0.1.3alpha to feature/simple-ciphers September 29, 2026 07:52
@ounsworth ounsworth added this to the 0.1.3alpha milestone Oct 7, 2026
@ounsworth ounsworth closed this Oct 24, 2026
@ounsworth ounsworth reopened this Oct 24, 2026
@ounsworth
ounsworth changed the base branch from feature/simple-ciphers to release/0.1.3alpha October 24, 2026 15:08
@ounsworth

Copy link
Copy Markdown
Contributor Author

Closing, as this has been replaced by #177

@ounsworth ounsworth closed this Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants