pub enum Rv32ZknhInstruction<Reg> {
Sha256Sig0 {
rd: Reg,
rs1: Reg,
},
Sha256Sig1 {
rd: Reg,
rs1: Reg,
},
Sha256Sum0 {
rd: Reg,
rs1: Reg,
},
Sha256Sum1 {
rd: Reg,
rs1: Reg,
},
Sha512Sig0h {
rd: Reg,
rs1: Reg,
rs2: Reg,
},
Sha512Sig0l {
rd: Reg,
rs1: Reg,
rs2: Reg,
},
Sha512Sig1h {
rd: Reg,
rs1: Reg,
rs2: Reg,
},
Sha512Sig1l {
rd: Reg,
rs1: Reg,
rs2: Reg,
},
Sha512Sum0r {
rd: Reg,
rs1: Reg,
rs2: Reg,
},
Sha512Sum1r {
rd: Reg,
rs1: Reg,
rs2: Reg,
},
}Expand description
RISC-V RV32 Zknh instruction (SHA-256 and SHA-512 sigma/sum functions).
SHA-256 instructions take a single source register. SHA-512 instructions take two source registers because 64-bit operands must be split across two 32-bit registers on RV32. The register conventions differ by instruction and follow the RISC-V scalar crypto Sail model exactly:
sha512sig0l,sha512sig1l: rs1 = LOW word, rs2 = HIGH wordsha512sig0h,sha512sig1h: rs1 = HIGH word, rs2 = LOW wordsha512sum0r,sha512sum1r: rs1 = LOW word, rs2 = HIGH word
For sha512sum0r and sha512sum1r the Sail pseudocode builds the 64-bit operand as
x[63:32] = X(rs2), x[31:0] = X(rs1) (rs2 is the HIGH half) and writes the low 32 bits of the
result to rd.
Variants§
Sha256Sig0
Sha256Sig1
Sha256Sum0
Sha256Sum1
Sha512Sig0h
Sha512Sig0l
Sha512Sig1h
Sha512Sig1l
Sha512Sum0r
Sha512Sum1r
Trait Implementations§
Source§impl<Reg: Clone> Clone for Rv32ZknhInstruction<Reg>
impl<Reg: Clone> Clone for Rv32ZknhInstruction<Reg>
Source§fn clone(&self) -> Rv32ZknhInstruction<Reg>
fn clone(&self) -> Rv32ZknhInstruction<Reg>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Reg: Debug> Debug for Rv32ZknhInstruction<Reg>
impl<Reg: Debug> Debug for Rv32ZknhInstruction<Reg>
Source§impl<Reg> Display for Rv32ZknhInstruction<Reg>where
Reg: Display,
impl<Reg> Display for Rv32ZknhInstruction<Reg>where
Reg: Display,
§impl<Reg> Instruction for Rv32ZknhInstruction<Reg>
impl<Reg> Instruction for Rv32ZknhInstruction<Reg>
Source§impl<Reg: PartialEq> PartialEq for Rv32ZknhInstruction<Reg>
impl<Reg: PartialEq> PartialEq for Rv32ZknhInstruction<Reg>
impl<Reg: Copy> Copy for Rv32ZknhInstruction<Reg>
impl<Reg: Eq> Eq for Rv32ZknhInstruction<Reg>
impl<Reg> StructuralPartialEq for Rv32ZknhInstruction<Reg>
Auto Trait Implementations§
impl<Reg> Freeze for Rv32ZknhInstruction<Reg>where
Reg: Freeze,
impl<Reg> RefUnwindSafe for Rv32ZknhInstruction<Reg>where
Reg: RefUnwindSafe,
impl<Reg> Send for Rv32ZknhInstruction<Reg>where
Reg: Send,
impl<Reg> Sync for Rv32ZknhInstruction<Reg>where
Reg: Sync,
impl<Reg> Unpin for Rv32ZknhInstruction<Reg>where
Reg: Unpin,
impl<Reg> UnsafeUnpin for Rv32ZknhInstruction<Reg>where
Reg: UnsafeUnpin,
impl<Reg> UnwindSafe for Rv32ZknhInstruction<Reg>where
Reg: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more