Skip to content

Commit

Permalink
Opt deserialize_compressed -> deserialize_compressed_unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 committed Mar 10, 2023
1 parent 5923b2e commit e3eb836
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions precompile/bls12-381/src/bls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl From<G1Projective> for PublicKey {
}
impl PublicKey {
pub fn from_bytes(bytes: &[u8]) -> Result<PublicKey, SerializationError> {
let p = G1Affine::deserialize_compressed(bytes)?;
let p = G1Affine::deserialize_compressed_unchecked(bytes)?;
Ok(Self(p.into()))
}

Expand Down Expand Up @@ -104,11 +104,11 @@ pub fn hash_to_curve_g2(message: &[u8]) -> Result<G2Projective, HashToCurveError
#[cfg(test)]
mod tests {
// crates.io
use rand::Rng;
use ark_std::test_rng;
use ark_bls12_381::Fr;
use ark_ec::Group;
use ark_ff::UniformRand;
use ark_std::test_rng;
use rand::Rng;
// darwinia
use super::*;

Expand Down

0 comments on commit e3eb836

Please sign in to comment.