Skip to content

Commit

Permalink
Fix GH#705: iv/IV/nonce parameter can be explicitly None (typing) for…
Browse files Browse the repository at this point in the history
… AES
  • Loading branch information
Legrandin committed Jan 27, 2023
1 parent 7ff4746 commit 7b9dc80
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lib/Crypto/Cipher/AES.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,30 @@ def new(key: ByteString,
@overload
def new(key: ByteString,
mode: Literal[2],
iv : ByteString = ...,
iv : Optional[ByteString] = ...,
use_aesni : bool = ...) -> \
CbcMode: ...

@overload
def new(key: ByteString,
mode: Literal[2],
IV : ByteString = ...,
IV : Optional[ByteString] = ...,
use_aesni : bool = ...) -> \
CbcMode: ...

# MODE_CFB
@overload
def new(key: ByteString,
mode: Literal[3],
iv : ByteString = ...,
iv : Optional[ByteString] = ...,
segment_size : int = ...,
use_aesni : bool = ...) -> \
CfbMode: ...

@overload
def new(key: ByteString,
mode: Literal[3],
IV : ByteString = ...,
IV : Optional[ByteString] = ...,
segment_size : int = ...,
use_aesni : bool = ...) -> \
CfbMode: ...
Expand All @@ -68,22 +68,22 @@ def new(key: ByteString,
@overload
def new(key: ByteString,
mode: Literal[5],
iv : ByteString = ...,
iv : Optional[ByteString] = ...,
use_aesni : bool = ...) -> \
OfbMode: ...

@overload
def new(key: ByteString,
mode: Literal[5],
IV : ByteString = ...,
IV : Optional[ByteString] = ...,
use_aesni : bool = ...) -> \
OfbMode: ...

# MODE_CTR
@overload
def new(key: ByteString,
mode: Literal[6],
nonce : ByteString = ...,
nonce : Optional[ByteString] = ...,
initial_value : Union[int, ByteString] = ...,
counter : Dict = ...,
use_aesni : bool = ...) -> \
Expand All @@ -93,22 +93,22 @@ def new(key: ByteString,
@overload
def new(key: ByteString,
mode: Literal[7],
iv : ByteString = ...,
iv : Optional[ByteString] = ...,
use_aesni : bool = ...) -> \
OpenPgpMode: ...

@overload
def new(key: ByteString,
mode: Literal[7],
IV : ByteString = ...,
IV : Optional[ByteString] = ...,
use_aesni : bool = ...) -> \
OpenPgpMode: ...

# MODE_CCM
@overload
def new(key: ByteString,
mode: Literal[8],
nonce : ByteString = ...,
nonce : Optional[ByteString] = ...,
mac_len : int = ...,
assoc_len : int = ...,
use_aesni : bool = ...) -> \
Expand All @@ -118,7 +118,7 @@ def new(key: ByteString,
@overload
def new(key: ByteString,
mode: Literal[9],
nonce : ByteString = ...,
nonce : Optional[ByteString] = ...,
mac_len : int = ...,
use_aesni : bool = ...) -> \
EaxMode: ...
Expand All @@ -127,15 +127,15 @@ def new(key: ByteString,
@overload
def new(key: ByteString,
mode: Literal[10],
nonce : ByteString = ...,
nonce : Optional[ByteString] = ...,
use_aesni : bool = ...) -> \
SivMode: ...

# MODE_SIV
@overload
def new(key: ByteString,
mode: Literal[11],
nonce : ByteString = ...,
nonce : Optional[ByteString] = ...,
mac_len : int = ...,
use_aesni : bool = ...) -> \
GcmMode: ...
Expand All @@ -144,7 +144,7 @@ def new(key: ByteString,
@overload
def new(key: ByteString,
mode: Literal[12],
nonce : ByteString = ...,
nonce : Optional[ByteString] = ...,
mac_len : int = ...,
use_aesni : bool = ...) -> \
OcbMode: ...
Expand Down

0 comments on commit 7b9dc80

Please sign in to comment.