summaryrefslogtreecommitdiffstats
path: root/openpgp/src/tests.rs
blob: cc8aa569d146abdffa67fe32f444d61657663681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Test data for Sequoia.
//!
//! This module includes the test data from `openpgp/tests/data` in a
//! structured way.

use std::fmt;

pub struct Test {
    path: &'static str,
    pub bytes: &'static [u8],
}

impl fmt::Display for Test {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "openpgp/tests/data/{}", self.path)
    }
}

macro_rules! t {
    ( $path: expr ) => {
        &Test {
            path: $path,
            bytes: include_bytes!(concat!("../tests/data/", $path)),
        }
    }
}

pub const TPKS: &[&Test] = &[
    t!("keys/dennis-simon-anton.pgp"),
    t!("keys/dsa2048-elgamal3072.pgp"),
    t!("keys/emmelie-dorothea-dina-samantha-awina-ed25519.pgp"),
    t!("keys/erika-corinna-daniela-simone-antonia-nistp256.pgp"),
    t!("keys/erika-corinna-daniela-simone-antonia-nistp384.pgp"),
    t!("keys/erika-corinna-daniela-simone-antonia-nistp521.pgp"),
    t!("keys/testy-new.pgp"),
    t!("keys/testy.pgp"),
    t!("keys/neal.pgp"),
    t!("keys/dkg-sigs-out-of-order.pgp"),
];

pub const TSKS: &[&Test] = &[
    t!("keys/dennis-simon-anton-private.pgp"),
    t!("keys/dsa2048-elgamal3072-private.pgp"),
    t!("keys/emmelie-dorothea-dina-samantha-awina-ed25519-private.pgp"),
    t!("keys/erika-corinna-daniela-simone-antonia-nistp256-private.pgp"),
    t!("keys/erika-corinna-daniela-simone-antonia-nistp384-private.pgp"),
    t!("keys/erika-corinna-daniela-simone-antonia-nistp521-private.pgp"),
    t!("keys/testy-new-private.pgp"),
    t!("keys/testy-nistp256-private.pgp"),
    t!("keys/testy-nistp384-private.pgp"),
    t!("keys/testy-nistp521-private.pgp"),
    t!("keys/testy-private.pgp"),
];