Skip to content
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

chore(docs): add strings guides #1922

Merged
merged 1 commit into from
Jan 13, 2025
Merged

chore(docs): add strings guides #1922

merged 1 commit into from
Jan 13, 2025

Conversation

tmontaigu
Copy link
Contributor

No description provided.

@cla-bot cla-bot bot added the cla-signed label Jan 7, 2025
@tmontaigu tmontaigu marked this pull request as ready for review January 7, 2025 15:07
@tmontaigu tmontaigu force-pushed the tm/strings-guide branch 2 times, most recently from 7c4ebbb to 79523f9 Compare January 7, 2025 15:17
Comment on lines 3 to 5
This document explains the string type provided by the High-level API.

TFHE-RS has supports for **ASCII** strings with the type `FheAsciiString`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFHE-rs maybe even **TFHE-rs**

add a warning about missing Compact/Compressed

Talk about the fact it was a bounty that was integrated @yuxizama if you have a wording to advertise the bounty program

@tmontaigu tmontaigu force-pushed the tm/strings-guide branch 2 times, most recently from 3005732 to 91b6ea3 Compare January 8, 2025 14:04
@tmontaigu tmontaigu requested a review from IceTDrinker January 8, 2025 15:34
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small things, let's not merge right away once it's ready we are supposed to share documentation for review by marketing product first

{% endhint %}

{% hint style="warning" %}
Strings are not yet compatible with CompactCiphertextList and CompressedCiphertextList
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use ` as well to surround the type names here

Comment on lines 19 to 15
A lot of common operations are supported, to list a few of them:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the op names are the same between HL traits and the strings module let's think of linking to docs.rs

which makes me think we should update the Cargo.toml for the docs.rs build to also use the strings feature, seems we don't build strings on docs.rs at the moment

let mut buffer2 = vec![];
safe_serialize(&other_string, &mut buffer2, 1 << 30).unwrap();
// The two strings created with padding, have the same
// memory/disk footprint, even though
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even though ?

Copy link
Contributor

@yuxizama yuxizama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions.
Thanks!

tfhe/docs/guides/strings.md Outdated Show resolved Hide resolved
tfhe/docs/guides/strings.md Outdated Show resolved Hide resolved
tfhe/docs/guides/strings.md Outdated Show resolved Hide resolved
tfhe/docs/guides/strings.md Outdated Show resolved Hide resolved
Comment on lines 29 to 31
At encryption, strings can be encrypted with some *padding*.
The null character (b'\0') is used as the padding character, the *padding* mechanism
can be used to hide the actual length of the string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Encryption with Padding

When encrypting strings, you can add paddings to hide the actual length of strings.
To add paddings, use the the null character (b'\0'). Here is an example:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add paddings, use the the null character (b'\0'). This sentence is not correct as its not the user that choses what is used for padding, so I changed it a bit

Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot !

Please prepare a PR targeting 0.11 with the same content and we'll be good to go !

@tmontaigu tmontaigu merged commit 979a1b3 into main Jan 13, 2025
108 checks passed
@tmontaigu tmontaigu deleted the tm/strings-guide branch January 13, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants