Metadata-Version: 2.4
Name: Whirlpool
Version: 1.1.0
Summary: Bindings for whirlpool hash reference implementation.
Author-email: Olaf Conradi <olaf@conradi.org>
License: Public Domain
Project-URL: Homepage, https://github.com/oohlaf/python-whirlpool
Project-URL: Repository, https://github.com/oohlaf/python-whirlpool
Project-URL: Changelog, https://github.com/oohlaf/python-whirlpool/blob/master/CHANGELOG.md
Keywords: digest,hashlib,whirlpool
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: Public Domain
Classifier: Programming Language :: C
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,>=2.7
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS.txt
Dynamic: license-file

# python-whirlpool

[![CI](https://github.com/oohlaf/python-whirlpool/actions/workflows/ci.yml/badge.svg)](https://github.com/oohlaf/python-whirlpool/actions/workflows/ci.yml)
[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](http://unlicense.org/)

The [Whirlpool] algorithm is designed by Vincent Rijmen and Paulo S.L.M. Barreto.
It is a secure and modern digest function that has been recommended by the
[NESSIE] project and adopted in the ISO/IEC 10118-3 international standard.

Digest functions, also known as hash functions, produce fixed-length output (a
digest or hash) from a variable-length message. They are designed to be a
one-way function.

This library is a Python wrapper around the Whirlpool C reference implementation.
The Whirlpool reference implementations are public domain, as is this code.

The first version of the wrapper was written by James Cleveland with help
from #python on irc.freenode.net.

Later on, the wrapper was rewritten by Olaf Conradi to use the hashlib interface
and he made the library compatible with Python 3.

## Installation

This library is available on [PyPI].

    pip install whirlpool

## Usage

This is the same interface provided by the other digest algorithms in
Python's hashlib.

    import whirlpool

    wp = whirlpool.new("My String")
    hashed_string = wp.hexdigest()

    wp.update("My Salt")
    hashed_string = wp.hexdigest()

Starting with Python 3 text strings (as shown above) are stored as unicode.
You need to specify the encoding of these strings before hashing.

    wp = whirlpool.new(data.encoding('utf-8'))

Strings that are marked as binary do not need encoding.

## Development

The source code is available on [GitHub].

    git clone https://github.com/oohlaf/python-whirlpool.git
    cd python-whirlpool

Install in development mode using:

    pip install -e .

## Testing

This module is tested using Python 2.7, PyPy, and Python 3.9 and up.

You can run the test suite locally with:

    python -m unittest discover -s test -p 'test_*.py'

For a multi-version local test matrix, you can also use:

    tox

[Whirlpool]: https://en.wikipedia.org/wiki/Whirlpool_(cryptography)
[NESSIE]: https://www.cosic.esat.kuleuven.be/nessie/
[PyPI]: https://pypi.python.org/pypi/Whirlpool
[GitHub]: https://github.com/oohlaf/python-whirlpool
