1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//! WOTS public keys.

/// An WOTS public key.
#[derive(Eq, PartialEq)]
pub struct PublicKey([[u8; 32]; 32]);

impl PublicKey {
    /// Convert this public key to a byte array.
    pub fn to_bytes(&self) -> [[u8; 32]; 32] {
        self.0
    }
}

/// Construct a `PublicKey` from a bytes.
impl From<[[u8; 32]; 32]> for PublicKey {
    fn from(key: [[u8; 32]; 32]) -> Self {
        Self(key)
    }
}