diff options
author | 2018-12-12 15:33:14 -0600 | |
---|---|---|
committer | 2018-12-12 15:33:14 -0600 | |
commit | e4ac48bc75064c0e144020ded1ed877d226742c8 (patch) | |
tree | ffee70e6c957a717cc8a6b805e6cefa59ed05bc7 /WireGuard/WireGuard/Crypto/Curve25519.swift | |
parent | Tons more swiftlint warnings fixed. Still a few remaining. (diff) | |
download | wireguard-apple-e4ac48bc75064c0e144020ded1ed877d226742c8.tar.xz wireguard-apple-e4ac48bc75064c0e144020ded1ed877d226742c8.zip |
More linter warnings fixed, enabled more swiftlint rules, project cleanup
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
Diffstat (limited to 'WireGuard/WireGuard/Crypto/Curve25519.swift')
-rw-r--r-- | WireGuard/WireGuard/Crypto/Curve25519.swift | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/WireGuard/WireGuard/Crypto/Curve25519.swift b/WireGuard/WireGuard/Crypto/Curve25519.swift index 43d9b00..53404cc 100644 --- a/WireGuard/WireGuard/Crypto/Curve25519.swift +++ b/WireGuard/WireGuard/Crypto/Curve25519.swift @@ -9,7 +9,7 @@ struct Curve25519 { static func generatePrivateKey() -> Data { var privateKey = Data(repeating: 0, count: TunnelConfiguration.keyLength) - privateKey.withUnsafeMutableBytes { (bytes: UnsafeMutablePointer<UInt8>) in + privateKey.withUnsafeMutableBytes { bytes in curve25519_generate_private_key(bytes) } assert(privateKey.count == TunnelConfiguration.keyLength) @@ -19,8 +19,8 @@ struct Curve25519 { static func generatePublicKey(fromPrivateKey privateKey: Data) -> Data { assert(privateKey.count == TunnelConfiguration.keyLength) var publicKey = Data(repeating: 0, count: TunnelConfiguration.keyLength) - privateKey.withUnsafeBytes { (privateKeyBytes: UnsafePointer<UInt8>) in - publicKey.withUnsafeMutableBytes { (bytes: UnsafeMutablePointer<UInt8>) in + privateKey.withUnsafeBytes { privateKeyBytes in + publicKey.withUnsafeMutableBytes { bytes in curve25519_derive_public_key(bytes, privateKeyBytes) } } |