public static function verify(
        HiddenString $password,
        string $stored,
        EncryptionKey $secretKey,
        string $additionalData = ''
    ): bool {
        $config = self::getConfig($stored);
        // Base64-urlsafe encoded, so 4/3 the size of raw binary
        if (Binary::safeStrlen($stored) < ((int) $config->SHORTEST_CIPHERTEXT_LENGTH * 4/3)) {
            throw new InvalidMessage(
                'Encrypted password hash is too short.'
            );
        }
        // First let's decrypt the hash
        $hash_str = Crypto::decryptWithAd($stored, $secretKey, $additionalData, $config->ENCODING);
        // Upon successful decryption, verify the password is correct
        return \sodium_crypto_pwhash_str_verify(
            $hash_str->getString(),
            $password->getString()
        );
    }