Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
unwrap results
Browse files Browse the repository at this point in the history
  • Loading branch information
Achim Schneider committed Mar 19, 2023
1 parent c12045d commit de3cfbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion primitives/arkworks/src/ed_on_bls12_377.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use sp_std::vec::Vec;
pub fn msm(bases: Vec<u8>, scalars: Vec<u8>) -> Vec<u8> {
let bases: Vec<_> = serialize_iter_to_vec::<twisted_edwards::Affine<EdwardsConfig>>(bases);
let scalars: Vec<_> =
serialize_iter_to_vec::<<EdwardsConfig as CurveConfig>::ScalarField>(scalars);
serialize_iter_to_vec::<<EdwardsConfig as CurveConfig>::ScalarField>(scalars).unwrap();

let result = <EdwardsProjective as VariableBaseMSM>::msm(&bases, &scalars).unwrap();

Expand Down
6 changes: 3 additions & 3 deletions primitives/arkworks/src/ed_on_bls12_381.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ use sp_std::vec::Vec;

/// Compute a multi scalar multiplication on G! through arkworks
pub fn te_msm(bases: Vec<u8>, scalars: Vec<u8>) -> Vec<u8> {
let bases: Vec<_> = serialize_iter_to_vec::<TEAffine<JubjubConfig>>(bases);
let bases: Vec<_> = serialize_iter_to_vec::<TEAffine<JubjubConfig>>(bases).unwrap();
let scalars: Vec<_> =
serialize_iter_to_vec::<<JubjubConfig as CurveConfig>::ScalarField>(scalars);
serialize_iter_to_vec::<<JubjubConfig as CurveConfig>::ScalarField>(scalars).unwrap();

let result = <EdwardsProjective as VariableBaseMSM>::msm(&bases, &scalars).unwrap();

Expand All @@ -44,7 +44,7 @@ pub fn te_msm(bases: Vec<u8>, scalars: Vec<u8>) -> Vec<u8> {
pub fn sw_msm(bases: Vec<u8>, scalars: Vec<u8>) -> Vec<u8> {
let bases: Vec<_> = serialize_iter_to_vec::<SWAffine<JubjubConfig>>(bases);
let scalars: Vec<_> =
serialize_iter_to_vec::<<JubjubConfig as CurveConfig>::ScalarField>(scalars);
serialize_iter_to_vec::<<JubjubConfig as CurveConfig>::ScalarField>(scalars).unwrap();

let result = <SWProjective as VariableBaseMSM>::msm(&bases, &scalars).unwrap();

Expand Down

0 comments on commit de3cfbd

Please sign in to comment.