Skip to content

Commit 23c4ffe

Browse files
committed
[update] Update yaml files
Update the yaml files to version v1.0.3 of OpenTitan's pentest framework. Signed-off-by: Siemen Dhooghe <[email protected]>
1 parent bc453b1 commit 23c4ffe

File tree

151 files changed

+10646
-3048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+10646
-3048
lines changed

capture/capture_aes.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
44
# SPDX-License-Identifier: Apache-2.0
55

6+
import json
67
import logging
78
import random
89
import signal
@@ -12,28 +13,21 @@
1213
from functools import partial
1314
from pathlib import Path
1415
from typing import Optional
15-
import json
1616

1717
import numpy as np
1818
import yaml
1919
from Crypto.Cipher import AES
2020
from project_library.project import ProjectConfig, SCAProject
21-
from scopes.scope import (
22-
Scope,
23-
ScopeConfig,
24-
convert_num_cycles,
25-
convert_offset_cycles,
26-
determine_sampling_rate,
27-
)
21+
from scopes.scope import (Scope, ScopeConfig, convert_num_cycles,
22+
convert_offset_cycles, determine_sampling_rate)
2823
from tqdm import tqdm
2924

3025
import util.helpers as helpers
3126
from target.communication.sca_aes_commands import OTAES
3227
from target.communication.sca_prng_commands import OTPRNG
3328
from target.communication.sca_trigger_commands import OTTRIGGER
3429
from target.targets import Target, TargetConfig
35-
from util import check_version
36-
from util import plot
30+
from util import check_version, plot
3731

3832
# Both the number of bytes in the plaintext and key are fixed.
3933
plaintext_len = 16

capture/capture_hmac.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# To be compatible to the other capture scripts, the variable is
88
# called ciphertext
99

10+
import json
1011
import logging
1112
import random
1213
import signal
@@ -16,19 +17,13 @@
1617
from functools import partial
1718
from pathlib import Path
1819
from typing import Optional
19-
import json
2020

2121
import numpy as np
2222
import yaml
2323
from Crypto.Hash import HMAC, SHA256
2424
from project_library.project import ProjectConfig, SCAProject
25-
from scopes.scope import (
26-
Scope,
27-
ScopeConfig,
28-
convert_num_cycles,
29-
convert_offset_cycles,
30-
determine_sampling_rate,
31-
)
25+
from scopes.scope import (Scope, ScopeConfig, convert_num_cycles,
26+
convert_offset_cycles, determine_sampling_rate)
3227
from tqdm import tqdm
3328

3429
import util.helpers as helpers

capture/capture_ibex.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
44
# SPDX-License-Identifier: Apache-2.0
55

6+
import json
67
import logging
78
import random
89
import signal
@@ -12,18 +13,12 @@
1213
from functools import partial
1314
from pathlib import Path
1415
from typing import Optional
15-
import json
1616

1717
import numpy as np
1818
import yaml
1919
from project_library.project import ProjectConfig, SCAProject
20-
from scopes.scope import (
21-
Scope,
22-
ScopeConfig,
23-
convert_num_cycles,
24-
convert_offset_cycles,
25-
determine_sampling_rate,
26-
)
20+
from scopes.scope import (Scope, ScopeConfig, convert_num_cycles,
21+
convert_offset_cycles, determine_sampling_rate)
2722
from tqdm import tqdm
2823

2924
import util.helpers as helpers

capture/capture_kmac.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# called ciphertext
99

1010
import binascii
11+
import json
1112
import logging
1213
import random
1314
import signal
@@ -17,28 +18,21 @@
1718
from functools import partial
1819
from pathlib import Path
1920
from typing import Optional
20-
import json
2121

2222
import numpy as np
2323
import yaml
2424
from Crypto.Hash import KMAC128
2525
from project_library.project import ProjectConfig, SCAProject
26-
from scopes.scope import (
27-
Scope,
28-
ScopeConfig,
29-
convert_num_cycles,
30-
convert_offset_cycles,
31-
determine_sampling_rate,
32-
)
26+
from scopes.scope import (Scope, ScopeConfig, convert_num_cycles,
27+
convert_offset_cycles, determine_sampling_rate)
3328
from tqdm import tqdm
3429

3530
import util.helpers as helpers
3631
from target.communication.sca_kmac_commands import OTKMAC
3732
from target.communication.sca_prng_commands import OTPRNG
3833
from target.communication.sca_trigger_commands import OTTRIGGER
3934
from target.targets import Target, TargetConfig
40-
from util import check_version
41-
from util import plot
35+
from util import check_version, plot
4236

4337
"""KMAC SCA capture script.
4438

capture/capture_otbn.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,8 @@
1616
import numpy as np
1717
import yaml
1818
from project_library.project import ProjectConfig, SCAProject
19-
from scopes.scope import (
20-
Scope,
21-
ScopeConfig,
22-
convert_num_cycles,
23-
convert_offset_cycles,
24-
determine_sampling_rate,
25-
)
19+
from scopes.scope import (Scope, ScopeConfig, convert_num_cycles,
20+
convert_offset_cycles, determine_sampling_rate)
2621
from tqdm import tqdm
2722

2823
import util.helpers as helpers

capture/capture_sha3.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# To be compatible to the other capture scripts, the variable is
88
# called ciphertext
99

10+
import json
1011
import logging
1112
import random
1213
import signal
@@ -16,28 +17,21 @@
1617
from functools import partial
1718
from pathlib import Path
1819
from typing import Optional
19-
import json
2020

2121
import numpy as np
2222
import yaml
2323
from Crypto.Hash import SHA3_256
2424
from project_library.project import ProjectConfig, SCAProject
25-
from scopes.scope import (
26-
Scope,
27-
ScopeConfig,
28-
convert_num_cycles,
29-
convert_offset_cycles,
30-
determine_sampling_rate,
31-
)
25+
from scopes.scope import (Scope, ScopeConfig, convert_num_cycles,
26+
convert_offset_cycles, determine_sampling_rate)
3227
from tqdm import tqdm
3328

3429
import util.helpers as helpers
3530
from target.communication.sca_prng_commands import OTPRNG
3631
from target.communication.sca_sha3_commands import OTSHA3
3732
from target.communication.sca_trigger_commands import OTTRIGGER
3833
from target.targets import Target, TargetConfig
39-
from util import check_version
40-
from util import plot
34+
from util import check_version, plot
4135

4236
# Byte lengths of the text and tag.
4337
text_length = 16

capture/configs/aes_sca_chip.yaml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
target:
22
target_type: chip
33
fw_bin: "../objs/sca_ujson_chip_signed.img"
4+
opentitantool: "../objs/opentitantool"
45
target_clk_mult: 1
56
target_freq: 100000000
67
baudrate: 115200
7-
output_len_bytes: 16
8-
protocol: "ujson"
9-
port: "/dev/ttyUSB1"
8+
# You can specify the port or leave it empty to find it automatically.
109
# Trigger source.
1110
# hw: Precise, hardware-generated trigger - FPGA only.
1211
# sw: Fully software-controlled trigger.
1312
trigger: "sw"
1413
waverunner:
1514
waverunner_ip: 192.168.33.128
16-
num_segments: 20
1715
# num_samples: 6000
1816
# offset_samples: 0
1917
# cycles will only be used if not given in samples
@@ -24,22 +22,22 @@ waverunner:
2422
channel: C1
2523
sparsing: 0
2624
capture:
27-
scope_select: waverunner
25+
# scope_select: husky, waverunner, none
26+
scope_select: none
2827
num_traces: 1000
29-
show_plot: True
28+
num_segments: 20
29+
show_plot: False
3030
plot_traces: 100
31+
# trace_db: cw
3132
trace_db: ot_trace_library
3233
trace_threshold: 10000
33-
# trace_db: cw
3434
test:
35-
which_test: aes_random_batch
35+
which_test: daisy_chain
36+
# which_test: single
37+
# which_test: daisy_chain
3638
# which_test: aes_random
3739
# which_test: aes_fvsr_key
38-
# which_test: aes_fvsr_key_batch
3940
# which_test: aes_fvsr_data
40-
# which_test: aes_fvsr_data_batch
41-
key_len_bytes: 16
42-
text_len_bytes: 16
4341
# These initial values are used only for random capture but not fixed-vs-random.
4442
key_fixed: [0x81, 0x1E, 0x37, 0x31, 0xB0, 0x12, 0x0A, 0x78, 0x42, 0x78, 0x1E, 0x22, 0xB2, 0x5C, 0xDD, 0xF9]
4543
text_fixed: [0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA]
@@ -49,11 +47,27 @@ test:
4947
# 32-bit seed for masking on device. To switch off the masking, use 0 as LFSR seed.
5048
# lfsr_seed: 0x00000000
5149
lfsr_seed: 0xdeadbeef
52-
# When True, the instruction cache is enabled.
53-
enable_icache: True
54-
# When True, the dummy instructions are enabled.
55-
enable_dummy_instr: False
56-
# When True, enable the jittery clock.
57-
enable_jittery_clock: False
58-
# When True, enable the SRAM readback feature.
59-
sram_readback_enable: False
50+
core_config: {
51+
"enable_icache": True,
52+
"enable_dummy_instr": True,
53+
"dummy_instr_count": 3,
54+
"enable_jittery_clock": True,
55+
"enable_sram_readback": True,
56+
"enable_data_ind_timing": True,
57+
}
58+
sensor_config: {
59+
"sensor_ctrl_enable": True,
60+
"sensor_ctrl_en_fatal": [
61+
False,
62+
False,
63+
False,
64+
False,
65+
False,
66+
False,
67+
False,
68+
False,
69+
False,
70+
False,
71+
False,
72+
],
73+
}

capture/configs/aes_sca_cw305.yaml

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)