fix typo, enforce alignment on the RawPage structure

I think i recall somewhere that an alignment of 16 is required
for certain structures in Rust for the RV32 target; since anything
could be put in there, let's enforce that.
This commit is contained in:
bunnie 2024-05-05 03:25:08 +08:00
parent 7ebfdf3ecd
commit 5fa955f507

View file

@ -26,14 +26,14 @@ pub struct SwapDescriptor {
#[repr(C)] #[repr(C)]
pub struct SwapSourceHeader { pub struct SwapSourceHeader {
pub version: u32, pub version: u32,
pub parital_nonce: [u8; 8], pub partial_nonce: [u8; 8],
pub mac_offset: u32, pub mac_offset: u32,
pub aad_len: u32, pub aad_len: u32,
// aad is limited to 64 bytes! // aad is limited to 64 bytes!
pub aad: [u8; 64], pub aad: [u8; 64],
} }
#[repr(C)] #[repr(C, align(16))]
pub struct RawPage { pub struct RawPage {
pub data: [u8; 4096], pub data: [u8; 4096],
} }