Skip to content

Commit bc6c2d6

Browse files
committed
cleanup, bump version to 1.2.0. the allow(unused) is due to avx512f-vaes targets - in that case that is never used
1 parent ac6b2d1 commit bc6c2d6

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aes_crypto"
3-
version = "1.1.0"
3+
version = "1.2.0"
44
authors = ["Sayantan Chakraborty <schakraborty.student@gmail.com>"]
55
edition = "2021"
66
license = "MIT"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
This is a pure-Rust platform-agnostic [AES](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf) library, that
22
is focused on reusability and optimal performance.
33

4-
This library guarantees the best performance on the `target_cpu` (if correctly specified). This currently has 5
4+
This library guarantees the best performance on the `target_cpu` (if correctly specified). This currently has 6
55
implementations, among which it automatically decides the best (most performant) using Cargo's `target_feature` flags.
66

77
# The implementations and their requirements are:

src/aes_riscv32.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ pub struct AesBlock(u32, u32, u32, u32);
99
macro_rules! _asm {
1010
($instruction:expr, $idx:literal, $rsd:ident, $rs:expr) => {
1111
asm!(
12-
concat!($instruction, "i {},{},{},", $idx),
13-
lateout(reg) $rsd,
14-
in(reg) $rsd,
15-
in(reg) $rs,
12+
concat!($instruction, "i {rd},{rs1},{rs2},", $idx),
13+
rd = lateout(reg) $rsd,
14+
rs1 = in(reg) $rsd,
15+
rs2 = in(reg) $rs,
1616
options(pure, nomem, nostack)
1717
)
1818
};

src/lib.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ fn try_from_slice<const N: usize, T: From<[u8; N]>>(value: &[u8]) -> Result<T, u
109109
}
110110
}
111111

112+
#[allow(unused)]
112113
#[inline(always)]
113114
const fn array_from_slice<const N: usize>(value: &[u8], offset: usize) -> [u8; N] {
114115
debug_assert!(value.len() - offset >= N);
@@ -491,21 +492,20 @@ fn enc_round_keys<const N: usize>(dec_round_keys: &[AesBlock; N]) -> [AesBlock;
491492
}
492493

493494
cfg_if! {
494-
if #[cfg(any(
495-
all(
496-
any(
497-
target_arch = "aarch64",
498-
target_arch = "arm64ec",
499-
all(feature = "nightly", target_arch = "arm", target_feature = "v8")
500-
),
501-
target_feature = "aes",
502-
), all(
503-
feature = "nightly",
504-
target_arch = "riscv32",
505-
target_feature = "zkne",
506-
target_feature = "zknd"
507-
)
508-
))] {
495+
if #[cfg(any(
496+
all(
497+
any(
498+
target_arch = "aarch64",
499+
target_arch = "arm64ec",
500+
all(feature = "nightly", target_arch = "arm", target_feature = "v8")
501+
),
502+
target_feature = "aes",
503+
), all(
504+
feature = "nightly",
505+
target_arch = "riscv32",
506+
target_feature = "zkne",
507+
target_feature = "zknd"
508+
)))] {
509509
macro_rules! aes_intr {
510510
($($name:ident),*) => {$(
511511
impl $name {
@@ -558,7 +558,7 @@ if #[cfg(any(
558558
acc.pre_dec_last($round_keys[$max - 1].into()) ^ $round_keys[$max].into()
559559
}};
560560
}
561-
}else{
561+
} else {
562562
macro_rules! impl_aes {
563563
(enc: $round_keys: expr, $plaintext: expr, $max:literal) => {{
564564
let mut acc = $plaintext ^ $round_keys[0].into();

0 commit comments

Comments
 (0)