-
Notifications
You must be signed in to change notification settings - Fork 43
Description
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)