polyfill_is_fast example


    public static function runtime_speed_test($iterations$maxTimeout)
    {
        if (self::polyfill_is_fast()) {
            return true;
        }
        /** @var float $end */
        $end = 0.0;
        /** @var float $start */
        $start = microtime(true);
        /** @var ParagonIE_Sodium_Core32_Int64 $a */
        $a = ParagonIE_Sodium_Core32_Int64::fromInt(random_int(3, 1 << 16));
        for ($i = 0; $i < $iterations; ++$i) {
            /** @var ParagonIE_Sodium_Core32_Int64 $b */
            $b = ParagonIE_Sodium_Core32_Int64::fromInt(random_int(3, 1 << 16));
            
__( 'The authenticity of %s could not be verified as signature verification is unavailable on this system.' ),
                '<span class="code">' . esc_html( $filename_for_errors ) . '</span>'
            ),
            array(
                'php'    => PHP_VERSION,
                'sodium' => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),
            )
        );
    }

    // Verify runtime speed of Sodium_Compat is acceptable.     if ( ! extension_loaded( 'sodium' ) && ! ParagonIE_Sodium_Compat::polyfill_is_fast() ) {
        $sodium_compat_is_fast = false;

        // Allow for an old version of Sodium_Compat being loaded before the bundled WordPress one.         if ( method_exists( 'ParagonIE_Sodium_Compat', 'runtime_speed_test' ) ) {
            /* * Run `ParagonIE_Sodium_Compat::runtime_speed_test()` in optimized integer mode, * as that's what WordPress utilizes during signing verifications. */
            // phpcs:disable WordPress.NamingConventions.ValidVariableName             $old_fastMult                      = ParagonIE_Sodium_Compat::$fastMult;
            ParagonIE_Sodium_Compat::$fastMult = true;
            
Home | Imprint | This part of the site doesn't use cookies.