rs_internal_state 0.1.3

This package serves as an essential building block within the `rs_shield` cryptographic library. It is focused on providing foundational functionality and infrastructure for various cryptographic operations within the larger project. While this package has been made publicly available to satisfy the dependency requirements of Rust's cargo system, its utility is predominantly realized in the context of the `rs_shield` project. Unless you are developing or maintaining a component of the `rs_shield` project, this package might offer limited direct utility. For access to a full suite of cryptographic functionalities, consider using the `rs_shield` library bundle.
Documentation
use rs_n_bit_words::{NBitWord, TSize};

type U64Word = NBitWord<u64>;

/// Process hashing steps of SHA-384, SHA-512, SHA-512/224 and SHA-512/256
pub struct Sha512Rotor<'a, 'b>(
    pub U64Word,
    pub U64Word,
    pub U64Word,
    pub &'a mut U64Word,
    pub U64Word,
    pub U64Word,
    pub U64Word,
    pub &'b mut U64Word,
    pub U64Word,
);

impl Sha512Rotor<'_, '_> {
    #[inline(always)]
    pub(crate) fn rnd(&mut self, k: u64) {
        let t0 = self.4.sigma1() + U64Word::ch(self.4, self.5, self.6) + *self.7 + self.8 + k;
        *self.3 += t0;
        *self.7 = t0 + self.0.sigma0() + U64Word::maj(self.0, self.1, self.2);
    }
}