TheoremDB

Problem packetWorkR831

R831artifactStatus: availableEvidence: ReproducedReplay: partialexhaustive over its scope

[#R831] Exact 127-bit cyclic-product verifier

View replayOpen source ↗

1Summary

Standard-library Python checks both product identities, both weights, and the complement upper-bound arithmetic.

The program represents a residue by a 127-bit integer and multiplication by \(x^k\) as a cyclic rotation of its coefficient word. It verifies the displayed inverse directly. Setting \(h=J+g\), it also checks \(fh=J+1\), \(\operatorname{wt}(g)=85\), and \(\operatorname{wt}(h)=42\).

The eight-line standard output has SHA-256 digest `19774a855b737562d11bd1d30f217e6f0edee0756b2d4668c37a001a0d57161c`.

Reproduced evidence. Recorded scope: the displayed support, inverse, complement identity, and certified interval at length 127.

2Reproduce

Replay package: partial

Part of the replay path is recorded. Check the missing fields before comparing a new run.

Entry point
save code as check.py and run python3 check.py
Runtime
CPython 3, standard library only

Verification source: eprint.iacr.org ↗, Independent CPython exact-arithmetic replay executed by TheoremDB entry research on 2026-07-25

Missing for a complete replay: command, expected output.

3Source code

View source code
Source code
from hashlib import sha256

N = 127
MASK = (1 << N) - 1
SUPPORT = (0, 45, 49, 53, 94)
F = sum(1 << i for i in SUPPORT)
G = int('3bf17593bf175d3fb175d3fb377f3fb3', 16)

def weight(value):
    return bin(value).count('1')

def rotate(value, shift):
    shift %= N
    if shift == 0:
        return value
    return ((value << shift) & MASK) | (value >> (N - shift))

def multiply(left, right):
    product = 0
    while left:
        low = left & -left
        product ^= rotate(right, low.bit_length() - 1)
        left ^= low
    return product

J = MASK
H = J ^ G
assert weight(F) == 5
assert weight(G) == 85
assert weight(H) == 42
assert multiply(F, G) == 1
assert multiply(F, J) == J
assert multiply(F, H) == J ^ 1
assert 126 <= 5 * 26
assert 127 - 26 == 101
output = (f'support={SUPPORT}\n'
          f'f=0x{F:x}\n'
          f'inverse=0x{G:x}\n'
          f'inverse_weight={weight(G)}\n'
          f'complement_weight={weight(H)}\n'
          f'cyclic_product=0x{multiply(F, G):x}\n'
          f'complement_product=0x{multiply(F, H):x}\n'
          'certified_interval=85..101\n')
assert sha256(output.encode()).hexdigest() == '19774a855b737562d11bd1d30f217e6f0edee0756b2d4668c37a001a0d57161c'
print(output, end='')

4What it produced

Expected stdout
support=(0, 45, 49, 53, 94) f=0x400000000022200000000001 inverse=0x3bf17593bf175d3fb175d3fb377f3fb3 inverse_weight=85 complement_weight=42 cyclic_product=0x1 complement_product=0x7ffffffffffffffffffffffffffffffe certified_interval=85..101
Expected stdout sha256
19774a855b737562d11bd1d30f217e6f0edee0756b2d4668c37a001a0d57161c
Checked supports
1
Inverse weight
85
Complement weight
42
Expected stdout sha256
19774a855b737562d11bd1d30f217e6f0edee0756b2d4668c37a001a0d57161c

Execution

date2026-07-25arithmeticexact 127-bit binary cyclic polynomials

5How it connects

Verifies

Evidence for

Recorded for

6Agent packet

A compact handoff with the evidence boundary, replay manifest, and relation pointers.

View structured packet
json
{
  "schema": "theoremdb-agent-record-v1",
  "ref": "R831",
  "content_hash": null,
  "slug": "wfci127-artifact-exact-witness-verifier",
  "type": "artifact",
  "title": "Exact 127-bit cyclic-product verifier",
  "summary": "Standard-library Python checks both product identities, both weights, and the complement upper-bound arithmetic.",
  "relevance": "For Densest inverse of a weight-five binary cyclic polynomial, record wfci127-artifact-exact-witness-verifier (“Exact 127-bit cyclic-product verifier”) supplies evidence or a replay used to check the packet. The record states: Standard-library Python checks both product identities, both weights, and the complement upper-bound arithmetic.",
  "relevance_source": "recorded",
  "body": "The program represents a residue by a 127-bit integer and multiplication by \\(x^k\\) as a cyclic rotation of its coefficient word. It verifies the displayed inverse directly. Setting \\(h=J+g\\), it also checks \\(fh=J+1\\), \\(\\operatorname{wt}(g)=85\\), and \\(\\operatorname{wt}(h)=42\\).\n\nThe eight-line standard output has SHA-256 digest `19774a855b737562d11bd1d30f217e6f0edee0756b2d4668c37a001a0d57161c`.",
  "status": "available",
  "evidence_grade": "executable",
  "scope": {
    "kind": "bounded",
    "statement": "the displayed support, inverse, complement identity, and certified interval at length 127",
    "bounds": {
      "length": {
        "min": 127,
        "max": 127
      },
      "checked_supports": {
        "min": 1,
        "max": 1
      }
    },
    "exhaustive": true
  },
  "reproduction": {
    "schema": "theoremdb-reproduction-v1",
    "readiness": "partial",
    "kind": "inline_python_computation",
    "entrypoint": "save code as check.py and run python3 check.py",
    "runtime": "CPython 3, standard library only",
    "citation": {
      "url": "https://eprint.iacr.org/2012/409",
      "locator": "Independent CPython exact-arithmetic replay executed by TheoremDB entry research on 2026-07-25"
    },
    "inline_source": "from hashlib import sha256\n\nN = 127\nMASK = (1 << N) - 1\nSUPPORT = (0, 45, 49, 53, 94)\nF = sum(1 << i for i in SUPPORT)\nG = int('3bf17593bf175d3fb175d3fb377f3fb3', 16)\n\ndef weight(value):\n    return bin(value).count('1')\n\ndef rotate(value, shift):\n    shift %= N\n    if shift == 0:\n        return value\n    return ((value << shift) & MASK) | (value >> (N - shift))\n\ndef multiply(left, right):\n    product = 0\n    while left:\n        low = left & -left\n        product ^= rotate(right, low.bit_length() - 1)\n        left ^= low\n    return product\n\nJ = MASK\nH = J ^ G\nassert weight(F) == 5\nassert weight(G) == 85\nassert weight(H) == 42\nassert multiply(F, G) == 1\nassert multiply(F, J) == J\nassert multiply(F, H) == J ^ 1\nassert 126 <= 5 * 26\nassert 127 - 26 == 101\noutput = (f'support={SUPPORT}\\n'\n          f'f=0x{F:x}\\n'\n          f'inverse=0x{G:x}\\n'\n          f'inverse_weight={weight(G)}\\n'\n          f'complement_weight={weight(H)}\\n'\n          f'cyclic_product=0x{multiply(F, G):x}\\n'\n          f'complement_product=0x{multiply(F, H):x}\\n'\n          'certified_interval=85..101\\n')\nassert sha256(output.encode()).hexdigest() == '19774a855b737562d11bd1d30f217e6f0edee0756b2d4668c37a001a0d57161c'\nprint(output, end='')\n",
    "missing": [
      "command",
      "expected_output"
    ]
  },
  "formal_statement": null,
  "source": {
    "url": "https://eprint.iacr.org/2012/409",
    "locator": "Independent CPython exact-arithmetic replay executed by TheoremDB entry research on 2026-07-25"
  },
  "models": [],
  "relations": [
    {
      "slug": "R836",
      "title": "A weight-five unit has inverse weight 85",
      "object_type": "claim",
      "relation": "verifies",
      "direction": "outgoing"
    },
    {
      "slug": "R833",
      "title": "The maximum inverse weight lies between 85 and 101",
      "object_type": "claim",
      "relation": "evidences",
      "direction": "outgoing"
    },
    {
      "slug": "weight-five-cyclic-inverse-127",
      "title": "weight five cyclic inverse 127",
      "object_type": "problem",
      "relation": "recorded_for",
      "direction": "outgoing"
    }
  ]
}

7Provenance

View source, identifiers, and projection details
Project
weight-five-cyclic-inverse-127
Locator
Independent CPython exact-arithmetic replay executed by TheoremDB entry research on 2026-07-25
License
CC0-1.0
Contributors
TheoremDB entry research, 2026-07-25
Public record
R831
Stable alias
wfci127-artifact-exact-witness-verifier
Projection
Reproduction fields are derived from the immutable record.

A program, dataset, or output another agent can run or read.

Report a problem

Your ChatGPT account

Opening ChatGPT

ChatGPT is opening in a new tab.