Skip to content

ci: check for typos in the CI #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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: 6 additions & 0 deletions .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@ jobs:
- env:
RUSTDOCFLAGS: "-Dwarnings --cfg docsrs"
run: cargo doc --no-deps --features std,serde,hazmat,sha2

typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/[email protected]
3 changes: 3 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[default.extend-identifiers]
# typ stands for type, but it's a reserved identifier
typ = "typ"
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed
- "Unsalted" PSS support ([#294])
- `EncryptionPrimitive`/`DecriptionPrimitive` traits ([#300])
- `EncryptionPrimitive`/`DescriptionPrimitive` traits ([#300])
- `PublicKey`/`PrivateKey` traits ([#300])
- `Zeroize` impl on `RsaPrivateKey`; automatically zeroized on drop ([#311])
- `Deref<Target=RsaPublicKey>` impl on `RsaPrivateKey`; use `AsRef` instead ([#317])
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub(crate) fn generate_multi_prime_key_with_exp<R: CryptoRng + ?Sized>(
if bit_size < 64 {
let prime_limit = (1u64 << (bit_size / nprimes) as u64) as f64;

// pi aproximates the number of primes less than prime_limit
// pi approximates the number of primes less than prime_limit

// Calculate `log(prime_limit)` as `log(x) = log2(x) / log2(e) = log2(x) * log(2)`.
let mut pi = prime_limit / ((bit_size / nprimes) as f64 * core::f64::consts::LN_2 - 1.);
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/rsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ fn blind<R: TryCryptoRng + ?Sized, K: PublicKeyParts>(
Ok((blinded, ir))
}

/// Given an m and and unblinding factor, unblind the m.
/// Given an m and unblinding factor, unblind the m.
fn unblind(m: &BoxedUint, unblinder: &BoxedUint, n_params: &BoxedMontyParams) -> BoxedUint {
// m * r^-1 (mod n)
debug_assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ mod tests {

let pub_key: RsaPublicKey = private_key.clone().into();
let m = BoxedUint::from(42u64);
let c = rsa_encrypt(&pub_key, &m).expect("encryption successfull");
let c = rsa_encrypt(&pub_key, &m).expect("encryption successful");

let m2 = rsa_decrypt_and_check::<ChaCha8Rng>(private_key, None, &c)
.expect("unable to decrypt without blinding");
Expand Down
4 changes: 2 additions & 2 deletions src/traits/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ pub trait PrivateKeyParts: PublicKeyParts {
/// Returns an iterator over the CRT Values
fn crt_values(&self) -> Option<&[CrtValue]>;

/// Returns the params for `p` if precomupted.
/// Returns the params for `p` if precomputed.
fn p_params(&self) -> Option<&BoxedMontyParams>;

/// Returns the params for `q` if precomupted.
/// Returns the params for `q` if precomputed.
fn q_params(&self) -> Option<&BoxedMontyParams>;
}

Expand Down