Skip to content

Bound random sampling domains and Paillier challenge widths - #15

Open
mswilkison wants to merge 1 commit into
codex/helper-lifecyclefrom
codex/sampling-bounds
Open

mswilkison wants to merge 1 commit into
codex/helper-lifecyclefrom
codex/sampling-bounds

Conversation

@mswilkison

@mswilkison mswilkison commented Sep 14, 2026

Copy link
Copy Markdown

Depends on #13: the safe-prime result handoff must observe cancellation before the newly accepted small parameter sizes are used. This PR is stacked on codex/helper-lifecycle.

Reject empty prime and unit sampling domains and structurally unsupported Paillier key sizes. Mask expanded GenerateXs candidates to the modulus width before rejection, and propagate empty sampler results through encryption, quadratic-residue generation, and direct MtA prover callers. The fixed-size Paillier proof constructor reports an invalid challenge domain with an explicit panic. The 18-bit structural floor is an implementation boundary, not a cryptographic security recommendation.

The 2048-bit challenge output is unchanged, checked against a digest of all 13 deterministic challenges captured from the unmodified base. Validation includes bounded parameter checks, modulus-width controls, full common and crypto tests, and ordinary 2048-bit Paillier/MtA tests with GOMAXPROCS=2 and go test -p 1. Formatting, diff checks, and independent patch review passed.

Source-level adaptation of public upstream dc9b957db02aa186e5e438cf9bd840c57e789008 and b64213a53a9a1f822c8dcdd9ad949cdfd27d6468.

Full test CI and formatting CI were dispatched for this branch because the automatic PR trigger only covers master.

Adapt the common prime-size and unit-domain guards from public upstream
dc9b957.

Adapt the Paillier sampling changes from public upstream
b64213a to this base. Use an 18-bit
minimum for the local safe-prime candidate range and separation condition.
Propagate empty sampler results through direct callers while preserving
function signatures and the ordinary 2048-bit challenge output.

These are source-level adaptations, not cherry-picks. This base has no
quadratic-non-residue sampling helper, and its ModProof is outside the
scope of this change.

Add bounded domain checks, modulus-width controls, and a fixed 2048-bit
challenge digest captured from base 86bd1a3.
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