INNER CODE UNIT · Rust

connection_principal_round_trips_fixed_bytes

AChep/keyguard-app · commonAgent/src/lib.rs:273

    fn connection_principal_round_trips_fixed_bytes() {
        let bytes = [0xA5; PRINCIPAL_FINGERPRINT_LEN];
        let principal = ConnectionPrincipal::from_bytes(bytes);

        assert_eq!(principal.as_bytes(), &bytes);
        assert_eq!(principal.into_bytes(), bytes);
    }

    #[test]
    fn generated_connection_principal_has_wire_length() {
        let principal = ConnectionPrincipal::generate().expect("OS randomness");

        assert_eq!(principal.as_bytes().len(), PRINCIPAL_FINGERPRINT_LEN);
    }

    #[test]
    fn subject_fingerprints_are_domain_separated() {
        let first = SubjectFingerprint::derive(b"macos-signing-v1", b"same evidence")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…