--------------------------
Minor Changes
^^^^^^^^^^^^^
- Small fixes & improvements to documentation.
- Small fixes & improvements to tests.
- Small fixes to type-hints.
- Small re-organization of source file contents.
- Small bug fixes.
Changes for version 0.20.0 (Backwards incompatible updates)
-----------------------------------------------------------
Major Changes
^^^^^^^^^^^^^
- The ``(a)json_(en/de)crypt`` & ``(a)bytes_(en/de)crypt`` functions &
methods now only expect to work with ``bytes`` type ciphertext. And,
the low-level cipher generators expect iterables of bytes where they
used to expect iterables of integers.
- The ``pid`` keyword-only argument throughout the package was changed
to ``aad`` to more clearly communicate its purpose as authenticated
additional data.
- The ``key``, ``salt`` & ``aad`` values throughout the package are now
expected to be ``bytes`` type values.
- The ``key`` must now be at least 32-bytes for use within the ``Chunky2048``
cipher & its interfaces.
- The ``salt``, for use in the ``Chunky2048`` cipher & its interfaces,
was decreased from needing to be 32-bytes to 24-bytes.
- The ``siv``, for use in the ``Chunky2048`` cipher & its interfaces, was
increased from needing to be 16-bytes to 24-bytes.
- The new ``KeyAADBundle`` class was created as the primary interface
for consuming ``key``, ``salt``, ``aad`` & ``siv`` values. This class'
objects are the only ones that are used to pass around these values
in low-level ``Chunky2048`` cipher functionalities. The higher-level
cipher functions are the only public interfaces that still receive
these ``key``, ``salt``, & ``aad`` values.
- The ``KeyAADBundle`` now manages the new initial key derivation of the
``Chunky2048`` cipher. This new algorithm is much more efficient,
utilizing the output of the keystream's first priming call instead of
throwing it away, removing the need for several other previously used
hashing calls.
- The ``bytes_keys`` & ``abytes_keys`` keystream generator algorithms
were improved & made more efficient. They also now only receive ``bytes``
type coroutine values or ``None``.
- The ``StreamHMAC`` algorithms were improved & made more efficient.
- The ``Chunky2048`` class now creates instance's that initialize, & who's
methods are callable, much more efficiently by reducing its previously
dynamic structure. Its now reasonable to use these instances in code
that has strict performance requirements.
- The ``Keys`` & ``AsyncKeys`` classes were trimmed of all instance
behaviour. They are now strictly namespaces which contain static or
class methods.
- All instance's of the word `password` throughout the package have been
replaced with the word `passphrase`. The ``Passcrypt`` class now only
accepts ``bytes`` type ``passphrase`` & ``salt`` values. The returned
hashes are also now always ``bytes``.
- The ``Padding`` & ``BytesIO`` classes' functionalities were made more
efficient & cleaned up their implementations.
- New ``PackageSigner`` & ``PackageVerifier`` classes were added to the
``keygens.py`` module to provide an intuituve API for users to sign their
own packages. This package now also uses these classes to sign itself.
- The new ``gentools.py`` module was created to organize the generator
utilities that were previously scattered throughout the package's
top-level namespaces.
- The new ``_exceptions.py`` module was created to help organize the
exceptions raised throughout the package, improving readability
& maintainability.
- The new ``_typing.py`` module was added to assist in the long process
of adding functional type-hinting throughout the package. For now,
the type hints that have been added primarily function as documentation.
- A new ``Slots`` base class was added to the ``commons.py`` module to
simplify the creation of more memory efficient & performant container
classes. The new ``_containers.py`` module was made for such classes
for use throughout the package. And, most classes throughout the
package were given ``__slots__`` attributes.
- A new ``OpenNamespace`` class was added, which is a subclass of ``Namespace``,
with the only difference being that instances do not omit attributes
from their repr's.
- The new ``(a)bytes_are_equal`` functions, which are pointers to
``hmac.compare_digest`` from the standard library, have replaced the
``(a)time_safe_equality`` functions.
- The ``(a)sha_256(_hmac)`` & ``(a)sha_512(_hmac)`` functions have had
their names changed to ``(a)sha3__256(_hmac)`` & ``(a)sha3__512(_hmac)``.
This was done to communicate that they are actually SHA3 functions,
but the double underscore is to keep them differentiable from the
standard library's ``hashlib`` objects. They can now also return
``bytes`` instead of hex strings if their ``hex`` keyword argument is truthy.
- The base functionality of the ``Comprende`` class was refactored out into a
``BaseComprende`` class. The chainable data processor generator methods
remain in the ``Comprende`` class. Their endpoint methods (such as ``(a)list``
& ``(a)join``) have also been changed so they don't cache results by default.
- The ``Passcrypt`` class' ``kb`` & ``hardness`` can now be set to values
independently from one another. The algorithm runs on the new
``(a)bytes_keys`` coroutines, & a slightly more effective cache building
procedure.
- The databases classes now don't preload their values by default. And,
various methods which work with tags & metatags have been given a
``cache`` keyword-only argument to toggle on/off the control of using
the cache for each operation.
- New method additions/changes to the database classes:
- ``(a)rollback_tag``, ``(a)clear_cache``, & a ``filenames`` property
were added.
- ``(a)hmac`` was changed to ``(a)make_hmac``, & now returns ``bytes`` hashes.
- ``(a)save`` was changed to ``(a)save_database``.
- ``(a)query`` was changed to ``(a)query_tag``.
- ``(a)set`` was changed to ``(a)set_tag``.
- ``(a)pop`` was changed to ``(a)pop_tag``.
- The ``tags``, ``metatags`` & ``filenames`` properties now return sets
instead of lists.
- The ``Ropake`` class has been removed from the package pending changes to
the protocol & its implementation.
- The ``(a)generate_salt`` function now returns ``bytes`` type values,
& takes a ``size`` keyword-only argument, with no default, that determines
the number of bytes returned between [8, 64].
- The ``(a)random_512`` & ``(a)random_256`` public functions can now cause
their underlying random number generators to fill their entropy pools
when either the ``rounds`` or ``refresh`` keyword arguments are specified.
- The following variables were removed from the package:
- ``(a)keys``, ``(a)passcrypt``, ``(a)seeder``, ``(a)time_safe_equality``,
``Datastream``, ``bits``, ``(a)seedrange``, ``(a)build_tree``,
``(a)customize_parameters``, ``convert_class_method_to_member``,
``convert_static_method_to_member``, ``(a)xor``, ``(a)padding_key``,
``(a)prime_table``, ``(a)unique_range_gen``, ``(a)non_0_digits``,
``(a)bytes_digits``, ``(a)digits``, ``(a)permute``, ``(a)shuffle``,
``(a)unshuffle``, ``(a)create_namespace``,
(``(a)depad_plaintext``, ``(a)pad_plaintext`` & their generator forms.
Only the non-generator forms remain in the ``Padding`` class), (The
``(a)passcrypt``, ``(a)uuids``, ``(a)into_namespace`` methods from the
database classes), (The ``(a)csprbg`` functions were removed & instead
the ``(a)csprng`` functions produce ``bytes`` type values.)
- Thorough & deep refactorings of modules, classes & methods. Many methods
& functions were made private, cleaning up the APIs of the package,
focusing on bringing the highest-level functionalities to top level
namespaces accessible to users. Some purely private functionalities
were entirely moved to private namespaces not readily accessible to
users.
- Most of the constants which determine the functionalities throughout
the package were refactored out into ``commons.py``. This allows
for easy changes to protocols & data formats.
Minor Changes
^^^^^^^^^^^^^
- Many documentation improvements, fixes, trimmings & updates.
- Added a ``WeakEntropy`` class to the ``randoms.py`` module.