Skip to content

Commit

Permalink
chore: implement Sync for elements
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Feb 14, 2024
1 parent e7f72ba commit de755f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rust-bindings/bls-signatures/src/elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ pub struct G1Element {
pub(crate) c_element: *mut c_void,
}

// G1Element is immutable and thread safe
unsafe impl Send for G1Element {}
unsafe impl Sync for G1Element {}

impl PartialEq for G1Element {
fn eq(&self, other: &Self) -> bool {
Expand Down Expand Up @@ -196,7 +198,9 @@ pub struct G2Element {
pub(crate) c_element: *mut c_void,
}

unsafe impl Send for G2Element {}
// G2Element is immutable and thread safe
unsafe impl Send for G1Element {}
unsafe impl Sync for G1Element {}

impl PartialEq for G2Element {
fn eq(&self, other: &Self) -> bool {
Expand Down

0 comments on commit de755f7

Please sign in to comment.