Skip to content

Commit 5e0b429

Browse files
authored
Add typos action and correct typos (#766)
* Add `typos` action and correct typos https://github.com/crate-ci/typos * Add `name` to `typos` job
1 parent 83ddc4b commit 5e0b429

File tree

6 files changed

+35
-9
lines changed

6 files changed

+35
-9
lines changed

.github/workflows/workspace.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,10 @@ jobs:
109109
with:
110110
toolchain: stable
111111
- run: cargo doc --all-features
112+
113+
typos:
114+
name: Check for typos
115+
runs-on: ubuntu-latest
116+
steps:
117+
- uses: actions/checkout@v4
118+
- uses: crate-ci/[email protected]

.typos.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[files]
2+
extend-exclude = [
3+
".git/",
4+
"*.svg",
5+
"TESTVECTORS"
6+
]
7+
8+
[default]
9+
extend-ignore-re = [
10+
# Patterns which appear to be 36 or more characters of Base64/Base64url
11+
'\b[0-9A-Za-z+/]{36,}\b',
12+
'\b[0-9A-Za-z_-]{36,}\b',
13+
]
14+
15+
[default.extend-words]
16+
"AKE" = "AKE" # Authenticated Key Exchange
17+
"Ono" = "Ono" # Surname
18+
"Tung" = "Tung" # Name
19+
"Monts" = "Monts" # Abbreviation for Montgomery

curve25519-dalek/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fn main() {
8484
}
8585
}
8686
Ok("unstable_avx512") if !nightly => {
87-
panic!("Could not override curve25519_dalek_backend to unstable_avx512, as this is nigthly only");
87+
panic!("Could not override curve25519_dalek_backend to unstable_avx512, as this is nightly only");
8888
}
8989
// default between serial / simd (if potentially capable)
9090
_ => match is_capable_simd(&target_arch, curve25519_dalek_bits) {

curve25519-dalek/src/traits.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub trait MultiscalarMul {
9090
/// # Examples
9191
///
9292
/// The trait bound aims for maximum flexibility: the inputs must be
93-
/// convertable to iterators (`I: IntoIter`), and the iterator's items
93+
/// convertible to iterators (`I: IntoIter`), and the iterator's items
9494
/// must be `Borrow<Scalar>` (or `Borrow<Point>`), to allow
9595
/// iterators returning either `Scalar`s or `&Scalar`s.
9696
///
@@ -211,7 +211,7 @@ pub trait VartimeMultiscalarMul {
211211
/// # Examples
212212
///
213213
/// The trait bound aims for maximum flexibility: the inputs must be
214-
/// convertable to iterators (`I: IntoIter`), and the iterator's items
214+
/// convertible to iterators (`I: IntoIter`), and the iterator's items
215215
/// must be `Borrow<Scalar>` (or `Borrow<Point>`), to allow
216216
/// iterators returning either `Scalar`s or `&Scalar`s.
217217
///
@@ -318,7 +318,7 @@ pub trait VartimePrecomputedMultiscalarMul: Sized {
318318
/// length than \\(B_j\\).
319319
///
320320
/// The trait bound aims for maximum flexibility: the input must
321-
/// be convertable to iterators (`I: IntoIter`), and the
321+
/// be convertible to iterators (`I: IntoIter`), and the
322322
/// iterator's items must be `Borrow<Scalar>`, to allow iterators
323323
/// returning either `Scalar`s or `&Scalar`s.
324324
fn vartime_multiscalar_mul<I>(&self, static_scalars: I) -> Self::Point
@@ -352,7 +352,7 @@ pub trait VartimePrecomputedMultiscalarMul: Sized {
352352
/// the same length.
353353
///
354354
/// The trait bound aims for maximum flexibility: the inputs must be
355-
/// convertable to iterators (`I: IntoIter`), and the iterator's items
355+
/// convertible to iterators (`I: IntoIter`), and the iterator's items
356356
/// must be `Borrow<Scalar>` (or `Borrow<Point>`), to allow
357357
/// iterators returning either `Scalar`s or `&Scalar`s.
358358
fn vartime_mixed_multiscalar_mul<I, J, K>(

ed25519-dalek/src/signature.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn check_scalar(bytes: [u8; 32]) -> Result<Scalar, SignatureError> {
7373
// potential non-reduced scalars is performed.
7474
//
7575
// This is compatible with ed25519-donna and libsodium when
76-
// -DED25519_COMPAT is NOT specified.
76+
// `-D ED25519_COMPAT` is NOT specified.
7777
if bytes[31] & 224 != 0 {
7878
return Err(InternalError::ScalarFormat.into());
7979
}

ed25519-dalek/tests/pkcs8.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn get_algo_identifier() {
8181
assert_eq!(identifier.oid, ed25519::pkcs8::ALGORITHM_OID);
8282

8383
let signing_key = SigningKey::from_bytes(&SK_BYTES);
84-
let identifer = signing_key.signature_algorithm_identifier().unwrap();
85-
assert!(identifer.parameters.is_none()); // According to rfc8410 this must be None
86-
assert_eq!(identifer.oid, ed25519::pkcs8::ALGORITHM_OID);
84+
let identifier = signing_key.signature_algorithm_identifier().unwrap();
85+
assert!(identifier.parameters.is_none()); // According to rfc8410 this must be None
86+
assert_eq!(identifier.oid, ed25519::pkcs8::ALGORITHM_OID);
8787
}

0 commit comments

Comments
 (0)