pub trait Domain: private::Sealed {}
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Binding {}
impl Domain for Binding {}
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum SpendAuth {}
impl Domain for SpendAuth {}
pub(crate) mod private {
use super::*;
fn hash_to_group(input: &[u8]) -> decaf377::Element {
decaf377::Element::encode_to_curve(&decaf377::Fq::from_le_bytes_mod_order(
blake2b_simd::blake2b(input).as_bytes(),
))
}
pub trait Sealed: Copy + Clone + Eq + PartialEq + core::fmt::Debug {
fn basepoint() -> decaf377::Element;
}
impl Sealed for Binding {
fn basepoint() -> decaf377::Element {
hash_to_group(b"decaf377-rdsa-binding")
}
}
impl Sealed for SpendAuth {
fn basepoint() -> decaf377::Element {
decaf377::Element::GENERATOR
}
}
}
pub(crate) use private::Sealed;