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

Replace math/rand with crypto/rand for generating challenge #829

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

ian-shim
Copy link
Contributor

Why are these changes needed?

Using crypto/rand to generate challenge for disperser endpoint

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@ian-shim ian-shim marked this pull request as ready for review October 23, 2024 04:19
s.metrics.HandleInvalidArgRequest("DisperseBlobAuthenticated")
return api.NewInvalidArgError(fmt.Sprintf("failed to generate challenge: %v", err))
}
challenge := binary.LittleEndian.Uint32(challengeBytes)
Copy link
Contributor

Choose a reason for hiding this comment

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

any preference to little or big endian

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think that matters much here as we're converting one random byte array into uint32

@ian-shim ian-shim merged commit 8a7a01d into Layr-Labs:master Oct 24, 2024
7 checks passed
ian-shim added a commit to ian-shim/eigenda that referenced this pull request Oct 25, 2024
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.

2 participants