Skip to content

Multi-exponentiation#248

Merged
tarcieri merged 22 commits into
RustCrypto:masterfrom
ycscaly:multiexp
Nov 18, 2023
Merged

Multi-exponentiation#248
tarcieri merged 22 commits into
RustCrypto:masterfrom
ycscaly:multiexp

Conversation

@ycscaly

@ycscaly ycscaly commented Jun 7, 2023

Copy link
Copy Markdown
Contributor

Resolves #250

@ycscaly ycscaly marked this pull request as draft June 11, 2023 14:38
@ycscaly ycscaly marked this pull request as ready for review November 13, 2023 23:01
@ycscaly

ycscaly commented Nov 13, 2023

Copy link
Copy Markdown
Contributor Author

@tarcieri

Comment thread src/uint/modular/constant_mod/const_pow.rs Outdated
@tarcieri tarcieri requested a review from fjarri November 16, 2023 15:33
…undedExp` traits for `Residue`, `DynResidue`
Comment thread src/uint/modular/runtime_mod/runtime_pow.rs Outdated
Comment thread src/uint/modular/runtime_mod/runtime_pow.rs Outdated
@ycscaly ycscaly requested a review from tarcieri November 16, 2023 17:56
@ycscaly

ycscaly commented Nov 16, 2023

Copy link
Copy Markdown
Contributor Author

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

@tarcieri

Copy link
Copy Markdown
Member

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

@ycscaly

ycscaly commented Nov 16, 2023

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
Member

What's the local error?

@ycscaly

ycscaly commented Nov 16, 2023

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Member

What Rust version are you using?

@ycscaly

ycscaly commented Nov 16, 2023

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Member

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

@ycscaly

ycscaly commented Nov 17, 2023

Copy link
Copy Markdown
Contributor Author

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.

Comment thread src/traits.rs Outdated
Comment thread src/uint/modular/runtime_mod/runtime_pow.rs Outdated
@ycscaly

ycscaly commented Nov 17, 2023

Copy link
Copy Markdown
Contributor Author

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

Comment thread src/uint/modular/runtime_mod/runtime_pow.rs Outdated
Co-authored-by: Tony Arcieri <bascule@gmail.com>
Comment thread src/traits.rs Outdated
Comment thread src/traits.rs Outdated
@tarcieri tarcieri merged commit 5a990d5 into RustCrypto:master Nov 18, 2023
@ycscaly

ycscaly commented Nov 18, 2023

Copy link
Copy Markdown
Contributor Author

Thanks!

@ycscaly

ycscaly commented Nov 18, 2023

Copy link
Copy Markdown
Contributor Author

@tarcieri are we too late for the release?

@tarcieri

Copy link
Copy Markdown
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`.
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