You are here

public static function ParagonIE_Sodium_Crypto32::box_beforenm in Automatic Updates 7

Same name and namespace in other branches
  1. 8 vendor/paragonie/sodium_compat/src/Crypto32.php \ParagonIE_Sodium_Crypto32::box_beforenm()

Used by crypto_box() to get the crypto_secretbox() key.

@internal Do not use this directly. Use ParagonIE_Sodium_Compat.

Parameters

string $sk:

string $pk:

Return value

string

Throws

SodiumException

TypeError

4 calls to ParagonIE_Sodium_Crypto32::box_beforenm()
ParagonIE_Sodium_Crypto32::box in vendor/paragonie/sodium_compat/src/Crypto32.php
X25519 key exchange followed by XSalsa20Poly1305 symmetric encryption
ParagonIE_Sodium_Crypto32::box_open in vendor/paragonie/sodium_compat/src/Crypto32.php
Decrypt a message encrypted with box().
ParagonIE_Sodium_File::box_decrypt in vendor/paragonie/sodium_compat/src/File.php
ParagonIE_Sodium_File::box_encrypt in vendor/paragonie/sodium_compat/src/File.php

File

vendor/paragonie/sodium_compat/src/Crypto32.php, line 543

Class

ParagonIE_Sodium_Crypto32
Class ParagonIE_Sodium_Crypto

Code

public static function box_beforenm($sk, $pk) {
  return ParagonIE_Sodium_Core32_HSalsa20::hsalsa20(str_repeat("\0", 16), self::scalarmult($sk, $pk));
}