Skip to content

Commit ee43b61

Browse files
committed
secp256k1-zkp-sys: remove not(fuzzing) gates on derives
I'm not sure why these derives are gated on not(fuzzing); I believe that there used to be fuzzing-only manual implementations. These do not exist anymore (or maybe they only existed upstream), and as a result the library does not compile when fuzzing is enabled. Also, make sure that cfg(fuzzing) is replaced by cfg(rust_secp_fuzz) everywhere so that the user has the ability to disable fuzzing mode.
1 parent 89edfd4 commit ee43b61

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

secp256k1-zkp-sys/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.9.1 - 2023-01-03
2+
3+
- Many changes; restart CHANGELOG.
4+
15
# 0.2.0 - 2021-01-06
26

37
- Completely replaced with https://github.com/comit-network/rust-secp256k1-zkp/ which has

secp256k1-zkp-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "secp256k1-zkp-sys"
3-
version = "0.9.0"
3+
version = "0.9.1"
44
authors = [ "Dawid Ciężarkiewicz <[email protected]>",
55
"Andrew Poelstra <[email protected]>",
66
"Steven Roose <[email protected]>",

secp256k1-zkp-sys/src/zkp.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,7 @@ impl RangeProof {
501501
}
502502

503503
#[repr(C)]
504-
#[derive(Copy, Clone)]
505-
#[cfg_attr(not(fuzzing), derive(Eq, PartialEq, Hash, Ord, PartialOrd))]
504+
#[derive(Copy, Clone, Eq, PartialEq, Hash, Ord, PartialOrd)]
506505
pub struct Tag([c_uchar; 32]);
507506
impl_array_newtype!(Tag, c_uchar, 32);
508507
impl_raw_debug!(Tag);
@@ -533,8 +532,7 @@ impl From<Tag> for [u8; 32] {
533532

534533
// TODO: Replace this with ffi::PublicKey?
535534
#[repr(C)]
536-
#[derive(Copy, Clone)]
537-
#[cfg_attr(not(fuzzing), derive(Ord, PartialOrd))]
535+
#[derive(Copy, Clone, Ord, PartialOrd)]
538536
pub struct PedersenCommitment([c_uchar; 64]);
539537
impl_array_newtype!(PedersenCommitment, c_uchar, 64);
540538
impl_raw_debug!(PedersenCommitment);
@@ -551,17 +549,14 @@ impl Default for PedersenCommitment {
551549
}
552550
}
553551

554-
#[cfg(not(fuzzing))]
555552
impl PartialEq for PedersenCommitment {
556553
fn eq(&self, other: &Self) -> bool {
557554
self.0[..] == other.0[..]
558555
}
559556
}
560557

561-
#[cfg(not(fuzzing))]
562558
impl Eq for PedersenCommitment {}
563559

564-
#[cfg(not(fuzzing))]
565560
impl Hash for PedersenCommitment {
566561
fn hash<H: hash::Hasher>(&self, state: &mut H) {
567562
self.0.hash(state);
@@ -647,12 +642,10 @@ impl EcdsaAdaptorSignature {
647642
}
648643
}
649644

650-
#[cfg(not(fuzzing))]
651645
impl PartialEq for EcdsaAdaptorSignature {
652646
fn eq(&self, other: &Self) -> bool {
653647
self.0[..] == other.0[..]
654648
}
655649
}
656650

657-
#[cfg(not(fuzzing))]
658651
impl Eq for EcdsaAdaptorSignature {}

src/zkp/generator.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ use rand::Rng;
88
///
99
/// Contrary to a [`crate::SecretKey`], the value 0 is also a valid tweak.
1010
/// Values outside secp curve order are invalid tweaks.
11-
#[derive(Default, Copy, Clone)]
12-
#[cfg_attr(not(fuzzing), derive(Eq, PartialEq, PartialOrd, Ord, Hash))]
11+
#[derive(Default, Copy, Clone, Eq, PartialEq, PartialOrd, Ord, Hash)]
1312
pub struct Tweak([u8; constants::SECRET_KEY_SIZE]);
1413
secp256k1_zkp_sys::impl_array_newtype!(Tweak, u8, constants::SECRET_KEY_SIZE);
1514

0 commit comments

Comments
 (0)