Conversation
| /// This struct represents PIR queries. | ||
| pub struct Query { | ||
| /// The encoded field queries. | ||
| fields: [Vec<u8>], |
There was a problem hiding this comment.
Looks good. Alternatively, we can have a Vec<Vec<u8>>, but not a big deal since the query is meant to be serialized and passed along to the server.
There was a problem hiding this comment.
I did [] because we don't want the array to be tampered with. Is my thinking here wrong?
There was a problem hiding this comment.
The fields will be non-mutable by definition (Rust things :) ) if that's what you mean. In order to change the values of a struct field, you'd need to wrap it in a Box or RefCell - similar to what we have in the Storage:
struct Storage {
secret_key: SecretKey,
size: usize,
store: RefCell<Vec<Scalar>>,
}
If store was defined as store: Vec<Scalar>,, the contents of the vector could not be changed.
|
@gpestana once your PR is merged, I will adapt this to look more like what you are doing. |
No description provided.