Skip to content

Commit

Permalink
More clearly describe the behavior of constant_time.bytes_eq
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Feb 5, 2014
1 parent 6781094 commit ae9451f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/hazmat/primitives/constant-time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down

0 comments on commit ae9451f

Please sign in to comment.