aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-02-04 17:16:37 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-02-04 17:16:37 -0800
commitae9451f145b1850ac6d0fd4891932f24c49c3c21 (patch)
tree54547a6665adbaf4e67aa78ff9b4ca0535cef707 /docs/hazmat/primitives
parent6781094003b86c0a6997452876ae63acd49809e1 (diff)
downloadcryptography-ae9451f145b1850ac6d0fd4891932f24c49c3c21.tar.gz
cryptography-ae9451f145b1850ac6d0fd4891932f24c49c3c21.tar.bz2
cryptography-ae9451f145b1850ac6d0fd4891932f24c49c3c21.zip
More clearly describe the behavior of constant_time.bytes_eq
Diffstat (limited to 'docs/hazmat/primitives')
-rw-r--r--docs/hazmat/primitives/constant-time.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/hazmat/primitives/constant-time.rst b/docs/hazmat/primitives/constant-time.rst
index 632e7c68..7924efca 100644
--- a/docs/hazmat/primitives/constant-time.rst
+++ b/docs/hazmat/primitives/constant-time.rst
@@ -19,8 +19,10 @@ about the timing attacks on KeyCzar and Java's ``MessageDigest.isEqual()``.
.. function:: bytes_eq(a, b)
- Compare ``a`` and ``b`` to one another in constant time if they are of the
- same length.
+ Compares ``a`` and ``b`` with one another. If ``a`` and ``b`` have
+ different lengths, this returns ``False`` immediately. Otherwise it
+ compares them in a way that takes the same amount of time, regardless of
+ how many characters are the same between the two.
.. doctest::