mirror of
https://github.com/Legrandin/pycryptodome.git
synced 2025-12-08 05:19:46 +00:00
Add nonce and initial_value parameters to CTR mode
This commit is contained in:
parent
6fc0c734a2
commit
c74b718aa6
13 changed files with 210 additions and 71 deletions
|
|
@ -123,9 +123,12 @@ def new(key, mode, *args, **kwargs):
|
|||
|
||||
For all other modes, it must be 8 bytes long.
|
||||
nonce : byte string
|
||||
(*Only* `MODE_EAX`).
|
||||
(*Only* `MODE_EAX` and `MODE_CTR`).
|
||||
A mandatory value that must never be reused for any other encryption.
|
||||
There are no restrictions on its length, but it is recommended to
|
||||
|
||||
For `MODE_CTR`, its length must be in the range ``[0..7]``.
|
||||
|
||||
For `MODE_EAX`, there are no restrictions, but it is recommended to
|
||||
use at least 16 bytes.
|
||||
counter : object
|
||||
(*Only* `MODE_CTR`). An object created by `Crypto.Util.Counter`.
|
||||
|
|
@ -136,6 +139,9 @@ def new(key, mode, *args, **kwargs):
|
|||
(*Only* `MODE_CFB`).The number of bits the plaintext and ciphertext
|
||||
are segmented in.
|
||||
It must be a multiple of 8. If not specified, it will be assumed to be 8.
|
||||
initial_value : integer
|
||||
(*Only* `MODE_CTR`). The initial value for the counter within
|
||||
the counter block. By default it is 0.
|
||||
|
||||
:Return: a DES cipher, of the applicable mode.
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue