aboutsummaryrefslogtreecommitdiff
path: root/epare/simulate.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'epare/simulate.ipynb')
-rw-r--r--epare/simulate.ipynb17
1 files changed, 10 insertions, 7 deletions
diff --git a/epare/simulate.ipynb b/epare/simulate.ipynb
index 4a0a07a..89a5533 100644
--- a/epare/simulate.ipynb
+++ b/epare/simulate.ipynb
@@ -89,10 +89,11 @@
"def get_small_scalar_multiples(mult: MultIdent,\n",
" params: DomainParameters,\n",
" bits: int,\n",
- " samples: int = 1000,\n",
+ " samples: int = 100,\n",
" use_init: bool = True,\n",
" use_multiply: bool = True,\n",
- " seed: bytes | None = None) -> MultResults:\n",
+ " seed: bytes | None = None,\n",
+ " kind: str = \"precomp+necessary\") -> MultResults:\n",
" from pyecsca.sca.re.rpa import multiples_computed\n",
" import random\n",
" \n",
@@ -110,7 +111,7 @@
"\n",
" for scalar in scalars:\n",
" # Use a list for less memory usage.\n",
- " results.append(list(multiples_computed(scalar, params, mult.klass, mult.partial, use_init, use_multiply)))\n",
+ " results.append(list(multiples_computed(scalar, params, mult.klass, mult.partial, use_init, use_multiply, kind=kind)))\n",
" return MultResults(results, samples)"
]
},
@@ -134,7 +135,7 @@
"params = get_params(category, curve, \"projective\")\n",
"num_workers = 20\n",
"bits = params.order.bit_length()\n",
- "samples = 1000\n",
+ "samples = 100\n",
"selected_mults = all_mults"
]
},
@@ -166,7 +167,7 @@
" for mult, future in tqdm(pool.as_completed(), desc=\"Computing small scalar distributions.\", total=len(pool.tasks)):\n",
" print(f\"Got {mult}.\")\n",
" if error := future.exception():\n",
- " print(error)\n",
+ " print(\"Error!\", error)\n",
" continue\n",
" res = future.result()\n",
" if mult not in multiples_mults:\n",
@@ -188,7 +189,9 @@
"metadata": {},
"source": [
"### Load\n",
- "Beware, the following load with try to load all chunks into memory, that will be very large."
+ "**Beware**, the following load with try to load all chunks into memory, that will be very large.\n",
+ "\n",
+ "You probably dont want to run this."
]
},
{
@@ -212,7 +215,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "264385f2-0f58-4f18-bfc2-61f2c5b6e5c8",
+ "id": "11b447f2-71ab-417e-a856-1724788cfc91",
"metadata": {},
"outputs": [],
"source": []