Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
image
imagewidth (px)
523
1.04k
End of preview. Expand in Data Studio

ascad-v2-1

This script downloads, extracts, and uploads the optimized ASCAD v2 (1-100k traces) dataset to Hugging Face Hub.

Dataset Structure

This dataset is stored in Zarr format, optimized for chunked and compressed cloud storage.

Traces (/traces)

  • Shape: [100000, 1000000] (Traces x Time Samples)
  • Data Type: int8
  • Chunk Shape: [50000, 200]

Metadata (/metadata)

  • ciphertext: shape [100000, 16], dtype uint8
  • key: shape [100000, 16], dtype uint8
  • mask: shape [100000, 16], dtype uint8
  • mask_: shape [100000, 16], dtype uint8
  • plaintext: shape [100000, 16], dtype uint8
  • rin: shape [100000, 1], dtype uint8
  • rin_: shape [100000, 1], dtype uint8
  • rm: shape [100000, 1], dtype uint8
  • rm_: shape [100000, 1], dtype uint8
  • rout: shape [100000, 1], dtype uint8
  • rout_: shape [100000, 1], dtype uint8

Auto-Generated Leakage Plots and Targets

Dataset Target Byte Index Description Plot Zoomed Plot
ascad-v2-1 ciphertext 0 Raw ciphertext byte at position byte_index.

ciphertext[i] where i = byte_index.
ascad-v2-1 ciphertext Zoomed ciphertext
ascad-v2-1 key 0 Raw key byte at position byte_index.

key[i] where i = byte_index.
ascad-v2-1 key Zoomed key
ascad-v2-1 mask 0 Raw per-byte mask at position byte_index.

mask[i] where i = byte_index.
ascad-v2-1 mask Zoomed mask
ascad-v2-1 mask_ 0 Raw per-byte mask for second S-box pass at position byte_index.

mask_[i] where i = byte_index.
ascad-v2-1 mask_ Zoomed mask_
ascad-v2-1 plaintext 0 Raw plaintext byte at position byte_index.

plaintext[i] where i = byte_index.
ascad-v2-1 plaintext Zoomed plaintext
ascad-v2-1 sbi 0 Unmasked S-Box Input (SBI) at AES byte position byte_index.

ptx[i] ^ key[i] where i = byte_index.
ascad-v2-1 sbi -
ascad-v2-1 sbo 0 Unmasked S-Box Output (SBO) at AES byte position byte_index.

SBOX[ptx[i] ^ key[i]] where i = byte_index.
ascad-v2-1 sbo -
ascad-v2-1 v2_affine_ptx 0 State after Map_in_G + Xor_states at slot byte_index.

rm * ptx[j] ^ mask[j] where j = perm[byte_index].

The affine-masked plaintext before any round key has been mixed in.
ascad-v2-1 v2_affine_ptx Zoomed v2_affine_ptx
ascad-v2-1 v2_hd_address_bus_transition 0 HD between the LUT index of the current time slot and the previous time slot. Models the physical Address Bus bit-flips during the tight SubBytes loop.

HD(LUT_idx[i], LUT_idx[i-1]) where i = byte_index.
ascad-v2-1 v2_hd_address_bus_transition -
ascad-v2-1 v2_hd_affine_sbi 0 HD between affine plaintext and masked SBI.

HD(rm*ptx[j]^mask[j], rm*(ptx[j]^key[j])^mask[j]) where j = perm[byte_index].
ascad-v2-1 v2_hd_affine_sbi -
ascad-v2-1 v2_hd_ark_operands 0 HD between the two operands entering the ALU during AddRoundKey r=0. HD(rmult * ptx[j] ^ mask[j], rmult * key[j]) ascad-v2-1 v2_hd_ark_operands Zoomed v2_hd_ark_operands
ascad-v2-1 v2_hd_ark_overwrite 0 HD modelling the ALU writing the AddRoundKey result back over the scaled key register. HD(rmult * key[j], rmult * (ptx[j] ^ key[j]) ^ mask[j]) ascad-v2-1 v2_hd_ark_overwrite Zoomed v2_hd_ark_overwrite
ascad-v2-1 v2_hd_lut_transition 0 HD between LUT index and LUT output.

HD(rm*(ptx[j]^key[j])^rin, rm*SBOX(ptx[j]^key[j])^rout) where j = perm[byte_index].
ascad-v2-1 v2_hd_lut_transition Zoomed v2_hd_lut_transition
ascad-v2-1 v2_hd_mask_interaction 0 HD between mask[j] and rin where j = perm[byte_index]. ascad-v2-1 v2_hd_mask_interaction -
ascad-v2-1 v2_hd_ptx_key 0 HD between rmptx[j] and rmkey[j] where j = perm[byte_index]. ascad-v2-1 v2_hd_ptx_key Zoomed v2_hd_ptx_key
ascad-v2-1 v2_hd_ptx_sbi 0 HD between the unmasked plaintext and the unmasked SBI.

HD(ptx[j], ptx[j] ^ key[j]) where j = perm[byte_index].
ascad-v2-1 v2_hd_ptx_sbi Zoomed v2_hd_ptx_sbi
ascad-v2-1 v2_hd_rm_rm_sbi 0 HD(rm, rm * (ptx[j] ^ key[j])) where j = perm[byte_index]. Models the hardware register transition from the multiplicative mask to the multiplicatively masked SBI. ascad-v2-1 v2_hd_rm_rm_sbi -
ascad-v2-1 v2_hd_rout_mask_interaction 0 Hamming distance between the global rout mask and the per-byte mask.

HD(rout, mask[j]) where j = perm[byte_index].
ascad-v2-1 v2_hd_rout_mask_interaction Zoomed v2_hd_rout_mask_interaction
ascad-v2-1 v2_hd_rout_raw_out 0 HD(rout, rm * SBOX(ptx[j] ^ key[j]) ^ rout) where j = perm[byte_index]. Models the transition between the global output mask and the raw LUT output. ascad-v2-1 v2_hd_rout_raw_out -
ascad-v2-1 v2_hd_rout_sbo_mid 0 HD(rout, rm * SBOX(ptx[j] ^ key[j]) ^ rout ^ mask[j]) where j = perm[byte_index]. Models the transition from the global output mask to the state inside the SubBytes inner loop after the per-byte mask has been added, but before rout is stripped. ascad-v2-1 v2_hd_rout_sbo_mid Zoomed v2_hd_rout_sbo_mid
ascad-v2-1 v2_hd_sbi 0 Hamming distance between masked plaintext and masked SBI.

HD(rm * ptx[j] ^ mask[j], rm * (ptx[j] ^ key[j]) ^ mask[j]) where j = perm[byte_index].
ascad-v2-1 v2_hd_sbi -
ascad-v2-1 v2_hd_sbi_sbo 0 HD between the unmasked SBI and unmasked SBO.

HD(ptx[j] ^ key[j], SBOX(ptx[j] ^ key[j])) where j = perm[byte_index].
ascad-v2-1 v2_hd_sbi_sbo -
ascad-v2-1 v2_hd_sbo_affine_mc 0 HD between the affine SBO and the masked MixColumns output.

HD(rm*SBOX(ptx[j]^key[j])^mask[j], MixColumns(...)[j]) where j = perm[byte_index].
ascad-v2-1 v2_hd_sbo_affine_mc -
ascad-v2-1 v2_hd_xw_lut_idx 0 HD between the pre-LUT state (Xor_Word applied) and the LUT index.

HD(rm*(ptx[j]^key[j])^mask[j]^rin, rm*(ptx[j]^key[j])^rin) where j = perm[byte_index].
ascad-v2-1 v2_hd_xw_lut_idx Zoomed v2_hd_xw_lut_idx
ascad-v2-1 v2_hw_affine_ptx 0 HW of the affine-masked plaintext.

HW(rm * ptx[j] ^ mask[j]) where j = perm[byte_index].
ascad-v2-1 v2_hw_affine_ptx Zoomed v2_hw_affine_ptx
ascad-v2-1 v2_hw_key 0 HW of the key byte at the permuted AES position.

HW(key[j]) where j = perm[byte_index].
ascad-v2-1 v2_hw_key Zoomed v2_hw_key
ascad-v2-1 v2_hw_lut_idx 0 HW of the sboxMasked LUT index.

HW(rm * (ptx[j] ^ key[j]) ^ rin) where j = perm[byte_index].
ascad-v2-1 v2_hw_lut_idx Zoomed v2_hw_lut_idx
ascad-v2-1 v2_hw_mask 0 HW of the per-byte additive mask.

HW(mask[j]) where j = perm[byte_index].
ascad-v2-1 v2_hw_mask Zoomed v2_hw_mask
ascad-v2-1 v2_hw_masked_sbi 0 HW of the affine-masked SBI entering round 1.

HW(rm * (ptx[j] ^ key[j]) ^ mask[j]) where j = perm[byte_index].
ascad-v2-1 v2_hw_masked_sbi Zoomed v2_hw_masked_sbi
ascad-v2-1 v2_hw_mc_parity_accumulator 0 HW of the MixColumns intermediate 't' variable (the affine column parity). t = a0 ^ a1 ^ a2 ^ a3 ascad-v2-1 v2_hw_mc_parity_accumulator Zoomed v2_hw_mc_parity_accumulator
ascad-v2-1 v2_hw_mixcolumns_masked 0 HW of the affine-masked MixColumns output.

HW(MixColumns(ShiftRows(rm * SBOX(ptx ^ key) ^ mask))[j]) where j = perm[byte_index].
ascad-v2-1 v2_hw_mixcolumns_masked Zoomed v2_hw_mixcolumns_masked
ascad-v2-1 v2_hw_ptx 0 HW of plaintext at the permuted AES position.

HW(ptx[j]) where j = perm[byte_index].
ascad-v2-1 v2_hw_ptx Zoomed v2_hw_ptx
ascad-v2-1 v2_hw_raw_out 0 HW of the sboxMasked LUT output.

HW(rm * SBOX(ptx[j] ^ key[j]) ^ rout) where j = perm[byte_index].
ascad-v2-1 v2_hw_raw_out Zoomed v2_hw_raw_out
ascad-v2-1 v2_hw_rm_key 0 HW of the multiplicatively masked key byte.

HW(rm * key[j]) where j = perm[byte_index].
ascad-v2-1 v2_hw_rm_key -
ascad-v2-1 v2_hw_rm_ptx 0 HW of the Map_in_G output (multiplicatively masked plaintext).

HW(rm * ptx[j]) where j = perm[byte_index].
ascad-v2-1 v2_hw_rm_ptx Zoomed v2_hw_rm_ptx
ascad-v2-1 v2_hw_sbi 0 HW of the unmasked SBI at the permuted AES position.

HW(ptx[j] ^ key[j]) where j = perm[byte_index].
ascad-v2-1 v2_hw_sbi -
ascad-v2-1 v2_hw_sbo 0 HW of the unmasked SBO at the permuted AES position.

HW(SBOX(ptx[j] ^ key[j])) where j = perm[byte_index].
ascad-v2-1 v2_hw_sbo Zoomed v2_hw_sbo
ascad-v2-1 v2_hw_sbo_affine 0 HW of the post-SubBytes affine state.

HW(rm * SBOX(ptx[j] ^ key[j]) ^ mask[j]) where j = perm[byte_index].
ascad-v2-1 v2_hw_sbo_affine Zoomed v2_hw_sbo_affine
ascad-v2-1 v2_hw_sbo_mid 0 HW of the mid-SubBytes state (rout and per-byte mask applied).

HW(rm * SBOX(ptx[j] ^ key[j]) ^ rout ^ mask[j]) where j = perm[byte_index].
ascad-v2-1 v2_hw_sbo_mid Zoomed v2_hw_sbo_mid
ascad-v2-1 v2_key 0 Plain key byte at the AES position consumed by shuffling slot byte_index.

key[j] where j = perm[byte_index].

The key byte is loaded unprotected from flash/ROM during AddRoundKey r=0 before being scaled into the GF(256) domain via gtab. Classic first-order DPA target; v2_rm_key is the masked (GF-scaled) version.
ascad-v2-1 v2_key -
ascad-v2-1 v2_lut_idx 0 sboxMasked LUT index computed during SubBytes at round 1, slot byte_index.

rm * (ptx[j] ^ key[j]) ^ rin where j = perm[byte_index].

Computed as state[j] ^ state2[j] inside the SubBytes loop: the additive masks (masksState) cancel, leaving only the multiplicatively-masked SBI XORed with rin. This is the value whose hamming weight leaks during the LUT address computation.
ascad-v2-1 v2_lut_idx Zoomed v2_lut_idx
ascad-v2-1 v2_mask_at_perm 0 Per-byte additive mask at the AES position consumed by shuffling slot byte_index.

mask[j] where j = perm[byte_index].

Distinct from mask[byte_index] whenever the permutation is non-identity. This is the mask that enters and leaves every intermediate in the affine invariant for slot byte_index.
ascad-v2-1 v2_mask_at_perm Zoomed v2_mask_at_perm
ascad-v2-1 v2_masked_key_affine 0 Key contribution after both multiplicative and additive masking.

rm * key[j] ^ mask[j] where j = perm[byte_index].
ascad-v2-1 v2_masked_key_affine -
ascad-v2-1 v2_masked_sbi 0 State entering round 1 at slot byte_index: after AddRoundKey r=0.

rm * (ptx[j] ^ key[j]) ^ mask[j] where j = perm[byte_index].

This is the affine-masked plaintext XOR key value that the round-1 SubBytes call will process.
ascad-v2-1 v2_masked_sbi Zoomed v2_masked_sbi
ascad-v2-1 v2_mixcolumns_masked 0 Output of MixColumns with affine masks still applied.

MixColumns(ShiftRows(rm * SBOX(ptx ^ key) ^ mask))[j] where j = perm[byte_index].
ascad-v2-1 v2_mixcolumns_masked Zoomed v2_mixcolumns_masked
ascad-v2-1 v2_perm 0 Shuffling permutation index at slot byte_index for ASCAD v2.

Returns j = perm[:, byte_index] — for each trace the AES byte position (0–15) processed in shuffling slot byte_index. All other slot-indexed v2_* targets derive j via this method.

Original-paper label: perm_index[byte_index] in the ASCAD v2 HDF5 file. Derived as:

perm[n, i] = G[G[G[G[(15 - i) XOR x0[n]] XOR x1[n]] XOR x2[n]] XOR x3[n]]

where G = _V2_PERM_G and x0..x3 are the lower nibbles of mask[:, 0..3].
ascad-v2-1 v2_perm Zoomed v2_perm
ascad-v2-1 v2_ptx 0 Plaintext byte at the AES position consumed by shuffling slot byte_index.

ptx[j] where j = perm[byte_index].

The byte value loaded from the plaintext register before Map_in_G scales it into the GF(256) multiplicative domain. Classic first-order DPA target; v2_rm_ptx is the masked version after Map_in_G.
ascad-v2-1 v2_ptx -
ascad-v2-1 v2_raw_out 0 SubBytes raw_out at round 1, slot byte_index: the sboxMasked LUT output.

rm * SBOX(ptx[j] ^ key[j]) ^ rout where j = perm[byte_index].

This is sboxMasked[lut_idx] — the value read from the firmware's masked S-Box LUT before it is XORed with state2[j] (masksState). It sits between :meth:v2_lut_idx (the LUT address) and :meth:v2_sbo_mid (the value written back into state[j]).

Original-paper label: sbox_masked[byte_index] in the ASCAD v2 HDF5 file and the NCC Group ML-104 blog 34-task model.
ascad-v2-1 v2_raw_out Zoomed v2_raw_out
ascad-v2-1 v2_raw_out_direct 0 SubBytes raw_out at round 1 indexed directly by AES byte position.

rm * SBOX(ptx[i] ^ key[i]) ^ rout where i = byte_index (no perm).

Unlike :meth:v2_raw_out, the shuffle permutation is not applied — byte_index maps directly to the AES state byte position. This is the same formula as :meth:v2_raw_out but over the identity byte ordering, making it practical as an un-permuted SNR or model target.

Original-paper label: sbox_masked_with_perm[byte_index] in the ASCAD v2 HDF5 file and the NCC Group ML-104 blog 18-task model (RMmSBOxROUT in scandal/crypto.py).
ascad-v2-1 v2_raw_out_direct -
ascad-v2-1 v2_rin_mask_interaction 0 Interaction between global input mask and per-byte mask.

rin ^ mask[j] where j = perm[byte_index].
ascad-v2-1 v2_rin_mask_interaction -
ascad-v2-1 v2_rm_key 0 Masked round-key contribution added during AddRoundKey r=0 at slot byte_index.

rm * key[j] where j = perm[byte_index].

This is gtab[key[j]] — the value XORed into state during the masked AddRoundKey call, scaled into the same multiplicative domain as the plaintext.
ascad-v2-1 v2_rm_key -
ascad-v2-1 v2_rm_ptx 0 Map_in_G output at slot byte_index: rm * ptx[j], j = perm[byte_index].

The plaintext byte scaled into the GF(256) multiplicative domain. Additive mask (masksState) has not yet been applied at this point.
ascad-v2-1 v2_rm_ptx -
ascad-v2-1 v2_rout_mask_interaction 0 Value of the interaction between the global rout mask and the per-byte mask. ascad-v2-1 v2_rout_mask_interaction -
ascad-v2-1 v2_sbi_perm 0 Unmasked SBI at the AES byte position consumed by shuffling slot byte_index.

ptx[j] ^ key[j] where j = perm[byte_index].

Unlike :meth:sbi, which uses byte_index as a direct AES byte position, this target follows the actual byte consumed by the firmware SubBytes shuffle at slot byte_index.
ascad-v2-1 v2_sbi_perm -
ascad-v2-1 v2_sbo_affine 0 Affine-masked SBO at slot byte_index after full SubBytes (post-loop rout strip).

rm * SBOX(ptx[j] ^ key[j]) ^ mask[j] where j = perm[byte_index].

This is the state value after the post-loop state[j] ^= rout pass restores the affine invariant. The rout mask is gone; only the multiplicative mask rm and the per-byte additive mask remain.
ascad-v2-1 v2_sbo_affine Zoomed v2_sbo_affine
ascad-v2-1 v2_sbo_hd 0 Hamming distance between mid-SubBytes and affine SBO.

HD(rm * SBOX(ptx[j] ^ key[j]) ^ rout ^ mask[j], rm * SBOX(ptx[j] ^ key[j]) ^ mask[j]) where j = perm[byte_index].
ascad-v2-1 v2_sbo_hd Zoomed v2_sbo_hd
ascad-v2-1 v2_sbo_mid 0 Mid-SubBytes state at slot byte_index before post-loop rout strip.

rm * SBOX(ptx[j] ^ key[j]) ^ rout ^ mask[j] where j = perm[byte_index].

This is raw_out ^ state2[j], i.e. the value written back into state[j] inside the SubBytes inner loop, before the post-loop state[j] ^= rout pass. The rout mask has not yet been removed.
ascad-v2-1 v2_sbo_mid Zoomed v2_sbo_mid
ascad-v2-1 v2_sbo_perm 0 Unmasked SBO at the AES byte position consumed by shuffling slot byte_index.

SBOX(ptx[j] ^ key[j]) where j = perm[byte_index].
ascad-v2-1 v2_sbo_perm -
ascad-v2-1 v2_xw_state 0 State after Xor_Word at round 1 (before SubBytes) at slot byte_index.

rm * (ptx[j] ^ key[j]) ^ mask[j] ^ rin where j = perm[byte_index].

This is the state byte written to the register immediately before the firmware issues the sboxMasked lookup.
ascad-v2-1 v2_xw_state Zoomed v2_xw_state
ascad-v2-1 rin none Raw global input mask rin. ascad-v2-1 rin Zoomed rin
ascad-v2-1 rin_ none Raw global input mask rin_ for second S-box pass. ascad-v2-1 rin_ Zoomed rin_
ascad-v2-1 rm none Raw global multiplicative mask rm (alpha). ascad-v2-1 rm Zoomed rm
ascad-v2-1 rm_ none Raw global multiplicative mask rm_ for second S-box pass. ascad-v2-1 rm_ Zoomed rm_
ascad-v2-1 rout none Raw global output mask rout. ascad-v2-1 rout Zoomed rout
ascad-v2-1 rout_ none Raw global output mask rout_ for second S-box pass. ascad-v2-1 rout_ Zoomed rout_

Parameters Used for Generation

  • HF_ORG: DLSCA
  • CHUNK_SIZE_Y: 50000
  • CHUNK_SIZE_X: 200
  • TOTAL_CHUNKS_ON_Y: 2
  • TOTAL_CHUNKS_ON_X: 5000
  • NUM_JOBS: 10
  • CAN_RUN_LOCALLY: True
  • CAN_RUN_ON_CLOUD: False
  • COMPRESSED: True

Usage

You can load this dataset directly using Zarr and Hugging Face File System:

import zarr
from huggingface_hub import HfFileSystem

fs = HfFileSystem()

# Map only once to the dataset root
root = zarr.open_group(fs.get_mapper("datasets/DLSCA/ascad-v2-1"), mode="r")

# Access traces directly
traces = root["traces"]
print("Traces shape:", traces.shape)

# Access plaintext metadata directly
plaintext = root["metadata"]["plaintext"]
print("Plaintext shape:", plaintext.shape)
Downloads last month
43,563