Skip to content

Commit

Permalink
bug fix signature size
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcl committed Dec 20, 2023
1 parent af91c52 commit 4087e72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/KukaiCryptoSwift/PrivateKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public struct PrivateKey: Codable {
let signatureLength = 64
var output = [UInt8](repeating: 0, count: signatureLength)

guard let context = secp256k1_context_create(UInt32(SECP256K1_CONTEXT_SIGN)), self.bytes.count == 64 else {
guard let context = secp256k1_context_create(UInt32(SECP256K1_CONTEXT_SIGN)), self.bytes.count == 32 else {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/KukaiCryptoSwift/PublicKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public struct PublicKey: Codable {
return Sodium.shared.sign.verify(message: message, publicKey: self.bytes, signature: signature)

case .secp256k1:
guard let context = secp256k1_context_create(UInt32(SECP256K1_CONTEXT_VERIFY)), signature.count == 64 else {
guard let context = secp256k1_context_create(UInt32(SECP256K1_CONTEXT_VERIFY)), signature.count == 32 else {
return false
}

Expand Down

0 comments on commit 4087e72

Please sign in to comment.