diff --git a/scaaml/capture/aes/aes_capture.py b/scaaml/capture/aes/aes_capture.py index e0a0f534..6a46e2ca 100644 --- a/scaaml/capture/aes/aes_capture.py +++ b/scaaml/capture/aes/aes_capture.py @@ -11,27 +11,31 @@ from scaaml.capture.aes.scope import SScope -def capture_aes_dataset(firmware_sha256: str, - architecture: str, - implementation: str, - shortname: str, - description: str, - capture_info: Dict, - crypto_implementation=AESSBOX, - algorithm: str = 'simpleserial-aes', - version: int = 1, - root_path: str = '/mnt/storage/chipwhisperer', - url: str = '', - examples_per_shard: int = 64, - measurements_info=None, - repetitions: int = 1, - chip_id: int = 164019, - test_keys: int = 1024, - test_plaintexts: int = 256, - train_keys: int = 3 * 1024, - train_plaintexts: int = 256, - holdout_keys: int = 0 * 1024, - holdout_plaintexts: int = 1): +def capture_aes_dataset( + firmware_sha256: str, + architecture: str, + implementation: str, + shortname: str, + description: str, + capture_info: Dict, + crypto_implementation=AESSBOX, + algorithm: str = 'simpleserial-aes', + version: int = 1, + root_path: str = '/mnt/storage/chipwhisperer', + url: str = '', + firmware_url: str = '', + paper_url: str = '', + licence: str = "https://creativecommons.org/licenses/by/4.0/", + examples_per_shard: int = 64, + measurements_info=None, + repetitions: int = 1, + chip_id: int = 164019, + test_keys: int = 1024, + test_plaintexts: int = 256, + train_keys: int = 3 * 1024, + train_plaintexts: int = 256, + holdout_keys: int = 0 * 1024, + holdout_plaintexts: int = 1) -> None: """Capture or continue capturing the dataset. Args: @@ -54,7 +58,10 @@ def capture_aes_dataset(firmware_sha256: str, algorithm: Algorithm name. version: Version of this dataset. root_path: Folder in which the dataset will be stored. - url: URL containing this dataset. + url: Where to download this dataset. + firmware_url: Where to dowload the firmware used while capture. + paper_url: Where to find the published paper. + licence: URL or the whole licence the dataset is published under. examples_per_shard: Size of a single part (for ML training purposes). measurements_info: Measurements info for scaaml.io.Dataset (what is measured, how many points are taken). @@ -95,6 +102,9 @@ def capture_aes_dataset(firmware_sha256: str, firmware_sha256=firmware_sha256, description=description, url=url, + firmware_url=firmware_url, + paper_url=paper_url, + licence=licence, examples_per_shard=examples_per_shard, measurements_info=measurements_info, attack_points_info=crypto_implementation.ATTACK_POINTS_INFO, @@ -102,6 +112,7 @@ def capture_aes_dataset(firmware_sha256: str, # Generators of key-plaintext pairs for different splits. crypto_algorithms = [] + def add_crypto_alg(split: Literal['test', 'train', 'holdout'], keys: int, plaintexts: int, repetitions: int): """Does not overwrite, safe to call multiple times. @@ -173,6 +184,9 @@ def capture_aes_scald_stm32f4_mbedtls( version: int = 1, root_path: str = '/mnt/storage/chipwhisperer', url: str = '', + firmware_url: str = '', + paper_url: str = '', + licence: str = "https://creativecommons.org/licenses/by/4.0/", examples_per_shard: int = 64, measurements_info=None, repetitions: int = 1, @@ -213,6 +227,9 @@ def capture_aes_scald_stm32f4_mbedtls( version=version, root_path=root_path, url=url, + firmware_url=firmware_url, + paper_url=paper_url, + licence=licence, examples_per_shard=examples_per_shard, measurements_info=measurements_info, capture_info=capture_info,