Repository navigation
fast modular arithmetic (montgomery multiplication) - #3
Merged
Merged
Conversation
- introduce new `engine-montgomery` crate implementing a 512-bit fixed-width montgomery multiplication backend for qpow mining. - mirror `cpu-fast` engine behavior and metrics for direct comparison. - add runtime backend selection with portable and x86_64 bmi2/adx kernels. - expose `--engine cpu-montgomery` cli option in miner-cli. - integrate engine and metrics support in miner-service with feature gating. - add engine backend info metric for observability and a/b testing.
Implement CIOS multiplication using MULX, ADCX, and ADOX instructions for x86_64 with BMI2 and ADX features detected at runtime. Fall back to other implementations when features are unavailable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nper job allows Montgomery form.crypto-bigint) or implement custom 8×64-bit Montgomery mul/reduction.R = 2^(word_size*limbs) mod n,R^2 mod n, andn'(Montgomery inverse).y,min Montgomery domain:m_hat = m * R^2 mod n,y0_hat = mod_pow(m, h + start_nonce, n) in Montgomeryor transform after standard pow.y_hat = montgomery_mul(y_hat, m_hat, n, n').