-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor/query #12
base: master
Are you sure you want to change the base?
refactor/query #12
Conversation
/// This struct represents PIR queries. | ||
pub struct Query { | ||
/// The encoded field queries. | ||
fields: [Vec<u8>], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.