PAKEs icon indicating copy to clipboard operation
PAKEs copied to clipboard

srp: `no_alloc` support

Open tarcieri opened this issue 1 month ago • 0 comments

The srp crate was recently migrated to crypto-bigint in #229.

crypto-bigint supports rich stack-allocated types which should work fine with the fix-sized groups in SRP, which we already model as separate types per-group.

The main problem right now is although crypto-bigint has a generic modpow implementation as of RustCrypto/crypto-bigint#988, we haven't actually wired that up for stack-allocated Montgomery form types like MontyForm and ConstMontyForm.

Once that upstream work happens in crypto-bigint we can consider switching over to stack-allocated integers wholesale, e.g. we could represent group parameters as ConstMontyParams and store g in ConstMontyForm, which would eliminate the runtime Montgomery parameter computation that happens when you create srp::Client or srp::Server today.

(sidebar: we could potentially even do that today actually, then convert to BoxedMontyParams when the client or server are initialized)

tarcieri avatar Jan 13 '26 19:01 tarcieri