Skip to content

Commit

Permalink
aead-stream: extract implementation from the aead crate (#627)
Browse files Browse the repository at this point in the history
This PR extracts implementation of the STREAM construction from the
`aead` crate into a separate crate as was proposed in
RustCrypto/traits#1665.
  • Loading branch information
newpavlov authored Sep 23, 2024
1 parent 4823379 commit 5080931
Show file tree
Hide file tree
Showing 10 changed files with 650 additions and 24 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/aead-stream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: aead-stream

on:
pull_request:
paths:
- ".github/workflows/aead-stream.yml"
- "aead-stream/**"
- "Cargo.*"
push:
branches: master

defaults:
run:
working-directory: aead-stream

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.65.0 # MSRV
- stable
target:
- thumbv7em-none-eabi
- wasm32-unknown-unknown
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- run: cargo build --no-default-features --release --target ${{ matrix.target }}

test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
# 32-bit Linux
- target: i686-unknown-linux-gnu
rust: 1.65.0 # MSRV
deps: sudo apt update && sudo apt install gcc-multilib
- target: i686-unknown-linux-gnu
rust: stable
deps: sudo apt update && sudo apt install gcc-multilib

# 64-bit Linux
- target: x86_64-unknown-linux-gnu
rust: 1.65.0 # MSRV
- target: x86_64-unknown-linux-gnu
rust: stable
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- run: ${{ matrix.deps }}
- run: cargo test --target ${{ matrix.target }} --release --no-default-features
- run: cargo test --target ${{ matrix.target }} --release
- run: cargo test --target ${{ matrix.target }} --release --all-features
- run: cargo build --target ${{ matrix.target }} --benches
55 changes: 31 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = [
"aead-stream",
"aes-gcm",
"aes-gcm-siv",
"aes-siv",
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ crate.

| Name | Algorithm | Crates.io | Documentation | MSRV |
|----------------------|------------------------------|-----------|---------------|-------|
| [`aead-stream`] | [STREAM] | [![crates.io](https://img.shields.io/crates/v/aead-stream.svg)](https://crates.io/crates/aead-stream) | [![Documentation](https://docs.rs/aead-stream/badge.svg)](https://docs.rs/aead-stream) | 1.65 |
| [`aes-gcm-siv`] | [AES-GCM-SIV] | [![crates.io](https://img.shields.io/crates/v/aes-gcm-siv.svg)](https://crates.io/crates/aes-gcm-siv) | [![Documentation](https://docs.rs/aes-gcm-siv/badge.svg)](https://docs.rs/aes-gcm-siv) | 1.51 |
| [`aes-gcm`] | [AES-GCM] | [![crates.io](https://img.shields.io/crates/v/aes-gcm.svg)](https://crates.io/crates/aes-gcm) | [![Documentation](https://docs.rs/aes-gcm/badge.svg)](https://docs.rs/aes-gcm) | 1.51 |
| [`aes-siv`] | [AES-SIV] | [![crates.io](https://img.shields.io/crates/v/aes-siv.svg)](https://crates.io/crates/aes-siv) | [![Documentation](https://docs.rs/aes-siv/badge.svg)](https://docs.rs/aes-siv) | 1.51 |
Expand Down Expand Up @@ -76,6 +77,7 @@ dual licensed as above, without any additional terms or conditions.

[//]: # (algorithms)

[STREAM]: https://eprint.iacr.org/2015/189.pdf
[AES-GCM]: https://en.wikipedia.org/wiki/Galois/Counter_Mode
[AES-GCM-SIV]: https://en.wikipedia.org/wiki/AES-GCM-SIV
[AES-SIV]: https://github.com/miscreant/meta/wiki/AES-SIV
Expand Down
8 changes: 8 additions & 0 deletions aead-stream/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## UNRELEASED
- Initial release
19 changes: 19 additions & 0 deletions aead-stream/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "aead-stream"
version = "0.6.0-pre"
description = "Generic implementation of the STREAM online authenticated encryption construction"
authors = ["RustCrypto Developers"]
edition = "2021"
license = "Apache-2.0 OR MIT"
readme = "README.md"
documentation = "https://docs.rs/aead-stream"
repository = "https://github.com/RustCrypto/AEADs"
keywords = ["aead", "stream", "encryption"]
categories = ["cryptography", "no-std"]
rust-version = "1.65"

[dependencies]
aead = { version = "=0.6.0-rc.0", default-features = false, features = ["stream"] }

[features]
alloc = ["aead/alloc"]
Loading

0 comments on commit 5080931

Please sign in to comment.