Skip to content

Commit

Permalink
Add serialized point constant
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Feb 6, 2024
1 parent ce90fa1 commit 09f80c6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ffi_interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ pub type CommitmentBytes = [u8; 64];
/// A serialized scalar field element
pub type ScalarBytes = [u8; 32];

/// This is the identity element of the group
pub const ZERO_POINT: CommitmentBytes = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
];

#[derive(Debug, Clone)]
pub enum Error {
LengthOfScalarsNotMultipleOf32 { len: usize },
Expand Down Expand Up @@ -519,6 +525,13 @@ mod tests {
}
}

#[test]
fn check_identity_constant() {
let identity = Element::zero();
let identity_bytes = identity.to_bytes_uncompressed();
assert_eq!(identity_bytes, ZERO_POINT);
}

#[cfg(test)]
mod pedersen_hash_tests {
use ipa_multipoint::{committer::DefaultCommitter, crs::CRS};
Expand Down

0 comments on commit 09f80c6

Please sign in to comment.