Skip to content

Commit

Permalink
Update DarkStar.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
consuelita committed Oct 11, 2021
1 parent feeb218 commit ba9d541
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/ShadowSwift/DarkStar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ let ConfirmationSize = 32

public struct DarkStar
{
let encryptKey: SymmetricKey
let decryptKey: SymmetricKey
var encryptKey: SymmetricKey!
var decryptKey: SymmetricKey!

public init?(serverPersistentPublicKey: P256.KeyAgreement.PublicKey, endpoint: NWEndpoint, connection: Connection)
{
Expand All @@ -36,8 +36,8 @@ public struct DarkStar
guard let newEncryptKey = DarkStar.createEncryptKey(serverPersistentPublicKey: serverPersistentPublicKey, serverEphemeralPublicKey: serverEphemeralPublicKey, clientEphemeralPrivateKey: clientEphemeralPrivateKey, serverEndpoint: endpoint) else {return nil}
encryptKey = newEncryptKey

guard let decryptKey = DarkStar.createDecryptKey(serverPersistentPublicKey: serverPersistentPublicKey, serverEphemeralPublicKey: serverEphemeralPublicKey, clientEphemeralPrivateKey: clientEphemeralPrivateKey, serverEndpoint: endpoint) else {return nil}
self.decryptKey = decryptKey
guard let newDecryptKey = DarkStar.createDecryptKey(serverPersistentPublicKey: serverPersistentPublicKey, serverEphemeralPublicKey: serverEphemeralPublicKey, clientEphemeralPrivateKey: clientEphemeralPrivateKey, serverEndpoint: endpoint) else {return nil}
decryptKey = newDecryptKey

let clientConfirmationCode = DarkStar.generateConfirmationCode(endpoint: endpoint, serverEphemeralPublicKey: serverEphemeralPublicKey, clientEphemeralPublicKey: clientEphemeralPublicKey)

Expand Down

0 comments on commit ba9d541

Please sign in to comment.