Skip to content

Commit

Permalink
Remove CryptPrints
Browse files Browse the repository at this point in the history
  • Loading branch information
consuelita committed Dec 13, 2023
1 parent 9676d05 commit 5e8509d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
28 changes: 14 additions & 14 deletions Sources/ShadowSwift/Async/AsyncDarkStarServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ public class AsyncDarkstarServer

let data = Data(result)

print("~~> handleServerConfirmationCode <~~")
print("ecdhData (\(ecdhData.count) bytes): \(ecdhData.hex)")
print("serverIdentifier (\(serverIdentifier.count) bytes): \(serverIdentifier.hex)")
print("serverPersistentPublicKey (\(serverPersistentPublicKeyDarkstarFormat.count) bytes): \(serverPersistentPublicKeyDarkstarFormat.hex)")
print("clientEphemeralPublicKeyData (\(clientEphemeralPublicKeyDarkstarFormat.count) bytes): \(clientEphemeralPublicKeyDarkstarFormat.hex)")
print("server confirmation code server copy (\(data.count) bytes): \(data.hex)")
print("~~> handleServerConfirmationCode <~~")
// print("~~> handleServerConfirmationCode <~~")
// print("ecdhData (\(ecdhData.count) bytes): \(ecdhData.hex)")
// print("serverIdentifier (\(serverIdentifier.count) bytes): \(serverIdentifier.hex)")
// print("serverPersistentPublicKey (\(serverPersistentPublicKeyDarkstarFormat.count) bytes): \(serverPersistentPublicKeyDarkstarFormat.hex)")
// print("clientEphemeralPublicKeyData (\(clientEphemeralPublicKeyDarkstarFormat.count) bytes): \(clientEphemeralPublicKeyDarkstarFormat.hex)")
// print("server confirmation code server copy (\(data.count) bytes): \(data.hex)")
// print("~~> handleServerConfirmationCode <~~")

try await connection.write(data)
}
Expand Down Expand Up @@ -196,13 +196,13 @@ public class AsyncDarkstarServer
let result = hash.finalize()
let resultData = Data(result)

print("~~> generateClientConfirmationCode <~~")
print("ecdhData (\(ecdhData.count) bytes): \(ecdhData.hex)")
print("serverIdentifier (\(serverIdentifier.count) bytes): \(serverIdentifier.hex)")
print("serverPersistentPublicKey (\(serverPersistentPublicKeyDarkstarFormat.count) bytes): \(serverPersistentPublicKeyDarkstarFormat.hex)")
print("clientEphemeralPublicKeyData (\(clientEphemeralPublicKeyDarkstarFormat.count) bytes): \(clientEphemeralPublicKeyDarkstarFormat.hex)")
print("client confirmation code server copy (\(resultData.count) bytes): \(resultData.hex)")
print("~~> generateClientConfirmationCode <~~")
// print("~~> generateClientConfirmationCode <~~")
// print("ecdhData (\(ecdhData.count) bytes): \(ecdhData.hex)")
// print("serverIdentifier (\(serverIdentifier.count) bytes): \(serverIdentifier.hex)")
// print("serverPersistentPublicKey (\(serverPersistentPublicKeyDarkstarFormat.count) bytes): \(serverPersistentPublicKeyDarkstarFormat.hex)")
// print("clientEphemeralPublicKeyData (\(clientEphemeralPublicKeyDarkstarFormat.count) bytes): \(clientEphemeralPublicKeyDarkstarFormat.hex)")
// print("client confirmation code server copy (\(resultData.count) bytes): \(resultData.hex)")
// print("~~> generateClientConfirmationCode <~~")

return resultData
}
Expand Down
12 changes: 6 additions & 6 deletions Sources/ShadowSwift/Async/AsyncDarkstarCipher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ public class AsyncDarkstarCipher
return nil
}

print("\n~~> AsyncDarkStarCipher Decrypt <~~")
print("Ciphertext (\(encrypted.count) bytes): \(encrypted.hex)")
print("nonce (\(nonce.data.count) bytes): \(nonce.data.hex)")
print("tag (\(tag.count) bytes): \(tag.hex)")
print("key (\(self.key.data.count) bytes): \(self.key.data.hex)")
print("~~> AsyncDarkStarCipher Decrypt <~~\n")
// print("\n~~> AsyncDarkStarCipher Decrypt <~~")
// print("Ciphertext (\(encrypted.count) bytes): \(encrypted.hex)")
// print("nonce (\(nonce.data.count) bytes): \(nonce.data.hex)")
// print("tag (\(tag.count) bytes): \(tag.hex)")
// print("key (\(self.key.data.count) bytes): \(self.key.data.hex)")
// print("~~> AsyncDarkStarCipher Decrypt <~~\n")

let sealedBox = try AES.GCM.SealedBox(nonce: nonce, ciphertext: encrypted, tag: tag)
let plaintext = try AES.GCM.open(sealedBox, using: self.key)
Expand Down

0 comments on commit 5e8509d

Please sign in to comment.