From 754bf0e25a9599b2851402e400e874477705de04 Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Sat, 11 Apr 2020 20:39:20 -0700 Subject: [PATCH 1/2] Uprev generic array to version 0.14 In 0.14 they added a pretty nice feature, which is that you can now split not just arrays that you hold by value, but you can split references to generic arrays, into a pair of references to generic arrays corresponding to the subslices, where the size calculations are done correctly at compile-time and the buffer size information is all preserved. https://docs.rs/generic-array/0.14.1/src/generic_array/sequence.rs.html#302-320 I have some ECIES code that looks like this, that builds on `aead` trait: ``` fn decrypt_in_place_detached( &self, key: &RistrettoPrivate, footer: &GenericArray, buffer: &mut [u8], ) -> Result<(), Error> { let (footer, version_data): (_, &GenericArray) = footer.split(); ``` Alternate version is like ``` fn decrypt_in_place_detached( &self, key: &RistrettoPrivate, footer: &GenericArray, buffer: &mut [u8], ) -> Result<(), Error> { let (footer, version_data) = Split::::split(footer); ``` I think these are both expected to work generic array 0.14. There are alternatives of course but they are less tidy :) Since I'm getting the generic array pub export from you, I think that to use this, I have to convince you that it's worth it to uprev. LMK what you think! Thanks --- aead/Cargo.toml | 2 +- block-cipher-trait/Cargo.toml | 2 +- digest/Cargo.toml | 2 +- stream-cipher/Cargo.toml | 2 +- universal-hash/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aead/Cargo.toml b/aead/Cargo.toml index d18a3efa2..81179f243 100644 --- a/aead/Cargo.toml +++ b/aead/Cargo.toml @@ -11,7 +11,7 @@ keywords = ["crypto", "encryption"] categories = ["cryptography", "no-std"] [dependencies] -generic-array = { version = "0.13", default-features = false } +generic-array = { version = "0.14", default-features = false } heapless = { version = "0.5", optional = true } [features] diff --git a/block-cipher-trait/Cargo.toml b/block-cipher-trait/Cargo.toml index 70e9e7785..fe8498872 100644 --- a/block-cipher-trait/Cargo.toml +++ b/block-cipher-trait/Cargo.toml @@ -10,7 +10,7 @@ keywords = ["crypto", "block-cipher", "trait"] categories = ["cryptography", "no-std"] [dependencies] -generic-array = "0.13" +generic-array = "0.14" blobby = { version = "0.1", optional = true } [features] diff --git a/digest/Cargo.toml b/digest/Cargo.toml index faeeff901..e0a2e7ceb 100644 --- a/digest/Cargo.toml +++ b/digest/Cargo.toml @@ -10,7 +10,7 @@ keywords = ["digest", "crypto", "hash"] categories = ["cryptography", "no-std"] [dependencies] -generic-array = "0.13" +generic-array = "0.14" blobby = { version = "0.1", optional = true } [features] diff --git a/stream-cipher/Cargo.toml b/stream-cipher/Cargo.toml index 159a1806b..1355e7dc0 100644 --- a/stream-cipher/Cargo.toml +++ b/stream-cipher/Cargo.toml @@ -10,7 +10,7 @@ keywords = ["crypto", "stream-cipher", "trait"] categories = ["cryptography", "no-std"] [dependencies] -generic-array = "0.13" +generic-array = "0.14" blobby = { version = "0.1", optional = true } [features] diff --git a/universal-hash/Cargo.toml b/universal-hash/Cargo.toml index 0f412af61..66da45701 100644 --- a/universal-hash/Cargo.toml +++ b/universal-hash/Cargo.toml @@ -11,7 +11,7 @@ categories = ["cryptography", "no-std"] edition = "2018" [dependencies] -generic-array = "0.13" +generic-array = "0.14" subtle = { version = "2", default-features = false } [features] From 30e4fb696b318af76e01e43442d1ece36f71ad11 Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Mon, 4 May 2020 22:36:18 -0700 Subject: [PATCH 2/2] Update .travis.yml and README.md to have MSRV 1.41, also test 1.43 --- .travis.yml | 6 +++--- README.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5a4fcef3d..554aa4ef8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,16 +4,16 @@ sudo: required matrix: include: - - rust: 1.31.0 + - rust: 1.41.0 script: cargo test --verbose --all --exclude aead --exclude signature --exclude universal-hash --release - - rust: 1.36.0 + - rust: 1.43.0 script: cargo test --verbose --package aead --package signature --package universal-hash --release - rust: stable script: cargo test --verbose --all --release - rust: nightly script: cargo test --verbose --all --release # tests if crates can be built with std feature - - rust: 1.31.0 + - rust: 1.41.0 script: ./build_std.sh - env: TARGET=i686-unknown-linux-gnu diff --git a/README.md b/README.md index cc1afce17..0a5bf208a 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Collection of traits which describe functionality of cryptographic primitives. | [`stream-cipher`](https://en.wikipedia.org/wiki/Stream_cipher) | [![crates.io](https://img.shields.io/crates/v/stream-cipher.svg)](https://crates.io/crates/stream-cipher) | [![Documentation](https://docs.rs/stream-cipher/badge.svg)](https://docs.rs/stream-cipher) | ### Minimum Rust version -All crates in this repository support Rust 1.31 or higher unless otherwise noted. +All crates in this repository support Rust 1.41 or higher unless otherwise noted. In future minimally supported version of Rust can be changed, but it will be done with the minor version bump.