diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index ce296d25..3b8aff50 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -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/typos@v1.35.1 diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000..3323627e --- /dev/null +++ b/.typos.toml @@ -0,0 +1,3 @@ +[default.extend-identifiers] +# typ stands for type, but it's a reserved identifier +typ = "typ" diff --git a/CHANGELOG.md b/CHANGELOG.md index 95ba2006..5d091bdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` impl on `RsaPrivateKey`; use `AsRef` instead ([#317]) diff --git a/src/algorithms/generate.rs b/src/algorithms/generate.rs index b8e4c890..4c121e81 100644 --- a/src/algorithms/generate.rs +++ b/src/algorithms/generate.rs @@ -44,7 +44,7 @@ pub(crate) fn generate_multi_prime_key_with_exp( 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.); diff --git a/src/algorithms/rsa.rs b/src/algorithms/rsa.rs index e1e35a56..cba7e663 100644 --- a/src/algorithms/rsa.rs +++ b/src/algorithms/rsa.rs @@ -210,7 +210,7 @@ fn blind( 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!( diff --git a/src/key.rs b/src/key.rs index 8b4f520e..6b31b377 100644 --- a/src/key.rs +++ b/src/key.rs @@ -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::(private_key, None, &c) .expect("unable to decrypt without blinding"); diff --git a/src/traits/keys.rs b/src/traits/keys.rs index b9e51caa..ee43bc66 100644 --- a/src/traits/keys.rs +++ b/src/traits/keys.rs @@ -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>; }