Documentation

CslibFrontier.Crypto.Computational.GenericGroup.Power

Exponentiation by products in the generic group model #

Group multiplication (product) and repeated-squaring exponentiation (power) over GroupOracleSpec n S ([BS23], Section 16.1.2, pp. 684–686). power ℓ k returns pure ℓ for k ≤ 1 because no label of 0 is held, so evalPure_power assumes 1 ≤ k. Bounds count only GroupQuery.IsProduct calls (worst case over oracle replies); the constant 2 is this library's, exponent arithmetic is not costed, and no machine-model bound is claimed.

Main definitions #

Main results #

References #

Multiply a and b via one .op a b 1 1 call; a rejected call (none) returns a.

@[irreducible]
def Cslib.Crypto.GenericGroup.power {n : ℕ} {S : Type} (ℓ : S) (k : ℕ) :

Repeated-squaring exponentiation in GroupOracleSpec n S; returns pure ℓ for k ≤ 1.

Every query made by product is a product (GroupQuery.IsProduct).

product makes at most 1 oracle query on every path.

Every query made by power is a product (GroupQuery.IsProduct).

theorem Cslib.Crypto.GenericGroup.isQueryBounded_power {n : ℕ} {S : Type} (ℓ : S) (k : ℕ) :
(power ℓ k).IsQueryBounded (2 * Nat.log 2 k)

power makes at most 2 * Nat.log 2 k product queries on every path, whatever the oracle returns; the factor 2 is this library's and exponent arithmetic is not costed.

theorem Cslib.Crypto.GenericGroup.evalPure_product {n : ℕ} {S : Type} {L : ZMod n → S} {O : (q : GroupQuery n S) → GroupOracleSpec n S q} (hO : ∀ (β₁ β₂ : ZMod n), O (GroupQuery.op (L β₁) (L β₂) 1 1) = some (L (β₁ + β₂))) (β₁ β₂ : ZMod n) :
OracleComp.evalPure O (product (L β₁) (L β₂)) = L (β₁ + β₂)

Against any oracle that multiplies labels of L, product outputs L (β₁ + β₂).

theorem Cslib.Crypto.GenericGroup.evalPure_power {n : ℕ} {S : Type} {L : ZMod n → S} {O : (q : GroupQuery n S) → GroupOracleSpec n S q} (hO : ∀ (β₁ β₂ : ZMod n), O (GroupQuery.op (L β₁) (L β₂) 1 1) = some (L (β₁ + β₂))) (β : ZMod n) {k : ℕ} (hk : 1 ≤ k) :
OracleComp.evalPure O (power (L β) k) = L (↑k * β)

Against any oracle that multiplies labels of L, power (L β) k outputs L (k * β) for 1 ≤ k.