if (self::
useNewSodiumAPI()) { return sodium_crypto_scalarmult_base($secretKey);
} if (self::
use_fallback('crypto_scalarmult_base'
)) { return (string) call_user_func('\\Sodium\\crypto_scalarmult_base',
$secretKey);
} if (ParagonIE_Sodium_Core_Util::
hashEquals($secretKey,
str_repeat("\0", self::CRYPTO_BOX_SECRETKEYBYTES
))) { throw new SodiumException('Zero secret key is not allowed'
);
} if (PHP_INT_SIZE === 4
) { return ParagonIE_Sodium_Crypto32::
scalarmult_base($secretKey);
} return ParagonIE_Sodium_Crypto::
scalarmult_base($secretKey);
} /**
* Authenticated symmetric-key encryption.
*
* Algorithm: XSalsa20-Poly1305
*
* @param string $plaintext The message you're encrypting
* @param string $nonce A Number to be used Once; must be 24 bytes
* @param string $key Symmetric encryption key
* @return string Ciphertext with Poly1305 MAC
* @throws SodiumException
* @throws TypeError
* @psalm-suppress MixedArgument
*/