Skip to content

Commit

Permalink
add to_bytes method
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-lj committed Sep 27, 2024
1 parent 8fda80f commit cf10019
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fastcrypto/src/groups/bls12381.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ impl G1ElementUncompressed {
Self(bytes)
}

/// Return the binary representation of this element.
pub fn to_bytes(&self) -> [u8; 2 * G1_ELEMENT_BYTE_LENGTH] {
self.0
}

fn to_blst_p1_affine(&self) -> FastCryptoResult<blst_p1_affine> {
let mut affine = blst_p1_affine::default();
unsafe {
Expand Down

0 comments on commit cf10019

Please sign in to comment.