Enum tink_proto::OutputPrefixType
source · #[repr(i32)]
pub enum OutputPrefixType {
UnknownPrefix,
Tink,
Legacy,
Raw,
Crunchy,
}
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 copy 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<OutputPrefixType> for OutputPrefixType
impl PartialEq<OutputPrefixType> for OutputPrefixType
source§fn eq(&self, other: &OutputPrefixType) -> bool
fn eq(&self, other: &OutputPrefixType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<OutputPrefixType> for OutputPrefixType
impl PartialOrd<OutputPrefixType> for OutputPrefixType
source§fn partial_cmp(&self, other: &OutputPrefixType) -> Option<Ordering>
fn partial_cmp(&self, other: &OutputPrefixType) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more