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

feat(cipher/diffiehellman): add fuzz test to key generators in diffiehellman algorithm #602

Closed
wants to merge 2 commits into from

Conversation

mcaci
Copy link
Contributor

@mcaci mcaci commented Oct 31, 2022

Hello, I think this is the last subpackage for the cipher package where the fuzz tests were not yet present. I added two quick fuzz tests for the key generators and tested them with 'go test ./cipher/diffiehellman/ -fuzz=FuzzGenM' and 'go test ./cipher/diffiehellman/ -fuzz=FuzzGenS' to check that the execution was getting along just fine.
Let me know if you have any feedbacks on it. Thanks again!

PR linked to issue #480

cipher/diffiehellman/diffiehellmankeyexchange_test.go Outdated Show resolved Hide resolved
f.Add(int64(5), int64(17))
f.Fuzz(func(t *testing.T, prvKey, shrdKey int64) {
// explicitly ignoring the return error
// here we want to test that no strange behaviors are raised when executing GenerateMutualKey
Copy link
Member

Choose a reason for hiding this comment

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

Can you define "strange" behaviour?

I'm of the opinion that these fuzz tests are for checking the unexpected behaviour - that could only be detected once you check the errors (since there are no panics in the algorithm.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

About the reason for these tests: it is mostly to run the function and see if it breaks for unexpected reasons like if there are any issue during the computation done in the algorithm, i.e. divisions by zero, overflows and so on. Let me know what are your thoughts on this.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think there is anything that is being checked for us to conclude that there is nothing "strange" happening. I don't think this is a change with any merit... 😓

@github-actions
Copy link

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Dec 25, 2022
@github-actions
Copy link

github-actions bot commented Jan 1, 2023

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants