mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2025-02-17 05:12:02 +00:00
Model: Move InterfaceConfiguration.publicKey to Curve25519.swift
The code for public key calculation need not be shared with the extension
This commit is contained in:
parent
de92f2dcd8
commit
2afb2244ff
@ -21,10 +21,6 @@ struct InterfaceConfiguration: Codable {
|
||||
var mtu: UInt16?
|
||||
var dns: [DNSServer] = []
|
||||
|
||||
var publicKey: Data {
|
||||
return Curve25519.generatePublicKey(fromPrivateKey: privateKey)
|
||||
}
|
||||
|
||||
init(name: String, privateKey: Data) {
|
||||
self.name = name
|
||||
self.privateKey = privateKey
|
||||
|
@ -25,3 +25,9 @@ struct Curve25519 {
|
||||
return publicKey
|
||||
}
|
||||
}
|
||||
|
||||
extension InterfaceConfiguration {
|
||||
var publicKey: Data {
|
||||
return Curve25519.generatePublicKey(fromPrivateKey: privateKey)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user