pub struct SHA { /* private fields */ }
Expand description
SHA (Secure Hash Algorithm) Accelerator
Implementations§
source§impl SHA
impl SHA
sourcepub const PTR: *const RegisterBlock = {0x6003b000 as *const sha::RegisterBlock}
pub const PTR: *const RegisterBlock = {0x6003b000 as *const sha::RegisterBlock}
Pointer to the register block
sourcepub const fn ptr() -> *const RegisterBlock
pub const fn ptr() -> *const RegisterBlock
Return the pointer to the register block
sourcepub unsafe fn steal() -> Self
pub unsafe fn steal() -> Self
Steal an instance of this peripheral
Safety
Ensure that the new instance of the peripheral cannot be used in a way that may race with any existing instances, for example by only accessing read-only or write-only registers, or by consuming the original peripheral and using critical sections to coordinate access between multiple new instances.
Additionally, other software such as HALs may rely on only one peripheral instance existing to ensure memory safety; ensure no stolen instances are passed to such software.
Methods from Deref<Target = RegisterBlock>§
sourcepub fn t_string(&self) -> &T_STRING
pub fn t_string(&self) -> &T_STRING
0x04 - String content register for calculating initial Hash Value (only effective for SHA-512/t)
sourcepub fn t_length(&self) -> &T_LENGTH
pub fn t_length(&self) -> &T_LENGTH
0x08 - String length register for calculating initial Hash Value (only effective for SHA-512/t)
sourcepub fn dma_block_num(&self) -> &DMA_BLOCK_NUM
pub fn dma_block_num(&self) -> &DMA_BLOCK_NUM
0x0c - Block number register (only effective for DMA-SHA)
sourcepub fn continue_(&self) -> &CONTINUE
pub fn continue_(&self) -> &CONTINUE
0x14 - Continues SHA operation (only effective in Typical SHA mode)
sourcepub fn dma_continue(&self) -> &DMA_CONTINUE
pub fn dma_continue(&self) -> &DMA_CONTINUE
0x20 - Continues SHA operation (only effective in DMA-SHA mode)
sourcepub fn h_mem_iter(&self) -> impl Iterator<Item = &H_MEM>
pub fn h_mem_iter(&self) -> impl Iterator<Item = &H_MEM>
Iterator for array of: 0x40..0x80 - Hash value
sourcepub fn m_mem_iter(&self) -> impl Iterator<Item = &M_MEM>
pub fn m_mem_iter(&self) -> impl Iterator<Item = &M_MEM>
Iterator for array of: 0x80..0x100 - Message