#[repr(u16, align(4))]pub enum Rv32ZkneInstruction<Hart>where
Hart: HartConfig,{
Aes32Esi {
rs1: Hart::Reg,
rs2: Hart::Reg,
rd: Hart::Reg,
bs: Rv32AesBs,
},
Aes32Esmi {
rs1: Hart::Reg,
rs2: Hart::Reg,
rd: Hart::Reg,
bs: Rv32AesBs,
},
}Expand description
RISC-V RV32 Zkne instructions (AES encryption)
Variants§
Aes32Esi
AES final round encryption step: SubBytes on one byte of rs2, rotated to the byte lane selected by bs, XOR’d into rs1.
rd = rs1 ^ rol32(SBOX[(rs2 >> (bs*8)) & 0xff] as u32, bs*8)
Aes32Esmi
AES middle round encryption step: SubBytes + partial MixColumns on one byte of rs2, rotated to the byte lane selected by bs, XOR’d into rs1.
rd = rs1 ^ rol32(MixColByte(SBOX[(rs2 >> (bs*8)) & 0xff]), bs*8)
Trait Implementations§
Source§impl<Hart> Clone for Rv32ZkneInstruction<Hart>
impl<Hart> Clone for Rv32ZkneInstruction<Hart>
Source§fn clone(&self) -> Rv32ZkneInstruction<Hart>
fn clone(&self) -> Rv32ZkneInstruction<Hart>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<Hart> Copy for Rv32ZkneInstruction<Hart>
Source§impl<Hart> Debug for Rv32ZkneInstruction<Hart>
impl<Hart> Debug for Rv32ZkneInstruction<Hart>
§impl<Reg, Hart> Display for Rv32ZkneInstruction<Hart>where
Reg: Display,
Hart: HartConfig<Reg = Reg>,
impl<Reg, Hart> Display for Rv32ZkneInstruction<Hart>where
Reg: Display,
Hart: HartConfig<Reg = Reg>,
impl<Hart> Eq for Rv32ZkneInstruction<Hart>
§impl<Reg, Hart> Instruction for Rv32ZkneInstruction<Hart>
Encoding layout (R-type, opcode 0x33, funct3 0x0):
impl<Reg, Hart> Instruction for Rv32ZkneInstruction<Hart>
Encoding layout (R-type, opcode 0x33, funct3 0x0):
[31:30] bs - 2-bit byte select
[29:25] funct5 - 0b1_0001 (aes32esi) / 0b1_0011 (aes32esmi)
[24:20] rs2
[19:15] rs1
[14:12] funct3 - 0b000
[11:7] rd
[6:0] opcode - 0b011_0011 (OP)Ratified match/mask values (from riscv-opcodes): MATCH_AES32ESI = 0x2200_0033, MASK_AES32ESI = 0x3e00_707f MATCH_AES32ESMI = 0x2600_0033, MASK_AES32ESMI = 0x3e00_707f
rd and rs1 are independent fields. The assembler convention places
the accumulator in both rd and rs1 (the rt pattern), but the hardware
does not require rd == rs1 and the decoder must not enforce it.
§const IMPLEMENTED_EXTENSIONS: &'static [ImplementedExtension]
const IMPLEMENTED_EXTENSIONS: &'static [ImplementedExtension]
§const OWN_ISA_EXTENSIONS: &'static [IsaExtension]
const OWN_ISA_EXTENSIONS: &'static [IsaExtension]
§fn try_decode(instruction: u32) -> Option<Self>
fn try_decode(instruction: u32) -> Option<Self>
Source§const ISA_STRING: &'static str = _
const ISA_STRING: &'static str = _
Tag_RISCV_arch attribute of ELF files, for example,
rv64i2p1_m2p0_zmmul1p0. Read moreSource§fn implements_extension<E>() -> boolwhere
E: Instruction<Hart = Self::Hart>,
fn implements_extension<E>() -> boolwhere
E: Instruction<Hart = Self::Hart>,
Self::IMPLEMENTED_EXTENSIONS for details