Skip to content

Commit

Permalink
fix: Build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
amosavian committed May 6, 2024
1 parent d0e8b21 commit 9b865c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Sources/JWSETKit/Cryptography/EC/P256.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ extension P256.KeyAgreement.PublicKey: CryptoECPublicKey {
extension P256.Signing.PublicKey: JSONWebValidatingKey {
public func verifySignature<S, D>(_ signature: S, for data: D, using _: JSONWebSignatureAlgorithm) throws where S: DataProtocol, D: DataProtocol {
let ecdsaSignature: P256.Signing.ECDSASignature
if signature.count == (curve?.coordinateSize ?? 0) * 2 {
// swiftformat:disable:next redundantSelf
if signature.count == (self.curve?.coordinateSize ?? 0) * 2 {
ecdsaSignature = try .init(rawRepresentation: signature)
} else {
ecdsaSignature = try .init(derRepresentation: signature)
Expand Down
3 changes: 2 additions & 1 deletion Sources/JWSETKit/Cryptography/EC/P384.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ extension P384.KeyAgreement.PublicKey: CryptoECPublicKey {
extension P384.Signing.PublicKey: JSONWebValidatingKey {
public func verifySignature<S, D>(_ signature: S, for data: D, using _: JSONWebSignatureAlgorithm) throws where S: DataProtocol, D: DataProtocol {
let ecdsaSignature: P384.Signing.ECDSASignature
if signature.count == (curve?.coordinateSize ?? 0) * 2 {
// swiftformat:disable:next redundantSelf
if signature.count == (self.curve?.coordinateSize ?? 0) * 2 {
ecdsaSignature = try .init(rawRepresentation: signature)
} else {
ecdsaSignature = try .init(derRepresentation: signature)
Expand Down
3 changes: 2 additions & 1 deletion Sources/JWSETKit/Cryptography/EC/P521.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ extension P521.KeyAgreement.PublicKey: CryptoECPublicKey {
extension P521.Signing.PublicKey: JSONWebValidatingKey {
public func verifySignature<S, D>(_ signature: S, for data: D, using _: JSONWebSignatureAlgorithm) throws where S: DataProtocol, D: DataProtocol {
let ecdsaSignature: P521.Signing.ECDSASignature
if signature.count == (curve?.coordinateSize ?? 0) * 2 {
// swiftformat:disable:next redundantSelf
if signature.count == (self.curve?.coordinateSize ?? 0) * 2 {
ecdsaSignature = try .init(rawRepresentation: signature)
} else {
ecdsaSignature = try .init(derRepresentation: signature)
Expand Down

0 comments on commit 9b865c5

Please sign in to comment.