Skip to content

Commit 83a33fd

Browse files
committed
Pin Cb7 field layout
Cb7 casts seeds through bytemuck as u32 words. repr(C) keeps seeds at offset 0. The u32 key field keeps the struct aligned to 4 bytes, so the cast remains aligned even if Rust layout choices change.
1 parent a524739 commit 83a33fd

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/cb7.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use core::fmt;
77
use bytemuck::{bytes_of, bytes_of_mut, cast_slice};
88

99
/// A processor for CB v7+ codes.
10+
#[repr(C)]
1011
#[derive(Clone)]
1112
pub struct Cb7 {
1213
seeds: [[u8; 256]; 5],

0 commit comments

Comments
 (0)