Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Cannot compile 0.3.7 in portable mode #193

Closed
GaroRobe opened this issue Sep 24, 2021 · 4 comments
Closed

Cannot compile 0.3.7 in portable mode #193

GaroRobe opened this issue Sep 24, 2021 · 4 comments
Labels
bug Something isn't working possibly-irrelevant We anticipate this will not be a concern in the near future
Milestone

Comments

@GaroRobe
Copy link

GaroRobe commented Sep 24, 2021

I'm adding dependence on ursa like:
ursa = { version = "=0.3.7", default-features = false, features = ["portable"] }
Only to get the following error:

   Compiling ursa v0.3.7
error[E0432]: unresolved import `amcl::secp256k1`
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:226:15
    |
226 |     use amcl::secp256k1::{ecdh, ecp};
    |               ^^^^^^^^^ could not find `secp256k1` in `amcl`

error[E0433]: failed to resolve: use of undeclared crate or module `signing_key`
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:261:22
    |
261 |             let sk = signing_key::to_bytes();
    |                      ^^^^^^^^^^^ use of undeclared crate or module `signing_key`

error[E0433]: failed to resolve: use of undeclared crate or module `verify_key`
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:263:30
    |
263 |             let compressed = verify_key::to_bytes(); //serialized as compressed point
    |                              ^^^^^^^^^^ use of undeclared crate or module `verify_key`

error[E0433]: failed to resolve: could not find `VerifyKey` in `k256`
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:279:28
    |
279 |             let pk = k256::VerifyKey::from_encoded_point(compressed_pk)
    |                            ^^^^^^^^^ could not find `VerifyKey` in `k256`

error[E0433]: failed to resolve: could not find `SigningKey` in `k256`
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:260:37
    |
260 |             let signing_key = k256::SigningKey::random(&mut OsRng);
    |                                     ^^^^^^^^^^ not found in `k256`
    |
help: consider importing this struct
    |
219 |     use k256::ecdsa::SigningKey;
    |

error[E0433]: failed to resolve: could not find `SigningKey` in `k256`
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:267:37
    |
267 |             let signing_key = k256::SigningKey::new(&sk)
    |                                     ^^^^^^^^^^ not found in `k256`
    |
help: consider importing this struct
    |
219 |     use k256::ecdsa::SigningKey;
    |

error[E0425]: cannot find value `signing_key` in crate `k256`
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:269:34
    |
269 |             let (sig, _) = k256::signing_key.sign(&message);
    |                                  ^^^^^^^^^^^ not found in `k256`

error[E0412]: cannot find type `Signature` in this scope
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:281:22
    |
281 |             let sig: Signature = k256::Signature::from_bytes(signature);
    |                      ^^^^^^^^^ not found in this scope
    |
help: consider importing one of these items
    |
219 |     use bls::Signature;
    |
219 |     use ed25519_dalek::Signature;
    |
219 |     use k256::ecdsa::Signature;
    |
219 |     use k256::ecdsa::recoverable::Signature;
    |
      and 3 other candidates

error[E0433]: failed to resolve: could not find `Signature` in `k256`
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:281:40
    |
281 |             let sig: Signature = k256::Signature::from_bytes(signature);
    |                                        ^^^^^^^^^ not found in `k256`
    |
help: consider importing one of these items
    |
219 |     use bls::Signature;
    |
219 |     use ed25519_dalek::Signature;
    |
219 |     use k256::ecdsa::Signature;
    |
219 |     use k256::ecdsa::recoverable::Signature;
    |
      and 3 other candidates

error[E0425]: cannot find function `verify` in crate `k256`
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:282:22
    |
282 |             Ok(k256::verify(&msg, &sig, &pk))
    |                      ^^^^^^ not found in `k256`
    |
help: consider importing this function
    |
219 |     use amcl::bn254::bls::verify;
    |

error[E0425]: cannot find value `msg` in this scope
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:282:30
    |
282 |             Ok(k256::verify(&msg, &sig, &pk))
    |                              ^^^ not found in this scope

error[E0433]: failed to resolve: could not find `Signature` in `k256`
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:285:33
    |
285 |             let mut sig = k256::Signature::parse(array_ref!(signature, 0, SIGNATURE_SIZE));
    |                                 ^^^^^^^^^ not found in `k256`
    |
help: consider importing one of these items
    |
219 |     use bls::Signature;
    |
219 |     use ed25519_dalek::Signature;
    |
219 |     use k256::ecdsa::Signature;
    |
219 |     use k256::ecdsa::recoverable::Signature;
    |
      and 3 other candidates

error[E0599]: no method named `input` found for struct `sha2::Sha256` in the current scope
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/bn/rust.rs:495:20
    |
495 |             hasher.input(&num);
    |                    ^^^^^ method not found in `sha2::Sha256`

error[E0599]: no method named `result` found for struct `sha2::Sha256` in the current scope
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/bn/rust.rs:498:19
    |
498 |         Ok(hasher.result().as_slice().to_vec())
    |                   ^^^^^^ method not found in `sha2::Sha256`

error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:33:16
    |
33  |         self.0.keypair::<sha2::Sha256>(option)
    |                ^^^^^^^---------------- help: remove these generics
    |                |
    |                expected 0 generic arguments
    |
note: associated function defined here, with 0 generic parameters
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:256:16
    |
256 |         pub fn keypair(
    |                ^^^^^^^

error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:36:16
    |
36  |         self.0.sign::<sha2::Sha256>(message, sk)
    |                ^^^^---------------- help: remove these generics
    |                |
    |                expected 0 generic arguments
    |
note: associated function defined here, with 0 generic parameters
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:266:16
    |
266 |         pub fn sign(&self, message: &[u8], sk: &PrivateKey) -> Result<Vec<u8>, CryptoError> {
    |                ^^^^

error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:44:16
    |
44  |         self.0.verify::<sha2::Sha256>(message, signature, pk)
    |                ^^^^^^---------------- help: remove these generics
    |                |
    |                expected 0 generic arguments
    |
note: associated function defined here, with 0 generic parameters
   --> /home/garorobe/.cargo/registry/src/github.com-1ecc6299db9ec823/ursa-0.3.7/src/signatures/secp256k1.rs:272:16
    |
272 |         pub fn verify(
    |                ^^^^^^

Some errors have detailed explanations: E0107, E0412, E0425, E0432, E0433, E0599.
For more information about an error, try `rustc --explain E0107`.
error: could not compile `ursa` due to 17 previous errors

Is there something I'm missing maybe or it's planned to fix?

@brianorwhatever
Copy link

I am getting this issue as well. @mikelodder7 would you be able to help me get this portable build working easily or is there big problems here?

@txq-bug
Copy link

txq-bug commented Jun 28, 2022

i want to know if replace libsecp256k1 with k256 crate, will this change affect oher work?

@brentzundel brentzundel added bug Something isn't working possibly-irrelevant We anticipate this will not be a concern in the near future labels Feb 1, 2023
@brentzundel brentzundel added this to the v1.0 milestone Feb 1, 2023
@berendsliedrecht
Copy link
Contributor

This should be fixed by #217

@appetrosyan
Copy link
Contributor

Indeed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working possibly-irrelevant We anticipate this will not be a concern in the near future
Development

No branches or pull requests

6 participants