perf(crypto): vectorized BLAKE3 / LtHash and cached key parsing #112
Labels
No labels
breaking-change
bug
documentation
duplicate
enhancement
good first issue
help wanted
performance
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Grandiras/ATProto.NET#112
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of the v0.7.0 update cycle. The CPU cost of Spaces syncing and signature verification.
Scope
Vector256<uint>, with a scalar fallback. A prototype measured 11.9 µs → 0.72 µs (16.6×) for 2048 B of output.Vector256<ushort>overMemoryMarshal.Castof the XOF output (little-endian, with a scalar fallback). A prototype measuredLtHash.Addat 13.1 µs → 0.77 µs (17×) with 0 B allocated. A 10k-recordSpaceRepoCommit.FromIndexdrops from 131 ms to about 8 ms.did:keypublic keys (bounded, keyed by the did:key string). Make the curve parametersstatic readonly, precompute the square-root exponent, decode Base58 into a span, and stopIsLowSallocating. A P-256 verify measured 90 µs → 41 µs.AtProtoCrypto:AtProtoKey.GetCompressedPublicKeyvsCompressPublicKey;DecompressPointre-deriving the curve from OIDs; repeated OID literals;FromMultikeyrepeatingMultibaseToBytes; and the curve→JWSalgmapping written twice (ServiceAuthGenerator,SpaceTokens), which becomes one helper.Blake3.KeyLen.Tests
atproto-interop-testscrypto fixtures (w3c_didkey_P256.json,w3c_didkey_K256.json,signature-fixtures.json), including low-S/high-S cases.K256_GenerateAndSign_IfSupported, which passes silently onPlatformNotSupportedException.Acceptance