Skip to content

Commit c2fe6b3

Browse files
dignifiedquireinitsecrettarcieri
authored
ocb3: import from offset-codebook-mode crate (#587)
Import from https://github.com/sgmenda/offset-cookbook-mode Includes modifications and consistency cleanups --------- Co-authored-by: sanketh <me@snkth.com> Co-authored-by: Tony Arcieri <bascule@gmail.com>
1 parent 57ac6eb commit c2fe6b3

File tree

12 files changed

+1191
-18
lines changed

12 files changed

+1191
-18
lines changed

.github/workflows/ocb3.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: ocb3
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/ocb3.yml"
7+
- "ocb3/**"
8+
- "Cargo.*"
9+
push:
10+
branches: master
11+
12+
defaults:
13+
run:
14+
working-directory: ocb3
15+
16+
env:
17+
CARGO_INCREMENTAL: 0
18+
RUSTFLAGS: "-Dwarnings"
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
rust:
26+
- 1.60.0 # MSRV
27+
- stable
28+
target:
29+
- armv7a-none-eabi
30+
- thumbv7em-none-eabi
31+
- wasm32-unknown-unknown
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: dtolnay/rust-toolchain@master
35+
with:
36+
toolchain: ${{ matrix.rust }}
37+
targets: ${{ matrix.target }}
38+
- run: cargo build --no-default-features --release --target ${{ matrix.target }}
39+
40+
test:
41+
runs-on: ubuntu-latest
42+
strategy:
43+
matrix:
44+
include:
45+
# 32-bit Linux
46+
- target: i686-unknown-linux-gnu
47+
rust: 1.60.0 # MSRV
48+
deps: sudo apt update && sudo apt install gcc-multilib
49+
- target: i686-unknown-linux-gnu
50+
rust: stable
51+
deps: sudo apt update && sudo apt install gcc-multilib
52+
53+
# 64-bit Linux
54+
- target: x86_64-unknown-linux-gnu
55+
rust: 1.60.0 # MSRV
56+
- target: x86_64-unknown-linux-gnu
57+
rust: stable
58+
steps:
59+
- uses: actions/checkout@v4
60+
- uses: dtolnay/rust-toolchain@master
61+
with:
62+
toolchain: ${{ matrix.rust }}
63+
targets: ${{ matrix.target }}
64+
- run: ${{ matrix.deps }}
65+
- run: cargo test --target ${{ matrix.target }} --release
66+
- run: cargo test --target ${{ matrix.target }} --release --features stream,std,zeroize
67+
- run: cargo test --target ${{ matrix.target }} --release --all-features
68+
- run: cargo build --target ${{ matrix.target }} --benches

Cargo.lock

Lines changed: 31 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ members = [
99
"deoxys",
1010
"eax",
1111
"mgm",
12+
"ocb3",
1213
]
1314
resolver = "2"

ocb3/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
8+
## 0.1.0 (2023-XX-XX)
9+
10+
- Initial release

ocb3/Cargo.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[package]
2+
name = "ocb3"
3+
version = "0.1.0"
4+
description = """
5+
Pure Rust implementation of the OCB3
6+
Authenticated Encryption with Associated Data (AEAD) Cipher
7+
"""
8+
authors = ["RustCrypto Developers"]
9+
edition = "2021"
10+
license = "Apache-2.0 OR MIT"
11+
readme = "README.md"
12+
documentation = "https://docs.rs/ocb3"
13+
repository = "https://github.com/RustCrypto/AEADs"
14+
keywords = ["aead", "encryption", "ocb", "ocb3"]
15+
categories = ["cryptography", "no-std"]
16+
rust-version = "1.60"
17+
18+
[dependencies]
19+
aead = { version = "0.5", default-features = false }
20+
cipher = "0.4"
21+
ctr = "0.9"
22+
subtle = { version = "2", default-features = false }
23+
zeroize = { version = "1", optional = true, default-features = false }
24+
25+
[dev-dependencies]
26+
aead = { version = "0.5", features = ["dev"], default-features = false }
27+
aes = { version = "0.8", default-features = false }
28+
hex-literal = "0.4"
29+
30+
[features]
31+
default = ["alloc", "getrandom"]
32+
std = ["aead/std", "alloc"]
33+
alloc = ["aead/alloc"]
34+
arrayvec = ["aead/arrayvec"]
35+
getrandom = ["aead/getrandom", "rand_core"]
36+
heapless = ["aead/heapless"]
37+
rand_core = ["aead/rand_core"]
38+
stream = ["aead/stream"]
39+
40+
[package.metadata.docs.rs]
41+
all-features = true
42+
rustdoc-args = ["--cfg", "docsrs"]

0 commit comments

Comments
 (0)