Skip to content

Commit 58b4089

Browse files
committed
chore(docs): add remarks on smart operations taking mutable inputs
1 parent 98db328 commit 58b4089

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tfhe/docs/fine_grained_api/integer/operations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Each operation may come in different 'flavors':
8888

8989
* `unchecked`: always does the operation, without checking if the result may exceed the capacity of the plaintext space.
9090
* `checked`: checks are done before computing the operation, returning an error if operation cannot be done safely.
91-
* `smart`: always does the operation, if the operation cannot be computed safely, the smart operation will propagate the carry buffer to make the operation possible.
91+
* `smart`: always does the operation, if the operation cannot be computed safely, the smart operation will propagate the carry buffer to make the operation possible. Some of those will require a mutable reference as input: this is because the inputs' carry might be cleaned, but this will not change the underlying encrypted value.
9292
* `default`: always compute the operation and always clear the carry. Could be **slower** than smart, but ensure that the timings are consistent from one call to another.
9393

9494
Not all operations have these 4 flavors, as some of them are implemented in a way that the operation is always possible without ever exceeding the plaintext space capacity.

tfhe/docs/fine_grained_api/shortint/operations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Each operation may come in different 'flavors':
3232

3333
* `unchecked`: always does the operation, without checking if the result may exceed the capacity of the plaintext space. Using this operation might have an impact on the correctness of the following operations;
3434
* `checked`: checks are done before computing the operation, returning an error if operation cannot be done safely;
35-
* `smart`: always does the operation. If the operation cannot be computed safely, the smart operation will clear the carry modulus to make the operation possible;
35+
* `smart`: always does the operation. If the operation cannot be computed safely, the smart operation will clear the carry to make the operation possible. Some of those will require a mutable reference as input: this is to allow the modification of the carry, but this will not change the underlying encrypted value;
3636
* `default`: always does the operation and always clears the carry. Could be **slower** than smart, but it ensures that the timings are consistent from one call to another.
3737

3838
Not all operations have these 4 flavors, as some of them are implemented in a way that the operation is always possible without ever exceeding the plaintext space capacity.

0 commit comments

Comments
 (0)