oberon 2.2.1

Oberon is a multi-factor zero-knowledge capable token without requiring email, SMS, or authenticator apps. The proof of token validity is only 96 bytes while the token itself is only 48 bytes.
Documentation
/*
    Copyright Michael Lodder. All Rights Reserved.
    SPDX-License-Identifier: Apache-2.0
*/
mod common;

use common::{MockRng, ID};
use oberon::{Blinding, SecretKey};

#[test]
fn blinding_works() {
    let blinding = Blinding::new(b"1234");
    let sk = SecretKey::new(MockRng::new());
    let token = sk.sign(ID).unwrap();
    assert_ne!(blinding.to_bytes(), [0u8; 48]);
    let blinded_token = &token - &blinding;
    assert_ne!(token, blinded_token);
    assert_eq!(token, &blinded_token + &blinding);

    // null blinding
    let blinding = Blinding::new(b"");
    let sk = SecretKey::new(MockRng::new());
    let token = sk.sign(ID).unwrap();
    assert_ne!(blinding.to_bytes(), [0u8; 48]);
    let blinded_token = &token - &blinding;
    assert_ne!(token, blinded_token);
    assert_eq!(token, &blinded_token + &blinding);
}