<?php
spl_autoload_register(function ($class) {
    $prefixes = [
        'phpseclib3\\' => __DIR__ . '/phpseclib/phpseclib/',
        'ParagonIE\\ConstantTime\\' => __DIR__ . '/phpseclib/paragonie-constant-time/src/'
    ];

    foreach ($prefixes as $prefix => $base_dir) {
        $len = strlen($prefix);
        if (strncmp($prefix, $class, $len) !== 0) {
            continue;
        }

        $relative_class = substr($class, $len);
        $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';

        if (file_exists($file)) {
            require $file;
            return;
        }
    }
});
?>