Skip to content

Commit

Permalink
Improve loops.md by being explicit about big O complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
fkettelhoit committed Dec 2, 2024
1 parent 25a950e commit 7fc93f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion garble_docs/src/guide/loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ for joined in join(rows1, rows2) {
```

Garble automatically joins the arrays in a for-join loop using a [bitonic sorting network](https://en.wikipedia.org/wiki/Bitonic_sorter), more concretely implementing the paper [Private Set Intersection:
Are Garbled Circuits Better than Custom Protocols?](https://www.ndss-symposium.org/wp-content/uploads/2017/09/06_4.pdf) without the shuffle step, which has a circuit complexity of `(m + n) * log(m + n)` instead of `m * n` which would result from joining the arrays using nested loops.
Are Garbled Circuits Better than Custom Protocols?](https://www.ndss-symposium.org/wp-content/uploads/2017/09/06_4.pdf) without the shuffle step, which has a circuit complexity of `O((m + n) * log(m + n))` instead of `O(m * n)` which would result from joining the arrays using nested loops.

> It is your responsibility to ensure that the **arrays that are joined in the loop must be sorted in ascending order!** Otherwise elements might be discarded or invalid data returned.
Expand Down

0 comments on commit 7fc93f9

Please sign in to comment.