Skip to content

Commit

Permalink
Update tutorial 0 (#102)
Browse files Browse the repository at this point in the history
* update figure

* update tutorial
  • Loading branch information
youben11 authored Jul 16, 2020
1 parent fdf1add commit 1af74f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions tutorials/Tutorial 0 - Getting Started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"\n",
"__Definition__ : Homomorphic encription (HE) is an encryption technique that allows computations to be made on ciphertexts and generates results that when decrypted, corresponds to the result of the same computations made on plaintexts.\n",
"\n",
"![he-black-box](assets/he-black-box.png)\n",
"<img src=\"assets/he-black-box.png\" alt=\"he-black-box\" width=\"600\"/>\n",
"\n",
"This means that an HE scheme lets you encrypt two numbers *X* and *Y*, add their encrypted versions so that it gets decrypted to *X + Y*, the addition could have been a multiplication as well. If we translate this to python, it may look something like this:\n",
"\n",
Expand Down Expand Up @@ -66,7 +66,7 @@
{
"data": {
"text/plain": [
"<_tenseal_cpp.TenSEALContext at 0x7f8f8c7a4970>"
"<_tenseal_cpp.TenSEALContext at 0x7fcb980c71f0>"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -157,7 +157,7 @@
{
"data": {
"text/plain": [
"<_tenseal_cpp.BFVVector at 0x7f8f8c7a98b0>"
"<_tenseal_cpp.BFVVector at 0x7fcb980bc330>"
]
},
"execution_count": 3,
Expand Down Expand Up @@ -303,8 +303,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"c2c multiply time: 15.959024429321289 ms\n",
"c2p multiply time: 1.3453960418701172 ms\n"
"c2c multiply time: 18.739938735961914 ms\n",
"c2p multiply time: 1.5423297882080078 ms\n"
]
}
],
Expand Down Expand Up @@ -370,14 +370,18 @@
"name": "stdout",
"output_type": "stream",
"text": [
"global_scale: -1.0\n",
"The global_scale isn't defined yet\n",
"global_scale: 1048576.0\n"
]
}
],
"source": [
"# global_scale = -1 means that it's not defined yet\n",
"print(\"global_scale:\", context.global_scale)\n",
"# this should throw an error as the global_scale isn't defined yet\n",
"try:\n",
" print(\"global_scale:\", context.global_scale)\n",
"except ValueError:\n",
" print(\"The global_scale isn't defined yet\")\n",
" \n",
"# you can define it to 2 ** 20 for instance\n",
"context.global_scale = 2 ** 20\n",
"print(\"global_scale:\", context.global_scale)"
Expand Down
Binary file modified tutorials/assets/he-black-box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1af74f0

Please sign in to comment.