Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d982c8f5
Commit
d982c8f5
authored
Sep 06, 2016
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
properly introduce reST literal blocks
parent
9b3d7705
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Doc/library/hashlib-blake2.rst
Doc/library/hashlib-blake2.rst
+4
-4
No files found.
Doc/library/hashlib-blake2.rst
View file @
d982c8f5
...
...
@@ -217,7 +217,7 @@ BLAKE2 can be securely used in prefix-MAC mode thanks to the
indifferentiability property inherited from BLAKE.
This example shows how to get a (hex-encoded) 128-bit authentication code for
message ``b'message data'`` with key ``b'pseudorandom key'``:
message ``b'message data'`` with key ``b'pseudorandom key'``:
:
>>> from hashlib import blake2b
>>> h = blake2b(key=b'pseudorandom key', digest_size=16)
...
...
@@ -227,7 +227,7 @@ message ``b'message data'`` with key ``b'pseudorandom key'``:
As a practical example, a web application can symmetrically sign cookies sent
to users and later verify them to make sure they weren't tampered with:
to users and later verify them to make sure they weren't tampered with:
:
>>> from hashlib import blake2b
>>> from hmac import compare_digest
...
...
@@ -251,7 +251,7 @@ to users and later verify them to make sure they weren't tampered with:
False
Even though there's a native keyed hashing mode, BLAKE2 can, of course, be used
in HMAC construction with :mod:`hmac` module:
in HMAC construction with :mod:`hmac` module:
:
>>> import hmac, hashlib
>>> m = hmac.new(b'secret key', digestmod=hashlib.blake2s)
...
...
@@ -334,7 +334,7 @@ function:
<http://www.skein-hash.info/sites/default/files/skein1.3.pdf>`_,
p. 21)
BLAKE2 can be personalized by passing bytes to the *person* argument:
BLAKE2 can be personalized by passing bytes to the *person* argument:
:
>>> from hashlib import blake2b
>>> FILES_HASH_PERSON = b'MyApp Files Hash'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment