danwallach / ElectionGuard-TypeScript

TypeScript implementation of ElectionGuard (subset for ballot encryption)
MIT License
8 stars 0 forks source link

External interface #36

Closed shreyasminocha closed 2 years ago

shreyasminocha commented 2 years ago

Write a top-level utility function that does everything EnhancedVoting needs (they initialize us with JS objects that correspond to the manifest, etc.). Where everything else is functional, this one would hide all the state inside and would have an API similar to the encrypt-async code, where you feed it individual bits of data and you eventually ask for the output.

shreyasminocha commented 2 years ago

Done in current encrypt-async

shreyasminocha commented 2 years ago

@danwallach while writing a usage example for the readme, I noticed that encrypt accepts a PlaintextContest, and that there isn't a version that accepts a JS object and deserializes it. Is this by design?

danwallach commented 2 years ago

For now, it's deliberate. I want the client of our API to fill out the plaintext data structures. We could potentially build a wrapper API around it, but lets wait and see if anybody wants one.

The Plaintext data structures are a lot simpler.

The Manifest stuff, on the other hand, is complicated. That's a place we might want to help simplify things.