Skip to content

Commit

Permalink
init create
Browse files Browse the repository at this point in the history
  • Loading branch information
programskillforverification committed Nov 26, 2024
1 parent 6360673 commit 5eb947b
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 0 deletions.
72 changes: 72 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ alloy-sol-macro-expander = { version = "=0.7.6", default-features = false }
alloy-sol-macro-input = { version = "=0.7.6", default-features = false }

const-hex = { version = "1.11.1", default-features = false }
ed25519-zebra = { version = "4.0.3", features = ["pem"] }
eyre = "0.6.8"
keccak-const = "0.2.0"
koba = "0.2.0"
Expand Down
1 change: 1 addition & 0 deletions contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ alloy-sol-types.workspace = true
alloy-sol-macro.workspace = true
alloy-sol-macro-expander.workspace = true
alloy-sol-macro-input.workspace = true
ed25519-zebra.workspace = true
stylus-sdk.workspace = true
keccak-const.workspace = true
openzeppelin-stylus-proc.workspace = true
Expand Down
46 changes: 46 additions & 0 deletions contracts/src/utils/cryptography/ed25519.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//! Edwards Digital Signature Algorithm (EdDSA) over Curve25519.

Check warning on line 1 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / stable / clippy

[clippy] reported by reviewdog 🐶 warning: item in documentation is missing backticks --> contracts/src/utils/cryptography/ed25519.rs:1:42 | 1 | //! Edwards Digital Signature Algorithm (EdDSA) over Curve25519. | ^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 1 | //! Edwards Digital Signature Algorithm (`EdDSA`) over Curve25519. | ~~~~~~~ Raw Output: contracts/src/utils/cryptography/ed25519.rs:1:42:w:warning: item in documentation is missing backticks --> contracts/src/utils/cryptography/ed25519.rs:1:42 | 1 | //! Edwards Digital Signature Algorithm (EdDSA) over Curve25519. | ^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 1 | //! Edwards Digital Signature Algorithm (`EdDSA`) over Curve25519. | ~~~~~~~ __END__

Check warning on line 1 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / beta / clippy

[clippy] reported by reviewdog 🐶 warning: item in documentation is missing backticks --> contracts/src/utils/cryptography/ed25519.rs:1:42 | 1 | //! Edwards Digital Signature Algorithm (EdDSA) over Curve25519. | ^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 1 | //! Edwards Digital Signature Algorithm (`EdDSA`) over Curve25519. | ~~~~~~~ Raw Output: contracts/src/utils/cryptography/ed25519.rs:1:42:w:warning: item in documentation is missing backticks --> contracts/src/utils/cryptography/ed25519.rs:1:42 | 1 | //! Edwards Digital Signature Algorithm (EdDSA) over Curve25519. | ^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 1 | //! Edwards Digital Signature Algorithm (`EdDSA`) over Curve25519. | ~~~~~~~ __END__
//!
//! These functions can be used to implement ed25519 key generation,
//! signing, and verification.
use alloc::vec::Vec;

use ed25519_zebra::{
ed25519::PublicKeyBytes, Signature, SigningKey, VerificationKey,
};

type Seed = [u8; 32];
type Public = PublicKeyBytes;

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / stable / clippy

[clippy] reported by reviewdog 🐶 warning: type alias `Public` is never used --> contracts/src/utils/cryptography/ed25519.rs:12:6 | 12 | type Public = PublicKeyBytes; | ^^^^^^ | = note: `#[warn(dead_code)]` on by default Raw Output: contracts/src/utils/cryptography/ed25519.rs:12:6:w:warning: type alias `Public` is never used --> contracts/src/utils/cryptography/ed25519.rs:12:6 | 12 | type Public = PublicKeyBytes; | ^^^^^^ | = note: `#[warn(dead_code)]` on by default __END__

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / wasm32-unknown-unknown

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / beta / clippy

[clippy] reported by reviewdog 🐶 warning: type alias `Public` is never used --> contracts/src/utils/cryptography/ed25519.rs:12:6 | 12 | type Public = PublicKeyBytes; | ^^^^^^ | = note: `#[warn(dead_code)]` on by default Raw Output: contracts/src/utils/cryptography/ed25519.rs:12:6:w:warning: type alias `Public` is never used --> contracts/src/utils/cryptography/ed25519.rs:12:6 | 12 | type Public = PublicKeyBytes; | ^^^^^^ | = note: `#[warn(dead_code)]` on by default __END__

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / beta

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / beta

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / features

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / features

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / features

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / features

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / Check WASM binary

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / coverage

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / macos-latest / stable

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / Gas usage report

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / Gas usage report

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / tests

type alias `Public` is never used

Check warning on line 12 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / tests

type alias `Public` is never used

/// A key pair.
#[derive(Copy, Clone)]
pub struct Pair {

Check warning on line 16 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / stable / clippy

[clippy] reported by reviewdog 🐶 warning: field `public` is never read --> contracts/src/utils/cryptography/ed25519.rs:17:5 | 16 | pub struct Pair { | ---- field in this struct 17 | public: VerificationKey, | ^^^^^^ | = note: `Pair` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis Raw Output: contracts/src/utils/cryptography/ed25519.rs:16:12:w:warning: field `public` is never read --> contracts/src/utils/cryptography/ed25519.rs:17:5 | 16 | pub struct Pair { | ---- field in this struct 17 | public: VerificationKey, | ^^^^^^ | = note: `Pair` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis __END__

Check warning on line 16 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / beta / clippy

[clippy] reported by reviewdog 🐶 warning: field `public` is never read --> contracts/src/utils/cryptography/ed25519.rs:17:5 | 16 | pub struct Pair { | ---- field in this struct 17 | public: VerificationKey, | ^^^^^^ | = note: `Pair` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis Raw Output: contracts/src/utils/cryptography/ed25519.rs:16:12:w:warning: field `public` is never read --> contracts/src/utils/cryptography/ed25519.rs:17:5 | 16 | pub struct Pair { | ---- field in this struct 17 | public: VerificationKey, | ^^^^^^ | = note: `Pair` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis __END__
public: VerificationKey,

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / wasm32-unknown-unknown

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / beta

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / beta

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / features

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / features

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / features

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / Check WASM binary

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / coverage

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / macos-latest / stable

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / Gas usage report

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / Gas usage report

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / tests

field `public` is never read

Check warning on line 17 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / tests

field `public` is never read
secret: SigningKey,
}

impl Pair {

Check warning on line 21 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / stable / clippy

[clippy] reported by reviewdog 🐶 warning: associated items `to_raw_vec`, `sign`, and `verify` are never used --> contracts/src/utils/cryptography/ed25519.rs:28:8 | 21 | impl Pair { | --------- associated items in this implementation ... 28 | fn to_raw_vec(&self) -> Vec<u8> { | ^^^^^^^^^^ ... 32 | fn sign(&self, message: &[u8]) -> Signature { | ^^^^ ... 36 | fn verify<M: AsRef<[u8]>>( | ^^^^^^ Raw Output: contracts/src/utils/cryptography/ed25519.rs:21:1:w:warning: associated items `to_raw_vec`, `sign`, and `verify` are never used --> contracts/src/utils/cryptography/ed25519.rs:28:8 | 21 | impl Pair { | --------- associated items in this implementation ... 28 | fn to_raw_vec(&self) -> Vec<u8> { | ^^^^^^^^^^ ... 32 | fn sign(&self, message: &[u8]) -> Signature { | ^^^^ ... 36 | fn verify<M: AsRef<[u8]>>( | ^^^^^^ __END__

Check warning on line 21 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / beta / clippy

[clippy] reported by reviewdog 🐶 warning: associated items `to_raw_vec`, `sign`, and `verify` are never used --> contracts/src/utils/cryptography/ed25519.rs:28:8 | 21 | impl Pair { | --------- associated items in this implementation ... 28 | fn to_raw_vec(&self) -> Vec<u8> { | ^^^^^^^^^^ ... 32 | fn sign(&self, message: &[u8]) -> Signature { | ^^^^ ... 36 | fn verify<M: AsRef<[u8]>>( | ^^^^^^ Raw Output: contracts/src/utils/cryptography/ed25519.rs:21:1:w:warning: associated items `to_raw_vec`, `sign`, and `verify` are never used --> contracts/src/utils/cryptography/ed25519.rs:28:8 | 21 | impl Pair { | --------- associated items in this implementation ... 28 | fn to_raw_vec(&self) -> Vec<u8> { | ^^^^^^^^^^ ... 32 | fn sign(&self, message: &[u8]) -> Signature { | ^^^^ ... 36 | fn verify<M: AsRef<[u8]>>( | ^^^^^^ __END__
/// Get the seed for this key.
pub fn seed(&self) -> Seed {

Check warning on line 23 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / stable / clippy

[clippy] reported by reviewdog 🐶 warning: this method could have a `#[must_use]` attribute --> contracts/src/utils/cryptography/ed25519.rs:23:5 | 23 | pub fn seed(&self) -> Seed { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn seed(&self) -> Seed` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate = note: `-W clippy::must-use-candidate` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::must_use_candidate)]` Raw Output: contracts/src/utils/cryptography/ed25519.rs:23:5:w:warning: this method could have a `#[must_use]` attribute --> contracts/src/utils/cryptography/ed25519.rs:23:5 | 23 | pub fn seed(&self) -> Seed { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn seed(&self) -> Seed` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate = note: `-W clippy::must-use-candidate` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::must_use_candidate)]` __END__

Check warning on line 23 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / beta / clippy

[clippy] reported by reviewdog 🐶 warning: this method could have a `#[must_use]` attribute --> contracts/src/utils/cryptography/ed25519.rs:23:5 | 23 | pub fn seed(&self) -> Seed { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn seed(&self) -> Seed` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate = note: `-W clippy::must-use-candidate` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::must_use_candidate)]` Raw Output: contracts/src/utils/cryptography/ed25519.rs:23:5:w:warning: this method could have a `#[must_use]` attribute --> contracts/src/utils/cryptography/ed25519.rs:23:5 | 23 | pub fn seed(&self) -> Seed { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn seed(&self) -> Seed` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate = note: `-W clippy::must-use-candidate` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::must_use_candidate)]` __END__
self.secret.into()
}

/// Return a vec filled with raw data.
fn to_raw_vec(&self) -> Vec<u8> {

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / stable / clippy

[clippy] reported by reviewdog 🐶 warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value --> contracts/src/utils/cryptography/ed25519.rs:28:19 | 28 | fn to_raw_vec(&self) -> Vec<u8> { | ^^^^^ | = help: consider choosing a less ambiguous name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention = note: `-W clippy::wrong-self-convention` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::wrong_self_convention)]` Raw Output: contracts/src/utils/cryptography/ed25519.rs:28:19:w:warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value --> contracts/src/utils/cryptography/ed25519.rs:28:19 | 28 | fn to_raw_vec(&self) -> Vec<u8> { | ^^^^^ | = help: consider choosing a less ambiguous name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention = note: `-W clippy::wrong-self-convention` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::wrong_self_convention)]` __END__

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / wasm32-unknown-unknown

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / beta / clippy

[clippy] reported by reviewdog 🐶 warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value --> contracts/src/utils/cryptography/ed25519.rs:28:19 | 28 | fn to_raw_vec(&self) -> Vec<u8> { | ^^^^^ | = help: consider choosing a less ambiguous name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention = note: `-W clippy::wrong-self-convention` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::wrong_self_convention)]` Raw Output: contracts/src/utils/cryptography/ed25519.rs:28:19:w:warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value --> contracts/src/utils/cryptography/ed25519.rs:28:19 | 28 | fn to_raw_vec(&self) -> Vec<u8> { | ^^^^^ | = help: consider choosing a less ambiguous name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention = note: `-W clippy::wrong-self-convention` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::wrong_self_convention)]` __END__

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / beta

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / beta

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / features

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / features

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / features

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / Check WASM binary

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / ubuntu / stable / coverage

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / macos-latest / stable

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / Gas usage report

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / Gas usage report

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / tests

associated items `to_raw_vec`, `sign`, and `verify` are never used

Check warning on line 28 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / tests

associated items `to_raw_vec`, `sign`, and `verify` are never used
self.seed().to_vec()
}

fn sign(&self, message: &[u8]) -> Signature {
self.secret.sign(message)
}

fn verify<M: AsRef<[u8]>>(
sig: &Signature,
message: M,
public: &Public,
) -> bool {
let Ok(public) = VerificationKey::try_from(public.to_bytes()) else {
return false;
};
public.verify(&sig, message.as_ref()).is_ok()

Check warning on line 44 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / stable / clippy

[clippy] reported by reviewdog 🐶 warning: this expression creates a reference which is immediately dereferenced by the compiler --> contracts/src/utils/cryptography/ed25519.rs:44:23 | 44 | public.verify(&sig, message.as_ref()).is_ok() | ^^^^ help: change this to: `sig` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `-W clippy::needless-borrow` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]` Raw Output: contracts/src/utils/cryptography/ed25519.rs:44:23:w:warning: this expression creates a reference which is immediately dereferenced by the compiler --> contracts/src/utils/cryptography/ed25519.rs:44:23 | 44 | public.verify(&sig, message.as_ref()).is_ok() | ^^^^ help: change this to: `sig` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `-W clippy::needless-borrow` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]` __END__

Check warning on line 44 in contracts/src/utils/cryptography/ed25519.rs

View workflow job for this annotation

GitHub Actions / beta / clippy

[clippy] reported by reviewdog 🐶 warning: this expression creates a reference which is immediately dereferenced by the compiler --> contracts/src/utils/cryptography/ed25519.rs:44:23 | 44 | public.verify(&sig, message.as_ref()).is_ok() | ^^^^ help: change this to: `sig` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `-W clippy::needless-borrow` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]` Raw Output: contracts/src/utils/cryptography/ed25519.rs:44:23:w:warning: this expression creates a reference which is immediately dereferenced by the compiler --> contracts/src/utils/cryptography/ed25519.rs:44:23 | 44 | public.verify(&sig, message.as_ref()).is_ok() | ^^^^ help: change this to: `sig` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `-W clippy::needless-borrow` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]` __END__
}
}
1 change: 1 addition & 0 deletions contracts/src/utils/cryptography/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Smart Contracts with cryptography.
pub mod ecdsa;
pub mod ed25519;
pub mod eip712;

0 comments on commit 5eb947b

Please sign in to comment.