Skip to content

fix(kos): make domain-separation salt non-invertible (tccr mix) - #3

Closed
AdamDawidKrol wants to merge 1 commit into
adam/kos-domain-sep-attack-testfrom
adam/kos-domain-separation-tccr
Closed

fix(kos): make domain-separation salt non-invertible (tccr mix)#3
AdamDawidKrol wants to merge 1 commit into
adam/kos-domain-sep-attack-testfrom
adam/kos-domain-separation-tccr

Conversation

@AdamDawidKrol

Copy link
Copy Markdown
Owner

Fixes the bypass demonstrated in #1.

The salt added in #2 was mixed into the setup PRG seeds with XOR (Prg::from_seed(seed ^ instance_id)). XOR is linear and invertible, and the receiver is the base-OT sender (it picks the seeds), so it can pre-compensate

seed_B[i][b] = seed_A[i][b] ^ id_A ^ id_B      (both b)

making seed_B ^ id_B == seed_A ^ id_A for every column. The salt cancels, the two instances collapse onto the same PRG stream, and XOR-ing the sender keys at a column with complementary receiver choices yields delta exactly — while both instances still pass their consistency checks.

Fix: mix the salt with a non-invertible tweakable correlation-robust hash instead:

Prg::from_seed(FIXED_KEY_AES.tccr(instance_id, seed))

Both parties apply the same transform to the same chosen seed (correctness preserved), but the receiver can no longer force cross-instance seed collisions without inverting AES.

Turns the kos::attack_poc security regression test from #1 green. mpz-ot-core and mpz-ot kos suites pass.

Stack: #2 (salt) → #1 ([red] test) → this PR ([green] fix).

The XOR seed mix (`Prg::from_seed(seed ^ instance_id)`) is linear and
invertible, so it does not actually domain-separate two KOS instances that
share one global delta. A malicious receiver controls the base-OT seeds (it
is the base-OT sender) and can pre-compensate

    seed_B[i][b] = seed_A[i][b] ^ id_A ^ id_B   (both b)

so that `seed_B ^ id_B == seed_A ^ id_A` for every column, collapsing the two
instances onto the same PRG stream while both still pass their consistency
checks. XOR-ing the sender keys at a column with complementary receiver
choices then yields delta exactly.

Mix the instance id in with a tweakable correlation-robust hash instead,
`Prg::from_seed(FIXED_KEY_AES.tccr(instance_id, seed))`. Both parties apply
the same transform to the same chosen seed, so extension correctness is
preserved, but the mix is non-invertible in `seed`, so a receiver can no
longer force cross-instance seed collisions.

Turns the security regression test in the previous commit green.
@AdamDawidKrol

Copy link
Copy Markdown
Owner Author

Folded into #2 — the salt and its non-invertible (tccr) mix now ship as a single commit.

@AdamDawidKrol
AdamDawidKrol deleted the adam/kos-domain-separation-tccr branch July 23, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant