Skip to content

Commit f60a29e

Browse files
committed
fix: Enable non-canister code on aarch64 as well
1 parent 0b57684 commit f60a29e

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ tempfile.workspace = true
4141
[target.'cfg(target_arch = "wasm32")'.dependencies]
4242
ic-cdk.workspace = true
4343

44-
[target.'cfg(target_arch = "x86_64")'.dependencies]
44+
[target.'cfg(any(target_arch = "x86_64", target_arch = "aarch64"))'.dependencies]
4545
fs-err.workspace = true

common/src/dcc_identity.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ use hmac::{Hmac, Mac};
1111
use ic_cdk::println;
1212
use pkcs8::der::zeroize::Zeroizing;
1313
use std::error::Error;
14-
#[cfg(target_arch = "x86_64")]
14+
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
1515
use std::io::Read;
16-
#[cfg(target_arch = "x86_64")]
16+
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
1717
use std::io::Write;
18-
#[cfg(target_arch = "x86_64")]
18+
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
1919
use std::path::PathBuf;
2020

2121
use crate::ED25519_SIGN_CONTEXT;
@@ -218,7 +218,7 @@ impl DccIdentity {
218218
.replace('\n', "")
219219
}
220220

221-
#[cfg(target_arch = "x86_64")]
221+
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
222222
pub fn write_verifying_key_to_pem_file(&self, file_path: &PathBuf) -> Result<(), CryptoError> {
223223
let pem_string = self.verifying_key_as_pem();
224224

@@ -246,7 +246,7 @@ impl DccIdentity {
246246
Ok(pem::encode(&pem_obj))
247247
}
248248

249-
#[cfg(target_arch = "x86_64")]
249+
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
250250
pub fn write_signing_key_to_pem_file(&self, file_path: &PathBuf) -> Result<(), CryptoError> {
251251
let pem_string = self.signing_key_as_pem_string()?;
252252

@@ -257,15 +257,15 @@ impl DccIdentity {
257257
Ok(())
258258
}
259259

260-
#[cfg(target_arch = "x86_64")]
260+
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
261261
pub fn identities_dir() -> PathBuf {
262262
dirs::home_dir()
263263
.expect("Failed to find home directory")
264264
.join(".dcc")
265265
.join("identity")
266266
}
267267

268-
#[cfg(target_arch = "x86_64")]
268+
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
269269
pub fn save_to_dir(&self, identity: &str) -> Result<(), CryptoError> {
270270
let identity_dir = Self::identities_dir().join(identity);
271271

@@ -290,7 +290,7 @@ impl DccIdentity {
290290
Ok(())
291291
}
292292

293-
#[cfg(target_arch = "x86_64")]
293+
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
294294
fn read_signing_key_from_pem_file(file_path: &PathBuf) -> Result<SigningKey, CryptoError> {
295295
let mut file = fs_err::File::open(file_path)?;
296296
let mut pem_string = String::new();
@@ -305,7 +305,7 @@ impl DccIdentity {
305305
Ok(key)
306306
}
307307

308-
#[cfg(target_arch = "x86_64")]
308+
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
309309
fn read_verifying_key_from_pem_file(file_path: &PathBuf) -> Result<VerifyingKey, CryptoError> {
310310
let mut file = fs_err::File::open(file_path)?;
311311
let mut pem_string = String::new();
@@ -327,7 +327,7 @@ impl DccIdentity {
327327
Ok(key)
328328
}
329329

330-
#[cfg(target_arch = "x86_64")]
330+
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
331331
pub fn load_from_dir(identity_dir: &PathBuf) -> Result<Self, CryptoError> {
332332
let identity_dir = if identity_dir.is_absolute() {
333333
identity_dir.to_path_buf()

0 commit comments

Comments
 (0)