Skip to content

Commit

Permalink
Documentation - Typos (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
joey-gm authored Apr 24, 2023
1 parent 33a20e6 commit dcf0815
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Sources/Crypto/ASN1/ASN1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ extension ArraySlice where Element == UInt8 {
let requiredBits = UInt.bitWidth - length.leadingZeroBitCount
switch requiredBits {
case 0...7:
// For 0 to 7 bits, the long form is unnacceptable and we require the short.
// For 0 to 7 bits, the long form is unacceptable and we require the short.
throw CryptoKitASN1Error.unsupportedFieldLength
case 8...:
// For 8 or more bits, fieldLength should be the minimum required.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Crypto/CryptoKitErrors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/// - incorrectKeySize: A key is being deserialized with an incorrect key size.
/// - incorrectParameterSize: The number of bytes passed for a given argument is incorrect.
/// - authenticationFailure: The authentication tag or signature is incorrect.
/// - underlyingCoreCryptoError: An unexpected error at a lower-level occured.
/// - underlyingCoreCryptoError: An unexpected error at a lower-level occurred.
/// - wrapFailure: Failed to wrap key
/// - unwrapFailure: Failed to unwrap key
public enum CryptoKitError: Error {
Expand Down
12 changes: 6 additions & 6 deletions Sources/Crypto/Key Agreement/ECDH.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ extension P256 {
public init<Bytes: RandomAccessCollection>(derRepresentation: Bytes) throws where Bytes.Element == UInt8 {
let bytes = Array(derRepresentation)

// We have to try to parse this twice because we have no informaton about what kind of key this is.
// We have to try to parse this twice because we have no information about what kind of key this is.
// We try with PKCS#8 first, and then fall back to SEC.1.

do {
Expand Down Expand Up @@ -257,7 +257,7 @@ extension P256 {
public init<Bytes: RandomAccessCollection>(derRepresentation: Bytes) throws where Bytes.Element == UInt8 {
let bytes = Array(derRepresentation)

// We have to try to parse this twice because we have no informaton about what kind of key this is.
// We have to try to parse this twice because we have no information about what kind of key this is.
// We try with PKCS#8 first, and then fall back to SEC.1.

do {
Expand Down Expand Up @@ -391,7 +391,7 @@ extension P384 {
public init<Bytes: RandomAccessCollection>(derRepresentation: Bytes) throws where Bytes.Element == UInt8 {
let bytes = Array(derRepresentation)

// We have to try to parse this twice because we have no informaton about what kind of key this is.
// We have to try to parse this twice because we have no information about what kind of key this is.
// We try with PKCS#8 first, and then fall back to SEC.1.

do {
Expand Down Expand Up @@ -525,7 +525,7 @@ extension P384 {
public init<Bytes: RandomAccessCollection>(derRepresentation: Bytes) throws where Bytes.Element == UInt8 {
let bytes = Array(derRepresentation)

// We have to try to parse this twice because we have no informaton about what kind of key this is.
// We have to try to parse this twice because we have no information about what kind of key this is.
// We try with PKCS#8 first, and then fall back to SEC.1.

do {
Expand Down Expand Up @@ -659,7 +659,7 @@ extension P521 {
public init<Bytes: RandomAccessCollection>(derRepresentation: Bytes) throws where Bytes.Element == UInt8 {
let bytes = Array(derRepresentation)

// We have to try to parse this twice because we have no informaton about what kind of key this is.
// We have to try to parse this twice because we have no information about what kind of key this is.
// We try with PKCS#8 first, and then fall back to SEC.1.

do {
Expand Down Expand Up @@ -793,7 +793,7 @@ extension P521 {
public init<Bytes: RandomAccessCollection>(derRepresentation: Bytes) throws where Bytes.Element == UInt8 {
let bytes = Array(derRepresentation)

// We have to try to parse this twice because we have no informaton about what kind of key this is.
// We have to try to parse this twice because we have no information about what kind of key this is.
// We try with PKCS#8 first, and then fall back to SEC.1.

do {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Crypto/Key Agreement/ECDH.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ extension ${CURVE} {
public init<Bytes: RandomAccessCollection>(derRepresentation: Bytes) throws where Bytes.Element == UInt8 {
let bytes = Array(derRepresentation)

// We have to try to parse this twice because we have no informaton about what kind of key this is.
// We have to try to parse this twice because we have no information about what kind of key this is.
// We try with PKCS#8 first, and then fall back to SEC.1.

do {
Expand Down
2 changes: 1 addition & 1 deletion Sources/_CryptoExtras/ChaCha20CTR/ChaCha20CTR.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extension Insecure {
/// - nonce: A 12 byte nonce for ChaCha20 encryption. The nonce must be unique for every use of the key to seal data.
/// - Returns: The encrypted ciphertext
/// - Throws: CipherError errors
/// - Warning: You most likely want to use the ChaChaPoly implemention with AuthenticatedData available at `Crypto.ChaChaPoly`
/// - Warning: You most likely want to use the ChaChaPoly implementation with AuthenticatedData available at `Crypto.ChaChaPoly`
public static func encrypt<
Plaintext: DataProtocol
>(
Expand Down
2 changes: 1 addition & 1 deletion Tests/CryptoTests/Utils/XCTestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extension XCTestCase {
/// Unwraps the given optional value, or if it is nil, throws an error and
/// registers an XCTest failure. Meant to be used in a test method that has
/// been marked as `throws`.
/// - Note: this is a replacement for `XCTUnwrap`, which is not availble
/// - Note: this is a replacement for `XCTUnwrap`, which is not available
/// in SPM command line builds as of this writing: <https://bugs.swift.org/browse/SR-11501>
func unwrap<T>(_ optional: T?, file: StaticString = (#file), line: UInt = #line) throws -> T {
guard let wrapped = optional else {
Expand Down

0 comments on commit dcf0815

Please sign in to comment.