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

client: use Randomconv.int16, provide rng via create #185

Merged
merged 1 commit into from
Aug 12, 2019

Conversation

hannesm
Copy link
Member

@hannesm hannesm commented Aug 7, 2019

this is a solution for #165 -- another could be to fully functorize over Mirage_random.C (but that'd bring us a Mirage_random dependency in the pure client, which I'd avoid) -- let me know what you think about this! :)

@hannesm hannesm requested a review from cfcs August 7, 2019 21:10
for i = 0 to pred n do
Cstruct.set_uint8 b i (Random.int 256)
done;
b
Copy link
Member Author

@hannesm hannesm Aug 7, 2019

Choose a reason for hiding this comment

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

could as well be required as a dependency from mirage-random-stdlib (but feels fine to have here imho)

@hannesm
Copy link
Member Author

hannesm commented Aug 7, 2019

NB: for the current use case, a function unit -> int (where the latter int should be something between 0x0000 and 0xFFFF) would be sufficient, but in the future we'll likely want label case randomisation which requires some random bits, thus I'd go with the int -> Cstruct.t we have specified and used elsewhere in mirage.. (well, a rng could have a nicer type, but that's sth to think about and fix elsewhere)

client/dns_client_flow.mli Show resolved Hide resolved
@hannesm hannesm merged commit f7ab296 into mirage:master Aug 12, 2019
@hannesm hannesm deleted the client-random branch August 12, 2019 12:13
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