Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for PowerPC big-endian #295

Merged
merged 1 commit into from
Dec 13, 2023
Merged

Conversation

justsmth
Copy link
Contributor

@justsmth justsmth commented Dec 12, 2023

Issues:

N/A

Description of changes:

  • Fix bug in Nonce construction affecting big-endian CPUs.
  • Impl From<&[BigEndian<u32>; 3]> and From<&[LittleEndian<u32>; 3]> for Nonce
  • Add CI for powerpc and powerpc64 (big-endian).

Call-outs:

  • Current behavior when converting a[u32; 3] to a Nonce implicitly assumes the u32 values are LittleEndian. To avoid ambiguity, it's better for the endian-ness of the values to be explicit. This PR (attempts to) mark the existing implicit implementation as deprecated in favor of new explicit alternatives.

Testing:

  • Tests succeed locally on Linux host. The cross-compilation of the tests on Mac host has a link failure.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@justsmth justsmth requested a review from a team as a code owner December 12, 2023 17:09
skmcgrail
skmcgrail previously approved these changes Dec 12, 2023
@codecov-commenter
Copy link

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (f3aa3ed) 95.48% compared to head (4e6ac05) 95.22%.
Report is 1 commits behind head on main.

Files Patch % Lines
aws-lc-rs/src/aead/nonce.rs 72.72% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #295      +/-   ##
==========================================
- Coverage   95.48%   95.22%   -0.26%     
==========================================
  Files          53       55       +2     
  Lines        6929     6992      +63     
==========================================
+ Hits         6616     6658      +42     
- Misses        313      334      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +232 to +237
let x = LittleEndian::from(45u32);
let y = LittleEndian::from(897);
let z = LittleEndian::from(4567);
let iv = Nonce::from(&[x, y, z]);
let poly1305_key = derive_poly1305_key(&chacha_key, iv);
assert_eq!(&expected_poly1305_key, &poly1305_key.key_and_nonce);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a BigEndian version of this test? Or does that get covered above when we run against the new power pc targets

@justsmth justsmth merged commit c3e3ff5 into aws:main Dec 13, 2023
104 of 109 checks passed
@justsmth justsmth deleted the support-ppc-be branch December 14, 2023 13:28
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.

4 participants