if (ParagonIE_Sodium_Core_Util::
strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES
) { throw new SodiumException('Argument 3 must be CRYPTO_BOX_KEYPAIRBYTES long.'
);
} if (self::
useNewSodiumAPI()) { return (string) sodium_crypto_box($plaintext,
$nonce,
$keypair);
} if (self::
use_fallback('crypto_box'
)) { return (string) call_user_func('\\Sodium\\crypto_box',
$plaintext,
$nonce,
$keypair);
} if (PHP_INT_SIZE === 4
) { return ParagonIE_Sodium_Crypto32::
box($plaintext,
$nonce,
$keypair);
} return ParagonIE_Sodium_Crypto::
box($plaintext,
$nonce,
$keypair);
} /**
* Anonymous public-key encryption. Only the recipient may decrypt messages.
*
* Algorithm: X25519-XSalsa20-Poly1305, as with crypto_box.
* The sender's X25519 keypair is ephemeral.
* Nonce is generated from the BLAKE2b hash of both public keys.
*
* This provides ciphertext integrity.
*
* @param string $plaintext Message to be sealed
* @param string $publicKey Your recipient's public key
* @return string Sealed message that only your recipient can
* decrypt
* @throws SodiumException
* @throws TypeError
* @psalm-suppress MixedArgument
*/