Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-exponentiation #248

Merged
merged 22 commits into from
Nov 18, 2023
Merged

Multi-exponentiation #248

merged 22 commits into from
Nov 18, 2023

Conversation

ycscaly
Copy link
Contributor

@ycscaly ycscaly commented Jun 7, 2023

Resolves #250

@ycscaly ycscaly marked this pull request as ready for review November 13, 2023 23:01
@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 13, 2023

@tarcieri

@tarcieri tarcieri requested a review from fjarri November 16, 2023 15:33
…undedExp` traits for `Residue`, `DynResidue`
@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 16, 2023

@tarcieri can you help me figure out the build problems? I think its due to my changes

@tarcieri
Copy link
Member

@ycscaly looks like you did a cargo update or something. Try resetting Cargo.lock?

@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 16, 2023

@tarcieri can you help me figure out the build problems? I think its due to my changes

Yeah. Because I can't compile against the Cargo.lock from main. I resetted and the CI is green whilst locally I can't run the code

@tarcieri
Copy link
Member

What's the local error?

@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 16, 2023

What's the local error?

On Mac M1

error[E0635]: unknown feature `proc_macro_span_shrink`
  --> /Users/jcscaly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.51/src/lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^

@tarcieri
Copy link
Member

What Rust version are you using?

@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 16, 2023

What Rust version are you using?

➜  crypto-bigint git:(multiexp) ✗ cargo --version
cargo 1.75.0-nightly (b4d18d4bd 2023-10-31)
➜  crypto-bigint git:(multiexp) ✗ rustup --version
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.75.0-nightly (9d83ac217 2023-10-31)`
➜  crypto-bigint git:(multiexp) ✗

@tarcieri
Copy link
Member

Yeah, that seems like a nightly regression. Try stable?

@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 17, 2023

Yeah, that seems like a nightly regression. Try stable?

works, had rust-toolchain set to nightly for some reason. So the current code is fine to be merged by me.

src/traits.rs Outdated Show resolved Hide resolved
@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 17, 2023

@tarcieri OK I did so, but couldn't use const_assert in the alloc function, so used assert.

Co-authored-by: Tony Arcieri <bascule@gmail.com>
src/traits.rs Outdated Show resolved Hide resolved
src/traits.rs Outdated Show resolved Hide resolved
@tarcieri tarcieri merged commit 5a990d5 into RustCrypto:master Nov 18, 2023
15 checks passed
@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 18, 2023

Thanks!

@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 18, 2023

@tarcieri are we too late for the release?

@tarcieri
Copy link
Member

Nope, though I'd like to get #277 in as well

@tarcieri tarcieri mentioned this pull request Nov 18, 2023
tarcieri added a commit that referenced this pull request Nov 27, 2023
Initial support for modular exponentiation, adapted from the original
implementation of `pow_montgomery_form` this crate used prior to #248:

https://github.com/RustCrypto/crypto-bigint/blob/4838fd96e1bde8b0c5e0ce691c366c7ec930e466/src/uint/modular/pow.rs

Proptested against `num_bigint::BitUint::modpow`.
@tarcieri tarcieri mentioned this pull request Nov 27, 2023
tarcieri added a commit that referenced this pull request Nov 28, 2023
Initial support for modular exponentiation, adapted from the original
implementation of `pow_montgomery_form` this crate used prior to #248:

https://github.com/RustCrypto/crypto-bigint/blob/4838fd96e1bde8b0c5e0ce691c366c7ec930e466/src/uint/modular/pow.rs

Proptested against `num_bigint::BitUint::modpow`.
zeevmoney pushed a commit to dwallet-labs/tiresias that referenced this pull request Jan 8, 2024
After [upstreaming our multi-exponentiation code to
crypto-bigint](RustCrypto/crypto-bigint#248),
this PR updates the crypto-bigint version and removes the local
`multiexp` module in its favor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi-Exponentiation
2 participants