Skip to content

Commit

Permalink
added print to check representation
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoSax committed Aug 28, 2023
1 parent 5c282ca commit d8d4ecc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/ReplicantSwift/Config/ConfigGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ public func generateNewConfigPair(serverAddress: String, usePolish: Bool, useTon
}

if usePolish {
let privateKey = PrivateKey.P256KeyAgreement(P256.KeyAgreement.PrivateKey())
let compactRepresentable = P256.KeyAgreement.PrivateKey(compactRepresentable: true)
print("raw representation: \(compactRepresentable.rawRepresentation.hex) (count: \(compactRepresentable.rawRepresentation.count)) | x963 representation: \(compactRepresentable.x963Representation.hex) (count: \(compactRepresentable.x963Representation.count)")
let privateKey = PrivateKey.P256KeyAgreement(compactRepresentable)

let publicKey = privateKey.publicKey
polishClientConfig = PolishClientConfig(serverAddress: serverAddress, serverPublicKey: publicKey)
polishServerConfig = PolishServerConfig(serverAddress: serverAddress, serverPrivateKey: privateKey)
Expand Down

0 comments on commit d8d4ecc

Please sign in to comment.