Trait ClientData

Source
pub trait ClientData<const L: usize> {
    // Required methods
    fn add_data_done(
        &self,
        result: Result<(), ErrorCode>,
        data: SubSlice<'static, u8>,
    );
    fn add_mut_data_done(
        &self,
        result: Result<(), ErrorCode>,
        data: SubSliceMut<'static, u8>,
    );
}
Expand description

Implement this trait and use set_client() in order to receive callbacks when data has been added to a digest.

‘L’ is the length of the ‘u8’ array to store the digest output.

Required Methods§

Source

fn add_data_done( &self, result: Result<(), ErrorCode>, data: SubSlice<'static, u8>, )

Called when the data has been added to the digest. data is the SubSlice passed in the call to add_data, whose active slice contains the data that was not added. On Ok, data has an active slice of size zero (all data was added). Valid ErrorCode values are:

  • OFF: the underlying digest engine is powered down and cannot be used.
  • BUSY: there is an outstanding add_data, add_data_mut, run, or verify operation, so the digest engine is busy and cannot accept more data.
  • SIZE: the active slice of the SubSlice has zero size.
  • CANCEL: the operation was cancelled by a call to clear_data.
  • FAIL: an internal failure.
Source

fn add_mut_data_done( &self, result: Result<(), ErrorCode>, data: SubSliceMut<'static, u8>, )

Called when the data has been added to the digest. data is the SubSliceMut passed in the call to add_mut_data, whose active slice contains the data that was not added. On Ok, data has an active slice of size zero (all data was added). Valid ErrorCode values are:

  • OFF: the underlying digest engine is powered down and cannot be used.
  • BUSY: there is an outstanding add_data, add_data_mut, run, or verify operation, so the digest engine is busy and cannot accept more data.
  • SIZE: the active slice of the SubSlice has zero size.
  • CANCEL: the operation was cancelled by a call to clear_data.
  • FAIL: an internal failure.

Implementors§

impl ClientData<32> for TestSha256

impl<'a, H: Digest<'a, L> + HmacSha256 + HmacSha384 + HmacSha512, const L: usize> ClientData<L> for HmacDriver<'a, H, L>

impl<'a, H: Digest<'a, L> + Sha256 + Sha384 + Sha512, const L: usize> ClientData<L> for ShaDriver<'a, H, L>

impl<'a, S: Sha256 + DigestDataHash<'a, 32>> ClientData<32> for HmacSha256Software<'a, S>

impl<'a, S: SignatureVerify<'static, HL, SL>, H: DigestDataHash<'a, HL>, const HL: usize, const SL: usize> ClientData<HL> for AppCheckerSignature<'a, S, H, HL, SL>