Comments (1)
This seems like an oversight on our part, thank you for pointing it out. We have arithmetic implementations for field elements F
behind ProgramNode
s so that you can do arithmetic within a #[zkp_program]
function, and I guess we mostly considered the BulletproofsField
type on its own to be used for providing static-ish arguments. But I can definitely see how it would be convenient to do some arithmetic on them outside of the ZKP program.
In the meantime, you could just do your arithmetic on a different integral type, and then cast to the BulletproofsField
. Your example above would change to something like:
// Create the list out of u32s
let mut counters_list = [0u32; 100];
for (i, f) in counters_list.into_iter().enumerate() {
if i == alices_index {
counters_list[i] = f + 1;
}
}
// Then cast them all to BulletproofsField
let counters_list = counters_list.map(BulletproofsField::from);
For this particular example, there's also a nice stdlib function you could use:
let counters_list: [BulletproofsField; 100] = core::array::from_fn(|i| {
if i == alices_index {
1.into()
} else {
0.into()
}
});
from sunscreen.
Related Issues (20)
- Set up WASM CI HOT 1
- Do we support non-uniform threadgroups on Metal?
- Support proofs with mixed bounds HOT 1
- Improve SDLP verification times
- Remove special modulus from SEAL HOT 1
- Make bulletproofs for comparing messages in ciphertexts
- wrap the 'seal/util' api in seal_fhe HOT 1
- Inaccessible page: Noise Margin HOT 4
- Sending an array of CipherTexts should allow sending [encrypt(1), encrypt(2)] rather than encrypt([1,2])
- Support trivial encryptions
- CKKS and BGV support from SEAL? HOT 2
- License clarification
- Type for Plaintext_Create4 incorrect on Debian ARM HOT 1
- Performance: Noise budget
- Sunscreen + ink! = zink!: License requirements
- FHE Proof: Separate Client and Server HOT 2
- `sunscreen::Error` does not implement `std::error:Error` HOT 1
- Breaking out seal_fhe: repo and license HOT 2
- relinearize_inplace doesn't reduce noise HOT 1
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 sunscreen.