3 comments

  • dave_universetf44 minutes ago
    The readme has strong LLM smells. Was the code written by an LLM as well?<p>What is your experience with cryptographic engineering, in particular avoiding common implementation pitfalls that bite first-time implementers of cryptographic primitives?<p>Are the primitives tested against Wycheproof vectors, and proofed against the common implementation mistakes they document?
    • tux33 minutes ago
      Yeah, spot on. This is what the code looks like: <a href="https:&#x2F;&#x2F;github.com&#x2F;loadingalias&#x2F;rscrypto&#x2F;blob&#x2F;4e24772a54fef3f6932e171f815dadb7cd0e3e8d&#x2F;src&#x2F;hashes&#x2F;crypto&#x2F;blake2b&#x2F;aarch64.rs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;loadingalias&#x2F;rscrypto&#x2F;blob&#x2F;4e24772a54fef3...</a><p>Look at these section comments that LLMs love (&quot;&#x2F;&#x2F; ─── Rotation helpers ────&quot;)<p>Now you sometimes see these section comments in legacy codebases that have very long files. What you don&#x27;t see people use is U+2500 BOX DRAWINGS LIGHT HORIZONTAL unicode characters padded out just right to look pretty. We humans have regular keyboards, but these AIs are trained to output emojis and pretty unicode.
  • sevenoftwelve52 minutes ago
    Hi @LoadingAlias,<p>&gt; Constant-time MAC, AEAD, and signature verification.<p>That sounds suspiciously incomplete to me.<p>Which cryptographic algorithms in the library are currently <i>not</i> implemented in constant time?<p>Where did the speedup come from? How where these optimizations achieved?<p>What motivated you to write the library? Why not contribute to existing rust crypto libraries instead? How is the work financed?<p>What peer review strategy are you following with the library? Who else but yourself has verified this code?
    • CodesInChaos19 minutes ago
      &quot;Constant-time signature verification&quot; stands out, since unlike signature creation, verification doesn&#x27;t involve secrets, and thus doesn&#x27;t require constant-time in most threat models.
    • sevenoftwelve47 minutes ago
      Why do the different sha2 variants not share code? This seems like a lot of opportunities for small mistakes&#x2F;discrepancies; especially considering the many architectures.<p>Was any of this generated using AI?
  • LoadingALIAS1 hour ago
    I&#x27;ve built rscrypto because crypto kept being where my Rust database stopped being portable: different stack on the server, different target story on WASM, different answer on RISC-V&#x2F;POWER&#x2F;IBM Z, and a different audit surface every time I added a primitive. The supply chain risk, given the landscape we&#x27;re in today, was too high.<p>v0.3.1 is one feature-selected crate. Leaf features when you need one primitive (`sha2`, `rsa`, `aes-gcm`, `ed25519`, etc.) or `full` for the stack. Scope includes SHA-2&#x2F;3, SHAKE, cSHAKE256, BLAKE2, BLAKE3, Ascon hash&#x2F;XOF, XXH3, RapidHash, CRCs, HMAC, KMAC256, HKDF, PBKDF2, Argon2, scrypt, PHC strings, RSA, Ed25519, X25519, AES-128&#x2F;256-GCM, AES-128&#x2F;256-GCM-SIV, ChaCha20-Poly1305, XChaCha20-Poly1305, AEGIS-256, and Ascon-AEAD128.<p>The primitive stack has zero default deps and no C-libs or FFI. Optional `getrandom`, `serde`, and `rayon` features stay out until enabled.<p>The current bench evidence is across nine Linux runners (Intel Sapphire Rapids, Intel Ice Lake, AMD Zen4, AMD Zen5, Graviton3, Graviton4, IBM Z&#x2F;s390x, IBM POWER10&#x2F;ppc64le, RISE RISC-V) and my local Apple MBP M1.<p>Linux vs. fastest-external: 3,545 wins and 5,210 wins-or-ties out of 5,832 comparisons, 1.61x geomean.<p>MBP M1 vs fastest-external: 235 wins and 450 wins-or-ties out of 463 comparisons, 1.25x geomean.<p>BLAKE3 large inputs (`&gt;=64 KiB`) are 2.31x geomean improvement across Linux vs the official `blake3` crate and 1.80x on MBP M1.<p>While it&#x27;s not universally faster - it&#x27;s incredibly close. Current weak spots include PBKDF2-SHA256 setup at `iters=1`, X25519 DH, RSA verification on Arm&#x2F;RISC-V, small-message AEAD rows, MBP M1 BLAKE3 64 KiB rows, HMAC-SHA256 bulk pressure against `aws-lc-rs`, and SHA3-256 streaming on Apple Silicon. The `.&#x2F;benchmark_results&#x2F;OVERVIEW.md` lists the losses next to the wins in more detail.<p>Trust, Testing, Etc: portable Rust is the byte-for-byte authority. SIMD&#x2F;ASM paths are accelerators and are differential tested against the portable path. MAC, AEAD, and signature comparisons are constant-time. Secret-bearing types zeroize on drop. I&#x27;ve got a pretty thorough Miri and Fuzzer testing gate setup, too. The RSA impl has it&#x27;s own CI gate. Codecov = 73.06, fuzzing included.<p>This is not FIPS 140-3 validated, not a TLS stack, not a key store, and not third-party audited yet. I am genuinely interested in a third-party audit and would LOVE to plan for FIPS 140-3 validation, but it&#x27;s just out of my reach right now.<p>The codebase&#x2F;lib is obviously pre-v1 and I&#x27;m asking for public review while API changes are still relatively cheap.<p>Repo: <a href="https:&#x2F;&#x2F;github.com&#x2F;loadingalias&#x2F;rscrypto" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;loadingalias&#x2F;rscrypto</a><p>Crate: <a href="https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;rscrypto" rel="nofollow">https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;rscrypto</a><p>Benches: <a href="https:&#x2F;&#x2F;github.com&#x2F;loadingalias&#x2F;rscrypto&#x2F;blob&#x2F;main&#x2F;benchmark_results&#x2F;OVERVIEW.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;loadingalias&#x2F;rscrypto&#x2F;blob&#x2F;main&#x2F;benchmark...</a><p>Migration Guides: <a href="https:&#x2F;&#x2F;github.com&#x2F;loadingalias&#x2F;rscrypto&#x2F;blob&#x2F;main&#x2F;docs&#x2F;migration&#x2F;README.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;loadingalias&#x2F;rscrypto&#x2F;blob&#x2F;main&#x2F;docs&#x2F;migr...</a><p>Me: <a href="https:&#x2F;&#x2F;x.com&#x2F;loadingalias" rel="nofollow">https:&#x2F;&#x2F;x.com&#x2F;loadingalias</a><p>If you&#x27;re testing, benching, etc. and happen to stumble across inconsistencies, vulnerabilities, etc. - please just reach out directly via &#x27;X&#x27; or use Github&#x27;s Vulnerability Reporting. There are a decent number of people already using the library.<p>Also, the &#x27;fastest-external&#x27; competitors for perf comparisons are almost always one of the following: aws-lc-rs, ring, RustCrypto, dryoc, OpenSSL, Blake3 and&#x2F;or one of the many &#x27;crc-fast&#x2F;fast-crc&#x27; crate variations. I benched these external crates against eachother in the beginning to trace the most performant before hunting inefficiency and cutting out any external deps&#x2F;c-libs. So, if the benches show a 2x geomean over Blake3... that means it&#x27;s over the fastest implementation of Blake3 I could find and bench publicly.