You are here

public static function ParagonIE_Sodium_Crypto::box_seed_keypair in Automatic Updates 8

Same name and namespace in other branches
  1. 7 vendor/paragonie/sodium_compat/src/Crypto.php \ParagonIE_Sodium_Crypto::box_seed_keypair()

Parameters

string $seed:

Return value

string

Throws

SodiumException

TypeError

1 call to ParagonIE_Sodium_Crypto::box_seed_keypair()
ParagonIE_Sodium_Compat::crypto_box_seed_keypair in vendor/paragonie/sodium_compat/src/Compat.php
Generate an X25519 keypair from a seed.

File

vendor/paragonie/sodium_compat/src/Crypto.php, line 573

Class

ParagonIE_Sodium_Crypto
Class ParagonIE_Sodium_Crypto

Code

public static function box_seed_keypair($seed) {
  $sKey = ParagonIE_Sodium_Core_Util::substr(hash('sha512', $seed, true), 0, 32);
  $pKey = self::scalarmult_base($sKey);
  return $sKey . $pKey;
}