Add stubs for TgCrypto (#12469)

This commit is contained in:
Radik Islamov
2024-08-01 19:52:17 +05:00
committed by GitHub
parent daefde073d
commit 17af88919f
3 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
# stubtest doesn't recognize these function as taking only positional-only arguments.
tgcrypto.cbc256_decrypt
tgcrypto.cbc256_encrypt
tgcrypto.ctr256_decrypt
tgcrypto.ctr256_encrypt
tgcrypto.ige256_decrypt
tgcrypto.ige256_encrypt

View File

@@ -0,0 +1,2 @@
version = "1.2.*"
upstream_repository = "https://github.com/pyrogram/tgcrypto"

View File

@@ -0,0 +1,8 @@
from typing_extensions import Buffer
def ige256_encrypt(data: Buffer, key: Buffer, iv: Buffer, /) -> bytes: ...
def ige256_decrypt(data: Buffer, key: Buffer, iv: Buffer, /) -> bytes: ...
def ctr256_encrypt(data: Buffer, key: Buffer, iv: Buffer, state: Buffer, /) -> bytes: ...
def ctr256_decrypt(data: Buffer, key: Buffer, iv: Buffer, state: Buffer, /) -> bytes: ...
def cbc256_encrypt(data: Buffer, key: Buffer, iv: Buffer, /) -> bytes: ...
def cbc256_decrypt(data: Buffer, key: Buffer, iv: Buffer, /) -> bytes: ...