Index: wp-admin/includes/file.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-admin/includes/file.php	(date 1557425095000)
+++ wp-admin/includes/file.php	(date 1558040439994)
@@ -1199,6 +1199,41 @@
 
 	}
 
+	$oldFastMult = ParagonIE_Sodium_Compat::$fastMult;
+	ParagonIE_Sodium_Compat::$fastMult = true;
+	if (
+		! extension_loaded( 'sodium' ) &&
+		! ParagonIE_Sodium_Compat::polyfill_is_fast()
+	) {
+		$max = ini_get('max_execution_time');
+		$unsafe = true;
+		if (method_exists('ParagonIE_Sodium_Compat', 'runtime_speed_test')) {
+		    // Guard this around a method_exists() to prevent breakage with sodium_compat < 1.9 loaded by plugins
+			$unsafe = ! ParagonIE_Sodium_Compat::runtime_speed_test(25, 5);
+		}
+		if ($unsafe && $max > 0 && $max < 60) {
+			ParagonIE_Sodium_Compat::$fastMult = $oldFastMult;
+			// This cannot be performed in a reasonable amount of time
+			// https://github.com/paragonie/sodium_compat#help-sodium_compat-is-slow-how-can-i-make-it-fast
+
+			return new WP_Error(
+				'signature_verification_unsupported',
+				sprintf(
+				/* translators: 1: The filename of the package. */
+					__('The authenticity of %1$s could not be verified as signature verification is unavailable on this system.'),
+					'<span class="code">' . esc_html($filename_for_errors) . '</span>'
+				),
+				array(
+					'php' => phpversion(),
+					'sodium' => defined('SODIUM_LIBRARY_VERSION') ? SODIUM_LIBRARY_VERSION : (defined('ParagonIE_Sodium_Compat::VERSION_STRING') ? ParagonIE_Sodium_Compat::VERSION_STRING : false),
+					'polyfill-is-fast' => false,
+					'max-execution-time' => $max
+				)
+			);
+		}
+	}
+	ParagonIE_Sodium_Compat::$fastMult = $oldFastMult;
+
 	if ( ! $signatures ) {
 		return new WP_Error(
 			'signature_verification_no_signature',
