dalek-cryptography / x25519-dalek

X25519 elliptic curve Diffie-Hellman key exchange in pure-Rust, using curve25519-dalek.
BSD 3-Clause "New" or "Revised" License
328 stars 133 forks source link

Version 1.2.0 doesn't compile (method cannot be called on `MontgomeryPoint` due to unsatisfied trait bounds) #83

Open Revertron opened 2 years ago

Revertron commented 2 years ago

Please, see this PR checks: https://github.com/Revertron/Alfis/pull/163/checks?check_run_id=3716024097 And here is a copy:

   Compiling x25519-dalek v1.2.0
     Running `rustc --crate-name x25519_dalek --edition=2018 /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/x25519-dalek-1.2.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=on --cfg 'feature="default"' --cfg 'feature="std"' --cfg 'feature="u64_backend"' -C metadata=baaddb637a5d6d32 -C extra-filename=-baaddb637a5d6d32 --out-dir /home/runner/work/Alfis/Alfis/target/debug/deps -L dependency=/home/runner/work/Alfis/Alfis/target/debug/deps --extern curve25519_dalek=/home/runner/work/Alfis/Alfis/target/debug/deps/libcurve25519_dalek-8ade5031273b1cae.rmeta --extern rand_core=/home/runner/work/Alfis/Alfis/target/debug/deps/librand_core-b12315593518f00b.rmeta --extern zeroize=/home/runner/work/Alfis/Alfis/target/debug/deps/libzeroize-bc125cf8446a0177.rmeta --cap-lints allow`
error[E0599]: the method `is_identity` exists for struct `MontgomeryPoint`, but its trait bounds were not satisfied
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/x25519-dalek-1.2.0/src/x25519.rs:265:17
    |
265 |         !self.0.is_identity()
    |                 ^^^^^^^^^^^ method cannot be called on `MontgomeryPoint` due to unsatisfied trait bounds
    | 
   ::: /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/curve25519-dalek-3.1.0/src/montgomery.rs:71:1
    |
71  | pub struct MontgomeryPoint(pub [u8; 32]);
    | -----------------------------------------
    | |
    | doesn't satisfy `MontgomeryPoint: Identity`
    | doesn't satisfy `MontgomeryPoint: IsIdentity`
    |
    = note: the following trait bounds were not satisfied:
            `MontgomeryPoint: Identity`
            which is required by `MontgomeryPoint: IsIdentity`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `x25519-dalek` due to previous error

Caused by:
  process didn't exit successfully: `rustc --crate-name x25519_dalek --edition=2018 /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/x25519-dalek-1.2.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=on --cfg 'feature="default"' --cfg 'feature="std"' --cfg 'feature="u64_backend"' -C metadata=baaddb637a5d6d32 -C extra-filename=-baaddb637a5d6d32 --out-dir /home/runner/work/Alfis/Alfis/target/debug/deps -L dependency=/home/runner/work/Alfis/Alfis/target/debug/deps --extern curve25519_dalek=/home/runner/work/Alfis/Alfis/target/debug/deps/libcurve25519_dalek-8ade5031273b1cae.rmeta --extern rand_core=/home/runner/work/Alfis/Alfis/target/debug/deps/librand_core-b12315593518f00b.rmeta --extern zeroize=/home/runner/work/Alfis/Alfis/target/debug/deps/libzeroize-bc125cf8446a0177.rmeta --cap-lints allow` (exit status: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed
Ryanmtate commented 2 years ago

try to update curve25519-dalek to v3.2.0

teor2345 commented 2 years ago

try to update curve25519-dalek to v3.2.0

We also had this issue, it seems like x25519-dalek 1.2.0's dependency on curve25519-dalek should be 3.1 or 3.2.