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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
use num_enum::{IntoPrimitive, TryFromPrimitive};
use zeroize::Zeroize;
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(inspectable))]
#[cfg_attr(feature = "fuzz", derive(arbitrary::Arbitrary))]
#[derive(Clone, Copy, PartialEq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)]
#[repr(u16)]
pub enum DataType {
None = 0,
Key = 1,
Ciphertext = 2,
PasswordHash = 3,
Share = 4,
}
impl Default for DataType {
fn default() -> Self {
Self::None
}
}
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(inspectable))]
#[cfg_attr(feature = "fuzz", derive(arbitrary::Arbitrary))]
#[derive(Clone, Copy, PartialEq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)]
#[repr(u16)]
pub enum CiphertextVersion {
Latest = 0,
V1 = 1,
V2 = 2,
}
impl Default for CiphertextVersion {
fn default() -> Self {
Self::Latest
}
}
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(inspectable))]
#[cfg_attr(feature = "fuzz", derive(arbitrary::Arbitrary))]
#[derive(Clone, Copy, PartialEq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)]
#[repr(u16)]
pub enum PasswordHashVersion {
Latest = 0,
V1 = 1,
}
impl Default for PasswordHashVersion {
fn default() -> Self {
Self::Latest
}
}
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(inspectable))]
#[cfg_attr(feature = "fuzz", derive(arbitrary::Arbitrary))]
#[derive(Clone, Copy, PartialEq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)]
#[repr(u16)]
pub enum KeyVersion {
Latest = 0,
V1 = 1,
}
impl Default for KeyVersion {
fn default() -> Self {
Self::Latest
}
}
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(inspectable))]
#[cfg_attr(feature = "fuzz", derive(arbitrary::Arbitrary))]
#[derive(Clone, Copy, PartialEq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)]
#[repr(u16)]
pub enum SecretSharingVersion {
Latest = 0,
V1 = 1,
}
impl Default for SecretSharingVersion {
fn default() -> Self {
Self::Latest
}
}
#[derive(Clone, Copy, PartialEq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)]
#[cfg_attr(feature = "fuzz", derive(arbitrary::Arbitrary))]
#[repr(u16)]
pub enum CiphertextSubtype {
None = 0,
Symmetric = 1,
Asymmetric = 2,
}
impl Default for CiphertextSubtype {
fn default() -> Self {
Self::None
}
}
#[derive(Clone, Copy, PartialEq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)]
#[cfg_attr(feature = "fuzz", derive(arbitrary::Arbitrary))]
#[repr(u16)]
pub enum KeySubtype {
None = 0,
Private = 1,
Public = 2,
}
impl Default for KeySubtype {
fn default() -> Self {
Self::None
}
}
#[derive(Clone, Copy, PartialEq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)]
#[cfg_attr(feature = "fuzz", derive(arbitrary::Arbitrary))]
#[repr(u16)]
pub enum PasswordHashSubtype {
None = 0,
}
impl Default for PasswordHashSubtype {
fn default() -> Self {
Self::None
}
}
#[derive(Clone, Copy, PartialEq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)]
#[cfg_attr(feature = "fuzz", derive(arbitrary::Arbitrary))]
#[repr(u16)]
pub enum ShareSubtype {
None = 0,
}
impl Default for ShareSubtype {
fn default() -> Self {
Self::None
}
}