From 3ee112d4b980d6b62010b18a4107bad4720cbd8c Mon Sep 17 00:00:00 2001 From: moana Date: Thu, 4 Jan 2024 15:38:52 +0100 Subject: [PATCH 1/2] jubjub-schnorr: Initial commit This package continues the development of [dusk-schnorr] (at version `0.18.0`) under the new name: jubjub-schnorr. [dusk-schnorr]: https://github.com/dusk-network/schnorr/ --- .github/workflows/dusk_ci.yaml | 14 +- CHANGELOG.md | 286 +---------------------------- Cargo.toml | 6 +- README.md | 14 +- benches/signature.rs | 2 +- benches/signature_double.rs | 2 +- benches/signature_var_generator.rs | 4 +- src/keys/public.rs | 6 +- src/keys/secret.rs | 10 +- src/signatures.rs | 6 +- tests/gadgets.rs | 6 +- tests/keys.rs | 6 +- tests/schnorr.rs | 2 +- tests/schnorr_double.rs | 2 +- tests/schnorr_var_generator.rs | 2 +- 15 files changed, 45 insertions(+), 323 deletions(-) diff --git a/.github/workflows/dusk_ci.yaml b/.github/workflows/dusk_ci.yaml index e1cb40f..63364e3 100644 --- a/.github/workflows/dusk_ci.yaml +++ b/.github/workflows/dusk_ci.yaml @@ -18,7 +18,7 @@ jobs: name: Build Benchmarks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - run: cargo bench --no-run --features=double,var_generator @@ -28,17 +28,17 @@ jobs: with: test_flags: --features=double,var_generator - test_nightly_std_double: - name: Nightly tests std + test_nightly_std_double_compiles: + name: Nightly std feature=double tests compile uses: dusk-network/.github/.github/workflows/run-tests.yml@main with: - test_flags: --features=var_generator + test_flags: --features=double --no-run - test_nightly_std_var_generator: - name: Nightly tests std + test_nightly_std_var_generator_compiles: + name: Nightly std feature=var_generator tests compile uses: dusk-network/.github/.github/workflows/run-tests.yml@main with: - test_flags: --features=double + test_flags: --features=var_generator --no-run test_nightly_no_std: name: Nightly tests no_std diff --git a/CHANGELOG.md b/CHANGELOG.md index e331899..e73e160 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,292 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.18.0] - 2024-01-03 - -### Changed - -- Update `dusk-plonk` -> 0.19 -- Update `dusk-poseidon` -> 0.33 - -## [0.17.0] - 2023-12-13 - -### Changed - -- Move `verify` method to the public key structs [#81] -- Rename `PublicKeyPair` to `PublicKeyDouble` [#110] -- Rename `sign-single` to `sign` [#110] -- Restructure code internally [#110] -- Rename `DoubleSignature` to `SignatureDouble` [#107] -- Rename gadgets [#107]: - - `single_key_verify` -> `verify_signature` - - `double_key_verify` -> `verify_signature_double` -- Replace `HexDebug` trait by `Debug` for `SecretKey` and `PublicKey` [#107] -- Derive `PartialEq` trait instead of implementing it manually [#107] -- Derive `PartialEq` for `PublicKeyDouble` [#107] -- Update `dusk-bls12_381` -> 0.13 -- Update `dusk-jubjub` -> 0.14 -- Update `dusk-plonk` -> 0.18 -- Update `dusk-poseidon` -> 0.32 - -### Added - -- Add `from_raw_unchecked` to `PublicKeyDouble` [#81] -- Add latex documentation of the signature scheme to the README [#110] -- Add `SecretKeyVarGen`, `PublicKeyVarGen` and `SignatureVarGen` [#107] -- Add "double" feature for `SignatureDouble` [#107] -- Add "var_generator" feature for `SignatureVarGen` [#107] -- Add gadget `verify_signature_var_gen` [#107] -- Add `ff` dependency - -## [0.16.0] - 2023-11-22 - -### Added - -- Update README with keys structure [#104] -- Add documentation to the new key structs [#105] - -### Changed - -- Change the NotePublicKey tuple struct to directly be a tuple with two fields [#111] -- Change double and single signature creation to be a method on `NoteSecretKey` [#81] -- Rename internal `key_variants` module to `signatures` [#96] -- Rename the signatures method `to_witness` to `append` [#99] -- Update benchmarks to latest version of plonk [#94] -- Update test structure [#94] -- Move `PublicKeyPair` from `DoubleSignature` to `public_keys` [#95] -- Rename keys: `NoteSecretKey` -> `SecretKey`, `NotePublicKey` -> `PublicKey` [#108] - -### Removed - -- Hide `(Double)Signature::new()` from the public API [#81] - -## [0.15.0] - 2023-11-1 - -### Added - -- Move `SecretKey` & `PublicKey` from dusk_pki and renamed them to `NoteSecretKey` & `NotePublicKey` [#80] -- Add lib and module level documentation [#49] - -### Changed - -- Rename `double_key::Proof` struct to `double_key::Signature` [#89] -- Deprecate `Proof` public struct [#89] -- Re-export `double_key::Proof` as `DoubleSignature` [#89] - -## [0.14.0] - 2023-10-12 - -### Changed - -- Update `dusk-bls12_381` from `0.11` to `0.12` -- Update `dusk-jubjub` from `0.12` to `0.13` -- Update `dusk-pki` from `0.12` to `0.13` -- Update `dusk-poseidon` from `0.30` to `0.31` -- Update `dusk-plonk` from `0.14` to `0.16` - -### Added - -- Add `ff` dev-dependency - -### Removed - -- Remove `canonical` and `canonical_derive` dependencies -- Remove `canon` feature - -## [0.13.0] - 2023-06-28 - -### Changed - -- Update `dusk-pki` from `0.11` to `0.12` -- Update `dusk-poseidon` from `0.28` to `0.30` -- Update `dusk-plonk` from `0.13` to `0.14` -- Update `rust-toolchain` from `nightly-2022-08-08` to `nightly-2023-05-22` - -## [0.12.1] - 2022-12-19 - -### Added - -- Derive `Default` for `Signature` and `Proof` - -## [0.12.0] - 2022-10-27 - -### Changed - -- Update `dusk-plonk` from `0.12` to `0.13` -- Update `dusk-poseidon` from `0.26` to `0.28` - -## [0.11.1] - 2022-10-19 - -### Added - -- Add support for `rkyv-impl` under `no_std` - -## [0.11.0] - 2022-08-17 - -### Added - -- Add `CheckBytes` impl for `rkyv`ed structs -- Add `rkyv` implementations behind feature [#69] - -### Changed - -- Update dusk-poseidon from `0.23.0-rc` to `0.26` -- Update dusk-pki from `0.9.0-rc` to `0.11` -- Update dusk-plonk from `0.9` to `0.12` -- Update dusk-bls12_381 from `0.8` to `0.11` -- Update dusk-jubjub from `0.10` to `0.12` -- Update canonical from `0.6` to `0.7` -- Update canonical_derive from `0.6` to `0.7` - -## Fixed - -- Fix KeyPair serialization - -## [0.8.0-rc] - -### Changed - -- Update `dusk-poseidon` from `0.21` to `0.22.0-rc` [#59] -- Update `dusk-pki` from `0.7` to `0.8.0-rc` [#59] - -## [0.7.0] - 2021-06-02 - -### Added - -- Add `default-features=false` to `rand_core` [#52] - -### Changed - -- Update `canonical` from `0.5` to `0.6` [#41] -- Update `dusk-plonk` from `0.6` to `0.8` [#41] -- Update `dusk-poseidon` from `0.18` to `0.21.0-rc` [#41] -- Update `dusk-pki` from `0.6` to `0.7` [#41] -- Change crate name from `schnorr` to `dusk-schnorr` [#41] -- Change default crate featureset to be `alloc`. [#50] - -### Removed - -- Remove one hashing level for `message` in signature processing [#55] -- Remove `anyhow` from dependencies [#50] - -## [0.6.0] - 2021-04-06 - -### Changed - -- Update `dusk-plonk` from `0.6` to `0.7` [#37] -- Update `dusk-poseidon` from `0.19` to `0.20` [#37] - -## [0.5.2] - 2021-02-15 - -### Changed - -- Update `dusk-pki` to pull from crates.io - -## [0.5.1] - 2021-02-11 - -### Changed - -- Update `dusk-pki` `v0.6.0` - -## [0.5.0] - 2021-02-11 - -### Changed - -- Update `poseidon252` to `dusk-poseidon` `v0.18` - -## [0.4.1] - 2021-02-09 - -### Changed - -- Bump `dusk-pki` to `v0.5.3` - -## [0.4.0] - 2021-01-29 +## [0.1.0] - 2024-01-08 ### Added -- `PublicKeyPair` attributes R and R_prime exposed as methods -- `Proof::keys` added to fetch `PublicKeyPair` - -### Changed - -- JubJubScalars renamed from `U` to `u`, as in notation standards -- Bump `poseidon252` to `v0.17.0` -- Bump `dusk-pki` to `v0.5.1` - -## [0.3.0] - 2021-01-28 - -### Added - -- Add `dusk_bytes::Serializable` trait to structure -- Add dusk_pki's `SecretKey` and `PublicKey` - -### Removed - -- Remove manual implementation of `to_bytes` and `from_bytes` -- Remove `SecretKey`, `PublicKey` from `schnorr` -- Remove `Error` schnorr enum - -### Changed - -- `single_key::SecretKey.sign` method is now `Signature::new` -- `double_key::SecretKey.sign` method is now `Proof::new` -- Change return value of single's key `verify` from `Result` to `bool` -- Change return value of double's key `verify` from `Result` to `bool` -- Update CHANGELOG to ISO 8601 -- Bump `poseidon252` to `v0.16.0` -- Bump `dusk-bls12_381` to `v0.6` -- Bump `dusk-jubjub` to `v0.8` -- Bump `dusk-plonk` to `v0.5` -- Bump `canonical` to `v0.5` -- Bump `canonical_derive` to `v0.5` - -## [0.2.1] - 2021-01-08 - -### Fixes - -- Fix byte truncation for BLS -> JubJub conversion +- Add initial commit, this package continues the development of [dusk-schnorr](https://github.com/dusk-network/schnorr/) at version `0.18.0` under the new name: jubjub-schnorr -[#111]: https://github.com/dusk-network/schnorr/issues/111 -[#110]: https://github.com/dusk-network/schnorr/issues/110 -[#108]: https://github.com/dusk-network/schnorr/issues/108 -[#105]: https://github.com/dusk-network/schnorr/issues/105 -[#104]: https://github.com/dusk-network/schnorr/issues/104 -[#99]: https://github.com/dusk-network/schnorr/issues/99 -[#96]: https://github.com/dusk-network/schnorr/issues/96 -[#95]: https://github.com/dusk-network/schnorr/issues/95 -[#94]: https://github.com/dusk-network/schnorr/issues/94 -[#89]: https://github.com/dusk-network/schnorr/issues/89 -[#81]: https://github.com/dusk-network/schnorr/issues/81 -[#80]: https://github.com/dusk-network/schnorr/issues/80 -[#69]: https://github.com/dusk-network/schnorr/issues/69 -[#59]: https://github.com/dusk-network/schnorr/issues/59 -[#55]: https://github.com/dusk-network/schnorr/issues/55 -[#52]: https://github.com/dusk-network/schnorr/issues/52 -[#50]: https://github.com/dusk-network/schnorr/issues/50 -[#49]: https://github.com/dusk-network/schnorr/issues/49 -[#41]: https://github.com/dusk-network/schnorr/issues/41 -[#37]: https://github.com/dusk-network/schnorr/issues/37 -[Unreleased]: https://github.com/dusk-network/schnorr/compare/v0.18.0...HEAD -[0.18.0]: https://github.com/dusk-network/schnorr/compare/v0.17.0...v0.18.0 -[0.17.0]: https://github.com/dusk-network/schnorr/compare/v0.16.0...v0.17.0 -[0.16.0]: https://github.com/dusk-network/schnorr/compare/v0.15.0...v0.16.0 -[0.15.0]: https://github.com/dusk-network/schnorr/compare/v0.14.0...v0.15.0 -[0.14.0]: https://github.com/dusk-network/schnorr/compare/v0.13.0...v0.14.0 -[0.13.0]: https://github.com/dusk-network/schnorr/compare/v0.12.1...v0.13.0 -[0.12.1]: https://github.com/dusk-network/schnorr/compare/v0.12.0...v0.12.1 -[0.12.0]: https://github.com/dusk-network/schnorr/compare/v0.11.1...v0.12.0 -[0.11.1]: https://github.com/dusk-network/schnorr/compare/v0.11.0...v0.11.1 -[0.11.0]: https://github.com/dusk-network/schnorr/compare/v0.7.0...v0.11.0 -[0.7.0]: https://github.com/dusk-network/schnorr/compare/v0.6.0...v0.7.0 -[0.6.0]: https://github.com/dusk-network/schnorr/compare/v0.5.2...v0.6.0 -[0.5.2]: https://github.com/dusk-network/schnorr/compare/v0.5.1...v0.5.2 -[0.5.1]: https://github.com/dusk-network/schnorr/compare/v0.5.0...v0.5.1 -[0.5.0]: https://github.com/dusk-network/schnorr/compare/v0.4.1...v0.5.0 -[0.4.1]: https://github.com/dusk-network/schnorr/compare/v0.4.0...v0.4.1 -[0.4.0]: https://github.com/dusk-network/schnorr/compare/v0.3.0...v0.4.0 -[0.3.0]: https://github.com/dusk-network/schnorr/compare/v0.2.1...v0.3.0 -[0.2.1]: https://github.com/dusk-network/schnorr/compare/v0.2.0...v0.2.1 -[0.2.0]: https://github.com/dusk-network/schnorr/compare/v0.1.0...v0.2.0 -[0.1.0]: https://github.com/dusk-network/schnorr/releases/tag/v0.1.0 +[Unreleased]: https://github.com/dusk-network/jubjub-schnorr/compare/v0.1.0...HEAD +[0.1.0]: https://github.com/dusk-network/jubjub-schnorr/releases/tag/v0.1.0 diff --git a/Cargo.toml b/Cargo.toml index 7bb3790..090d59c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "dusk-schnorr" -version = "0.18.0" +name = "jubjub-schnorr" +version = "0.1.0" edition = "2021" readme = "README.md" -repository = "https://github.com/dusk-network/schnorr" +repository = "https://github.com/dusk-network/jubjub-schnorr" keywords = ["cryptography", "schnorr", "zk-snarks", "zero-knowledge", "signatures"] categories =["algorithms", "cryptography", "mathematics"] description = "A pure-Rust implementation of Schnorr signatures with a PLONK circuit module additionally" diff --git a/README.md b/README.md index fd3d716..61151bf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# dusk-schnorr +# jubjub-schnorr ![Build Status](https://github.com/dusk-network/schnorr/workflows/Continuous%20integration/badge.svg) [![Repository](https://img.shields.io/badge/github-schnorr-blueviolet?logo=github)](https://github.com/dusk-network/schnorr) [![Documentation](https://img.shields.io/badge/docs-schnorr-blue?logo=rust)](https://docs.rs/schnorr/) @@ -113,15 +113,15 @@ The implemented signature scheme is existentially unforgeable under chosen-messa While the basic Schnorr signature scheme is a widely recognized construct, the double-key variant as employed by Phoenix is a novel introduction. In the context of the transaction protocol, this allows for the delegation of proof computations without compromising the confidentiality of the signer's secret key. ## Usage -To integrate the `dusk-schnorr` crate into your project, add it with the following command: +To integrate the `jubjub-schnorr` crate into your project, add it with the following command: ```bash -cargo add dusk-schnorr +cargo add jubjub-schnorr ``` A basic example demonstrating how to generate and verify a Schnorr signature: ```rust use dusk_bls12_381::BlsScalar; -use dusk_schnorr::{SecretKey, PublicKey}; +use jubjub_schnorr::{SecretKey, PublicKey}; use rand::rngs::StdRng; use rand::SeedableRng; use ff::Field; @@ -134,7 +134,7 @@ fn main() { // Key generation let sk = SecretKey::random(&mut rng); - // Standard Dusk-Schnorr signature scheme: + // Standard Schnorr signature scheme: let pk = PublicKey::from(&sk); let signature = sk.sign(&mut rng, message); assert!(pk.verify(&signature, message), "The signature should be valid."); @@ -142,7 +142,7 @@ fn main() { // Double Dusk-Schnorr signature scheme: #[cfg(features = "double")] { - let pk = dusk_schnorr::PublicKeyDouble::from(&sk); + let pk = jubjub_schnorr::PublicKeyDouble::from(&sk); let signature = sk.sign_double(&mut rng, message); assert!(pk.verify(&signature, message), "The signature should be valid."); } @@ -152,7 +152,7 @@ fn main() { { let generator = dusk_jubjub::GENERATOR_EXTENDED * JubJubScalar::from(42u64); let sk = sk.with_variable_generator(generator); - let pk = dusk_schnorr::PublicKeyVarGen::from(&sk); + let pk = jubjub_schnorr::PublicKeyVarGen::from(&sk); let signature = sk.sign(&mut rng, message); assert!(pk.verify(&signature, message), "The signature should be valid."); } diff --git a/benches/signature.rs b/benches/signature.rs index 211b7d4..afb8388 100644 --- a/benches/signature.rs +++ b/benches/signature.rs @@ -6,8 +6,8 @@ use criterion::{criterion_group, criterion_main, Criterion}; -use dusk_schnorr::{gadgets, PublicKey, SecretKey, Signature}; use ff::Field; +use jubjub_schnorr::{gadgets, PublicKey, SecretKey, Signature}; use rand::rngs::StdRng; use rand::SeedableRng; diff --git a/benches/signature_double.rs b/benches/signature_double.rs index ebeb3e8..c171e31 100644 --- a/benches/signature_double.rs +++ b/benches/signature_double.rs @@ -6,8 +6,8 @@ use criterion::{criterion_group, criterion_main, Criterion}; -use dusk_schnorr::{gadgets, PublicKeyDouble, SecretKey, SignatureDouble}; use ff::Field; +use jubjub_schnorr::{gadgets, PublicKeyDouble, SecretKey, SignatureDouble}; use rand::rngs::StdRng; use rand::SeedableRng; diff --git a/benches/signature_var_generator.rs b/benches/signature_var_generator.rs index 5789fb6..0ab3182 100644 --- a/benches/signature_var_generator.rs +++ b/benches/signature_var_generator.rs @@ -6,10 +6,10 @@ use criterion::{criterion_group, criterion_main, Criterion}; -use dusk_schnorr::{ +use ff::Field; +use jubjub_schnorr::{ gadgets, PublicKeyVarGen, SecretKeyVarGen, SignatureVarGen, }; -use ff::Field; use rand::rngs::StdRng; use rand::SeedableRng; diff --git a/src/keys/public.rs b/src/keys/public.rs index 944c9f1..b20b4b3 100644 --- a/src/keys/public.rs +++ b/src/keys/public.rs @@ -41,7 +41,7 @@ use rkyv::{Archive, Deserialize, Serialize}; /// /// Generate a [`PublicKey`] from a [`SecretKey`]: /// ``` -/// use dusk_schnorr::{SecretKey, PublicKey}; +/// use jubjub_schnorr::{SecretKey, PublicKey}; /// use dusk_bls12_381::BlsScalar; /// use rand::rngs::StdRng; /// use rand::SeedableRng; @@ -170,7 +170,7 @@ impl PublicKey { /// ``` /// use rand::rngs::StdRng; /// use rand::SeedableRng; -/// use dusk_schnorr::{SecretKey, PublicKeyDouble}; +/// use jubjub_schnorr::{SecretKey, PublicKeyDouble}; /// /// let mut rng = StdRng::seed_from_u64(12345); /// let sk = SecretKey::random(&mut rng); @@ -312,7 +312,7 @@ impl Serializable<64> for PublicKeyDouble { /// /// Generate a [`PublicKeyVarGen`] from a [`SecretKeyVarGen`]: /// ``` -/// use dusk_schnorr::{SecretKeyVarGen, PublicKeyVarGen}; +/// use jubjub_schnorr::{SecretKeyVarGen, PublicKeyVarGen}; /// use dusk_bls12_381::BlsScalar; /// use rand::rngs::StdRng; /// use rand::SeedableRng; diff --git a/src/keys/secret.rs b/src/keys/secret.rs index 8c62ac1..6c827d8 100644 --- a/src/keys/secret.rs +++ b/src/keys/secret.rs @@ -39,7 +39,7 @@ use rkyv::{Archive, Deserialize, Serialize}; /// /// Generate a random `SecretKey`: /// ``` -/// use dusk_schnorr::SecretKey; +/// use jubjub_schnorr::SecretKey; /// use rand::rngs::StdRng; /// use rand::SeedableRng; /// @@ -126,7 +126,7 @@ impl SecretKey { /// Sign a message with a [`SecretKey`] and verify with the respective /// [`PublicKey`]: /// ``` - /// use dusk_schnorr::{SecretKey, PublicKey}; + /// use jubjub_schnorr::{SecretKey, PublicKey}; /// use dusk_jubjub::JubJubScalar; /// use dusk_bls12_381::BlsScalar; /// use rand::rngs::StdRng; @@ -192,7 +192,7 @@ impl SecretKey { /// Double sign a message with a [`SecretKey`] and verify with the /// respective [`PublicKeyDouble`]: /// ``` - /// use dusk_schnorr::{SecretKey, PublicKeyDouble}; + /// use jubjub_schnorr::{SecretKey, PublicKeyDouble}; /// use dusk_jubjub::JubJubScalar; /// use dusk_bls12_381::BlsScalar; /// use rand::rngs::StdRng; @@ -276,7 +276,7 @@ impl SecretKey { /// Generate a random `SecretKey`: /// Generating a random `SecretKeyVarGen` with a variable generator /// ``` -/// use dusk_schnorr::{SecretKey, SecretKeyVarGen}; +/// use jubjub_schnorr::{SecretKey, SecretKeyVarGen}; /// use rand::rngs::StdRng; /// use rand::SeedableRng; /// use dusk_jubjub::{JubJubScalar, GENERATOR_EXTENDED}; @@ -409,7 +409,7 @@ impl SecretKeyVarGen { /// Sign a message with a [`SecretKeyVarGen`] and verify with the respective /// [`PublicKeyVarGen`]: /// ``` - /// use dusk_schnorr::{SecretKeyVarGen, PublicKeyVarGen}; + /// use jubjub_schnorr::{SecretKeyVarGen, PublicKeyVarGen}; /// use dusk_jubjub::JubJubScalar; /// use dusk_bls12_381::BlsScalar; /// use rand::rngs::StdRng; diff --git a/src/signatures.rs b/src/signatures.rs index 1673f47..871bad6 100644 --- a/src/signatures.rs +++ b/src/signatures.rs @@ -29,7 +29,7 @@ use rkyv::{Archive, Deserialize, Serialize}; /// /// ``` /// use dusk_bls12_381::BlsScalar; -/// use dusk_schnorr::{PublicKey, SecretKey, Signature}; +/// use jubjub_schnorr::{PublicKey, SecretKey, Signature}; /// use rand::rngs::StdRng; /// use rand::SeedableRng; /// use ff::Field; @@ -152,7 +152,7 @@ pub(crate) fn challenge_hash( /// ``` /// use rand::rngs::StdRng; /// use rand::SeedableRng; -/// use dusk_schnorr::{SecretKey, PublicKeyDouble, SignatureDouble}; +/// use jubjub_schnorr::{SecretKey, PublicKeyDouble, SignatureDouble}; /// use dusk_bls12_381::BlsScalar; /// use ff::Field; /// @@ -307,7 +307,7 @@ pub(crate) fn challenge_hash_double( /// /// ``` /// use dusk_bls12_381::BlsScalar; -/// use dusk_schnorr::{PublicKeyVarGen, SecretKeyVarGen, SignatureVarGen}; +/// use jubjub_schnorr::{PublicKeyVarGen, SecretKeyVarGen, SignatureVarGen}; /// use rand::rngs::StdRng; /// use rand::SeedableRng; /// use ff::Field; diff --git a/tests/gadgets.rs b/tests/gadgets.rs index 83d1493..3febfab 100644 --- a/tests/gadgets.rs +++ b/tests/gadgets.rs @@ -5,18 +5,18 @@ // Copyright (c) DUSK NETWORK. All rights reserved. use dusk_plonk::prelude::Error as PlonkError; -use dusk_schnorr::{gadgets, PublicKey, SecretKey, Signature}; use ff::Field; +use jubjub_schnorr::{gadgets, PublicKey, SecretKey, Signature}; use rand::rngs::StdRng; use rand::SeedableRng; use dusk_plonk::prelude::*; #[cfg(feature = "double")] -use dusk_schnorr::{PublicKeyDouble, SignatureDouble}; +use jubjub_schnorr::{PublicKeyDouble, SignatureDouble}; #[cfg(feature = "var_generator")] -use dusk_schnorr::{PublicKeyVarGen, SecretKeyVarGen, SignatureVarGen}; +use jubjub_schnorr::{PublicKeyVarGen, SecretKeyVarGen, SignatureVarGen}; lazy_static::lazy_static! { pub static ref PP: PublicParameters = { diff --git a/tests/keys.rs b/tests/keys.rs index bcaaa62..81f1f50 100644 --- a/tests/keys.rs +++ b/tests/keys.rs @@ -5,14 +5,14 @@ // Copyright (c) DUSK NETWORK. All rights reserved. use dusk_jubjub::{JubJubAffine, JubJubExtended, JubJubScalar}; -use dusk_schnorr::{PublicKey, SecretKey}; +use jubjub_schnorr::{PublicKey, SecretKey}; use rand_core::OsRng; #[cfg(feature = "double")] -use dusk_schnorr::PublicKeyDouble; +use jubjub_schnorr::PublicKeyDouble; #[cfg(feature = "var_generator")] -use dusk_schnorr::{PublicKeyVarGen, SecretKeyVarGen}; +use jubjub_schnorr::{PublicKeyVarGen, SecretKeyVarGen}; #[test] #[allow(clippy::eq_op)] diff --git a/tests/schnorr.rs b/tests/schnorr.rs index 32da37d..2cef3d9 100644 --- a/tests/schnorr.rs +++ b/tests/schnorr.rs @@ -6,8 +6,8 @@ use dusk_bls12_381::BlsScalar; use dusk_bytes::Serializable; -use dusk_schnorr::{PublicKey, SecretKey, Signature}; use ff::Field; +use jubjub_schnorr::{PublicKey, SecretKey, Signature}; use rand::rngs::StdRng; use rand::SeedableRng; diff --git a/tests/schnorr_double.rs b/tests/schnorr_double.rs index c91cf80..b804274 100644 --- a/tests/schnorr_double.rs +++ b/tests/schnorr_double.rs @@ -6,8 +6,8 @@ use dusk_bls12_381::BlsScalar; use dusk_bytes::Serializable; -use dusk_schnorr::{PublicKeyDouble, SecretKey, SignatureDouble}; use ff::Field; +use jubjub_schnorr::{PublicKeyDouble, SecretKey, SignatureDouble}; use rand::rngs::StdRng; use rand::SeedableRng; diff --git a/tests/schnorr_var_generator.rs b/tests/schnorr_var_generator.rs index 716f393..3b92874 100644 --- a/tests/schnorr_var_generator.rs +++ b/tests/schnorr_var_generator.rs @@ -6,8 +6,8 @@ use dusk_bls12_381::BlsScalar; use dusk_bytes::Serializable; -use dusk_schnorr::{PublicKeyVarGen, SecretKeyVarGen, SignatureVarGen}; use ff::Field; +use jubjub_schnorr::{PublicKeyVarGen, SecretKeyVarGen, SignatureVarGen}; use rand::rngs::StdRng; use rand::SeedableRng; From b299b3fbac7bf48dfd0446c192692e3cacb0485c Mon Sep 17 00:00:00 2001 From: moana Date: Mon, 8 Jan 2024 12:58:54 +0100 Subject: [PATCH 2/2] Update doc-links --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 61151bf..8a9fd34 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # jubjub-schnorr -![Build Status](https://github.com/dusk-network/schnorr/workflows/Continuous%20integration/badge.svg) -[![Repository](https://img.shields.io/badge/github-schnorr-blueviolet?logo=github)](https://github.com/dusk-network/schnorr) -[![Documentation](https://img.shields.io/badge/docs-schnorr-blue?logo=rust)](https://docs.rs/schnorr/) +![Build Status](https://github.com/dusk-network/jubjub-schnorr/workflows/Continuous%20integration/badge.svg) +[![Repository](https://img.shields.io/badge/github-schnorr-blueviolet?logo=github)](https://github.com/dusk-network/jubjub-schnorr) +[![Documentation](https://img.shields.io/badge/docs-schnorr-blue?logo=rust)](https://docs.rs/jubjub-schnorr/) This crate provides a Rust implementation of the Schnorr signature scheme for the JubJub elliptic curve group, using the Poseidon hash function. This implementation is designed by the [Dusk](https://dusk.network) team.