use uor_foundation::enforcement::{GroundedShape, ShapeViolation};
use uor_foundation::pipeline::{ConstrainedTypeShape, ConstraintRef, IntoBindingValue};
#[derive(Debug, Clone, Copy)]
pub struct PolynomialShape<const MAX_DEGREE: usize, const COEFF_BYTES: usize>;
impl<const MAX_DEGREE: usize, const COEFF_BYTES: usize> Default
for PolynomialShape<MAX_DEGREE, COEFF_BYTES>
{
fn default() -> Self {
Self
}
}
impl<const MAX_DEGREE: usize, const COEFF_BYTES: usize> ConstrainedTypeShape
for PolynomialShape<MAX_DEGREE, COEFF_BYTES>
{
const IRI: &'static str = "https://uor.foundation/type/ConstrainedType";
const SITE_COUNT: usize = (MAX_DEGREE + 1) * COEFF_BYTES;
const CONSTRAINTS: &'static [ConstraintRef] = &[];
#[allow(clippy::cast_possible_truncation)]
const CYCLE_SIZE: u64 = 256u64.saturating_pow(((MAX_DEGREE + 1) * COEFF_BYTES) as u32);
}
impl<const MAX_DEGREE: usize, const COEFF_BYTES: usize> uor_foundation::pipeline::__sdk_seal::Sealed
for PolynomialShape<MAX_DEGREE, COEFF_BYTES>
{
}
impl<const MAX_DEGREE: usize, const COEFF_BYTES: usize> GroundedShape
for PolynomialShape<MAX_DEGREE, COEFF_BYTES>
{
}
impl<const MAX_DEGREE: usize, const COEFF_BYTES: usize> IntoBindingValue
for PolynomialShape<MAX_DEGREE, COEFF_BYTES>
{
const MAX_BYTES: usize = (MAX_DEGREE + 1) * COEFF_BYTES;
fn into_binding_bytes(&self, _out: &mut [u8]) -> Result<usize, ShapeViolation> {
Ok(0)
}
}
pub type Polynomial7Mod256 = PolynomialShape<7, 32>;
pub type Polynomial15Mod256 = PolynomialShape<15, 32>;