Debian Codegraph @

Doc/src/hash/blake2b.rst

raw
1 BLAKE2b
2 =======
3
4 `BLAKE2b`_ is an optimized variant of BLAKE, one of the SHA-3 candidates that
5 made it to the final round of the NIST hash competition.
6 It is specified in `RFC7693 <https://tools.ietf.org/html/rfc7693>`_.
7
8 The algorithm uses 64 bit words, and it therefore works best on
9 64-bit platforms. The digest size ranges from 8 to 512 bits.
10
11 >>> from Crypto.Hash import BLAKE2b
12 >>>
13 >>> h_obj = BLAKE2b.new(digest_bits=512)
14 >>> h_obj.update(b'Some data')
15 >>> print h_obj.hexdigest()
16
17 Optionally, BLAKE2b can work as a cryptographic MAC when initialized
18 with a secret key.
19
20 >>> from Crypto.Hash import BLAKE2b
21 >>>
22 >>> mac = BLAKE2b.new(digest_bits=256, key=b'secret')
23 >>> mac.update(b'Some data')
24 >>> print mac.hexdigest()
25
26 .. _BLAKE2b: https://blake2.net/
27
28 .. automodule:: Crypto.Hash.BLAKE2b
29 :members: