anubis-wormhole 1.0.0

A post-quantum secure file transfer tool based on the Magic Wormhole protocol.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::kdf;

pub fn relay_token_from_kdata(k_data: &[u8]) -> [u8;32] {
    // HKDF-SHA512 with context "transit_relay_token"
    let prk = kdf::hkdf_extract_sha512(&[], k_data);
    let okm = kdf::hkdf_expand_sha512(&prk, b"transit_relay_token", 32);
    let mut out = [0u8;32]; out.copy_from_slice(&okm[..32]); out
}

pub fn sender_handshake_string(token: &[u8;32]) -> String {
    format!("please relay {}\n", hex::encode(token))
}

pub fn receiver_handshake_string(token: &[u8;32]) -> String {
    format!("please relay {}\n", hex::encode(token))
}