We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The class is currently not thread-safe. A naive thread safe implementation existed but was removed: #69
We could use a thread-safe cache pattern, as proposed here. Something like this;
public class SRP6RandomEphemeral { private FinalWrapper wrapper; // ... public Bytes bytes(ByteOrder preferredOrder) { FinalWrapper w = wrapper; if (w == null) { // check 1 synchronized(this) { w = wrapper; if (w == null) { // check2 // Compute random BigInteger r // ... w = new FinalWrapper(new SRP6CustomIntegerVariable(r)); wrapper = w; } } } return w.instance.bytes(preferredOrder); } private static class FinalWrapper { public final SRP6IntegerVariable instance; public FinalWrapper(SRP6IntegerVariable instance) { this.instance = instance; } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The class is currently not thread-safe. A naive thread safe implementation existed but was removed: #69
We could use a thread-safe cache pattern, as proposed here. Something like this;
The text was updated successfully, but these errors were encountered: