You are here

public static function ParagonIE_Sodium_Crypto::scalarmult in Automatic Updates 8

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

ECDH over Curve25519

@internal Do not use this directly. Use ParagonIE_Sodium_Compat.

Parameters

string $sKey:

string $pKey:

Return value

string

Throws

SodiumException

TypeError

2 calls to ParagonIE_Sodium_Crypto::scalarmult()
ParagonIE_Sodium_Compat::crypto_scalarmult in vendor/paragonie/sodium_compat/src/Compat.php
Calculate the shared secret between your secret key and your recipient's public key.
ParagonIE_Sodium_Crypto::box_beforenm in vendor/paragonie/sodium_compat/src/Crypto.php
Used by crypto_box() to get the crypto_secretbox() key.

File

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

Class

ParagonIE_Sodium_Crypto
Class ParagonIE_Sodium_Crypto

Code

public static function scalarmult($sKey, $pKey) {
  $q = ParagonIE_Sodium_Core_X25519::crypto_scalarmult_curve25519_ref10($sKey, $pKey);
  self::scalarmult_throw_if_zero($q);
  return $q;
}