New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose CSPRNG, constant-time string compare #1

Merged
merged 2 commits into from May 3, 2015

Conversation

Projects
None yet
2 participants
@paragonie-scott
Contributor

paragonie-scott commented May 3, 2015

New methods:

  • hashEquals() - constant-time string comparison
  • randomBytes() - pulls random bytes from whichever entropy source is available
  • safeStrlen() - mbstring.func_overload-safe strlen() (used by hashEquals())

paragonie-scott added some commits May 3, 2015

Expose CSPRNG, constant-time string compare
New methods:

* `hashEquals()`
* `randomBytes()`
* `safeStrlen()`
Slight improvement
Optimize `hashEquals()` by caching the result of `function_exists()`.

Also fixed a slight inconsistency with `phpversion()`.
@bitbeans

This comment has been minimized.

Show comment
Hide comment
@bitbeans

bitbeans May 3, 2015

Owner

Thank you scott!

Owner

bitbeans commented May 3, 2015

Thank you scott!

bitbeans added a commit that referenced this pull request May 3, 2015

Merge pull request #1 from paragonie-scott/patch-1
Expose CSPRNG, constant-time string compare

@bitbeans bitbeans merged commit a86c485 into bitbeans:master May 3, 2015

@paragonie-scott paragonie-scott deleted the paragonie-scott:patch-1 branch May 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment