proof_of_sql::base::scalar

Trait Scalar

Source
pub trait Scalar:
    Clone
    + Debug
    + Display
    + PartialEq
    + Default
    + for<'a> From<&'a str>
    + Sync
    + Send
    + One
    + Sum
    + Product
    + Sub<Output = Self>
    + Copy
    + MulAssign
    + AddAssign
    + Zero
    + for<'a> From<&'a Self>
    + for<'a> From<&'a bool>
    + for<'a> From<&'a i8>
    + for<'a> From<&'a i16>
    + for<'a> From<&'a i32>
    + for<'a> From<&'a i64>
    + for<'a> From<&'a i128>
    + for<'a> From<&'a u8>
    + TryInto<bool>
    + TryInto<i8>
    + TryInto<i16>
    + TryInto<i32>
    + TryInto<i64>
    + TryInto<i128>
    + Into<[u64; 4]>
    + From<[u64; 4]>
    + Ord
    + Neg<Output = Self>
    + Zero
    + AddAssign
    + CanonicalSerialize
    + UniformRand
    + Inv<Output = Option<Self>>
    + SubAssign
    + RefInto<[u64; 4]>
    + for<'a> From<&'a String>
    + VarInt
    + From<String>
    + From<i128>
    + From<i64>
    + From<i32>
    + From<i16>
    + From<i8>
    + From<bool>
    + Into<BigInt>
    + TryFrom<BigInt, Error = ScalarConversionError> {
    const MAX_SIGNED: Self;
    const ZERO: Self;
    const ONE: Self;
    const TWO: Self;
    const TEN: Self;
}
Expand description

A trait for the scalar field used in Proof of SQL.

Required Associated Constants§

Source

const MAX_SIGNED: Self

The value (p - 1) / 2. This is “mid-point” of the field - the “six” on the clock. It is the largest signed value that can be represented in the field with the natural embedding.

Source

const ZERO: Self

The 0 (additive identity) element of the field.

Source

const ONE: Self

The 1 (multiplicative identity) element of the field.

Source

const TWO: Self

1 + 1

Source

const TEN: Self

2 + 2 + 2 + 2 + 2

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Scalar for DoryScalar

Source§

const MAX_SIGNED: Self = _

Source§

const ZERO: Self = _

Source§

const ONE: Self = _

Source§

const TWO: Self = _

Source§

const TEN: Self = _

Source§

impl Scalar for Curve25519Scalar

Source§

const MAX_SIGNED: Self = _

Source§

const ZERO: Self = _

Source§

const ONE: Self = _

Source§

const TWO: Self = _

Source§

const TEN: Self = _