plonky2/field/src/ops.rs

12 lines
194 B
Rust
Raw Normal View History

use std::ops::Mul;
pub trait Square {
fn square(&self) -> Self;
}
impl<F: Mul<F, Output = Self> + Copy> Square for F {
default fn square(&self) -> Self {
*self * *self
}
}