Skip to main content

gent_crypto/authority/
helper.rs

1use super::*;
2
3const DOMAIN: &[u8] = b"gent/native-helper-peer/v1\0";
4
5impl NodeIdentity {
6    /// Authenticate a challenge on one native QUIC connection.
7    pub fn sign_helper_channel(&self, transcript: &Digest) -> Result<[u8; 64]> {
8        Ok(self
9            .key
10            .sign(&signing_input(DOMAIN, transcript, 256)?)
11            .to_bytes())
12    }
13}
14
15pub fn verify_helper_channel(key: &PublicKey, transcript: &Digest, signature: &[u8]) -> Result<()> {
16    verify(key, DOMAIN, transcript, signature, 256)
17}