#[repr(i32)]pub enum OutputPrefixType {
UnknownPrefix = 0,
Tink = 1,
Legacy = 2,
Raw = 3,
Crunchy = 4,
}
Expand description
Tink produces and accepts ciphertexts or signatures that consist of a prefix and a payload. The payload and its format is determined entirely by the primitive, but the prefix has to be one of the following 4 types:
- Legacy: prefix is 5 bytes, starts with \x00 and followed by a 4-byte key id that is computed from the key material. In addition to that, signature schemes and MACs will add a \x00 byte to the end of the data being signed / MACed when operating on keys with this OutputPrefixType.
- Crunchy: prefix is 5 bytes, starts with \x00 and followed by a 4-byte key id that is generated randomly.
- Tink : prefix is 5 bytes, starts with \x01 and followed by 4-byte key id that is generated randomly.
- Raw : prefix is 0 byte, i.e., empty.
Variants§
Implementations§
Source§impl OutputPrefixType
impl OutputPrefixType
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for OutputPrefixType
impl Clone for OutputPrefixType
Source§fn clone(&self) -> OutputPrefixType
fn clone(&self) -> OutputPrefixType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for OutputPrefixType
impl Debug for OutputPrefixType
Source§impl Default for OutputPrefixType
impl Default for OutputPrefixType
Source§fn default() -> OutputPrefixType
fn default() -> OutputPrefixType
Returns the “default value” for a type. Read more
Source§impl From<OutputPrefixType> for i32
impl From<OutputPrefixType> for i32
Source§fn from(value: OutputPrefixType) -> i32
fn from(value: OutputPrefixType) -> i32
Converts to this type from the input type.
Source§impl Hash for OutputPrefixType
impl Hash for OutputPrefixType
Source§impl Ord for OutputPrefixType
impl Ord for OutputPrefixType
Source§fn cmp(&self, other: &OutputPrefixType) -> Ordering
fn cmp(&self, other: &OutputPrefixType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for OutputPrefixType
impl PartialEq for OutputPrefixType
Source§impl PartialOrd for OutputPrefixType
impl PartialOrd for OutputPrefixType
Source§impl TryFrom<i32> for OutputPrefixType
impl TryFrom<i32> for OutputPrefixType
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
The type returned in the event of a conversion error.
Source§fn try_from(value: i32) -> Result<OutputPrefixType, UnknownEnumValue>
fn try_from(value: i32) -> Result<OutputPrefixType, UnknownEnumValue>
Performs the conversion.
impl Copy for OutputPrefixType
impl Eq for OutputPrefixType
impl StructuralPartialEq for OutputPrefixType
Auto Trait Implementations§
impl Freeze for OutputPrefixType
impl RefUnwindSafe for OutputPrefixType
impl Send for OutputPrefixType
impl Sync for OutputPrefixType
impl Unpin for OutputPrefixType
impl UnwindSafe for OutputPrefixType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more