Skip to content

Commit

Permalink
fix: secp256k1 was creating compressed keys and should be uncompressed (
Browse files Browse the repository at this point in the history
#7)

removed some prints that should not be there
  • Loading branch information
beatt83 authored Feb 21, 2024
1 parent b2aa25e commit 797c2ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ public extension JWK {
throw JWK.Error.missingYComponent
}
let data = x + y
print(self.keyID)
print(x.toHexString())
print(x.count)
print(y.toHexString())
print(y.count)
switch type {
case is P256.KeyAgreement.PublicKey.Type:
return try P256.KeyAgreement.PublicKey(rawRepresentation: data) as! T
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ struct Secp256k1KeyGeneration: KeyGeneration {
public func generateKeyPairJWK(purpose: KeyGenerationPurpose) throws -> JWK {
switch purpose {
case .signing:
return try secp256k1.Signing.PrivateKey().jwkRepresentation
return try secp256k1.Signing.PrivateKey(format: .uncompressed).jwkRepresentation
case .keyAgreement:
return try secp256k1.KeyAgreement.PrivateKey().jwkRepresentation
return try secp256k1.KeyAgreement.PrivateKey(format: .uncompressed).jwkRepresentation
}
}
}

0 comments on commit 797c2ad

Please sign in to comment.