Skip to content

Commit a112416

Browse files
committed
Minor doc markup polish
1 parent 5c12dbb commit a112416

12 files changed

+72
-71
lines changed

.github/CONTRIBUTING.rst

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
How To Contribute
22
=================
33

4-
First off, thank you for considering contributing to ``argon2-cffi``!
4+
First off, thank you for considering contributing to *argon2-cffi*!
55
It's people like *you* who make it such a great tool for everyone.
66

77
This document intends to make contribution more accessible by codifying tribal knowledge and expectations.
@@ -96,55 +96,55 @@ Documentation
9696
9797
- Added ``argon2_cffi.func()`` that does foo.
9898
It's pretty cool.
99-
[`#1 <https://github.com/hynek/argon2_cffi/pull/1>`_]
99+
`#1 <https://github.com/hynek/argon2_cffi/pull/1>`_
100100
- ``argon2_cffi.func()`` now doesn't crash the Large Hadron Collider anymore.
101101
That was a nasty bug!
102-
[`#2 <https://github.com/hynek/argon2_cffi/pull/2>`_]
102+
`#2 <https://github.com/hynek/argon2_cffi/pull/2>`_
103103
104104
105105
Local Development Environment
106106
-----------------------------
107107

108108
You can (and should) run our test suite using tox_.
109109
However, you’ll probably want a more traditional environment as well.
110-
We highly recommend to develop using the latest Python 3 release because ``argon2_cffi`` tries to take advantage of modern features whenever possible.
110+
We highly recommend to develop using the latest Python 3 release because *argon2-cffi* tries to take advantage of modern features whenever possible.
111111

112112
First create a `virtual environment <https://virtualenv.pypa.io/>`_.
113113
It’s out of scope for this document to list all the ways to manage virtual environments in Python, but if you don’t already have a pet way, take some time to look at tools like `pew <https://github.com/berdario/pew>`_, `virtualfish <https://virtualfish.readthedocs.io/>`_, and `virtualenvwrapper <https://virtualenvwrapper.readthedocs.io/>`_.
114114

115-
Next, get an up to date checkout of the ``argon2_cffi`` repository:
115+
Next, get an up to date checkout of the *argon2-cffi* repository:
116116

117117
.. code-block:: bash
118118
119-
$ git clone [email protected]:hynek/argon2_cffi.git
119+
$ git clone [email protected]:hynek/argon2-cffi.git
120120
121121
or if you want to use git via ``https``:
122122

123123
.. code-block:: bash
124124
125-
$ git clone https://github.com/hynek/argon2_cffi.git
125+
$ git clone https://github.com/hynek/argon2-cffi.git
126126
127-
Change into the newly created directory and **after activating your virtual environment** install an editable version of ``argon2_cffi`` along with its tests and docs requirements:
127+
Change into the newly created directory and **after activating your virtual environment** install an editable version of *argon2-cffi* along with its tests and docs requirements:
128128

129-
- First you have to make sure, that our git submodules are up to date and the Argon2 extension is built:
129+
- First you have to make sure, that our git submodules are up to date and the *Argon2* extension is built:
130130

131131
#. ``git submodule init`` (to initialize git submodule mechanics)
132-
#. ``git submodule update`` (to update the vendored Argon2 C library to the version ``argon2_cffi`` is currently packaging)
132+
#. ``git submodule update`` (to update the vendored *Argon2* C library to the version *argon2-cffi* is currently packaging)
133133
#. ``python setup.py build`` (to build the CFFI module)
134134

135-
One of the environments requires a system-wide installation of Argon2.
135+
One of the environments requires a system-wide installation of *Argon2*.
136136
On macOS, it's available in Homebrew (`brew install argon2`, but you also will have to update your `LDFLAGS` so you compiler finds it) and recent Ubuntus (zesty and later) ship it too.
137137

138138

139-
- Next (re-)install ``argon2_cffi`` along with its developement requirements:
139+
- Next (re-)install *argon2-cffi* along with its developement requirements:
140140

141141
.. code-block:: bash
142142
143143
$ pip install -e '.[dev]'
144144
145145
****
146146

147-
**Whenever the Argon2 C code changes**: you will have to perform the steps above again except of ``git submodule init``.
147+
**Whenever the *Argon2 C* code changes**: you will have to perform the steps above again except of ``git submodule init``.
148148

149149
****
150150

AUTHORS.rst

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
Credits & License
22
=================
33

4-
``argon2-cffi`` is maintained by Hynek Schlawack and released under the `MIT license <https://github.com/hynek/argon2-cffi/blob/main/LICENSE>`_.
4+
*argon2-cffi* is maintained by Hynek Schlawack and released under the `MIT license <https://github.com/hynek/argon2-cffi/blob/main/LICENSE>`_.
55

66
The development is kindly supported by `Variomedia AG <https://www.variomedia.de/>`_.
7+
Please consider `supporting me <https://hynek.me/say-thanks/>`_ too!
78

89
A full list of contributors can be found in GitHub's `overview <https://github.com/hynek/argon2-cffi/graphs/contributors>`_.
910

1011

1112
Vendored Code
1213
-------------
1314

14-
Argon2
15-
^^^^^^
15+
*Argon2*
16+
^^^^^^^^
1617

17-
The original Argon2 repo can be found at https://github.com/P-H-C/phc-winner-argon2/.
18+
The original *Argon2* repo can be found at https://github.com/P-H-C/phc-winner-argon2/.
1819

19-
Except for the components listed below, the Argon2 code in this repository is copyright (c) 2015 Daniel Dinu, Dmitry Khovratovich (main authors), Jean-Philippe Aumasson and Samuel Neves, and under CC0_ license.
20+
Except for the components listed below, the *Argon2* code in this repository is copyright (c) 2015 Daniel Dinu, Dmitry Khovratovich (main authors), Jean-Philippe Aumasson and Samuel Neves, and under CC0_ license.
2021

2122
The string encoding routines in src/encoding.c are copyright (c) 2015 Thomas Pornin, and under CC0_ license.
2223

2324
The `BLAKE2 <https://www.blake2.net>`_ code in ``src/blake2/`` is copyright (c) Samuel Neves, 2013-2015, and under CC0_ license.
2425

25-
The authors of Argon2 also were very helpful to get the library to compile on ancient versions of Visual Studio for ancient versions of Python.
26+
The authors of *Argon2* also were very helpful to get the library to compile on ancient versions of Visual Studio for ancient versions of Python.
2627

27-
The documentation also quotes frequently from the Argon2 paper_ to avoid mistakes by rephrasing.
28+
The documentation also quotes frequently from the *Argon2* paper_ to avoid mistakes by rephrasing.
2829

2930
.. _CC0: https://creativecommons.org/publicdomain/zero/1.0/
3031
.. _paper: https://www.password-hashing.net/argon2-specs.pdf

CHANGELOG.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Backward-incompatible changes:
103103
- Python 3.4 is not supported anymore.
104104
It has been unsupported by the Python core team for a while now and its PyPI downloads are negligible.
105105

106-
It's very unlikely that ``argon2-cffi`` will break under 3.4 anytime soon, but we don't test it and don't ship binary wheels for it anymore.
106+
It's very unlikely that *argon2-cffi* will break under 3.4 anytime soon, but we don't test it and don't ship binary wheels for it anymore.
107107

108108

109109
Deprecations:
@@ -213,7 +213,7 @@ Vendoring Argon2 @ `670229c <https://github.com/P-H-C/phc-winner-argon2/tree/670
213213
Changes:
214214
^^^^^^^^
215215

216-
- It is now possible to use the ``argon2-cffi`` bindings against an Argon2 library that is provided by the system.
216+
- It is now possible to use the *argon2-cffi* bindings against an Argon2 library that is provided by the system.
217217

218218

219219
----

FAQ.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
Frequently Asked Questions
22
==========================
33

4-
I'm using ``bcrypt``/``PBKDF2``/``scrypt``/``yescrypt``, do I need to migrate?
4+
I'm using *bcrypt*/*PBKDF2*/*scrypt*/*yescrypt*, do I need to migrate?
55
Using password hashes that aren't memory hard carries a certain risk but there's **no immediate danger or need for action**.
6-
If however you are deciding how to hash password *today*, Argon2 is the superior, future-proof choice.
6+
If however you are deciding how to hash password *today*, *Argon2* is the superior, future-proof choice.
77

88
But if you already use one of the hashes mentioned in the question, you should be fine for the foreseeable future.
9-
If you're using ``scrypt`` or ``yescrypt``, you will be probably fine for good.
9+
If you're using *scrypt* or *yescrypt*, you will be probably fine for good.
1010

1111
Why do the ``verify()`` methods raise an Exception instead of returning ``False``?
12-
#. The Argon2 library had no concept of a "wrong password" error in the beginning.
12+
#. The *Argon2* library had no concept of a "wrong password" error in the beginning.
1313
Therefore when writing these bindings, an exception with the full error had to be raised so you could inspect what went actually wrong.
1414

1515
It goes without saying that it's impossible to switch now for backward-compatibility reasons.

docs/api.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ API Reference
33

44
.. module:: argon2
55

6-
``argon2-cffi`` comes with an high-level API and hopefully reasonable defaults for Argon2 parameters that result in a verification time of 40--50ms on recent-ish hardware.
6+
*argon2-cffi* comes with an high-level API and hopefully reasonable defaults for *Argon2* parameters that result in a verification time of 40--50ms on recent-ish hardware.
77

88
.. warning::
99

@@ -117,7 +117,7 @@ The super low-level ``argon2_core()`` function is exposed too if you need access
117117

118118
.. autofunction:: core
119119

120-
In order to use :func:`core`, you need access to ``argon2-cffi``'s FFI objects.
120+
In order to use :func:`core`, you need access to *argon2-cffi*'s FFI objects.
121121
Therefore it is OK to use ``argon2.low_level.ffi`` and ``argon2.low_level.lib`` when working with it:
122122

123123
.. doctest::
@@ -155,15 +155,15 @@ Therefore it is OK to use ``argon2.low_level.ffi`` and ``argon2.low_level.lib``
155155
>>> out == argon2.low_level.hash_secret_raw(pwd, salt, 1, 8, 1, 8, Type.D)
156156
True
157157

158-
All constants and types on ``argon2.low_level.lib`` are guaranteed to stay as long they are not altered by Argon2 itself.
158+
All constants and types on ``argon2.low_level.lib`` are guaranteed to stay as long they are not altered by *Argon2* itself.
159159

160160
.. autofunction:: error_to_str
161161

162162

163163
Deprecated APIs
164164
---------------
165165

166-
These APIs are from the first release of ``argon2-cffi`` and proved to live in an unfortunate mid-level.
166+
These APIs are from the first release of *argon2-cffi* and proved to live in an unfortunate mid-level.
167167
On one hand they have defaults and check parameters but on the other hand they only consume byte strings.
168168

169169
Therefore the decision has been made to replace them by a high-level (:class:`argon2.PasswordHasher`) and a low-level (:mod:`argon2.low_level`) solution.

docs/argon2.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
What is Argon2?
2-
===============
1+
What is *Argon2*?
2+
=================
33

44
.. note::
55

66
**TL;DR**: Use :class:`argon2.PasswordHasher` with its default parameters to securely hash your passwords.
77

88
You do **not** need to read or understand anything below this box.
99

10-
Argon2 is a secure password hashing algorithm.
10+
*Argon2* is a secure password hashing algorithm.
1111
It is designed to have both a configurable runtime as well as memory consumption.
1212

1313
This means that you can decide how long it takes to hash a password and how much memory is required.
1414

15-
Argon2 comes in three variants:
15+
*Argon2* comes in three variants:
1616

1717
Argon2d
1818
is faster and uses data-depending memory access, which makes it less suitable for hashing secrets and more suitable for cryptocurrencies and applications with no threats from side-channel timing attacks.
@@ -55,7 +55,7 @@ The `Password Hashing Competition`_ took place between 2012 and 2015 to find a n
5555
Previously the NIST was in charge but after certain events and revelations_ their integrity has been put into question by the general public.
5656
So a group of independent cryptographers and security researchers came together.
5757

58-
In the end, Argon2 was announced_ as the winner.
58+
In the end, *Argon2* was announced_ as the winner.
5959

6060
.. _Password Hashing Competition: https://www.password-hashing.net/
6161
.. _revelations: https://en.wikipedia.org/wiki/Dual_EC_DRBG

docs/backward-compatibility.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Backward Compatibility
22
======================
33

4-
``argon2-cffi`` has a very strong backward compatibility policy.
4+
*argon2-cffi* has a very strong backward compatibility policy.
55
Generally speaking, you shouldn't ever be afraid of updating.
66

77
If breaking changes are needed do be done, they are:

docs/cli.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CLI
22
===
33

4-
To aid you with finding the parameters, ``argon2-cffi`` offers a CLI interface that can be accessed using ``python -m argon2``.
5-
It will benchmark Argon2’s password *verification* in the current environment.
4+
To aid you with finding the parameters, *argon2-cffi* offers a CLI interface that can be accessed using ``python -m argon2``.
5+
It will benchmark *Argon2*’s password *verification* in the current environment.
66
You can use command line arguments to set hashing parameters:
77

88
.. code-block:: text

docs/installation.rst

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
Installation
22
============
33

4-
Using the Vendored Argon2
5-
-------------------------
4+
Using the Vendored *Argon2*
5+
---------------------------
66

77
.. code-block:: bash
88
99
python -m pip install argon2-cffi
1010
1111
should be all it takes.
1212

13-
But since ``argon2-cffi`` vendors Argon2's C code by default, it can lead to complications depending on the platform.
13+
But since *argon2-cffi* vendors *Argon2*'s C code by default, it can lead to complications depending on the platform.
1414

1515
The C code is known to compile and work on all common platforms (including x86, ARM, and PPC).
1616
On x86, an SSE2_-optimized version is used.
1717

18-
If something goes wrong, please try to update your ``cffi``, ``pip`` and ``setuptools`` first:
18+
If something goes wrong, please try to update your *cffi*, *pip* and *setuptools* packages first:
1919

2020
.. code-block:: bash
2121
2222
python -m pip install -U cffi pip setuptools
2323
2424
25-
Overall this should be the safest bet because ``argon2-cffi`` has been specifically tested against the vendored version.
25+
Overall this should be the safest bet because *argon2-cffi* has been specifically tested against the vendored version.
2626

2727

2828
Wheels
2929
^^^^^^
3030

3131
Binary `wheels <https://pythonwheels.com>`_ for macOS, Windows, and Linux are provided on PyPI_.
32-
With a recent-enough ``pip`` and ``setuptools``, they should be used automatically.
32+
With a recent-enough *pip* and *setuptools*, they should be used automatically.
3333

3434

3535
Source Distribution
3636
^^^^^^^^^^^^^^^^^^^
3737

3838
A working C compiler and `CFFI environment`_ are required.
39-
If you've been able to compile Python CFFI extensions before, ``argon2-cffi`` should install without any problems.
39+
If you've been able to compile Python CFFI extensions before, *argon2-cffi* should install without any problems.
4040

4141

42-
Using a System-wide Installation of Argon2
43-
------------------------------------------
42+
Using a System-wide Installation of *Argon2*
43+
--------------------------------------------
4444

45-
If you set ``ARGON2_CFFI_USE_SYSTEM`` to ``1`` (and *only* ``1``), ``argon2-cffi`` will not build its bindings.
46-
However binary wheels are preferred by ``pip`` and Argon2 gets installed along with ``argon2-cffi`` anyway.
45+
If you set ``ARGON2_CFFI_USE_SYSTEM`` to ``1`` (and *only* ``1``), *argon2-cffi* will not build its bindings.
46+
However binary wheels are preferred by *pip* and *Argon2* gets installed along with *argon2-cffi* anyway.
4747

48-
Therefore you also have to instruct ``pip`` to use a source distribution:
48+
Therefore you also have to instruct *pip* to use a source distribution:
4949

5050
.. code-block:: bash
5151
5252
env ARGON2_CFFI_USE_SYSTEM=1 \
5353
python -m pip install --no-binary=argon2-cffi argon2-cffi
5454
55-
This approach can lead to problems around your build chain and you can run into incompatibilities between Argon2 and ``argon2-cffi`` if the latter has been tested against a different version.
55+
This approach can lead to problems around your build chain and you can run into incompatibilities between *Argon2* and *argon2-cffi* if the latter has been tested against a different version.
5656

5757
**It is your own responsibility to deal with these risks if you choose this path.**
5858

@@ -67,9 +67,9 @@ This can go wrong and is problematic for cross-compiling.
6767

6868
Therefore you can use the ``ARGON2_CFFI_USE_SSE2`` environment variable to control the process:
6969

70-
- If you set it to ``1``, ``argon2-cffi`` will build **with** SSE2 support.
71-
- If you set it to ``0``, ``argon2-cffi`` will build **without** SSE2 support.
72-
- If you set it to anything else, it will be ignored and ``argon2-cffi`` will try to guess.
70+
- If you set it to ``1``, *argon2-cffi* will build **with** SSE2 support.
71+
- If you set it to ``0``, *argon2-cffi* will build **without** SSE2 support.
72+
- If you set it to anything else, it will be ignored and *argon2-cffi* will try to guess.
7373

7474
Available since version 20.1.0.
7575

docs/parameters.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ Choosing Parameters
44
.. note::
55

66
You can probably just use :class:`argon2.PasswordHasher` with its default values and be fine.
7-
But it's good to double check using ``argon2-cffi``'s :doc:`cli` client, whether its defaults are too slow or too fast for your use case.
7+
But it's good to double check using *argon2-cffi*'s :doc:`cli` client, whether its defaults are too slow or too fast for your use case.
88

99
Finding the right parameters for a password hashing algorithm is a daunting task.
10-
The authors of Argon2 specified a method in their `paper <https://github.com/P-H-C/phc-winner-argon2/blob/master/argon2-specs.pdf>`_, however some parts of it have been revised in the `RFC draft`_ for Argon2 that is currently being written.
10+
The authors of *Argon2* specified a method in their `paper <https://github.com/P-H-C/phc-winner-argon2/blob/master/argon2-specs.pdf>`_, however some parts of it have been revised in the `RFC draft`_ for *Argon2* that is currently being written.
1111

1212
The current recommended best practice is as follow:
1313

1414
#. Choose whether you want Argon2i, Argon2d, or Argon2id (``type``).
1515
If you don't know what that means, choose Argon2id (:attr:`argon2.Type.ID`).
16-
#. Figure out how many threads can be used on each call to Argon2 (``parallelism``, called "lanes" in the RFC).
16+
#. Figure out how many threads can be used on each call to *Argon2* (``parallelism``, called "lanes" in the RFC).
1717
They recommend twice as many as the number of cores dedicated to hashing passwords.
1818
:class:`~argon2.PasswordHasher` will *not* determine this for you and use a default value that you can find in the linked API docs.
1919
#. Figure out how much memory each call can afford (``memory_cost``).
@@ -27,14 +27,14 @@ The current recommended best practice is as follow:
2727
One `recommendation <https://web.archive.org/web/20160304024620/https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2015/march/enough-with-the-salts-updates-on-secure-password-schemes/>`_ for concurent user logins is to keep it under 0.5 ms.
2828
The RFC recommends under 500 ms.
2929
The truth is somewhere between those two values: more is more secure, less is a better user experience.
30-
``argon2-cffi``'s defaults try to land somewhere in the middle and aim for ~50ms, but the actual time depends on your hardware.
30+
*argon2-cffi*'s defaults try to land somewhere in the middle and aim for ~50ms, but the actual time depends on your hardware.
3131

3232
Please note though, that even a verification time of 1 second won't protect you against bad passwords from the "top 10,000 passwords" lists that you can find online.
3333
#. Measure the time for hashing using your chosen parameters.
3434
Find a ``time_cost`` that is within your accounted time.
3535
If ``time_cost=1`` takes too long, lower ``memory_cost``.
3636

37-
``argon2-cffi``'s :doc:`cli` will help you with this process.
37+
*argon2-cffi*'s :doc:`cli` will help you with this process.
3838

3939

4040
.. note::

0 commit comments

Comments
 (0)