class Kalium implements Encryptor {

    @Override
    public SharedKey computeSharedKey(final PublicKey publicKey, final PrivateKey privateKey) {
        final byte[] output = new byte[CRYPTO_BOX_CURVE25519XSALSA20POLY1305_BEFORENMBYTES];

        LOGGER.debug("Computing the shared key for public key {} and private key {}", publicKey, privateKey);
        final int sodiumResult =
                this.sodium.crypto_box_curve25519xsalsa20poly1305_beforenm(
                        output, publicKey.getKeyBytes(), privateKey.getKeyBytes());

        if (sodiumResult == -1) {
            LOGGER.error("Could not compute the shared key for pub {} and priv {}", publicKey, privateKey);
            throw new EncryptorException("Kalium could not compute the shared key");
        }

        final SharedKey sharedKey = SharedKey.from(output);

        LOGGER.debug("Computed shared key {} for pub {} and priv {}", sharedKey, publicKey, privateKey);

        return sharedKey;
    }

    public  Kalium(final NaCl.Sodium sodium);

}