Skip to content

kernel: build in CPU routines for SHA-256 and SHA-512 - #67

Merged
bcressey merged 1 commit into
bottlerocket-os:developfrom
bcressey:arm64-ce
Mar 12, 2025
Merged

kernel: build in CPU routines for SHA-256 and SHA-512#67
bcressey merged 1 commit into
bottlerocket-os:developfrom
bcressey:arm64-ce

Conversation

@bcressey

@bcressey bcressey commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

Issue number:
Fixes #66

Description of changes:
Ensure that support for specialized CPU instructions that accelerate SHA-256 are built into the kernel for both x86_64 and aarch64. Add SHA-512 for good measure since we may switch to that hash algorithm for dm-verity at some point.

Testing done:
aarch64 variants now print:

[    0.166490] device-mapper: verity: sha256 using implementation "sha256-ce"

Tested both aws-k8s-1.32 and aws-k8s-1.32-fips for aarch64.

Kernel config diff:

==> config-aarch64-5.10-diff <==
 CRYPTO_SHA256_ARM64 m -> y
 CRYPTO_SHA2_ARM64_CE m -> y
 CRYPTO_SHA512_ARM64 n -> y
 CRYPTO_SHA512_ARM64_CE n -> y

==> config-aarch64-5.15-diff <==
 CRYPTO_SHA256_ARM64 m -> y
 CRYPTO_SHA2_ARM64_CE m -> y
 CRYPTO_SHA512_ARM64 m -> y
 CRYPTO_SHA512_ARM64_CE m -> y

==> config-aarch64-6.1-diff <==
 CRYPTO_SHA256_ARM64 m -> y
 CRYPTO_SHA2_ARM64_CE m -> y
 CRYPTO_SHA512_ARM64 m -> y
 CRYPTO_SHA512_ARM64_CE m -> y

==> config-x86_64-5.10-diff <==

==> config-x86_64-5.15-diff <==

==> config-x86_64-6.1-diff <==

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
@bcressey
bcressey requested review from arnaldo2792 and larvacea March 7, 2025 03:53
@bcressey
bcressey marked this pull request as ready for review March 7, 2025 15:25
@bcressey
bcressey merged commit 8b8d691 into bottlerocket-os:develop Mar 12, 2025
@bcressey
bcressey deleted the arm64-ce branch March 12, 2025 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build in arm64 support for crypto extensions

3 participants