Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ commands:
jobs:
Check Rust formatting:
docker:
- image: circleci/rust:latest
- image: rust:latest
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
Expand All @@ -41,7 +41,7 @@ jobs:
- run: cargo fmt -- --check
Rust tests - stable:
docker:
- image: circleci/rust:latest
- image: rust:latest
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
Expand All @@ -50,7 +50,7 @@ jobs:
- rust-tests
Rust tests - beta:
docker:
- image: circleci/rust:latest
- image: rust:latest
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [
"JR Conlin <src+git@jrconlin.com>",
]
license = "MPL-2.0"
edition = "2021"
edition = "2024"
repository = "https://github.com/mozilla/rust-ece"
description = "Encrypted Content-Encoding for HTTP Rust implementation."
keywords = ["http-ece", "web-push"]
Expand All @@ -21,7 +21,7 @@ lazy_static = { version = "1.5", optional = true }
once_cell = "1.21"
openssl = { version = "0.10", optional = true }
serde = { version = "1.0", features = ["derive"], optional = true }
sha2 = { version = "0.10", optional = true }
sha2 = { version = "0.10", optional = true } # blocked by hkdf 0.12

[features]
default = ["backend-openssl", "serializable-keys"]
Expand Down
4 changes: 2 additions & 2 deletions src/aes128gcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ fn split_into_records(
// Ensure we have enough padding to give at least one byte of it to each record.
// This is the only reason why we might expand the padding beyond what was requested.
let mut min_num_records = plaintext.len() / (rs - 1);
if plaintext.len() % (rs - 1) != 0 {
if !plaintext.len().is_multiple_of(rs - 1) {
min_num_records += 1;
}
let pad_length = std::cmp::max(pad_length, min_num_records);
Expand Down Expand Up @@ -482,7 +482,7 @@ impl<'a> Iterator for PlaintextRecordIterator<'a> {
// The extra plaintext must be distributed as evenly as possible
// amongst all but the final record.
let mut extra_share = self.extra_plaintext / (records_remaining - 1);
if self.extra_plaintext % (records_remaining - 1) != 0 {
if !self.extra_plaintext.is_multiple_of(records_remaining - 1) {
extra_share += 1;
}
plaintext_share += extra_share;
Expand Down