You are here

public static function ParagonIE_Sodium_Core32_XSalsa20::xsalsa20 in Automatic Updates 7

Same name and namespace in other branches
  1. 8 vendor/paragonie/sodium_compat/src/Core32/XSalsa20.php \ParagonIE_Sodium_Core32_XSalsa20::xsalsa20()

Expand a key and nonce into an xsalsa20 keystream.

@internal You should not use this directly from another application

Parameters

int $len:

string $nonce:

string $key:

Return value

string

Throws

SodiumException

TypeError

2 calls to ParagonIE_Sodium_Core32_XSalsa20::xsalsa20()
ParagonIE_Sodium_Compat::crypto_stream in vendor/paragonie/sodium_compat/src/Compat.php
Expand a key and nonce into a keystream of pseudorandom bytes.
ParagonIE_Sodium_Core32_XSalsa20::xsalsa20_xor in vendor/paragonie/sodium_compat/src/Core32/XSalsa20.php
Encrypt a string with XSalsa20. Doesn't provide integrity.

File

vendor/paragonie/sodium_compat/src/Core32/XSalsa20.php, line 24

Class

ParagonIE_Sodium_Core32_XSalsa20
Class ParagonIE_Sodium_Core32_XSalsa20

Code

public static function xsalsa20($len, $nonce, $key) {
  $ret = self::salsa20($len, self::substr($nonce, 16, 8), self::hsalsa20($nonce, $key));
  return $ret;
}