-
Notifications
You must be signed in to change notification settings - Fork 151
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
feat(hlapi): add strings #1882
base: main
Are you sure you want to change the base?
feat(hlapi): add strings #1882
Conversation
9087fcf
to
7f541c9
Compare
7f541c9
to
20b34c3
Compare
pub fn try_encrypt_with_padding( | ||
str: impl AsRef<str>, | ||
padding: u32, | ||
client_key: &ClientKey, | ||
) -> crate::Result<Self> { |
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.
Maybe it would be easier for the users to give the total size instead of the padding count here, so they don't have to compute it from the string size
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.
we could add a try_encrypt_with_fixed_sized
which encrypts and padds (or trims) so that the str has the given size
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.
yes good idea !
|
||
impl FheStringStrip<&Self> for FheAsciiString { | ||
/// If the pattern does match the start of the string, returns a new encrypted string | ||
/// with the specified pattern from the start, and boolean set to `true`, |
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.
missing a word ?
} | ||
|
||
/// If the pattern does match the end of the string, returns a new encrypted string | ||
/// with the specified pattern from the end, and boolean set to `true`, |
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.
missing "stripped" ?
|
||
impl FheStringStrip<&ClearString> for FheAsciiString { | ||
/// If the pattern does match the start of the string, returns a new encrypted string | ||
/// with the specified pattern from the start, and boolean set to `true`, |
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.
idem
} | ||
|
||
/// If the pattern does match the end of the string, returns a new encrypted string | ||
/// with the specified pattern from the end, and boolean set to `true`, |
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.
idem
} | ||
} | ||
|
||
fn test_string_len_is_empty(client_key: &ClientKey) { |
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.
Maybe have a test where the string is actually empty ?
No description provided.