Source: https://guthlabs.ai/docs/instruments/modular-exponentiation-calculator/

instrument / verified-clean

# Modular Exponentiation Calculator

The current ledger marks this instrument verified clean within the source-bound verification corpus.

Status: **VERIFIED_CLEAN**Lifecycle: **verified-clean**

## Inspectable records

[01**Overview**Purpose and lifecycle](<https://guthlabs.ai/docs/instruments/modular-exponentiation-calculator/>)[02**Mechanism**Method and assumptions](<https://guthlabs.ai/docs/instruments/modular-exponentiation-calculator/mechanism/>)[03**Implementation**Binding and validation](<https://guthlabs.ai/docs/instruments/modular-exponentiation-calculator/implementation/>)[04**Qualification**Evidence and errata](<https://guthlabs.ai/docs/instruments/modular-exponentiation-calculator/qualification/>)

## Ledger state

The current ledger marks this instrument verified clean within the source-bound verification corpus.

**Area**: Computing & Information

**Tranche**: tranche-4

**Evidence ID**: t4-136

**Ledger rows**: 1

No ledger note is attached.

## Review findings

The catalog description is not honest as written because the formula omits the final modulo reduction and the domain constraints are absent. The empty honest_label is a concern: the instrument should explicitly state that it is a toy/coursework calculator unless it has rigorously bounded, arbitrary-precision behavior suitable for cryptographic-sized integers.

### Formula and scope findings

- The stated formula is not correct as an integer equality: the product of the selected residues must itself be reduced modulo m, i.e. result = (Π (b^(2^i) mod m)) mod m.

- The formula does not explicitly define the square-and-multiply accumulator update, including reducing after every multiplication.

- The supported domain is unspecified; square-and-multiply requires an integer exponent e >= 0 and a positive integer modulus m > 0.

- The promised step-by-step binary-exponent trace has no specified format or required intermediate values.

### Unit assumptions

- Base, exponent, and modulus are dimensionless integers; no physical units or unit conversions apply.

- The exponent is a nonnegative integer.

- The modulus is a positive integer; m = 0 is invalid.

- For ordinary arithmetic, inputs should be within exact-integer limits. JavaScript Number arithmetic is not exact for all large integers, so arbitrary-precision BigInt or an explicit safe-integer limit is required.

## Boundary hardening

**BREAK_CLAIMED** · SELF_FLAGGED

The specification does not define behavior for modulus 0 or define the residue convention for negative bases. Modulus 0 must be rejected, and raw JavaScript remainder semantics produce -2 for base -3, exponent 3, modulus 5 whereas the standard least-nonnegative modular result is 3.

## Errata and corrections

No applied erratum is attached to this unique-name record.

## Inspectable example

4 review vectors are recorded. One source-bound sample is shown below.

````
{
  "inputs": {
    "base": 5,
    "exponent": 13,
    "modulus": 23
  },
  "expected_outputs": {
    "result": 21,
    "trace": {
      "exponent_binary": "1101",
      "squared_residues": [
        {
          "bit": 0,
          "value": 5
        },
        {
          "bit": 1,
          "value": 2
        },
        {
          "bit": 2,
          "value": 4
        },
        {
          "bit": 3,
          "value": 16
        }
      ],
      "selected_bits": [
        0,
        2,
        3
      ],
      "accumulator_values": [
        5,
        20,
        21
      ]
    }
  },
  "working": "13 = 2^3 + 2^2 + 2^0 = 1101_2. b^(2^0) mod m = 5^1 mod 23 = 5. b^(2^1) mod m = 5^2 = 25, 25 mod 23 = 2. b^(2^2) mod m = 2^2 = 4. b^(2^3) mod m = 4^2 = 16. Select bits 0, 2, and 3: accumulator = 1 × 5 = 5; then 5 × 4 = 20; then 20 × 16 = 320; 320 mod 23 = 21."
}
````

## Related workflows

[Crypto & Number Theory Classroomfast powering](<https://guthlabs.ai/docs/instrument-workflows/crypto-classroom/>)

## Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

- `VERIFIED_LEDGER.json · VERIFIED_CLEAN`

- `evidence-tranche4/tranche4-results.json`

- `BOUNDARY_HAZARD_CATALOG.json`
