parent
9e087d578b
commit
07b547b80c
1
Makefile
1
Makefile
|
@ -49,6 +49,7 @@ clean-test: ## remove test and coverage artifacts
|
||||||
|
|
||||||
lint: ## check style with flake8
|
lint: ## check style with flake8
|
||||||
flake8 src tests
|
flake8 src tests
|
||||||
|
pylint src tests/*
|
||||||
|
|
||||||
test: install ## run tests quickly with the default Python
|
test: install ## run tests quickly with the default Python
|
||||||
py.test tests
|
py.test tests
|
||||||
|
|
|
@ -20,8 +20,7 @@ RSA
|
||||||
:members:
|
:members:
|
||||||
:inherited-members:
|
:inherited-members:
|
||||||
|
|
||||||
Example
|
**Example:**
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
>>> from wolfcrypt.ciphers import RsaPrivate, RsaPublic
|
>>> from wolfcrypt.ciphers import RsaPrivate, RsaPublic
|
||||||
>>> from wolfcrypt.utils import h2b
|
>>> from wolfcrypt.utils import h2b
|
||||||
|
|
|
@ -7,17 +7,25 @@ Symmetric Key Algorithms
|
||||||
cryptographic key** for both encryption and decryption of data.
|
cryptographic key** for both encryption and decryption of data.
|
||||||
This operation is also known as **Symmetric Key Encryption**.
|
This operation is also known as **Symmetric Key Encryption**.
|
||||||
|
|
||||||
``wolfcrypt`` provides access to the following **Symmetric Key Ciphers**:
|
Symmetric Key Encryption Classes
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
Interface
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
|
All **Symmetric Key Ciphers** available in this module implements the following
|
||||||
|
interface:
|
||||||
|
|
||||||
|
.. autoclass:: _Cipher
|
||||||
|
:members:
|
||||||
|
|
||||||
AES
|
AES
|
||||||
---
|
~~~
|
||||||
|
|
||||||
.. autoclass:: Aes
|
.. autoclass:: Aes
|
||||||
:members:
|
:members:
|
||||||
:inherited-members:
|
|
||||||
|
|
||||||
Example
|
**Example:**
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
.. doctest::
|
.. doctest::
|
||||||
|
|
||||||
|
@ -31,14 +39,12 @@ Example
|
||||||
b'now is the time '
|
b'now is the time '
|
||||||
|
|
||||||
Triple DES
|
Triple DES
|
||||||
----------
|
~~~~~~~~~~
|
||||||
|
|
||||||
.. autoclass:: Des3
|
.. autoclass:: Des3
|
||||||
:members:
|
:members:
|
||||||
:inherited-members:
|
|
||||||
|
|
||||||
Example
|
**Example:**
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
.. doctest::
|
.. doctest::
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ class _Cipher(object):
|
||||||
raise ValueError("key must be %s in length, not %d" %
|
raise ValueError("key must be %s in length, not %d" %
|
||||||
(self._key_sizes, len(key)))
|
(self._key_sizes, len(key)))
|
||||||
elif not key: # pragma: no cover
|
elif not key: # pragma: no cover
|
||||||
raise ValueError("key must not be 0 in length")
|
raise ValueError("key must not be 0 in length")
|
||||||
|
|
||||||
if IV is not None and len(IV) != self.block_size:
|
if IV is not None and len(IV) != self.block_size:
|
||||||
raise ValueError("IV must be %d in length, not %d" %
|
raise ValueError("IV must be %d in length, not %d" %
|
||||||
|
|
|
@ -308,7 +308,7 @@ def test_ecc_make_shared_secret():
|
||||||
b_pub = EccPublic()
|
b_pub = EccPublic()
|
||||||
b_pub.import_x963(b.export_x963())
|
b_pub.import_x963(b.export_x963())
|
||||||
|
|
||||||
assert a.shared_secret(b) == \
|
assert a.shared_secret(b) \
|
||||||
b.shared_secret(a) == \
|
== b.shared_secret(a) \
|
||||||
a.shared_secret(b_pub) == \
|
== a.shared_secret(b_pub) \
|
||||||
b.shared_secret(a_pub)
|
== b.shared_secret(a_pub)
|
||||||
|
|
Loading…
Reference in New Issue