Skip to content

Commit

Permalink
added secp256k1_verify and secp256r1_verify ops
Browse files Browse the repository at this point in the history
  • Loading branch information
cameroncooper authored and arvidn committed Jun 8, 2023
1 parent 24dcc04 commit f89b52e
Show file tree
Hide file tree
Showing 12 changed files with 494 additions and 13 deletions.
213 changes: 210 additions & 3 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ bls12_381 = { version = "=0.8.0", features = ["experimental"] }
group = "=0.13.0"
sha2 = "=0.9.9"
openssl = { version = "=0.10.52", features = ["vendored"], optional = true }
getrandom = { version = "=0.2.9", features = ["js" ]}
# for secp sigs
k256 = { version = "0.13.1", features = ["ecdsa"] }
p256 = { version = "0.13.2", features = ["ecdsa"] }

[dev-dependencies]
rstest = "=0.17.0"
6 changes: 5 additions & 1 deletion fuzz/fuzz_targets/operators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ use clvmr::more_ops::{
op_pubkey_for_exp, op_sha256, op_strlen, op_substr, op_subtract,
};
use clvmr::reduction::{EvalErr, Response};
use clvmr::secp_ops::{op_secp256k1_verify, op_secp256r1_verify};
use clvmr::serde::node_from_bytes;

type Opf = fn(&mut Allocator, NodePtr, Cost) -> Response;

const FUNS: [Opf; 41] = [
const FUNS: [Opf; 43] = [
op_if as Opf,
op_cons as Opf,
op_first as Opf,
Expand Down Expand Up @@ -62,6 +63,9 @@ const FUNS: [Opf; 41] = [
op_bls_map_to_g2 as Opf,
op_bls_pairing_identity as Opf,
op_bls_verify as Opf,
// Secp operators
op_secp256k1_verify as Opf,
op_secp256r1_verify as Opf,
];

fuzz_target!(|data: &[u8]| {
Expand Down
Loading

0 comments on commit f89b52e

Please sign in to comment.