commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
ebff34563712beec55577cbaf0251b4c0c13d324 | Thomas Coratger | 2024-12-13T15:19:05 | polyval: fix typo in `karatsuba1` comment (#222) | diff --git a/polyval/src/backend/pmull.rs b/polyval/src/backend/pmull.rs
index 82ad6bc..0c9eb53 100644
--- a/polyval/src/backend/pmull.rs
+++ b/polyval/src/backend/pmull.rs
@@ -99,7 +99,7 @@ impl Polyval {
unsafe fn karatsuba1(x: uint8x16_t, y: uint8x16_t) -> (uint8x16_t, uint8x16_t, uint8x16_t) {
// First Karats... | 1 | 1 | 1 |
f9383e0fdb934deb8831e70cdc0267aea2b41792 | Tony Arcieri | 2024-07-26T21:05:05 | Cut release candidate (#216)
Releases the following crates:
- `ghash` v0.6.0-rc.0
- `poly1305` v0.9.0-rc.0
- `polyval` v0.7.0-rc.0 | diff --git a/Cargo.lock b/Cargo.lock
index 03947ba..1b64019 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -41,7 +41,7 @@ dependencies = [
[[package]]
name = "ghash"
-version = "0.6.0-pre.0"
+version = "0.6.0-rc.0"
dependencies = [
"hex-literal",
"opaque-debug",
@@ -78,7 +78,7 @@ checksum = "c08d65885ee38876c4f86... | 4 | 7 | 7 |
0e77fc138d84fa93a0b20083a52b152909808e5c | Tony Arcieri | 2024-07-26T20:47:17 | polyval: remove `cfg(polyval_armv8)`; enable by default (#214) | diff --git a/polyval/Cargo.toml b/polyval/Cargo.toml
index ba07fa3..58d7c0d 100644
--- a/polyval/Cargo.toml
+++ b/polyval/Cargo.toml
@@ -32,7 +32,7 @@ std = ["universal-hash/std"]
[lints.rust.unexpected_cfgs]
level = "warn"
-check-cfg = ["cfg(polyval_armv8)", "cfg(polyval_force_soft)"]
+check-cfg = ["cfg(polyval_fo... | 4 | 7 | 13 |
edd24e5942c10eff4b494795d10bcac58c942736 | Tony Arcieri | 2024-07-26T20:33:14 | Bump `universal-hash` to v0.6.0-rc.0 (#213) | diff --git a/Cargo.lock b/Cargo.lock
index 829cc37..03947ba 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -19,9 +19,9 @@ dependencies = [
[[package]]
name = "crypto-common"
-version = "0.2.0-pre.5"
+version = "0.2.0-rc.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7aa2ec04f5120b83... | 3 | 6 | 6 |
aea55b847f9b80f0561099529ed4baa8c1d232ab | Tony Arcieri | 2024-07-26T20:08:50 | Bump `hex-literal` to v0.4 (#212) | diff --git a/Cargo.lock b/Cargo.lock
index 14b7f33..829cc37 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -51,9 +51,9 @@ dependencies = [
[[package]]
name = "hex-literal"
-version = "0.3.4"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ebdb29d2ea9ed0083cd8cece49bbd... | 4 | 5 | 5 |
bca110f4c759f6d6d6b96408e789dfda8381e484 | Tony Arcieri | 2024-07-26T19:39:58 | poly1305,polyval: import `UhfClosure` for better cosmetics (#211)
Reduces the multi-line function signatures to a single line | diff --git a/poly1305/src/backend/autodetect.rs b/poly1305/src/backend/autodetect.rs
index 5f015e6..29c6074 100644
--- a/poly1305/src/backend/autodetect.rs
+++ b/poly1305/src/backend/autodetect.rs
@@ -1,7 +1,7 @@
//! Autodetection support for AVX2 CPU intrinsics on x86 CPUs, with fallback
//! to the "soft" backend wh... | 6 | 12 | 30 |
1d319caafc9a62d4cacd5b3d6abcb805baab885c | Martin Geisler | 2024-07-26T01:37:04 | Update test vector URL to match redirect (#208) | diff --git a/poly1305/tests/lib.rs b/poly1305/tests/lib.rs
index 0671503..3dc8733 100644
--- a/poly1305/tests/lib.rs
+++ b/poly1305/tests/lib.rs
@@ -68,7 +68,7 @@ fn donna_self_test2() {
#[test]
fn test_tls_vectors() {
- // from http://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-04
+ // from https://da... | 1 | 1 | 1 |
418f198c0b401473477e111e84789b0ee12185b2 | Martin Geisler | 2024-07-26T01:36:18 | poly1305: formatting of hex literal in soft.rs (#207) | diff --git a/poly1305/src/backend/soft.rs b/poly1305/src/backend/soft.rs
index 595ed02..c7b2728 100644
--- a/poly1305/src/backend/soft.rs
+++ b/poly1305/src/backend/soft.rs
@@ -32,7 +32,7 @@ impl State {
pub(crate) fn new(key: &Key) -> State {
let mut poly = State::default();
- // r &= 0xffffffc0... | 1 | 1 | 1 |
878e52742eb5331bee21a9ddcfbbcb31fe59b7c2 | Tony Arcieri | 2024-07-26T01:33:30 | Cargo.lock: bump dependencies (#210)
Updates the following dependencies:
$ cargo update
Updating crates.io index
Locking 5 packages to latest compatible versions
Updating getrandom v0.2.12 -> v0.2.15
Updating hybrid-array v0.2.0-rc.7 -> v0.2.0-rc.9
Updating libc v0.2.149 -> v0.2.155
... | diff --git a/Cargo.lock b/Cargo.lock
index c0f83b4..14b7f33 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -30,9 +30,9 @@ dependencies = [
[[package]]
name = "getrandom"
-version = "0.2.12"
+version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "190092ea657667030ac6a35e305e62... | 5 | 44 | 46 |
e290086600f6d544923bd7e206397facda37e358 | Tony Arcieri | 2024-07-26T01:00:01 | poly1305+polyval: add lints.rust.unexpected_cfgs (#209)
Fixes warnings on Rust 1.80 | diff --git a/poly1305/Cargo.toml b/poly1305/Cargo.toml
index 3bafd6d..3cec37f 100644
--- a/poly1305/Cargo.toml
+++ b/poly1305/Cargo.toml
@@ -25,3 +25,7 @@ hex-literal = "0.3"
[features]
std = ["universal-hash/std"]
+
+[lints.rust.unexpected_cfgs]
+level = "warn"
+check-cfg = ["cfg(fuzzing)", "cfg(poly1305_force_sof... | 2 | 8 | 0 |
2587c03b5715f0251e71e30a209d6a63528964d9 | Arthur Gautier | 2024-03-08T17:22:55 | ghash: poly1305: polyval: pre-releases (#201) | diff --git a/Cargo.lock b/Cargo.lock
index e39c307..c0f83b4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -41,7 +41,7 @@ dependencies = [
[[package]]
name = "ghash"
-version = "0.6.0-pre"
+version = "0.6.0-pre.0"
dependencies = [
"hex-literal",
"opaque-debug",
@@ -89,7 +89,7 @@ dependencies = [
[[package]]
n... | 5 | 10 | 12 |
6d51e014b4d95a8bd8c82821867af47f25a7c01b | Alexandr Kitaev | 2024-02-01T14:35:25 | ghash+polyval: add `new_with_init_block` (#195)
Adds customization for init_block, needed for `belt-dwp` AEAD | diff --git a/ghash/src/lib.rs b/ghash/src/lib.rs
index a38328d..d9b053e 100644
--- a/ghash/src/lib.rs
+++ b/ghash/src/lib.rs
@@ -61,10 +61,10 @@ impl KeySizeUser for GHash {
type KeySize = U16;
}
-impl KeyInit for GHash {
- /// Initialize GHASH with the given `H` field element
+impl GHash {
+ /// Initiali... | 6 | 99 | 32 |
aadd0c14c2e8a6f337d3bfd2169ea926bca6b969 | Артём Павлов [Artyom Pavlov] | 2023-10-27T12:00:07 | Update Cargo.lock | diff --git a/Cargo.lock b/Cargo.lock
index f7e8fad..518f37c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -10,9 +10,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cpufeatures"
-version = "0.2.10"
+version = "0.2.11"
source = "registry+https://github.com/rust-la... | 1 | 2 | 2 |
4f49804c9525a3b44ea72c69ffff49a61dff263f | Артём Павлов [Artyom Pavlov] | 2023-10-23T11:39:11 | Update Cargo.lock | diff --git a/Cargo.lock b/Cargo.lock
index 586f7d8..f7e8fad 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -10,9 +10,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cpufeatures"
-version = "0.2.9"
+version = "0.2.10"
source = "registry+https://github.com/rust-lan... | 1 | 6 | 6 |
845e6fcb88c2b53552ac4146c41d428b41243be6 | Артём Павлов [Artyom Pavlov] | 2023-07-05T11:06:06 | Update Cargo.lock | diff --git a/Cargo.lock b/Cargo.lock
index 39e05c7..586f7d8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -10,9 +10,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cpufeatures"
-version = "0.2.8"
+version = "0.2.9"
source = "registry+https://github.com/rust-lang... | 1 | 4 | 4 |
973fe29a26663d080b57676c6d88acbae989f841 | Eric Lagergren | 2023-06-23T18:51:16 | polyval: implement Karatsuba multiplication for arm64 (#181)
Improves performance by ~200 MB/s on a 2020 M1.
Signed-off-by: Eric Lagergren <eric@ericlagergren.com> | diff --git a/polyval/src/backend/pmull.rs b/polyval/src/backend/pmull.rs
index bcd1d84..9d99316 100644
--- a/polyval/src/backend/pmull.rs
+++ b/polyval/src/backend/pmull.rs
@@ -67,10 +67,6 @@ impl Reset for Polyval {
}
impl Polyval {
- /// Mask value used when performing reduction.
- /// This corresponds to P... | 1 | 95 | 32 |
d1d55f2366789a6125f8ba6a7c1f7cc378102d58 | Tony Arcieri | 2023-06-16T23:04:26 | polyval: support `polyval_armv8` on Rust 1.61+ (#179)
All of the functionality needed for the ARMv8 backend has been
stabilized as of Rust 1.61.
This removes the superfluous use of `feature(stdsimd)` and updates the
relevant documentation. | diff --git a/polyval/src/lib.rs b/polyval/src/lib.rs
index eb9754d..0682371 100644
--- a/polyval/src/lib.rs
+++ b/polyval/src/lib.rs
@@ -27,14 +27,17 @@
//! compact implementation which uses a clever but simple technique to avoid
//! carry-spilling.
//!
-//! ## ARMv8 intrinsics (`PMULL`, nightly-only)
+//! ## ARMv8 ... | 1 | 7 | 5 |
19645bd6f9c6832cdd2963288a046e228d826e2e | Артём Павлов [Artyom Pavlov] | 2023-06-16T13:26:49 | Update Cargo.lock | diff --git a/Cargo.lock b/Cargo.lock
index 74225d6..acaf03e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -10,9 +10,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cpufeatures"
-version = "0.2.7"
+version = "0.2.8"
source = "registry+https://github.com/rust-lang... | 1 | 12 | 12 |
b25cc2788377364e8ecd5ed6ca0b4b44d9eb5661 | Tony Arcieri | 2022-07-31T17:17:56 | Bump `universal-hash` to v0.5 (#162)
Release notes: https://github.com/RustCrypto/traits/pull/1061 | diff --git a/Cargo.lock b/Cargo.lock
index d994673..8bee1f5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -102,9 +102,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
[[package]]
name = "universal-hash"
-version = "0.5.0-pre.2"
+version = "0.5.0"
source = "registry+https://github.co... | 3 | 4 | 4 |
9b0ac5d130a1e73d0640ef2a766d53498d25e1f7 | Tony Arcieri | 2022-07-24T19:01:28 | Cut `-pre.2` releases (#161)
These prereleases use `universal-hash` v0.5.0-pre.2:
- `ghash` v0.5.0-pre.2
- `poly13095` v0.8.0-pre.2
- `polyval` v0.6.0-pre.2 | diff --git a/Cargo.lock b/Cargo.lock
index 78f06cb..d994673 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -39,7 +39,7 @@ dependencies = [
[[package]]
name = "ghash"
-version = "0.5.0-pre.1"
+version = "0.5.0-pre.2"
dependencies = [
"hex-literal",
"opaque-debug",
@@ -67,7 +67,7 @@ checksum = "624a8340c38c1b80fd54... | 4 | 7 | 7 |
0054b3067aafefa0fb0694a8155fe14a23ba8666 | Tony Arcieri | 2022-07-24T18:46:20 | Bump `universal-hash` to v0.5.0-pre.2 (#160)
This adds `UhfBackend::blocks_needed_to_align` and impls it for the AVX2
backend of Poly1305.
Co-authored-by: str4d <thestr4d@gmail.com> | diff --git a/Cargo.lock b/Cargo.lock
index dec2e82..78f06cb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -102,9 +102,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
[[package]]
name = "universal-hash"
-version = "0.5.0-pre.1"
+version = "0.5.0-pre.2"
source = "registry+https://git... | 4 | 14 | 4 |
f39df507fdf9e21e490af07f6f40e2a793a62a5d | Tony Arcieri | 2022-07-20T15:36:03 | Cut `-pre.1` releases (#158)
These prereleases use `universal-hash` v0.5.0-pre.1:
- `ghash` v0.5.0-pre.1
- `poly13095` v0.8.0-pre.1
- `polyval` v0.6.0-pre.1 | diff --git a/Cargo.lock b/Cargo.lock
index 78fc411..dec2e82 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -39,7 +39,7 @@ dependencies = [
[[package]]
name = "ghash"
-version = "0.5.0-pre"
+version = "0.5.0-pre.1"
dependencies = [
"hex-literal",
"opaque-debug",
@@ -67,7 +67,7 @@ checksum = "624a8340c38c1b80fd5490... | 4 | 7 | 7 |
d3f7b355c4c34e152d58dd6cebe10e1c9eeea511 | Tony Arcieri | 2022-07-20T14:44:44 | polyval: impl `Reset` (#157)
This is useful in the implementation of `aes-gcm-siv`, as it allows for
calling the newly re-added `finalize_reset` method, which is useful to
avoid consuming `self` when computing the tag.
SIV mode encryption requires first computing the tag as a pass of
POLYVAL over the plaintext, ... | diff --git a/polyval/src/backend/autodetect.rs b/polyval/src/backend/autodetect.rs
index d70e7fa..376a946 100644
--- a/polyval/src/backend/autodetect.rs
+++ b/polyval/src/backend/autodetect.rs
@@ -6,7 +6,7 @@ use core::mem::ManuallyDrop;
use universal_hash::{
consts::U16,
crypto_common::{BlockSizeUser, KeySi... | 5 | 45 | 9 |
90bcb02a55016d31ef005bd333bf1769f6fa1bc4 | Tony Arcieri | 2022-07-20T14:08:26 | Bump `universal-hash` to v0.5.0-pre.1 (#156) | diff --git a/Cargo.lock b/Cargo.lock
index 13c9656..78fc411 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -102,9 +102,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
[[package]]
name = "universal-hash"
-version = "0.5.0-pre"
+version = "0.5.0-pre.1"
source = "registry+https://githu... | 3 | 4 | 4 |
2e76e1b7eeee8fc627c09d3a7c71b979cccdb7b8 | Tony Arcieri | 2021-08-28T02:20:43 | ghash: relax zeroize constraints (#141)
Allows all 1.0 versions of `zeroize` earlier than 1.4 (MSRV 1.51+) | diff --git a/ghash/Cargo.toml b/ghash/Cargo.toml
index 1830b53..465f912 100644
--- a/ghash/Cargo.toml
+++ b/ghash/Cargo.toml
@@ -17,7 +17,9 @@ edition = "2018"
[dependencies]
opaque-debug = "0.3"
polyval = { version = "0.5.1", path = "../polyval" }
-zeroize = { version = "=1.3", optional = true, default-features = f... | 1 | 3 | 1 |
f6b0ab632ee40ee6c7c459c200bb46ce5b7c21cd | Artyom Pavlov | 2021-08-27T15:16:38 | polyval: use cpufeatures v0.2 instead of v0.2.1 (#138) | diff --git a/polyval/Cargo.toml b/polyval/Cargo.toml
index 7a20d80..f0ddaec 100644
--- a/polyval/Cargo.toml
+++ b/polyval/Cargo.toml
@@ -21,7 +21,7 @@ universal-hash = { version = "0.4", default-features = false }
zeroize = { version = "=1.3", optional = true, default-features = false }
[target.'cfg(any(target_arch... | 1 | 1 | 1 |
4785ff9b3b1a919341e185a9a2003d55fa749830 | Tony Arcieri | 2021-04-29T14:44:36 | Use `cpufeatures` v0.1 crate release (#116)
Renamed from `cpuid-bool` | diff --git a/Cargo.lock b/Cargo.lock
index f89ab58..a6c1989 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,10 +1,10 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
-name = "cpuid-bool"
-version = "0.2.0"
+name = "cpufeatures"
+version = "0.1.0"
source = "reg... | 5 | 9 | 9 |
751d267560850ebd2bbf3e4edd3105c88ea94af4 | Tony Arcieri | 2020-12-31T17:25:15 | poly1305: bump version to v0.7.0-pre
This reflects that the next release should bump the minor version due to
the MSRV change. | diff --git a/Cargo.lock b/Cargo.lock
index 8575cc1..a322506 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -52,7 +52,7 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "poly1305"
-version = "0.6.2"
+version = "0.7.0-pre"
dependencies = [
"cpuid-bool",
"hex-litera... | 2 | 2 | 2 |
7d01b6df33f84ab715291a3e1b64846aca4e176d | Tony Arcieri | 2020-12-26T17:17:11 | polyval: use u128 to impl `mulx` (#111)
Switches the internal implementation of `mulx()` from u64 to u128.
In addition to the test vectors added in #107, this change was further
integration tested against the `aes-gcm` crate, which contains a full
set of NIST test vectors. | diff --git a/polyval/src/mulx.rs b/polyval/src/mulx.rs
index a978042..75b7074 100644
--- a/polyval/src/mulx.rs
+++ b/polyval/src/mulx.rs
@@ -1,6 +1,6 @@
-/// The `mulX_POLYVAL()` function.
+//! The `mulX_POLYVAL()` function.
+
use crate::Block;
-use core::convert::TryInto;
/// The `mulX_POLYVAL()` function as defin... | 1 | 7 | 15 |
c16b73939679f5f6939132aee2ad5e0e3f56b00d | Tony Arcieri | 2020-12-26T16:45:09 | ghash: use `polyval::mulx` (#109)
The `ghash` crate is implemented in terms of POLYVAL using a technique
described in RFC 8452 Appendix A.
Part of this implementation is a multiply-by-x operation over POLYVAL
field elements (a.k.a. `mulX_POLYVAL` in RFC 8452 terminology), which
was previously defined in the `gha... | diff --git a/ghash/Cargo.toml b/ghash/Cargo.toml
index f22e326..e496e00 100644
--- a/ghash/Cargo.toml
+++ b/ghash/Cargo.toml
@@ -16,7 +16,7 @@ edition = "2018"
[dependencies]
opaque-debug = "0.3"
-polyval = { version = "0.4", path = "../polyval" }
+polyval = { version = "0.4.4", features = ["mulx"], path = "../poly... | 4 | 16 | 34 |
585432b198aabf414a5d617a5e553b0e321ea968 | Tony Arcieri | 2020-12-10T16:43:08 | Factor `autodetect` module under `backends` (#106) | diff --git a/poly1305/src/backend.rs b/poly1305/src/backend.rs
index 3c0a6d0..70b9a5b 100644
--- a/poly1305/src/backend.rs
+++ b/poly1305/src/backend.rs
@@ -6,4 +6,10 @@
))]
pub(crate) mod avx2;
+#[cfg(all(
+ any(target_arch = "x86", target_arch = "x86_64"),
+ not(feature = "force-soft")
+))]
+pub(crate) mod ... | 6 | 14 | 14 |
25bd61583b9688ce214120ddb99867845fdf6d77 | Tony Arcieri | 2020-12-10T14:10:56 | Use `opaque-debug` to impl Debug for all crates (#105)
Provides a simple opaque `Debug` impl | diff --git a/Cargo.lock b/Cargo.lock
index 0887890..a808e43 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -20,6 +20,7 @@ name = "ghash"
version = "0.3.0"
dependencies = [
"hex-literal",
+ "opaque-debug",
"polyval",
"zeroize",
]
@@ -43,12 +44,19 @@ dependencies = [
"proc-macro-hack",
]
+[[package]]
+name = "... | 7 | 18 | 0 |
99bb457e49dff935c006832ceb9bef9995b78322 | Tony Arcieri | 2020-12-10T01:41:10 | poly1305: remove performance notes (#103)
The performance with autodetection enabled is nearly identical to the
performance when passing explicit `target-cpu`/`target-flags`, so it's
now irrelevant to note it. | diff --git a/poly1305/src/lib.rs b/poly1305/src/lib.rs
index d39487b..f0513bc 100644
--- a/poly1305/src/lib.rs
+++ b/poly1305/src/lib.rs
@@ -19,20 +19,6 @@
//! Minimum supported Rust version may be changed in the future, but such
//! changes will be accompanied with a minor version bump.
//!
-//! # Performance Notes... | 1 | 0 | 14 |
c0ec0a2d22bcf11723a7e679b53dec67d3f218b3 | Tony Arcieri | 2020-12-10T01:30:35 | polyval: fix `zeroize` feature on autodetect backend (#102)
Adds a `Drop` impl for the autodetect backend which zeroizes when the
`zeroize` feature is enabled.
Due to the need for union members to be `Copy` until we can leverage
`ManuallyDrop` on MSRV 1.49+, the `soft` backends still don't implement
it properly.... | diff --git a/polyval/src/autodetect.rs b/polyval/src/autodetect.rs
index ba4f6fb..570a586 100644
--- a/polyval/src/autodetect.rs
+++ b/polyval/src/autodetect.rs
@@ -90,3 +90,13 @@ impl Clone for Polyval {
}
}
}
+
+#[cfg(feature = "zeroize")]
+impl Drop for Polyval {
+ fn drop(&mut self) {
+ use... | 3 | 14 | 0 |
0c84ace1468edc580945e2feed9dd47cb88736a4 | Tony Arcieri | 2020-12-08T18:31:20 | polyval: make `mul` an instance method of the CLMUL implementation (#98) | diff --git a/polyval/src/backend/clmul.rs b/polyval/src/backend/clmul.rs
index bc408fc..e18b726 100644
--- a/polyval/src/backend/clmul.rs
+++ b/polyval/src/backend/clmul.rs
@@ -46,7 +46,7 @@ impl UniversalHash for Polyval {
#[inline]
fn update(&mut self, x: &Block) {
unsafe {
- mul(self, x... | 1 | 63 | 61 |
bea6d8cd0974a51e0216f1d03e28cca95b6f47ac | Tony Arcieri | 2020-12-08T16:08:20 | polyval: rename `backends` module -> `backend` (#94)
...for consistency with the `poly1305` crate | diff --git a/polyval/src/autodetect.rs b/polyval/src/autodetect.rs
index f9a851f..ba4f6fb 100644
--- a/polyval/src/autodetect.rs
+++ b/polyval/src/autodetect.rs
@@ -1,7 +1,7 @@
//! Autodetection for (P)CLMUL(QDQ) CPU intrinsics on x86 CPUs, with fallback
//! to the "soft" backend when it's unavailable.
-use crate::... | 6 | 9 | 9 |
3ea67e64ab30fb46806c421ad1b35f2dbf90e03c | Tony Arcieri | 2020-12-08T14:59:18 | polyval: CLMUL detection (#92)
Automatically detects the availability of CLMUL based on CPUID, and
falls back to the "soft" implementation if unavailable. | diff --git a/Cargo.lock b/Cargo.lock
index 7a8cf7a..6718151 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,10 +1,10 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
-name = "cfg-if"
-version = "1.0.0"
+name = "cpuid-bool"
+version = "0.2.0"
source = "registry... | 8 | 222 | 90 |
30500eebba1c8404034dd117e83791d4fed15b59 | Tony Arcieri | 2020-12-08T13:33:38 | polyval: refactor backends (#91)
Simplifies gating of backend implementations using some of the tricks we
learned from the `aes` crate.
This is in anticipation of adding CLMUL autodetection. | diff --git a/polyval/src/backends.rs b/polyval/src/backends.rs
new file mode 100644
index 0000000..3830b3b
--- /dev/null
+++ b/polyval/src/backends.rs
@@ -0,0 +1,20 @@
+//! POLYVAL backends
+
+use cfg_if::cfg_if;
+
+cfg_if! {
+ if #[cfg(all(
+ target_feature = "pclmulqdq",
+ target_feature = "sse2",
+ ... | 5 | 23 | 35 |
adc4f77705be8c278a8ca66ced57f84f4a2b91a1 | Tony Arcieri | 2020-12-08T12:41:53 | polyval: fix typo (#89) | diff --git a/polyval/src/lib.rs b/polyval/src/lib.rs
index 8e9303a..018cf8d 100644
--- a/polyval/src/lib.rs
+++ b/polyval/src/lib.rs
@@ -1,7 +1,7 @@
//! **POLYVAL** is a GHASH-like universal hash over GF(2^128) useful for
//! implementing [AES-GCM-SIV] or [AES-GCM/GMAC].
//!
-//! From [RFC 8452 Section 3] which defi... | 1 | 1 | 1 |
3ecf4dd3fe664293ac655a10cdd59e6573afa101 | Tony Arcieri | 2020-09-29T21:12:25 | poly1305: add `chacha20` and `salsa20` keywords to Cargo.toml (#84) | diff --git a/poly1305/Cargo.toml b/poly1305/Cargo.toml
index 08dde5c..c0200ac 100644
--- a/poly1305/Cargo.toml
+++ b/poly1305/Cargo.toml
@@ -6,7 +6,7 @@ license = "Apache-2.0 OR MIT"
description = "The Poly1305 universal hash function and message authentication code"
documentation = "https://docs.rs/poly1305"
reposi... | 1 | 1 | 1 |
db99517ea1fbb5770818b546738f1f05e140d245 | Tony Arcieri | 2020-09-29T21:03:27 | polyval: add `aes-gcm` and `ghash` keywords to Cargo.toml (#83) | diff --git a/polyval/Cargo.toml b/polyval/Cargo.toml
index 7fed994..36e17e0 100644
--- a/polyval/Cargo.toml
+++ b/polyval/Cargo.toml
@@ -10,7 +10,7 @@ a Message Authentication Code (MAC)
documentation = "https://docs.rs/polyval"
repository = "https://github.com/RustCrypto/universal-hashes"
readme = "README.md"
-keyw... | 1 | 1 | 1 |
d8cef95232f7c9bdb43a0676fc40e9883bdcdb6a | Tony Arcieri | 2020-09-29T20:58:32 | polyval: add KEY_SIZE constant (#82) | diff --git a/polyval/src/lib.rs b/polyval/src/lib.rs
index 1c3a499..8e9303a 100644
--- a/polyval/src/lib.rs
+++ b/polyval/src/lib.rs
@@ -92,6 +92,9 @@ pub use clmul_backend::Polyval;
/// Size of a POLYVAL block in bytes
pub const BLOCK_SIZE: usize = 16;
+/// Size of a POLYVAL key in bytes
+pub const KEY_SIZE: usize... | 1 | 3 | 0 |
8717eea82e9b0ec1e79cbf4c27571c93427d818d | Tony Arcieri | 2020-09-29T19:15:59 | poly1305: refactor AVX2 backend's cached blocks (#76)
Makes `cached_blocks` into a `[Block; 4]`, which eliminates a bunch of
array offset calculations on the previous byte array.
We can rely on Rust layout to place these contiguously (i.e. stride == size):
https://github.com/rust-lang/unsafe-code-guidelines/blo... | diff --git a/poly1305/src/backend/avx2.rs b/poly1305/src/backend/avx2.rs
index 04ad0ab..d8a4b62 100644
--- a/poly1305/src/backend/avx2.rs
+++ b/poly1305/src/backend/avx2.rs
@@ -15,15 +15,14 @@
// optimisations provided by Bhattacharyya and Sarkar. The latter require the message
// length to be known, which is incompa... | 2 | 19 | 24 |
35187e0c2e49377918afa469fbda13a99ab8b94a | str4d | 2020-09-10T14:14:47 | Small refactors and fixes (#71)
* poly1305: Move backend logic into a module
* poly1305: Move fuzz_avx2 into fuzz module
* Fix compilation of benchmarks | diff --git a/ghash/benches/ghash.rs b/ghash/benches/ghash.rs
index 1d23eb9..4427b1a 100644
--- a/ghash/benches/ghash.rs
+++ b/ghash/benches/ghash.rs
@@ -2,7 +2,10 @@
extern crate test;
-use ghash::{universal_hash::UniversalHash, GHash};
+use ghash::{
+ universal_hash::{NewUniversalHash, UniversalHash},
+ GHa... | 9 | 77 | 60 |
f6a1e0ce094f7cd6aceafe66c3b3bcab919f884d | str4d | 2020-09-06T00:23:52 | poly1305: Re-add donna's self-test 2 test vector (#70) | diff --git a/poly1305/tests/lib.rs b/poly1305/tests/lib.rs
index 23f4009..2d531f4 100644
--- a/poly1305/tests/lib.rs
+++ b/poly1305/tests/lib.rs
@@ -1,8 +1,9 @@
use hex_literal::hex;
use poly1305::{
universal_hash::{NewUniversalHash, UniversalHash},
- Poly1305, BLOCK_SIZE,
+ Poly1305, BLOCK_SIZE, KEY_SIZE,... | 1 | 21 | 1 |
5cec96e9861a7bdf393883b5b5fb1616bf91fdca | str4d | 2020-09-05T19:12:29 | Updates to Poly1305 test vectors (#68)
* poly1305: Add test vector from RFC 7539
* poly1305: Document wrapping test vector from poly1305-donna
* poly1305: Use hex-literal to shrink test vectors | diff --git a/Cargo.lock b/Cargo.lock
index fcff6ec..2a1034b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -315,6 +315,7 @@ dependencies = [
name = "poly1305"
version = "0.6.0"
dependencies = [
+ "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"universal-hash 0.4.0 (registry+https://githu... | 3 | 47 | 57 |
1c7b8b395efec61017cc1ee5517ee86bae14071b | Artyom Pavlov | 2020-08-18T20:42:06 | Update hex-literal to v0.2 (#67) | diff --git a/Cargo.lock b/Cargo.lock
index 0eae343..fcff6ec 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -186,7 +186,7 @@ dependencies = [
name = "ghash"
version = "0.3.0"
dependencies = [
- "hex-literal 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hex-literal 0.2.1 (registry+https://github.com/... | 3 | 13 | 22 |
b6aef15ff8f59c017787813edca9651bce9b57d6 | Tony Arcieri | 2020-06-05T00:41:21 | Bump `universal-hash` dependency to v0.4 release | diff --git a/Cargo.lock b/Cargo.lock
index 84cd02c..2d98689 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -309,7 +309,7 @@ dependencies = [
name = "poly1305"
version = "0.6.0-pre"
dependencies = [
- "universal-hash 0.4.0-pre (git+https://github.com/RustCrypto/traits)",
+ "universal-hash 0.4.0 (registry+https://github.... | 4 | 7 | 10 |
53c701675ed374d7ee85ed17be1f22ab451d7a49 | Tony Arcieri | 2020-06-02T21:14:24 | Rename `*result*` to `finalize`
Implements the API changes from:
https://github.com/RustCrypto/traits/pull/161
The `universal-hash` crate now uses `update` and `finalize` nomenclature
ala the Initialize-Update-Finalize (IUF) interface naming scheme. | diff --git a/Cargo.lock b/Cargo.lock
index eb49bc5..84cd02c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6,7 +6,7 @@ version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.70 (regis... | 7 | 87 | 87 |
db130f78eb85492e89718f3dd3150b1f09ba6c58 | Jack Grigg | 2020-03-29T01:17:05 | poly1305: Fix build with zeroize enabled
When zeroize is enabled, Poly1305 implements Drop, and because
soft::Poly1305State does not implement Copy, we cannot move it out of
Poly1305. | diff --git a/poly1305/src/lib.rs b/poly1305/src/lib.rs
index 87b174a..5a96bba 100644
--- a/poly1305/src/lib.rs
+++ b/poly1305/src/lib.rs
@@ -83,7 +83,7 @@ impl UniversalHash for Poly1305 {
}
/// Get the hashed output
- fn result(self) -> Tag {
+ fn result(mut self) -> Tag {
self.state.finaliz... | 2 | 2 | 2 |
1d73f1c4406e95c8b920be118d4f988fb47c37c5 | Jack Grigg | 2020-03-28T23:35:12 | poly1305: Rewrite UniversalHash implementation for readability | diff --git a/poly1305/src/lib.rs b/poly1305/src/lib.rs
index c2cec58..87b174a 100644
--- a/poly1305/src/lib.rs
+++ b/poly1305/src/lib.rs
@@ -47,8 +47,8 @@ pub type Tag = Output<U16>;
#[derive(Clone)]
pub struct Poly1305 {
state: soft::Poly1305State,
- leftover: usize,
buffer: Block,
+ filled: usize,
... | 2 | 30 | 25 |
3b7590137a1b08a0d3b1a4f17502004445315b70 | Jack Grigg | 2020-03-28T23:07:21 | poly1305: Pass block from update_block to compute_block if we can
This path will be taken if the caller is exclusively using the
UniversalHash trait. The original path might be taken if they are mixing
in calls to Poly1305::update, which might result in partial blocks. | diff --git a/poly1305/src/lib.rs b/poly1305/src/lib.rs
index 53c15f2..c2cec58 100644
--- a/poly1305/src/lib.rs
+++ b/poly1305/src/lib.rs
@@ -66,8 +66,13 @@ impl UniversalHash for Poly1305 {
/// Input data into the Poly1305 universal hash function
fn update_block(&mut self, block: &GenericArray<u8, U16>) {
-... | 1 | 7 | 2 |
c0276149c557cf950a68c04f7840ca89a3fec98f | Jack Grigg | 2020-03-28T23:03:10 | poly1305: Move software implementation of Poly1305State into a module | diff --git a/poly1305/src/lib.rs b/poly1305/src/lib.rs
index a5294e4..53c15f2 100644
--- a/poly1305/src/lib.rs
+++ b/poly1305/src/lib.rs
@@ -5,12 +5,6 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms... | 2 | 266 | 254 |
74cdcb918d4fbb4f689839b5171de9e4496b1d17 | Jack Grigg | 2020-03-28T22:54:57 | poly1305: Split apart state machine and UniversalHash implementation | diff --git a/poly1305/src/lib.rs b/poly1305/src/lib.rs
index 3583775..a5294e4 100644
--- a/poly1305/src/lib.rs
+++ b/poly1305/src/lib.rs
@@ -42,33 +42,20 @@ pub type Block = [u8; BLOCK_SIZE];
/// Poly1305 tags (16-bytes)
pub type Tag = Output<U16>;
-/// The Poly1305 universal hash function.
-///
-/// Note that Poly... | 1 | 72 | 39 |
4e806a1b216053a76cda1e9e0aff5983fb84ddc7 | Jack Grigg | 2020-03-28T22:53:44 | poly1305: Use copy_from_slice in update instead of setting each byte | diff --git a/poly1305/src/lib.rs b/poly1305/src/lib.rs
index 55fe3bc..3583775 100644
--- a/poly1305/src/lib.rs
+++ b/poly1305/src/lib.rs
@@ -210,10 +210,7 @@ impl Poly1305 {
if self.leftover > 0 {
let want = min(16 - self.leftover, m.len());
- for (i, byte) in m.iter().cloned().enumer... | 1 | 1 | 4 |
54e7a03b9ad10e47fdc34b2ddf50f0950bb8d8a2 | Tony Arcieri | 2019-12-21T19:06:34 | polyval: match ideal assembly
The previous implementation used separate `#[target_feature(...)]`
blocks for each `core::arch` intrinsic. This thwarts the inliner, so
these all translated to `call` instructions.
This change inlines the intrinsic calls into larger
`#[target_feature(...)]`-gated functions.
When compili... | diff --git a/polyval/src/field/pclmulqdq.rs b/polyval/src/field/pclmulqdq.rs
index 3e1f738..3576373 100644
--- a/polyval/src/field/pclmulqdq.rs
+++ b/polyval/src/field/pclmulqdq.rs
@@ -43,30 +43,53 @@ impl From<M128i> for Block {
impl Add for M128i {
type Output = Self;
- /// Adds two POLYVAL field elements.... | 1 | 44 | 54 |
a55f7d24dcc431e5a3bb6cf16add5a023f8566ec | Tony Arcieri | 2019-12-21T16:13:17 | Use correct `pshufd` intrinsic
Previously the implementation used the `_mm_shuffle_pd` intrinsic which
maps to the `shufpd` (floating point shuffle) instruction.
This still produced the correct assembly, as LLVM noticed the inputs and
outputs were integers and substituted `pshufd` for `shufpd`, which is
the correct A... | diff --git a/polyval/src/field.rs b/polyval/src/field.rs
index 6c83f86..9e9e029 100644
--- a/polyval/src/field.rs
+++ b/polyval/src/field.rs
@@ -18,6 +18,7 @@ mod pclmulqdq;
mod u32_soft;
mod u64_soft;
+#[allow(unused_imports)]
use cfg_if::cfg_if;
use core::ops::{Add, Mul};
diff --git a/polyval/src/field/pclmul... | 2 | 5 | 5 |
4bf2398dbf1027394e7c32c973d0ba26852f963c | Tony Arcieri | 2019-12-11T00:25:50 | polyval: comment fixup
Move notes about the PCLMULQDQ-based implementation into `pclmulqdq.rs` | diff --git a/polyval/src/field.rs b/polyval/src/field.rs
index 04c00e6..6c83f86 100644
--- a/polyval/src/field.rs
+++ b/polyval/src/field.rs
@@ -6,12 +6,6 @@
//! > binary field of size 2^128. The field is defined by the irreducible
//! > polynomial x^128 + x^127 + x^126 + x^121 + 1."
//!
-//! This implementation pr... | 2 | 6 | 8 |
b2f0b8c99da5e86840590d4ad08a7947e0c979a7 | Tony Arcieri | 2019-12-05T16:25:27 | polyval: Use `cfg-if` crate to reduce duplication
There are probably better ways this could be leveraged, but this is at
least an improvement over what it was. | diff --git a/polyval/Cargo.toml b/polyval/Cargo.toml
index 6858a4f..43fb93e 100644
--- a/polyval/Cargo.toml
+++ b/polyval/Cargo.toml
@@ -15,6 +15,7 @@ categories = ["cryptography", "no-std"]
edition = "2018"
[dependencies]
+cfg-if = "0.1"
universal-hash = { version = "0.3", default-features = false }
zeroize = { ... | 2 | 15 | 21 |
77846a90b8062e5d52267306812cdfcacae31db5 | Tony Arcieri | 2019-12-05T15:47:07 | polyval: Constant-time 32-bit software implementation
Previously (in #7) BearSSL's `ghash_ctmul64.c` was adapted into a
portable software backend.
This commit additionally adapts BearSSL's `ghash_ctmul32.c` into a
portable constant-time field arithmetic backend for POLYVAL designed for
32-bit architectures. | diff --git a/polyval/benches/polyval.rs b/polyval/benches/polyval.rs
index df8dad8..1655be5 100644
--- a/polyval/benches/polyval.rs
+++ b/polyval/benches/polyval.rs
@@ -16,7 +16,7 @@ fn bench(c: &mut Criterion<CyclesPerByte>) {
group.bench_function(BenchmarkId::new("update_padded", size), |b| {
... | 4 | 283 | 45 |
43d60e1b7ded6fd2589cef9cfd91713f58d9dbe3 | Tony Arcieri | 2019-11-14T22:04:57 | ghash: rustfmt | diff --git a/ghash/src/lib.rs b/ghash/src/lib.rs
index 88ca68b..300ce4d 100644
--- a/ghash/src/lib.rs
+++ b/ghash/src/lib.rs
@@ -104,5 +104,7 @@ fn mulX_POLYVAL(block: &GenericArray<u8, U16>) -> GenericArray<u8, U16> {
v0 ^= v1h;
v1 ^= v0h ^ (v1h << 63) ^ (v1h << 62) ^ (v1h << 57);
- (u128::from(v0) | (u... | 1 | 3 | 1 |
ccec73ce84e520392ff8cef69dbcdbbe5600b5dd | Tony Arcieri | 2019-11-14T17:51:34 | Upgrade to `zeroize` 1.0
This removes the `-pre` from the requirements for all crates which are
using it.
Due to semver all of these crates are already using `zeroize` 1.0. | diff --git a/ghash/Cargo.toml b/ghash/Cargo.toml
index 41ab2e0..892b0ec 100644
--- a/ghash/Cargo.toml
+++ b/ghash/Cargo.toml
@@ -16,7 +16,7 @@ edition = "2018"
[dependencies]
polyval = { version = "0.3", path = "../polyval" }
-zeroize = { version = "1.0.0-pre", optional = true, default-features = false }
+zeroize =... | 3 | 3 | 3 |
f13608df77c5d06d35b08863638e77482f5d00b2 | Tony Arcieri | 2019-10-06T20:50:05 | ghash: Revert mulX_POLYVAL changes from #28
These changes broke the implementation of `mulX_POLYVAL`:
https://github.com/RustCrypto/universal-hashes/pull/28/files#diff-6189716e3235b5dfb266bd1c39947b1aR95
After reverting it, AES-GCM test vectors which previously failed are now
working:
https://github.com/RustCrypto/... | diff --git a/ghash/src/lib.rs b/ghash/src/lib.rs
index 2e0924a..88ca68b 100644
--- a/ghash/src/lib.rs
+++ b/ghash/src/lib.rs
@@ -93,9 +93,16 @@ impl UniversalHash for GHash {
/// [1]: https://tools.ietf.org/html/rfc8452#appendix-A
#[allow(non_snake_case)]
fn mulX_POLYVAL(block: &GenericArray<u8, U16>) -> GenericArra... | 1 | 12 | 5 |
457ab849cfc3199b94d607803b7726b0beb93949 | Tony Arcieri | 2019-10-05T18:49:49 | polyval: Remove `pub` from `field` module
We don't actually need to expose this, even for `ghash`.
Keeping it out of the public API until we actually have a legitimate use
case for exposing it will increase flexibility when we do want to. | diff --git a/ghash/Cargo.toml b/ghash/Cargo.toml
index ebd4645..30bfbee 100644
--- a/ghash/Cargo.toml
+++ b/ghash/Cargo.toml
@@ -16,6 +16,7 @@ edition = "2018"
[dependencies]
polyval = { version = "0.2", path = "../polyval" }
+zeroize = { version = "1.0.0-pre", optional = true, default-features = false }
[dev-de... | 5 | 32 | 26 |
962292ace9605c5df85fe306d687fc8edb7f8d9b | Tony Arcieri | 2019-10-04T00:04:57 | Upgrade to `universal-hash` crate v0.3 | diff --git a/ghash/Cargo.toml b/ghash/Cargo.toml
index 906843e..8d5c345 100644
--- a/ghash/Cargo.toml
+++ b/ghash/Cargo.toml
@@ -25,4 +25,3 @@ std = ["polyval/std"]
[badges]
maintenance = { status = "experimental" }
-travis-ci = { repository = "RustCrypto/universal-hashes" }
diff --git a/ghash/src/lib.rs b/ghash/sr... | 6 | 5 | 8 |
ada2dfce7e726322085275d4915c5acec4e45845 | Tony Arcieri | 2019-10-01T20:52:30 | zeroize 1.0.0-pre | diff --git a/poly1305/Cargo.toml b/poly1305/Cargo.toml
index df47fcd..8ec5034 100644
--- a/poly1305/Cargo.toml
+++ b/poly1305/Cargo.toml
@@ -13,7 +13,7 @@ edition = "2018"
[dependencies]
universal-hash = { version = "0.2", default-features = false }
-zeroize = { version = "0.10", optional = true, default-features =... | 2 | 2 | 2 |
778a1e0176c0300e802219656056285a1d94b413 | James McGlashan | 2019-09-22T00:00:00 | Copy UniversalHash::update_padded into Polyval's implementation + use black_box in benches | diff --git a/polyval/benches/polyval.rs b/polyval/benches/polyval.rs
index 6e32f79..aca74f0 100644
--- a/polyval/benches/polyval.rs
+++ b/polyval/benches/polyval.rs
@@ -3,19 +3,20 @@
extern crate test;
use polyval::{universal_hash::UniversalHash, Polyval};
-use test::Bencher;
+use test::{Bencher, black_box};
// ... | 2 | 25 | 2 |
49503511c16717839168edb7cef8bf285dcf4a50 | Tony Arcieri | 2019-09-19T22:03:21 | poly1305: Add `Tag` type
Alias for `Output<U16>`.
Based on TODO from this PR:
https://github.com/RustCrypto/AEADs/pull/8/files#diff-fdc13efdc7d664b91b2edc4e61ea2662R17 | diff --git a/poly1305/src/lib.rs b/poly1305/src/lib.rs
index cce4f74..7602578 100644
--- a/poly1305/src/lib.rs
+++ b/poly1305/src/lib.rs
@@ -39,6 +39,9 @@ pub const BLOCK_SIZE: usize = 16;
/// Poly1305 blocks (16-bytes)
pub type Block = [u8; BLOCK_SIZE];
+/// Poly1305 tags (16-bytes)
+pub type Tag = Output<U16>;
+
... | 1 | 10 | 7 |
89ff570e058d13b3444ec0dfa2cf875575ed2d70 | Tony Arcieri | 2019-09-19T16:04:31 | polyval: Removed unused file
Accidentally left over after #12. No longer used. | diff --git a/polyval/src/field/backend.rs b/polyval/src/field/backend.rs
deleted file mode 100644
index d9a2461..0000000
--- a/polyval/src/field/backend.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-//! Field arithmetic backends
-
-
-
-/// Field arithmetic backend
-pub trait Backend:
- Copy + Add<Output = Self> + Mul<Output = S... | 1 | 0 | 9 |
f6a33ae6ccd0574e2264cf1ca069520e043d3e22 | Tony Arcieri | 2019-09-19T15:12:59 | polyval: Simplify implementation
Eliminate needless traits and module depth, making `field::Element` into
a simple newtype wrapper. | diff --git a/polyval/src/field.rs b/polyval/src/field.rs
index e793e04..3973beb 100644
--- a/polyval/src/field.rs
+++ b/polyval/src/field.rs
@@ -14,11 +14,36 @@
//!
//! [RFC 8452 Section 3]: https://tools.ietf.org/html/rfc8452#section-3
-pub mod backend;
+#[cfg(all(
+ target_feature = "pclmulqdq",
+ target_fe... | 5 | 34 | 57 |
2265955e3f1c61d8104915f7a67a5ffcb71685fe | Tony Arcieri | 2019-09-05T21:04:29 | polyval: Implement GHASH
Implements GHASH in terms of POLYVAL as described in RFC 8452 Appendix A:
https://tools.ietf.org/html/rfc8452#appendix-A | diff --git a/polyval/Cargo.toml b/polyval/Cargo.toml
index f043592..855aad4 100644
--- a/polyval/Cargo.toml
+++ b/polyval/Cargo.toml
@@ -22,6 +22,7 @@ zeroize = { version = "0.10", optional = true, default-features = false }
hex-literal = "0.1"
[features]
+ghash = []
std = ["universal-hash/std"]
[badges]
diff -... | 6 | 118 | 11 |
43c6622892943f67bef1695d625d6d59f05fb58d | Tony Arcieri | 2019-09-03T15:12:26 | polyval: Refactor in prep for soft backend rewrite
This incrementally incorporates some of the refactoring changes from #7
in order to simplify the diff for that PR (and because those changes
seem generally good regardless). | diff --git a/poly1305/benches/poly1305.rs b/poly1305/benches/poly1305.rs
index 58f6dbd..dc8d857 100644
--- a/poly1305/benches/poly1305.rs
+++ b/poly1305/benches/poly1305.rs
@@ -2,7 +2,7 @@
extern crate test;
-use poly1305::{Poly1305, universal_hash::UniversalHash};
+use poly1305::{universal_hash::UniversalHash, Po... | 8 | 82 | 142 |
241b3949d50ef04f8e51e949cff0f8b4bf3394f9 | Tony Arcieri | 2019-09-01T17:34:49 | polyval: Use UniversalHash trait | diff --git a/polyval/Cargo.toml b/polyval/Cargo.toml
index 1dd12e4..f85e272 100644
--- a/polyval/Cargo.toml
+++ b/polyval/Cargo.toml
@@ -15,13 +15,15 @@ categories = ["cryptography", "no-std"]
edition = "2018"
[dependencies]
-subtle = { version = "2", default-features = false }
+universal-hash = { version = "0.2", ... | 9 | 77 | 172 |
299eff8efa798c2174b899b30960bff5e2b57e3e | Tony Arcieri | 2019-09-01T16:23:07 | poly1305: Use UniversalHash trait
A first pass at adapting Poly1305 to use the `UniversalHash` trait | diff --git a/poly1305/Cargo.toml b/poly1305/Cargo.toml
index 015fa5d..2bbf2de 100644
--- a/poly1305/Cargo.toml
+++ b/poly1305/Cargo.toml
@@ -12,11 +12,12 @@ readme = "README.md"
edition = "2018"
[dependencies]
-subtle = { version = "2", default-features = false }
-zeroize = { version = "0.9", optional = true, defau... | 4 | 120 | 160 |
49f2fea4b7725742ddf1454ef0651d5f33589d9e | Steven Sheldon | 2017-02-20T05:41:54 | Bumped to 1.0.0 | diff --git a/Cargo.toml b/Cargo.toml
index cfb0c08..6ec331f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "malloc_buf"
-version = "0.0.6"
+version = "1.0.0"
authors = ["Steven Sheldon"]
description = "Structs for handling malloc'd memory passed to Rust." | 1 | 1 | 1 |
975314803ebb00625ff8632861f3e55f9e7ce4df | Steven Sheldon | 2017-02-20T05:39:07 | Renamed new to from_ptr
If we ever do want to add support for allocating your own Malloc, new
sounds like it'd be the right name for that method. from_ptr is more
consistent with the name of other ffi constructors like this in rust. | diff --git a/src/lib.rs b/src/lib.rs
index d72bea4..3116c4d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -25,7 +25,7 @@ impl<T> Malloc<T> {
Unsafe because there must be a valid instance of `T` at `ptr`.
*/
- pub unsafe fn new(ptr: *mut T) -> Malloc<T> {
+ pub unsafe fn from_ptr(ptr: *mut T) -> Malloc<T... | 1 | 3 | 3 |
5e6eed6738bcb772c4fd52a3c9494b831c0bdc86 | Steven Sheldon | 2017-02-20T05:33:54 | Documented new methods. | diff --git a/src/lib.rs b/src/lib.rs
index 36c2313..d72bea4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -14,11 +14,17 @@ use libc::{c_char, c_void};
const DUMMY_PTR: *mut c_void = 0x1 as *mut c_void;
/// A type that represents a `malloc`'d chunk of memory.
+/// When dropped, a `Malloc` will `free` that memory.
pub... | 1 | 15 | 1 |
1506abf2bafb3b7bceb77fe678b83f4b98be7ceb | Steven Sheldon | 2017-02-19T19:33:05 | Implemented a few common traits for Malloc | diff --git a/src/lib.rs b/src/lib.rs
index 6682dff..36c2313 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,6 +4,7 @@ extern crate libc;
#[cfg(test)]
extern crate std;
+use core::fmt;
use core::ops::Deref;
use core::ptr;
use core::slice;
@@ -74,6 +75,24 @@ impl<T: ?Sized> Drop for Malloc<T> {
}
}
+impl<T:... | 1 | 19 | 0 |
4eb9d5b29b0697dc4995a8d7c4d695faf4e22767 | Steven Sheldon | 2017-02-19T19:25:35 | Added a Malloc::new constructor for single allocations | diff --git a/src/lib.rs b/src/lib.rs
index a8c7189..6682dff 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -17,6 +17,12 @@ pub struct Malloc<T: ?Sized> {
ptr: *mut T,
}
+impl<T> Malloc<T> {
+ pub unsafe fn new(ptr: *mut T) -> Malloc<T> {
+ Malloc { ptr: ptr }
+ }
+}
+
impl<T> Malloc<[T]> {
/**
... | 1 | 31 | 21 |
b01d13b95b612f120de8a373c115410e859be727 | Steven Sheldon | 2017-02-19T19:07:38 | Malloc::from_array no longer returns None on null
In general rust methods that take a pointer don't seem to check for
null, and this makes it consistent with Malloc::from_c_str. | diff --git a/src/lib.rs b/src/lib.rs
index 3915ea7..a8c7189 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,23 +18,23 @@ pub struct Malloc<T: ?Sized> {
}
impl<T> Malloc<[T]> {
- /// Constructs a new `Malloc` for a `malloc`'d buffer
- /// with the given length at the given pointer.
- /// Returns `None` if t... | 1 | 19 | 24 |
61651d201ab16783ed8429b4691f70046ae7cb04 | Steven Sheldon | 2017-02-19T18:52:19 | Remove the Copy bound by using drop_in_place | diff --git a/src/lib.rs b/src/lib.rs
index 0e869e6..3915ea7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -5,6 +5,7 @@ extern crate libc;
extern crate std;
use core::ops::Deref;
+use core::ptr;
use core::slice;
use core::str::{Utf8Error, self};
use libc::{c_char, c_void};
@@ -16,7 +17,7 @@ pub struct Malloc<T: ?Si... | 1 | 25 | 4 |
7cebad07b43495412426ceb3d566d2b4d0acf3ca | Steven Sheldon | 2017-02-19T18:27:38 | Added a Malloc::from_c_str constructor | diff --git a/src/lib.rs b/src/lib.rs
index ef54805..0e869e6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -6,7 +6,8 @@ extern crate std;
use core::ops::Deref;
use core::slice;
-use libc::c_void;
+use core::str::{Utf8Error, self};
+use libc::{c_char, c_void};
const DUMMY_PTR: *mut c_void = 0x1 as *mut c_void;
@@ ... | 1 | 27 | 2 |
e4c24dfe50f6ff7bda291792e8a06c2ac19b5eb3 | Steven Sheldon | 2017-02-19T18:02:15 | Make the crate no_std | diff --git a/src/lib.rs b/src/lib.rs
index 65bd1cc..ef54805 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,7 +1,11 @@
+#![no_std]
+
extern crate libc;
+#[cfg(test)]
+extern crate std;
-use std::ops::Deref;
-use std::slice;
+use core::ops::Deref;
+use core::slice;
use libc::c_void;
const DUMMY_PTR: *mut c_void = ... | 1 | 6 | 2 |
e389c1ebb3a59c16940a1f5ea197e181b57ac1e3 | Steven Sheldon | 2017-02-19T17:59:12 | Replace MallocBuffer<T> with Malloc<[T]> | diff --git a/src/lib.rs b/src/lib.rs
index 24066b6..65bd1cc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,61 +1,52 @@
extern crate libc;
-use std::marker::PhantomData;
use std::ops::Deref;
use std::slice;
use libc::c_void;
-struct MallocPtr(*mut c_void);
-
-impl Drop for MallocPtr {
- fn drop(&mut self) {
-... | 1 | 33 | 42 |
230861bf873ec72a644ae5a1b39fdf0b3a1ce654 | Steven Sheldon | 2015-11-06T16:32:06 | Added gitignore to Cargo excludes. | diff --git a/Cargo.toml b/Cargo.toml
index 90e1270..cfb0c08 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,5 +8,7 @@ repository = "https://github.com/SSheldon/malloc_buf"
documentation = "http://ssheldon.github.io/malloc_buf/malloc_buf/"
license = "MIT"
+exclude = [".gitignore"]
+
[dependencies]
libc = ">= 0.1, <... | 1 | 2 | 0 |
a7811e5f4c6f9685dd57ad9bfe34e9bf6b0ba4f9 | Steven Sheldon | 2015-11-06T16:30:13 | Bumped to 0.0.6. | diff --git a/Cargo.toml b/Cargo.toml
index b4ac1e0..90e1270 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "malloc_buf"
-version = "0.0.5"
+version = "0.0.6"
authors = ["Steven Sheldon"]
description = "Structs for handling malloc'd memory passed to Rust." | 1 | 1 | 1 |
047e44f6fde58937b1c2574229b4dfdbe8adbf14 | Steven Sheldon | 2015-11-06T16:29:38 | Updated libc dependency to allow 0.2. | diff --git a/Cargo.toml b/Cargo.toml
index 9bd260d..b4ac1e0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,4 +9,4 @@ documentation = "http://ssheldon.github.io/malloc_buf/malloc_buf/"
license = "MIT"
[dependencies]
-libc = "0.1"
+libc = ">= 0.1, < 0.3" | 1 | 1 | 1 |
bab724c8ad090a53e482103a93cd924a17068cd1 | Steven Sheldon | 2015-03-21T20:38:26 | Bumped to 0.0.5. | diff --git a/Cargo.toml b/Cargo.toml
index 0b2ff56..9bd260d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "malloc_buf"
-version = "0.0.4"
+version = "0.0.5"
authors = ["Steven Sheldon"]
description = "Structs for handling malloc'd memory passed to Rust." | 1 | 1 | 1 |
688c88cd5982431ff30b344a9df4dd1637fdebcc | Steven Sheldon | 2015-03-21T20:37:55 | Removed MallocString struct. | diff --git a/src/lib.rs b/src/lib.rs
index 43596f2..24066b6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,11 +1,9 @@
extern crate libc;
-use std::ffi::CStr;
use std::marker::PhantomData;
use std::ops::Deref;
use std::slice;
-use std::str;
-use libc::{c_char, c_void};
+use libc::c_void;
struct MallocPtr(*mut c... | 1 | 3 | 61 |
81fbd0214f878f44a4faaaa0a5ef6b6a39211b4b | Steven Sheldon | 2015-03-17T04:48:23 | Bumped to 0.0.4. | diff --git a/Cargo.toml b/Cargo.toml
index 61d7592..0b2ff56 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "malloc_buf"
-version = "0.0.3"
+version = "0.0.4"
authors = ["Steven Sheldon"]
description = "Structs for handling malloc'd memory passed to Rust." | 1 | 1 | 1 |
5a116f2ef32ee13f43796657220fdfa045e54f70 | Steven Sheldon | 2015-03-17T04:38:13 | Added a MallocPtr struct to remove unsafe_destructor. | diff --git a/src/lib.rs b/src/lib.rs
index ea99ee2..43596f2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,17 +1,27 @@
-#![feature(unsafe_destructor)]
-
extern crate libc;
use std::ffi::CStr;
+use std::marker::PhantomData;
use std::ops::Deref;
use std::slice;
use std::str;
use libc::{c_char, c_void};
+struct ... | 1 | 22 | 16 |
33cddc291caca63b98bc67d9996de0dfe8c59a46 | Steven Sheldon | 2015-03-17T03:59:02 | Revert dropping items and instead require Copy.
This reverts commit 97c78243ed4acf31895a09909a036d7c26eee2e2. | diff --git a/src/lib.rs b/src/lib.rs
index a44a1f5..ea99ee2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,7 +4,6 @@ extern crate libc;
use std::ffi::CStr;
use std::ops::Deref;
-use std::ptr;
use std::slice;
use std::str;
use libc::{c_char, c_void};
@@ -15,13 +14,12 @@ pub struct MallocBuffer<T> {
len: usiz... | 1 | 2 | 7 |
9b2b0d64895ca19bea4ee512537e13bd41910382 | Steven Sheldon | 2015-03-16T07:12:46 | Updated features for the latest rust. | diff --git a/src/lib.rs b/src/lib.rs
index 7169f9c..a44a1f5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,4 @@
-#![feature(core, unsafe_destructor)]
+#![feature(unsafe_destructor)]
extern crate libc; | 1 | 1 | 1 |
5fe0d18e7b6cc92efc7e83f80594413be01f61ec | Steven Sheldon | 2015-03-07T19:00:52 | Updated features for the latest rust. | diff --git a/src/lib.rs b/src/lib.rs
index 897b600..7169f9c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,4 @@
-#![feature(core, std_misc, unsafe_destructor)]
+#![feature(core, unsafe_destructor)]
extern crate libc; | 1 | 1 | 1 |
5f0651b2272dcb91a2a8c02771ca4e6dc77db02d | Steven Sheldon | 2015-02-28T21:49:24 | Bumped to 0.0.3. | diff --git a/Cargo.toml b/Cargo.toml
index 9906a25..61d7592 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "malloc_buf"
-version = "0.0.2"
+version = "0.0.3"
authors = ["Steven Sheldon"]
description = "Structs for handling malloc'd memory passed to Rust." | 1 | 1 | 1 |
98acbceb812c4e92371b3c63c0896f5cfbf380b6 | Steven Sheldon | 2015-02-28T21:48:05 | Add tests. | diff --git a/src/lib.rs b/src/lib.rs
index 956be86..897b600 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -103,3 +103,50 @@ impl Deref for MallocString {
}
}
}
+
+#[cfg(test)]
+mod tests {
+ use std::ptr;
+ use libc::{c_char, self};
+
+ use super::{MallocBuffer, MallocString};
+
+ #[test]
+ ... | 1 | 47 | 0 |
a7c0db3ffc30cc1f1bc5a1cc5a124e3981c44c93 | Steven Sheldon | 2015-02-28T21:46:57 | Allow pointers to be null for 0-length buffers. | diff --git a/src/lib.rs b/src/lib.rs
index f9b4589..956be86 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,7 +18,7 @@ pub struct MallocBuffer<T> {
impl<T> MallocBuffer<T> {
/// Constructs a new `MallocBuffer` for a `malloc`'d buffer
/// with the given length at the given pointer.
- /// Returns `None` if ... | 1 | 9 | 3 |
3f55f1370db23b600829cef0ce671eebd291aa89 | Steven Sheldon | 2015-02-24T07:11:00 | Replace deprecated c_str_to_bytes method. | diff --git a/src/lib.rs b/src/lib.rs
index 33b314b..f9b4589 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,7 +2,7 @@
extern crate libc;
-use std::ffi;
+use std::ffi::CStr;
use std::ops::Deref;
use std::ptr;
use std::slice;
@@ -71,8 +71,8 @@ impl MallocString {
if ptr.is_null() {
None
... | 1 | 3 | 3 |
498278d7b938768c0a6558c7c93bfe7a55f60444 | Steven Sheldon | 2015-02-07T22:56:37 | Replaced deprecated from_raw_buf method. | diff --git a/src/lib.rs b/src/lib.rs
index 647afc7..33b314b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,7 +3,6 @@
extern crate libc;
use std::ffi;
-use std::mem;
use std::ops::Deref;
use std::ptr;
use std::slice;
@@ -51,10 +50,8 @@ impl<T> Deref for MallocBuffer<T> {
type Target = [T];
fn deref(&s... | 1 | 1 | 4 |
f0f133bbcb85b5d9b5cbfaa934967b3ac27cbc02 | Steven Sheldon | 2015-01-31T17:59:09 | Bumped to 0.0.2. | diff --git a/Cargo.toml b/Cargo.toml
index 2e7e76a..9906a25 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "malloc_buf"
-version = "0.0.1"
+version = "0.0.2"
authors = ["Steven Sheldon"]
description = "Structs for handling malloc'd memory passed to Rust." | 1 | 1 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.