use crate::{BaseField, ScalarField};
use o1_utils::FieldHelpers;
use std::fmt;
#[derive(Clone, Eq, fmt::Debug, PartialEq)]
pub struct Signature {
pub rx: BaseField,
pub s: ScalarField,
}
impl Signature {
pub fn new(rx: BaseField, s: ScalarField) -> Self {
Self { rx, s }
}
}
impl fmt::Display for Signature {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut rx_bytes = self.rx.to_bytes();
let mut s_bytes = self.s.to_bytes();
rx_bytes.reverse();
s_bytes.reverse();
write!(f, "{}{}", hex::encode(rx_bytes), hex::encode(s_bytes))
}
}