Module capsules_extra::hmac

source ·
Expand description

HMAC (Hash-based Message Authentication Code).

§Usage

let hmac = &earlgrey::hmac::HMAC;

let mux_hmac = static_init!(MuxHmac<'static, lowrisc::hmac::Hmac>, MuxHmac::new(hmac));
digest::Digest::set_client(&earlgrey::hmac::HMAC, mux_hmac);

let virtual_hmac_user = static_init!(
    VirtualMuxHmac<'static, lowrisc::hmac::Hmac>,
    VirtualMuxHmac::new(mux_hmac)
);
let hmac = static_init!(
    capsules::hmac::HmacDriver<'static, VirtualMuxHmac<'static, lowrisc::hmac::Hmac>>,
    capsules::hmac::HmacDriver::new(
        virtual_hmac_user,
        board_kernel.create_grant(&memory_allocation_cap),
    )
);
digest::Digest::set_client(virtual_hmac_user, hmac);

Structs§

Constants§