Skip to content

Commit 7955832

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

File tree

9 files changed

+41
-36
lines changed

9 files changed

+41
-36
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
run: |
2727
cargo valgrind test
2828
cargo test
29+
cargo test --doc
2930
3031
- name: Upload artifacts
3132
uses: actions/upload-artifact@v4

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)