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

surface PRNG functionality in SDK #969

Closed
graydon opened this issue Jun 12, 2023 · 0 comments · Fixed by #1023
Closed

surface PRNG functionality in SDK #969

graydon opened this issue Jun 12, 2023 · 0 comments · Fixed by #1023

Comments

@graydon
Copy link
Contributor

graydon commented Jun 12, 2023

There are some new host functions that should surface in the SDK now.

github-merge-queue bot pushed a commit that referenced this issue Sep 16, 2023
### What

Expose `prng_reseed`, `u64_in_inclusive_range` and `vec_shuffle` in the
SDK.

### Why

Exposing the PRNG functions in the SDK allows users to utilize
randomness provided by the host in their smart contracts.

### Known limitations

N/A

Close #969

-----

I added tests for `sha256` and `verify_sig_ed25519` while I was in here.
Let me know if those changes should be moved to a separate PR. I
considered adding a PRNG module separate from the `crypto` module. I
decided to keep them under `crypto` because there are only three
functions. Also this is also similar `getRandomValues` is a function
implemented within the [Web Crypto
API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) in
browsers.

---------

Co-authored-by: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
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 a pull request may close this issue.

1 participant