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

Add cipher cost option #4

Merged
merged 3 commits into from Sep 21, 2022
Merged

Conversation

corverroos
Copy link
Contributor

Adds an option to override the cipher cost. Useful to speed up tests that create a lot of keystores.

encryptor.go Outdated
// the default value of 18 (ie. 2^18=262144). Higher values increases the
// cost of an exhaustive search but makes encoding and decoding proportionally slower.
// This should only be in testing as it affects security.
func WithCost(_ *testing.T, costPower uint) Option {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should check to confirm that t is not nil, and panic if it is nil. Although I'm not a fan of panicking in general, this is one of those situations where it makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, updated

@mcdee mcdee merged commit b122c68 into wealdtech:master Sep 21, 2022
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