Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI

Check warning on line 1 in .github/workflows/ci.yml

View check run for this annotation

power-z-gha-runner / rust (ubuntu-24.04-ppc64le, ghcr.io/pyca/cryptography-runner-ubuntu-rolling:ppc64le, --env RUSTUP...

Repository Approval Required

This repository is not authorized for automated runs.
Raw output
Job 110627715120 cannot proceed. Please contact the administrator to verify the repository's approval status. Details: repository is not approved for automated runs
Retrying job 110627715120 (Attempt 1) in 1m0s

on:
push:
Expand Down Expand Up @@ -258,9 +258,25 @@
image: ghcr.io/pyca/cryptography-runner-ubuntu-rolling:armv7l
# A fresh home avoids upgrading the image's incomplete Rust installation.
options: --env RUSTUP_HOME=/tmp/verified-garbage-rustup
# PPC64LE: pyca's ppc64le runner image, on a ppc64le runner (as
# pyca/cryptography does).
- os: ubuntu-24.04-ppc64le
container:
image: ghcr.io/pyca/cryptography-runner-ubuntu-rolling:ppc64le
# A fresh home avoids upgrading the image's incomplete Rust installation.
options: --env RUSTUP_HOME=/tmp/verified-garbage-rustup
- os: macos-latest
- os: windows-latest
rust: [stable, "1.88"]
exclude:
# Inline assembly (and so `naked_asm!`) on PowerPC was stabilized
# in Rust 1.95, after the crate's minimum of 1.88.
- platform:
os: ubuntu-24.04-ppc64le
container:
image: ghcr.io/pyca/cryptography-runner-ubuntu-rolling:ppc64le
options: --env RUSTUP_HOME=/tmp/verified-garbage-rustup
rust: "1.88"
# One job each for the upcoming toolchains, to catch regressions (and
# new warnings, which are errors here) before they reach stable.
include:
Expand Down
14 changes: 14 additions & 0 deletions bench/benches/primitives/chacha20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ use crate::{OPENSSL, SIZES, VG};
/// `ci/bench_arches.py`).
pub const USES: &[&str] = &["chacha20"];

#[cfg(not(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
)))]
pub fn bench(_: &mut Criterion) {}

#[cfg(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
))]
pub fn bench(c: &mut Criterion) {
let key = [0x42; 32];
let nonce = [0x24; 16];
Expand Down
14 changes: 14 additions & 0 deletions bench/benches/primitives/hmac_sha256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ use verified_garbage::hmac::Hmac;
/// `ci/bench_arches.py`): this one and those it calls.
pub const USES: &[&str] = &["hmac_sha256", "sha256"];

#[cfg(not(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
)))]
pub fn bench(_: &mut Criterion) {}

#[cfg(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
))]
pub fn bench(c: &mut Criterion) {
crate::hmac_group(
c,
Expand Down
14 changes: 14 additions & 0 deletions bench/benches/primitives/md5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ use crate::hash_group;
/// `ci/bench_arches.py`).
pub const USES: &[&str] = &["md5"];

#[cfg(not(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
)))]
pub fn bench(_: &mut Criterion) {}

#[cfg(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
))]
pub fn bench(c: &mut Criterion) {
hash_group(c, "md5", Md5::digest, MessageDigest::md5());
}
14 changes: 14 additions & 0 deletions bench/benches/primitives/sha1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ use crate::hash_group;
/// `ci/bench_arches.py`).
pub const USES: &[&str] = &["sha1"];

#[cfg(not(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
)))]
pub fn bench(_: &mut Criterion) {}

#[cfg(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
))]
pub fn bench(c: &mut Criterion) {
hash_group(c, "sha1", Sha1::digest, MessageDigest::sha1());
}
14 changes: 14 additions & 0 deletions bench/benches/primitives/sha224.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ use crate::hash_group;
/// `ci/bench_arches.py`).
pub const USES: &[&str] = &["sha224", "sha256"];

#[cfg(not(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
)))]
pub fn bench(_: &mut Criterion) {}

#[cfg(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
))]
pub fn bench(c: &mut Criterion) {
hash_group(c, "sha224", Sha224::digest, MessageDigest::sha224());
}
14 changes: 14 additions & 0 deletions bench/benches/primitives/sha256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ use crate::hash_group;
/// `ci/bench_arches.py`).
pub const USES: &[&str] = &["sha256"];

#[cfg(not(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
)))]
pub fn bench(_: &mut Criterion) {}

#[cfg(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
))]
pub fn bench(c: &mut Criterion) {
hash_group(c, "sha256", Sha256::digest, MessageDigest::sha256());
}
14 changes: 14 additions & 0 deletions bench/benches/primitives/sha512.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ use crate::hash_group;
/// `ci/bench_arches.py`).
pub const USES: &[&str] = &["sha512"];

#[cfg(not(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
)))]
pub fn bench(_: &mut Criterion) {}

#[cfg(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
))]
pub fn bench(c: &mut Criterion) {
hash_group(c, "sha512", Sha512::digest, MessageDigest::sha512());
}
6 changes: 4 additions & 2 deletions ci/bench_arches.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ def need(arch, module):

for path in changed:
asm, api, family = ASM.match(path), API.match(path), FAMILY.match(path)
if asm and asm[1] in PLATFORMS:
if asm[2] != "mod":
if asm:
# The assembly of an architecture that is not benchmarked (e.g.
# PPC64LE) needs no benchmark.
if asm[1] in PLATFORMS and asm[2] != "mod":
need(asm[1], asm[2])
elif api:
for a in PLATFORMS:
Expand Down
2 changes: 1 addition & 1 deletion ci/check_arch_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import sys

ROOT = pathlib.Path(__file__).resolve().parent.parent
ARCHES = frozenset({"x86_64", "aarch64", "arm", "x86"})
ARCHES = frozenset({"x86_64", "aarch64", "arm", "x86", "powerpc64"})

INNER_CFG = re.compile(r"^#!\[cfg\((.*?)\)\]$", re.MULTILINE | re.DOTALL)
BENCH_CFG = re.compile(r"^#\[cfg\(((?!not\().*?)\)\]\npub fn bench\(", re.MULTILINE | re.DOTALL)
Expand Down
7 changes: 7 additions & 0 deletions src/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
//! this library knows: anything else panics, rather than quietly testing
//! another configuration.

// No PPC64LE module chooses among implementations yet, so detection is only
// used by the tests there.
#![cfg_attr(
all(target_arch = "powerpc64", target_endian = "little"),
allow(dead_code)
)]

use core::sync::atomic::{AtomicU32, Ordering};

/// The features detection knows, by their Rust `target_feature` names: bit
Expand Down
7 changes: 7 additions & 0 deletions tests/acvp/mldsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
//! by verifying its signatures, and against Wycheproof's seed vectors
//! (`tests/wycheproof/mldsa*.rs`).

#![cfg(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
))]

/// Defines the tests of the parameter set named `$name` (`"ML-DSA-44"`), of
/// the module `$module` and its key types.
// Used by the parameter sets' files, on the architectures they support.
Expand Down
7 changes: 7 additions & 0 deletions tests/rfc1321/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
//! always run. Every vector of the suite is checked, in one call and split
//! into pieces at every position.

#![cfg(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86"
))]

use verified_garbage::hashes::HashFunction;
use verified_garbage::hashes::md5::Md5;

Expand Down
Loading