1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# SPDX-License-Identifier: MIT
 
from __future__ import annotations
 
 
class Argon2Error(Exception):
    """
    Superclass of all argon2 exceptions.
 
    Never thrown directly.
    """
 
 
class VerificationError(Argon2Error):
    """
    Verification failed.
 
    You can find the original error message from Argon2 in ``args[0]``.
    """
 
 
class VerifyMismatchError(VerificationError):
    """
    The secret does not match the hash.
 
    Subclass of :exc:`argon2.exceptions.VerificationError`.
 
    .. versionadded:: 16.1.0
    """
 
 
class HashingError(Argon2Error):
    """
    Raised if hashing failed.
 
    You can find the original error message from Argon2 in ``args[0]``.
    """
 
 
class InvalidHashError(ValueError):
    """
    Raised if the hash is invalid before passing it to Argon2.
 
    .. versionadded:: 23.1.0
       As a replacement for :exc:`argon2.exceptions.InvalidHash`.
    """
 
 
class UnsupportedParametersError(ValueError):
    """
    Raised if the current platform does not support the parameters.
 
    For example, in WebAssembly parallelism must be set to 1.
 
    .. versionadded:: 25.1.0
    """
 
 
InvalidHash = InvalidHashError
"""
Deprecated alias for :class:`InvalidHashError`.
 
.. versionadded:: 18.2.0
.. deprecated:: 23.1.0
    Use :exc:`argon2.exceptions.InvalidHashError` instead.
"""