Skip to content

Commit

Permalink
v0.3.2: Fix short-circuit issue in hashes-equal?
Browse files Browse the repository at this point in the history
  • Loading branch information
skinkade committed Nov 12, 2021
1 parent 3ab2b3b commit 5473a13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).

## [0.3.2]
### Fixed
Short-circuit in `hashes-equal?` prevented intended behavior

## [0.3.1]
### Added
MD5 and SHA2 family hashing
Expand Down Expand Up @@ -41,6 +45,7 @@ JVM and ClojureScript support for cryptographically-random:
- collection samples
- passwords/passphrases

[0.3.2]: https://github.com/skinkade/uniformity/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/skinkade/uniformity/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/skinkade/uniformity/compare/v0.2.2...v0.3.0
[0.2.2]: https://github.com/skinkade/uniformity/compare/v0.2.1...v0.2.2
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject io.github.skinkade/uniformity "0.3.1"
(defproject io.github.skinkade/uniformity "0.3.2"
:description "A Clojure(Script) library for easy-to-use cryptography"
:url "https://github.com/skinkade/uniformity"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
Expand Down
6 changes: 3 additions & 3 deletions src/uniformity/hash.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
(if (not= (count hash1) (count hash2))
false
(reduce (fn [equals idx]
(and equals
(= (get hash1 idx)
(get hash2 idx))))
(and (= (get hash1 idx)
(get hash2 idx))
equals))
true
(range (count hash1)))))

0 comments on commit 5473a13

Please sign in to comment.