Comments (3)
I'm not sure I understand what you try to achieve here, sorry. Could you elaborate on the use case you have in mind?
from mirage-crypto.
So, I have an application (functorized over the Mirage_random.S
given by mirage
) which expects the g
state to be able to generate something random from this state. So I need to pass it from whatever it comes from. In the MirageOS context, due to Mirage_random.S
, the type g
is completely abstract and I don't have any way to get/create it and use it. It would be nice to have this g
state at the start
function to pass it then to my application (and ensure a full control of how the application generate random stuffs).
More concretely, a SMTP submission service needs Random.g
to generate a stamp needed for the SMTP authentication.
Of course, I can rely on the global state but I lost the ability to fully control the behavior of my application.
from mirage-crypto.
hmm, I fail to understand your requirement. do you need to preserve the generator state for later (potentially a restart)?
Indeed, g
is abstract and global. it also changes quickly over time (using rdrand/rdseed and lwt enter_hook). if you have the requirement to preserve g
and re-generate the exact same random, my best bet would be to generate random data (with Mirage_crypto_rng.generate
) and then construct your own generator (e.g. https://github.com/mirleft/ocaml-x509/blob/v0.14.1/lib/private_key.ml#L23-L26). Since g
is abstract, you won't be able to dump and restore it.
In other applications (see the X509 code as well) I've just used an optonal g
-- would that be an option for you as well?
from mirage-crypto.
Related Issues (20)
- test failures on arm32 HOT 1
- Question: Exposing the tag in AES-GCM HOT 3
- Config flags are not correct when used in cross-architecture-compilation with Dune 3 HOT 5
- Split sub libraries in `mirage-crypto-rng` into individual packages HOT 3
- RNG initialization inconsistencies HOT 1
- cleanup CI scripts HOT 1
- mirage-crypto-rng-eio questions HOT 6
- Mirage_crypto.Chacha20.authenticate_encrypt seg-faults on empty message HOT 3
- Failure to build in a unikernel with target hvt HOT 3
- Support for secp256k1 HOT 1
- Ed25519 / X25519 potential performance improvements (by looking at BoringSSL)
- [dkml] Virtual library for mirage-crypto-pk
- Make mirage-crypto-ec (test) independent of mirage-crypto-pk HOT 2
- [dkml] mirage-crypto-ec issues
- Roadmap for 1.0 release HOT 9
- ARM64 cycle count HOT 3
- data races in mirage-crypto HOT 9
- Revise API (remove intermediate modules)
- P-521 sign not constant-time HOT 7
- Wipe secret key data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mirage-crypto.