From a473dfe4f88055e4ce459a1931c9ce823e4994fc Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Thu, 8 Nov 2018 14:48:16 +0530 Subject: Model: Move InterfaceConfiguration.publicKey to Curve25519.swift The code for public key calculation need not be shared with the extension Signed-off-by: Roopesh Chander --- WireGuard/WireGuard/Crypto/Curve25519.swift | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'WireGuard/WireGuard/Crypto/Curve25519.swift') diff --git a/WireGuard/WireGuard/Crypto/Curve25519.swift b/WireGuard/WireGuard/Crypto/Curve25519.swift index e0f9c0f..84c35d3 100644 --- a/WireGuard/WireGuard/Crypto/Curve25519.swift +++ b/WireGuard/WireGuard/Crypto/Curve25519.swift @@ -25,3 +25,9 @@ struct Curve25519 { return publicKey } } + +extension InterfaceConfiguration { + var publicKey: Data { + return Curve25519.generatePublicKey(fromPrivateKey: privateKey) + } +} -- cgit v1.2.3-59-g8ed1b