You are here

public static function ParagonIE_Sodium_Crypto32::box_publickey_from_secretkey in Automatic Updates 8

Same name and namespace in other branches
  1. 7 vendor/paragonie/sodium_compat/src/Crypto32.php \ParagonIE_Sodium_Crypto32::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_Crypto32::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/Crypto32.php, line 642

Class

ParagonIE_Sodium_Crypto32
Class ParagonIE_Sodium_Crypto

Code

public static function box_publickey_from_secretkey($sKey) {
  if (ParagonIE_Sodium_Core32_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);
}