Skip to content

Commit

Permalink
Merge pull request #1279 from NickeZ/nickez/arm64-support
Browse files Browse the repository at this point in the history
Nickez/arm64 support
  • Loading branch information
NickeZ authored Aug 19, 2024
2 parents c8f800e + 8c6646b commit 96d5e49
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rust/bitbox02/src/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn mcu_32_bytes(out: &mut [u8; 32]) {
unsafe { bitbox02_sys::random_32_bytes_mcu(out.as_mut_ptr()) }
}

#[cfg(target_arch = "x86_64")]
#[cfg(not(target_arch = "arm"))]
pub fn mcu_32_bytes(out: &mut [u8; 32]) {
extern "C" {
fn rand() -> util::c_types::c_int;
Expand Down
6 changes: 6 additions & 0 deletions src/rust/util/src/c_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,22 @@ pub type c_int = i32;

#[cfg(target_arch = "x86_64")]
pub type c_uint = u64;
#[cfg(target_arch = "aarch64")]
pub type c_uint = u64;
#[cfg(target_arch = "arm")]
pub type c_uint = u32;

#[cfg(target_arch = "x86_64")]
pub type c_long = i64;
#[cfg(target_arch = "aarch64")]
pub type c_long = i64;
#[cfg(target_arch = "arm")]
pub type c_long = i32;

#[cfg(target_arch = "x86_64")]
pub type c_ulong = u64;
#[cfg(target_arch = "aarch64")]
pub type c_ulong = u64;
#[cfg(target_arch = "arm")]
pub type c_ulong = u32;

Expand Down
2 changes: 1 addition & 1 deletion src/securechip/securechip.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ static ATCA_STATUS _lock_slot(securechip_slot_t slot)
static ATCA_STATUS _factory_setup(void)
{
if (_interface_functions == NULL) {
return SC_ERR_IFS;
return (ATCA_STATUS)SC_ERR_IFS;
}
bool is_config_locked = false;
ATCA_STATUS result = atcab_is_locked(LOCK_ZONE_CONFIG, &is_config_locked);
Expand Down

0 comments on commit 96d5e49

Please sign in to comment.