You are here

protected static function ParagonIE_Sodium_File::box_decrypt in Automatic Updates 7

Same name and namespace in other branches
  1. 8 vendor/paragonie/sodium_compat/src/File.php \ParagonIE_Sodium_File::box_decrypt()

Parameters

resource $ifp:

resource $ofp:

int $mlen:

string $nonce:

string $boxKeypair:

Return value

bool

Throws

SodiumException

TypeError

2 calls to ParagonIE_Sodium_File::box_decrypt()
ParagonIE_Sodium_File::box_open in vendor/paragonie/sodium_compat/src/File.php
Open a boxed file (rather than a string). Uses less memory than ParagonIE_Sodium_Compat::crypto_box_open(), but produces the same result.
ParagonIE_Sodium_File::box_seal_open in vendor/paragonie/sodium_compat/src/File.php
Open a sealed file (rather than a string). Uses less memory than ParagonIE_Sodium_Compat::crypto_box_seal_open(), but produces the same result.

File

vendor/paragonie/sodium_compat/src/File.php, line 804

Class

ParagonIE_Sodium_File
Class ParagonIE_Sodium_File

Code

protected static function box_decrypt($ifp, $ofp, $mlen, $nonce, $boxKeypair) {
  if (PHP_INT_SIZE === 4) {
    return self::secretbox_decrypt($ifp, $ofp, $mlen, $nonce, ParagonIE_Sodium_Crypto32::box_beforenm(ParagonIE_Sodium_Crypto32::box_secretkey($boxKeypair), ParagonIE_Sodium_Crypto32::box_publickey($boxKeypair)));
  }
  return self::secretbox_decrypt($ifp, $ofp, $mlen, $nonce, ParagonIE_Sodium_Crypto::box_beforenm(ParagonIE_Sodium_Crypto::box_secretkey($boxKeypair), ParagonIE_Sodium_Crypto::box_publickey($boxKeypair)));
}