Skip to content

Commit

Permalink
SwiftFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
btoms20 committed Sep 1, 2022
1 parent 3962cd2 commit d6f3449
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/CryptoSwift/RSA/RSA.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public final class RSA: DERCodable {

/// The size of the modulus, in bits
public let keySize: Int

/// The size of the modulus, in bytes (rounded up to the nearest full byte)
public let keySizeBytes: Int

Expand Down Expand Up @@ -134,7 +134,7 @@ public final class RSA: DERCodable {

internal extension CS.BigUInt {
/// The minimum number of bytes required to represent this integer in binary.
var byteWidth:Int {
var byteWidth: Int {
let bytes = self.bitWidth / 8
return self.bitWidth % 8 == 0 ? bytes : bytes + 1
}
Expand Down Expand Up @@ -291,9 +291,9 @@ extension RSA {
let privateKeyAsnNode: ASN1.Node =
.sequence(nodes: [
.integer(data: Data(hex: "0x00")),
.integer(data: DER.i2ospData(x: mod.bytes, size: keySizeBytes)),
.integer(data: DER.i2ospData(x: e.serialize().bytes, size: 3)),
.integer(data: DER.i2ospData(x: d.serialize().bytes, size: keySizeBytes)),
.integer(data: DER.i2ospData(x: mod.bytes, size: self.keySizeBytes)),
.integer(data: DER.i2ospData(x: self.e.serialize().bytes, size: 3)),
.integer(data: DER.i2ospData(x: d.serialize().bytes, size: self.keySizeBytes)),
.integer(data: DER.i2ospData(x: primes.p.serialize().bytes, size: paramWidth)),
.integer(data: DER.i2ospData(x: primes.q.serialize().bytes, size: paramWidth)),
.integer(data: DER.i2ospData(x: (d % (primes.p - 1)).serialize().bytes, size: paramWidth)),
Expand Down

0 comments on commit d6f3449

Please sign in to comment.