Skip to content

Commit

Permalink
Update DPE to the latest zerocopy.
Browse files Browse the repository at this point in the history
  • Loading branch information
clundin25 authored and jhand2 committed Feb 21, 2025
1 parent 448ce4e commit 49422d3
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ members = [
[workspace.dependencies]
caliptra-cfi-lib-git = { git = "https://github.com/chipsalliance/caliptra-cfi.git", package = "caliptra-cfi-lib-git", rev = "a98e499d279e81ae85881991b1e9eee354151189", default-features = false, features = ["cfi", "cfi-counter" ] }
caliptra-cfi-derive-git = { git = "https://github.com/chipsalliance/caliptra-cfi.git", package = "caliptra-cfi-derive-git", rev = "a98e499d279e81ae85881991b1e9eee354151189"}
zerocopy = { version = "0.8.8", features = ["derive"] }
zerocopy = { version = "0.8.17", features = ["derive"] }
openssl = "0.10.64"

[profile.firmware]
Expand Down
2 changes: 1 addition & 1 deletion dpe/src/commands/certify_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use cfg_if::cfg_if;
zerocopy::Immutable,
zerocopy::KnownLayout,
)]
pub struct CertifyKeyFlags(u32);
pub struct CertifyKeyFlags(pub u32);

bitflags! {
impl CertifyKeyFlags: u32 {}
Expand Down
2 changes: 1 addition & 1 deletion dpe/src/commands/derive_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use platform::Platform;
zerocopy::Immutable,
zerocopy::KnownLayout,
)]
pub struct DeriveContextFlags(u32);
pub struct DeriveContextFlags(pub u32);

bitflags! {
impl DeriveContextFlags: u32 {
Expand Down
2 changes: 1 addition & 1 deletion dpe/src/commands/initialize_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use cfg_if::cfg_if;
zerocopy::Immutable,
zerocopy::KnownLayout,
)]
pub struct InitCtxCmd(u32);
pub struct InitCtxCmd(pub u32);

bitflags! {
impl InitCtxCmd: u32 {
Expand Down
2 changes: 1 addition & 1 deletion dpe/src/commands/rotate_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use caliptra_cfi_lib_git::{cfi_assert, cfi_assert_eq};
zerocopy::Immutable,
zerocopy::KnownLayout,
)]
pub struct RotateCtxFlags(u32);
pub struct RotateCtxFlags(pub u32);

bitflags! {
impl RotateCtxFlags: u32 {
Expand Down
2 changes: 1 addition & 1 deletion dpe/src/commands/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crypto::{Crypto, Digest, EcdsaSig};
zerocopy::Immutable,
zerocopy::KnownLayout,
)]
pub struct SignFlags(u32);
pub struct SignFlags(pub u32);

bitflags! {
impl SignFlags: u32 {}
Expand Down
6 changes: 3 additions & 3 deletions dpe/src/dpe_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ pub struct DpeEnv<'a, T: DpeTypes + 'a> {
#[derive(IntoBytes, TryFromBytes, KnownLayout, Immutable, Zeroize)]
pub struct DpeInstance {
pub contexts: [Context; MAX_HANDLES],
pub(crate) support: Support,
pub support: Support,

/// Can only successfully execute the initialize context command for non-simulation (i.e.
/// `InitializeContext(simulation=false)`) once per reset cycle.
pub(crate) has_initialized: U8Bool,
pub has_initialized: U8Bool,

// unused buffer added to make DpeInstance word aligned and remove padding
reserved: [u8; 3],
pub reserved: [u8; 3],
}

impl DpeInstance {
Expand Down
2 changes: 1 addition & 1 deletion dpe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const INTERNAL_INPUT_INFO_SIZE: usize = size_of::<GetProfileResp>() + size_of::<
)]
#[repr(C, align(1))]
pub struct U8Bool {
val: u8,
pub val: u8,
}

impl U8Bool {
Expand Down
2 changes: 1 addition & 1 deletion dpe/src/support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use zeroize::Zeroize;

#[derive(Default, IntoBytes, FromBytes, KnownLayout, Immutable, Zeroize, Copy, Clone)]
#[repr(C)]
pub struct Support(u32);
pub struct Support(pub u32);

bitflags! {
impl Support: u32 {
Expand Down

0 comments on commit 49422d3

Please sign in to comment.