You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,8 @@ The API of K1 maps almost 1:1 with Apple's [CryptoKit][ck], vendoring a set of k
14
14
Just like that K1 vendors these key pairs:
15
15
-`K1.KeyAgreement.PrivateKey` / `K1.KeyAgreement.PublicKey` for key agreement (ECDH)
16
16
-`K1.Schnorr.PrivateKey` / `K1.Schnorr.PublicKey` for sign / verify methods using Schnorr signature scheme
17
-
-`K1.ECDSA.Recoverable.PrivateKey` / `K1.ECDSA.Recoverable.PublicKey` for sign / verify methods using ECDSA (producing/validating signature where public key is recoverable)
18
-
-`K1.ECDSA.NonRecoverable.PrivateKey` / `K1.ECDSA.NonRecoverable.PublicKey` for sign / verify methods using ECDSA (producing/validating signature where public key is **not** recoverable)
17
+
-`K1.ECDSAWithKeyRecovery.PrivateKey` / `K1.ECDSAWithKeyRecovery.PublicKey` for sign / verify methods using ECDSA (producing/validating signature where public key is recoverable)
18
+
-`K1.ECDSA.PrivateKey` / `K1.ECDSA.PublicKey` for sign / verify methods using ECDSA (producing/validating signature where public key is **not** recoverable)
19
19
20
20
Just like you can convert between e.g. `Curve25519.KeyAgreement.PrivateKey` and `Curve25519.Signing.PrivateKey` back and forth using any of the initializers and serializer, you can convert between all PrivateKeys and all PublicKeys of all features in K1.
21
21
@@ -64,8 +64,8 @@ Furthermore, all PublicKeys's have these additional APIs:
64
64
## ECDSA (Elliptic Curve Digital Signature Algorithm)
65
65
66
66
There exists two set of ECDSA key pairs:
67
-
- A key pair for signatures from which you can recover the public key, specifically: `K1.ECDSA.Recoverable.PrivateKey` and `K1.ECDSA.Recoverable.PublicKey`
68
-
- A key pair for signatures from which you can **not** recover the public key, specifically: `K1.ECDSA.NonRecoverable.PrivateKey` and `K1.ECDSA.NonRecoverable.PublicKey`
67
+
- A key pair for signatures from which you can recover the public key, specifically: `K1.ECDSAWithKeyRecovery.PrivateKey` and `K1.ECDSAWithKeyRecovery.PublicKey`
68
+
- A key pair for signatures from which you can **not** recover the public key, specifically: `K1.ECDSA.PrivateKey` and `K1.ECDSA.PublicKey`
69
69
70
70
For each private key there exists two different `signature:for:options` (one taking hashed data and taking `Digest` as argument) methods and one `signature:forUnhashed:options`.
71
71
@@ -76,7 +76,7 @@ The `option` is a `K1.ECDSA.SigningOptions` struct, which by default specifies [
76
76
#### Sign
77
77
78
78
```swift
79
-
let alice = K1.ECDA.NonRecovarable.PrivateKey()
79
+
let alice = K1.ECDSA.PrivateKey()
80
80
```
81
81
82
82
##### Hashed (Data)
@@ -109,8 +109,8 @@ let signature = try alice.signature(forUnhashed: message)
109
109
110
110
```swift
111
111
let hashedMessage: Data =// from somewhere
112
-
let publicKey: K1.ECDSA.NonRecoverable.PublicKey = alice.publcKey
113
-
let signature: K1.ECDSA.NonRecoverable.Signature // from above
112
+
let publicKey: K1.ECDSA.PublicKey = alice.publcKey
Copy file name to clipboardExpand all lines: Sources/K1/K1/ECDSA/ECDSA.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
// MARK: - K1.ECDSA
2
2
extensionK1{
3
-
/// A mechanism used to create or verify a cryptographic signature using the `secp256k1` elliptic curve digital signature algorithm (ECDSA).
3
+
/// A mechanism used to create or verify a cryptographic signature using the `secp256k1` elliptic curve digital signature algorithm (ECDSA), signatures that do not offer recovery of the public key.
/// A mechanism used to create or verify a cryptographic signature using the `secp256k1` elliptic curve digital signature algorithm (ECDSA), signatures that do not offer recovery of the public key.
8
-
publicenumNonRecoverable{
9
-
// Just a namespace
10
-
}
11
-
}
12
-
13
-
// MARK: - K1.ECDSA.NonRecoverable.Signature
14
-
extensionK1.ECDSA.NonRecoverable{
15
7
/// A `secp256k1` elliptic curve digital signature algorithm (ECDSA) signature,
16
8
/// from which users can recover a public key with the message that was signed.
/// A mechanism used to create or verify a cryptographic signature using the `secp256k1` elliptic curve digital signature algorithm (ECDSA), signatures that do offers recovery of the public key.
8
-
publicenumRecoverable{
8
+
publicenumECDSAWithKeyRecovery{
9
9
// Just a namespace
10
10
}
11
11
}
12
12
13
-
// MARK: - K1.ECDSA.Recoverable.Signature
14
-
extensionK1.ECDSA.Recoverable{
13
+
// MARK: - K1.ECDSAWithKeyRecovery.Signature
14
+
extensionK1.ECDSAWithKeyRecovery{
15
15
/// A `secp256k1` elliptic curve digital signature algorithm (ECDSA) signature,
16
16
/// from which users **cannot** recover the public key, not without the `RecoveryID`.
0 commit comments