You are here

public static function ParagonIE_Sodium_Crypto::box_publickey_from_secretkey in Automatic Updates 7

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

@internal Do not use this directly. Use ParagonIE_Sodium_Compat.

Parameters

string $sKey:

Return value

string

Throws

RangeException

SodiumException

TypeError

1 call to ParagonIE_Sodium_Crypto::box_publickey_from_secretkey()
ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey in vendor/paragonie/sodium_compat/src/Compat.php
Calculate the X25519 public key from a given X25519 secret key.

File

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

Class

ParagonIE_Sodium_Crypto
Class ParagonIE_Sodium_Crypto

Code

public static function box_publickey_from_secretkey($sKey) {
  if (ParagonIE_Sodium_Core_Util::strlen($sKey) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES) {
    throw new RangeException('Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES bytes long.');
  }
  return self::scalarmult_base($sKey);
}