Be aware: Foundation will NEVER ask for your seed words, device PIN, or call you unexpectedly. If anyone does, it's a scam.

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
where Option<usize>: Archive, ShaAlgo: Archive, [u8; 64]: Archive,

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 more

type Archived = ArchivedShaSetContext

The archived representation of this type. Read more

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.

fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)

Creates the archived version of this value at the given position and writes it to the given output. Read more

impl BlockingArchive for ShaSetContext

type Response = Result<usize, CryptoError>

response type for this message

impl Debug for ShaSetContext

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

impl<__D: Fallible + ?Sized> Deserialize<ShaSetContext, __D> for Archived<ShaSetContext>
where Option<usize>: Archive, <Option<usize> as Archive>::Archived: Deserialize<Option<usize>, __D>, ShaAlgo: Archive, <ShaAlgo as Archive>::Archived: Deserialize<ShaAlgo, __D>, [u8; 64]: Archive, <[u8; 64] as Archive>::Archived: Deserialize<[u8; 64], __D>,

fn deserialize( &self, deserializer: &mut __D, ) -> Result<ShaSetContext, <__D as Fallible>::Error>

Deserializes using the given deserializer

impl MessageId for ShaSetContext

const ID: MessageId = 9usize

unique message identifier

const SERVER: &'static str = "os/crypto"

target server name

impl<__S: Fallible + ?Sized> Serialize<__S> for ShaSetContext
where Option<usize>: Serialize<__S>, ShaAlgo: Serialize<__S>, [u8; 64]: Serialize<__S>,

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.

Auto Trait Implementations

impl Freeze for ShaSetContext

impl RefUnwindSafe for ShaSetContext

impl Send for ShaSetContext

impl Sync for ShaSetContext

impl Unpin for ShaSetContext

impl UnsafeUnpin for ShaSetContext

impl UnwindSafe for ShaSetContext