Skip to content

Commit 0499b5d

Browse files
committed
cleanup CI, cargo.toml, README and license blocks
1 parent ca56287 commit 0499b5d

File tree

9 files changed

+56
-44
lines changed

9 files changed

+56
-44
lines changed

.github/workflows/rust.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,25 @@ jobs:
1010
name: Test on latest Rust
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: "Rust Version"
14-
run: rustc --version
15-
1613
- name: "Checkout code"
1714
uses: actions/checkout@v4
1815

16+
- name: "Select toolchain"
17+
uses: dtolnay/rust-toolchain@stable
18+
19+
- name: "Rust Version"
20+
run: rustc --version
21+
1922
- name: Setup
2023
run: |
21-
rustc --version
2224
sudo apt-get update && sudo apt-get install -y valgrind
2325
cargo install cargo-valgrind
2426
2527
- name: Run tests
2628
run: |
2729
cargo valgrind test
2830
cargo test
31+
cargo test --doc
2932
3033
- name: Upload artifacts
3134
uses: actions/upload-artifact@v4
@@ -37,19 +40,24 @@ jobs:
3740
test-msrv:
3841
name: Test on Rust MSRV (1.63.0)
3942
runs-on: ubuntu-latest
40-
container:
41-
image: rust:1.63.0
4243
steps:
4344
- uses: actions/checkout@v4
4445

46+
- name: "Select toolchain"
47+
uses: dtolnay/[email protected]
48+
49+
- name: "Rust Version"
50+
run: rustc --version
51+
4552
- name: Setup
4653
run: |
47-
rustc --version
48-
apt-get update && apt-get install -y valgrind
54+
sudo apt-get update && sudo apt-get install -y valgrind
4955
cargo install cargo-valgrind --version 2.0.0
5056
5157
- name: Run tests
5258
run: |
59+
rm Cargo.lock
60+
cargo +1.63.0 generate-lockfile
5361
cargo valgrind test
5462
cargo test
5563

Cargo.lock

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

Cargo.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
[package]
2-
name = "ctaes"
2+
name = "ctaes-rs"
33
version = "0.1.0"
4-
authors = ["Blockstream <[email protected]>"]
5-
links = "ctaes"
6-
edition = "2015"
4+
authors = ["Philip Robinson <[email protected]>"]
5+
license = "MIT"
6+
homepage = "https://github.com/ElementsProject/rust-ctaes/"
7+
repository = "https://github.com/ElementsProject/rust-ctaes/"
8+
description = "Rust bindings and API for CTAES a constant-time AES implementation from Bitcoin Core https://github.com/bitcoin-core/ctaes"
9+
keywords = [ "crypto", "bitcoin", "aes" ]
10+
readme = "README.md"
11+
edition = "2021"
712

813
[dependencies]
914
thiserror = "1.0.30"

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# rust-ctaes
1+
# ctaes-rs
22

3-
A Rust FFI wrapper for CTAES library from <https://github.com/bitcoin-core/ctaes>
3+
Rust bindings and API for CTAES (constant-time AES implementation from Bitcoin Core found at
4+
https://github.com/bitcoin-core/ctaes")
45

56
The CTAES Library provides a constant time implementation of the AES algorithm. For completeness
67
this crate provides the interface to the AES-ECB methods, but they should not be used. Rather,

src/ctaes_ffi.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
/*********************************************************************
2-
* Copyright (c) 2023 Blockstream *
3-
* Distributed under the MIT software license, see the accompanying *
4-
* file COPYING or https://opensource.org/licenses/mit-license.php. *
5-
**********************************************************************/
1+
// Copyright (c) 2023 Blockstream
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or https://opensource.org/licenses/mit-license.php.
64

75
// Using Zeroize to zero out the memory used by AES contexts on drop
86
use zeroize::Zeroize;

src/error.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
/*********************************************************************
2-
* Copyright (c) 2023 Blockstream *
3-
* Distributed under the MIT software license, see the accompanying *
4-
* file COPYING or https://opensource.org/licenses/mit-license.php. *
5-
**********************************************************************/
1+
// Copyright (c) 2023 Blockstream
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or https://opensource.org/licenses/mit-license.php.
64

75
use thiserror::Error;
86

src/lib.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
//! A Rust FFI wrapper for CTAES library from <https://github.com/bitcoin-core/ctaes>
1+
// Copyright (c) 2023 Blockstream
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or https://opensource.org/licenses/mit-license.php.
4+
5+
//! Rust bindings and API for CTAES (constant-time AES implementation from Bitcoin Core found at
6+
//! https://github.com/bitcoin-core/ctaes)
27
//!
38
//! The CTAES Library provides a constant time implementation of the AES algorithm. For completeness
49
//! this crate provides the interface to the AES-ECB methods, but they should not be used. Rather,
@@ -12,7 +17,7 @@
1217
//! ```
1318
//! extern crate hex_conservative;
1419
//! use hex_conservative::FromHex;
15-
//! use ctaes::{Padding, Pkcs7, AesCbcBlockCipher, Aes128Cbc};
20+
//! use ctaes_rs::{Padding, Pkcs7, AesCbcBlockCipher, Aes128Cbc};
1621
//!
1722
//! let key = <[u8; 16]>::from_hex("2b7e151628aed2a6abf7158809cf4f3c").unwrap();
1823
//! let iv = <[u8; 16]>::from_hex("000102030405060708090a0b0c0d0e0f").unwrap();
@@ -396,10 +401,10 @@ impl AesCbcBlockCipher for Aes256Cbc<'_> {}
396401

397402
#[cfg(test)]
398403
mod test {
399-
use AES128_KEY_LENGTH;
400-
use AES192_KEY_LENGTH;
401-
use AES256_KEY_LENGTH;
402-
use {
404+
use crate::AES128_KEY_LENGTH;
405+
use crate::AES192_KEY_LENGTH;
406+
use crate::AES256_KEY_LENGTH;
407+
use crate::{
403408
Aes128, Aes128Cbc, Aes192, Aes192Cbc, Aes256, Aes256Cbc, AesBlockCipher, AesCbcBlockCipher,
404409
Error,
405410
};

src/padding.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
/*********************************************************************
2-
* Copyright (c) 2023 Blockstream *
3-
* Distributed under the MIT software license, see the accompanying *
4-
* file COPYING or https://opensource.org/licenses/mit-license.php. *
5-
**********************************************************************/
1+
// Copyright (c) 2023 Blockstream
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or https://opensource.org/licenses/mit-license.php.
64

7-
use Error;
5+
use crate::Error;
86

97
/// Trait defining interface for a Padding implementation
108
pub trait Padding {
@@ -98,8 +96,8 @@ impl Padding for Pkcs7 {
9896

9997
#[cfg(test)]
10098
mod test {
101-
use padding::{Padding, Pkcs7, ZeroPadding};
102-
use Error;
99+
use crate::padding::{Padding, Pkcs7, ZeroPadding};
100+
use crate::Error;
103101

104102
#[test]
105103
fn test_zero_padding() {

tests/tests.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
* file COPYING or https://opensource.org/licenses/mit-license.php. *
55
**********************************************************************/
66

7-
extern crate ctaes;
87
extern crate hex_conservative;
98

10-
use ctaes::Aes192Cbc;
11-
use ctaes::Aes256Cbc;
12-
use ctaes::{Aes128, Aes128Cbc, Aes192, Aes256, AesBlockCipher, AesCbcBlockCipher};
9+
use ctaes_rs::Aes192Cbc;
10+
use ctaes_rs::Aes256Cbc;
11+
use ctaes_rs::{Aes128, Aes128Cbc, Aes192, Aes256, AesBlockCipher, AesCbcBlockCipher};
1312
use hex_conservative::FromHex;
1413

1514
struct AesTestVector {

0 commit comments

Comments
 (0)