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

[#78] Thread safe API #82

Merged
merged 13 commits into from
Jul 22, 2019
Merged

[#78] Thread safe API #82

merged 13 commits into from
Jul 22, 2019

Conversation

clintfred
Copy link
Contributor

@clintfred clintfred commented Jul 17, 2019

see #78

Like #77 except not just a PoC. Care was taken to only hold Mutex a short amount of time. Because of the RandomBytesGen abstraction I was able to push the mutability all the way into there, leaving most of the rest of the code untouched. This wasn't immediately obvious, but seems cleaner than alternatives. The only downside is getting a bunch of random numbers in a row will go through a lot of lock/unlock cycles. I'll be interested to see if that shows up in the benchmarks at all, but I'm guessing it won't.

Changelog

  • Public API no longer contains mutable references. This makes sharing a single Recrypt among threads possible.

src/api.rs Outdated Show resolved Hide resolved
* hide mutability of RNG behind `RandomBytes` impl to improve call site ergonomics
* start on 480-bit API
* finish 480 bit API
* address rustdoc warnings
@clintfred clintfred changed the title [WIP] [#78] Thread safe API [#78] Thread safe API Jul 20, 2019
@clintfred clintfred merged commit 3f39b2d into master Jul 22, 2019
@clintfred clintfred deleted the 78-efficent-mutex branch July 22, 2019 22: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.

3 participants