Skip to content

Add entropy detection to random number generation #1711

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

VolodymyrBg
Copy link

This commit implements entropy detection for the random number generation process in the ecall_generate_random function. The changes include:

  1. Added a has_sufficient_entropy function that calculates Shannon entropy and performs frequency analysis on the generated random bytes
  2. Implemented additional heuristic checks for sequential bytes and repeating patterns
  3. Added detection of suspicious byte distributions to ensure high-quality randomness
  4. Generated random values are now verified for entropy quality before being used
  5. Removed the TODO comment as the feature is now implemented

These improvements enhance the security of the random number generation process by ensuring high-quality entropy and rejecting potentially weak random values.

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.

1 participant