Skip to content
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
Merged

Expose CSPRNG, constant-time string compare #1

merged 2 commits into from
May 3, 2015

Conversation

paragonie-scott
Copy link
Contributor

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())

New methods:

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

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

bitbeans commented May 3, 2015

Thank you scott!

bitbeans added a commit that referenced this pull request May 3, 2015
Expose CSPRNG, constant-time string compare
@bitbeans bitbeans merged commit a86c485 into bitbeans:master May 3, 2015
@paragonie-scott paragonie-scott deleted the patch-1 branch May 3, 2015 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants