Skip to content

Commit

Permalink
Implement functionality needed to use generic code for dynamic dory
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarttimwhite committed Dec 10, 2024
1 parent f893800 commit aef4ca1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/proof-of-sql/src/proof_primitive/dory/dory_commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use crate::base::{
scalar::{MontScalar, Scalar},
};
use alloc::vec::Vec;
use ark_bls12_381::Fr;
use ark_ec::pairing::PairingOutput;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use core::ops::Mul;
Expand All @@ -38,6 +39,18 @@ use num_traits::One;
/// The Dory scalar type. (alias for `MontScalar<ark_bls12_381::FrConfig>`)
pub type DoryScalar = MontScalar<ark_bls12_381::FrConfig>;

impl From<Fr> for DoryScalar {
fn from(value: Fr) -> Self {
MontScalar(value)
}
}

impl From<DoryScalar> for Fr {
fn from(value: DoryScalar) -> Self {
value.0
}
}

impl Scalar for DoryScalar {
const MAX_SIGNED: Self = Self(ark_ff::MontFp!(
"26217937587563095239723870254092982918845276250263818911301829349969290592256"
Expand Down

0 comments on commit aef4ca1

Please sign in to comment.