Struct
ShaSetContext
pub struct ShaSetContext {
pub context_id: Option<usize>,
pub algo: ShaAlgo,
pub hash_state: [u8; 64],
}Expand description
Allocate a server-side SHA context slot (or overwrite an existing one) and seed it
with the supplied hash state. context_id = None on first use; the server allocates
a slot and returns its id. Subsequent calls with the returned id overwrite the state.
Fields
context_id: Option<usize>None → allocate a new slot; Some(id) → overwrite existing slot.
algo: ShaAlgohash_state: [u8; 64]Intermediate hash state in standard digest byte order (BE per word). SHA-224/256 use the first 32 bytes; SHA-384/512 use all 64.
Trait Implementations
impl Archive for ShaSetContext
impl Archive for ShaSetContext
const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
An optimization flag that allows the bytes of this type to be copied
directly to a writer instead of calling
serialize. Read moretype Archived = ArchivedShaSetContext
type Archived = ArchivedShaSetContext
The archived representation of this type. Read more
type Resolver = ShaSetContextResolver
type Resolver = ShaSetContextResolver
The resolver for this type. It must contain all the additional
information from serializing needed to make the archived type from
the normal type.
impl BlockingArchive for ShaSetContext
impl BlockingArchive for ShaSetContext
type Response = Result<usize, CryptoError>
type Response = Result<usize, CryptoError>
response type for this message
impl Debug for ShaSetContext
impl Debug for ShaSetContext
impl<__D: Fallible + ?Sized> Deserialize<ShaSetContext, __D> for Archived<ShaSetContext>
impl<__D: Fallible + ?Sized> Deserialize<ShaSetContext, __D> for Archived<ShaSetContext>
fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<ShaSetContext, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<ShaSetContext, <__D as Fallible>::Error>
Deserializes using the given deserializer
impl MessageId for ShaSetContext
impl MessageId for ShaSetContext
const ID: MessageId = 9usize
const ID: MessageId = 9usize
unique message identifier
const SERVER: &'static str = "os/crypto"
const SERVER: &'static str = "os/crypto"
target server name
impl<__S: Fallible + ?Sized> Serialize<__S> for ShaSetContext
impl<__S: Fallible + ?Sized> Serialize<__S> for ShaSetContext
fn serialize(
&self,
serializer: &mut __S,
) -> Result<<Self as Archive>::Resolver, <__S as Fallible>::Error>
fn serialize( &self, serializer: &mut __S, ) -> Result<<Self as Archive>::Resolver, <__S as Fallible>::Error>
Writes the dependencies for the object and returns a resolver that can
create the archived type.