public static function ParagonIE_Sodium_Crypto::box_keypair in Automatic Updates 7
Same name and namespace in other branches
- 8 vendor/paragonie/sodium_compat/src/Crypto.php \ParagonIE_Sodium_Crypto::box_keypair()
@internal Do not use this directly. Use ParagonIE_Sodium_Compat.
Return value
string
Throws
Exception
SodiumException
TypeError
2 calls to ParagonIE_Sodium_Crypto::box_keypair()
- ParagonIE_Sodium_Compat::crypto_box_keypair in vendor/
paragonie/ sodium_compat/ src/ Compat.php - Generate a new random X25519 keypair.
- ParagonIE_Sodium_Crypto::box_seal in vendor/
paragonie/ sodium_compat/ src/ Crypto.php - X25519-XSalsa20-Poly1305 with one ephemeral X25519 keypair.
File
- vendor/
paragonie/ sodium_compat/ src/ Crypto.php, line 560
Class
- ParagonIE_Sodium_Crypto
- Class ParagonIE_Sodium_Crypto
Code
public static function box_keypair() {
$sKey = random_bytes(32);
$pKey = self::scalarmult_base($sKey);
return $sKey . $pKey;
}