def ecb_encrypt(encrypter, bs, pt):
"""ECB encryption mode of operation
- :param encrypter: Encrypting function, that takes block as an input
+ :param encrypter: encrypting function, that takes block as an input
:param int bs: cipher's blocksize
:param bytes pt: already padded plaintext
"""
def ctr(encrypter, bs, data, iv):
"""Counter mode of operation
- :param encrypter: Encrypting function, that takes block as an input
+ :param encrypter: encrypting function, that takes block as an input
:param int bs: cipher's blocksize
:param bytes data: plaintext/ciphertext
:param bytes iv: half blocksize-sized initialization vector
def ofb(encrypter, bs, data, iv):
"""OFB mode of operation
- :param encrypter: Encrypting function, that takes block as an input
+ :param encrypter: encrypting function, that takes block as an input
:param int bs: cipher's blocksize
:param bytes data: plaintext/ciphertext
:param bytes iv: blocksize-sized initialization vector
def cbc_encrypt(encrypter, bs, pt, iv):
"""CBC encryption mode of operation
- :param encrypter: Encrypting function, that takes block as an input
+ :param encrypter: encrypting function, that takes block as an input
:param int bs: cipher's blocksize
:param bytes pt: already padded plaintext
:param bytes iv: blocksize-sized initialization vector
def cfb_encrypt(encrypter, bs, pt, iv):
"""CFB encryption mode of operation
- :param encrypter: Encrypting function, that takes block as an input
+ :param encrypter: encrypting function, that takes block as an input
:param int bs: cipher's blocksize
:param bytes pt: plaintext
:param bytes iv: blocksize-sized initialization vector
def cfb_decrypt(encrypter, bs, ct, iv):
"""CFB decryption mode of operation
- :param encrypter: Encrypting function, that takes block as an input
+ :param encrypter: encrypting function, that takes block as an input
:param int bs: cipher's blocksize
:param bytes ct: ciphertext
:param bytes iv: blocksize-sized initialization vector
def mac(encrypter, bs, data):
"""MAC (known here as CMAC, OMAC1) mode of operation
- :param encrypter: Encrypting function, that takes block as an input
+ :param encrypter: encrypting function, that takes block as an input
:param int bs: cipher's blocksize
:param bytes data: data to authenticate