             case .SERVER: return crypto_kx_server_session_keys
             }
         }
-    }
-
-    /**
-     Generates a key exchange secret key and a corresponding public key.
-
-     - Returns: A key pair containing the secret key and public key.
-     */
-    public func keyPair() -> KeyPair? {
-        var publicKey = Data(count: PublicKeyBytes)
-        var secretKey = Data(count: SecretKeyBytes)
-
-        guard .SUCCESS == publicKey.withUnsafeMutableBytes({ publicKeyPtr in
-            secretKey.withUnsafeMutableBytes { secretKeyPtr in
-                crypto_kx_keypair(publicKeyPtr, secretKeyPtr).exitCode
-            }
-        }) else { return nil }
-
-        return KeyPair(publicKey: publicKey, secretKey: secretKey)
-    }
-
-    /**
-     Generates a key exchange secret key and a corresponding public key derived from a seed.
-
-     - Parameter seed: The value from which to derive the secret and public key.
-
-     - Returns: A key pair containing the secret key and public key.
-     */
-    public func keyPair(seed: Data) -> KeyPair? {
-        guard seed.count == SeedBytes else { return nil }
-        var pk = Data(count: PublicKeyBytes)
-        var sk = Data(count: SecretKeyBytes)
-
-        guard .SUCCESS == pk.withUnsafeMutableBytes({ pkPtr in
-            sk.withUnsafeMutableBytes { skPtr in
-                seed.withUnsafeBytes { seedPtr in
-                    crypto_kx_seed_keypair(pkPtr, skPtr, seedPtr).exitCode
-                }
-            }
-        }) else { return nil }
-
-        return KeyPair(publicKey: pk, secretKey: sk)
     }
 
     /**

        return SessionKeyPair(rx: rx, tx: tx)
    }
}

import Clibsodium

public class KeyExchange {
    public let SessionKeyBytes = Int(crypto_kx_sessionkeybytes())

    public struct SessionKeyPair {
        public let rx: Data
