diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 5e7fa44..c2b0486 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -109,3 +109,10 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + typos: + name: Check for typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: crate-ci/typos@v1.33.1 diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..d93cbd3 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,19 @@ +[files] +extend-exclude = [ + ".git/", + "*.svg", + "TESTVECTORS" +] + +[default] +extend-ignore-re = [ + # Patterns which appear to be 36 or more characters of Base64/Base64url + '\b[0-9A-Za-z+/]{36,}\b', + '\b[0-9A-Za-z_-]{36,}\b', +] + +[default.extend-words] +"AKE" = "AKE" # Authenticated Key Exchange +"Ono" = "Ono" # Surname +"Tung" = "Tung" # Name +"Monts" = "Monts" # Abbreviation for Montgomery diff --git a/curve25519-dalek/build.rs b/curve25519-dalek/build.rs index 1b0f618..b062078 100644 --- a/curve25519-dalek/build.rs +++ b/curve25519-dalek/build.rs @@ -84,7 +84,7 @@ fn main() { } } Ok("unstable_avx512") if !nightly => { - panic!("Could not override curve25519_dalek_backend to unstable_avx512, as this is nigthly only"); + panic!("Could not override curve25519_dalek_backend to unstable_avx512, as this is nightly only"); } // default between serial / simd (if potentially capable) _ => match is_capable_simd(&target_arch, curve25519_dalek_bits) { diff --git a/curve25519-dalek/src/traits.rs b/curve25519-dalek/src/traits.rs index 80a6423..0e6fc17 100644 --- a/curve25519-dalek/src/traits.rs +++ b/curve25519-dalek/src/traits.rs @@ -90,7 +90,7 @@ pub trait MultiscalarMul { /// # Examples /// /// The trait bound aims for maximum flexibility: the inputs must be - /// convertable to iterators (`I: IntoIter`), and the iterator's items + /// convertible to iterators (`I: IntoIter`), and the iterator's items /// must be `Borrow` (or `Borrow`), to allow /// iterators returning either `Scalar`s or `&Scalar`s. /// @@ -211,7 +211,7 @@ pub trait VartimeMultiscalarMul { /// # Examples /// /// The trait bound aims for maximum flexibility: the inputs must be - /// convertable to iterators (`I: IntoIter`), and the iterator's items + /// convertible to iterators (`I: IntoIter`), and the iterator's items /// must be `Borrow` (or `Borrow`), to allow /// iterators returning either `Scalar`s or `&Scalar`s. /// @@ -318,7 +318,7 @@ pub trait VartimePrecomputedMultiscalarMul: Sized { /// length than \\(B_j\\). /// /// The trait bound aims for maximum flexibility: the input must - /// be convertable to iterators (`I: IntoIter`), and the + /// be convertible to iterators (`I: IntoIter`), and the /// iterator's items must be `Borrow`, to allow iterators /// returning either `Scalar`s or `&Scalar`s. fn vartime_multiscalar_mul(&self, static_scalars: I) -> Self::Point @@ -352,7 +352,7 @@ pub trait VartimePrecomputedMultiscalarMul: Sized { /// the same length. /// /// The trait bound aims for maximum flexibility: the inputs must be - /// convertable to iterators (`I: IntoIter`), and the iterator's items + /// convertible to iterators (`I: IntoIter`), and the iterator's items /// must be `Borrow` (or `Borrow`), to allow /// iterators returning either `Scalar`s or `&Scalar`s. fn vartime_mixed_multiscalar_mul( diff --git a/ed25519-dalek/src/signature.rs b/ed25519-dalek/src/signature.rs index af82768..ae3f9bf 100644 --- a/ed25519-dalek/src/signature.rs +++ b/ed25519-dalek/src/signature.rs @@ -73,7 +73,7 @@ fn check_scalar(bytes: [u8; 32]) -> Result { // potential non-reduced scalars is performed. // // This is compatible with ed25519-donna and libsodium when - // -DED25519_COMPAT is NOT specified. + // `-D ED25519_COMPAT` is NOT specified. if bytes[31] & 224 != 0 { return Err(InternalError::ScalarFormat.into()); } diff --git a/ed25519-dalek/tests/pkcs8.rs b/ed25519-dalek/tests/pkcs8.rs index 4a12318..f073a5f 100644 --- a/ed25519-dalek/tests/pkcs8.rs +++ b/ed25519-dalek/tests/pkcs8.rs @@ -81,7 +81,7 @@ fn get_algo_identifier() { assert_eq!(identifier.oid, ed25519::pkcs8::ALGORITHM_OID); let signing_key = SigningKey::from_bytes(&SK_BYTES); - let identifer = signing_key.signature_algorithm_identifier().unwrap(); - assert!(identifer.parameters.is_none()); // According to rfc8410 this must be None - assert_eq!(identifer.oid, ed25519::pkcs8::ALGORITHM_OID); + let identifier = signing_key.signature_algorithm_identifier().unwrap(); + assert!(identifier.parameters.is_none()); // According to rfc8410 this must be None + assert_eq!(identifier.oid, ed25519::pkcs8::ALGORITHM_OID); }