array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.sodium-crypto-scalarmult.php', 1 => 'sodium_crypto_scalarmult', ), 'up' => array ( 0 => 'ref.sodium.php', 1 => 'Sodium Functions', ), 'prev' => array ( 0 => 'function.sodium-crypto-scalarmult-ristretto255.php', 1 => 'sodium_crypto_scalarmult_ristretto255', ), 'next' => array ( 0 => 'function.sodium-crypto-secretbox-keygen.php', 1 => 'sodium_crypto_secretbox_keygen', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/sodium/functions/sodium-crypto-scalarmult.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 7 >= 7.2.0, PHP 8)
sodium_crypto_scalarmult — Compute a shared secret given a user's secret key and another user's public key
Elliptic Curve Diffie-Hellman. Calculates scalar n times point p, on an elliptic curve.
n
scalar, which is typically a secret key
p
point (x-coordinate), which is typically a public key
A 32-byte random string.