ParagonIE_Sodium_File::box_decrypt

Advertisement

Syntax Syntax

ParagonIE_Sodium_File::box_decrypt( resource $ifp, resource $ofp, int $mlen, string $nonce, string $boxKeypair )

Parameters Parameters

$ifp

(Required)

$ofp

(Required)

$mlen

(Required)

$nonce

(Required)

$boxKeypair

(Required)

Return Return

(bool)

Source Source

File: wp-includes/sodium_compat/src/File.php

    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)
            )
        );
    }

Advertisement

Advertisement

Leave a Reply