Project_Overview - galihru/pqcrypto GitHub Wiki

Project Overview

This library implements all core mathematical primitives and high-level APIs for LAI (Lemniscate-AGM Isogeny):

  • Hash-Based Seed Function

    $$ H(x, y, s) = \mathrm{SHA256}\bigl(\text{bytes}(x),|,\text{bytes}(y),|,\text{bytes}(s)\bigr) \bmod p $$

  • Modular Square Root via Tonelli–Shanks (with a fast branch if (p \equiv 3 \pmod 4)).

  • LAI Transformation

$$\begin{cases}h = H(x,y,s),[6pt] x' = \dfrac{x + a + h}{2} \bmod p,[6pt]y' = \sqrt{x,y + h} \bmod p,\end{cases}$$

where $$(T\bigl((x,y),,s;,a,,p\bigr) = (x',,y'))$$.

  • Binary Exponentiation of $$(T)$$ to compute $$(T^k(P_0))$$ in $$(O(\log k))$$ time.
  • Key Generation, Encryption, and Decryption routines for integer messages $$(0 \le m < p)$$.
  • Bulk JSON Decryption: decrypt an entire JSON payload into raw bytes (e.g., to reconstruct a file or UTF-8 text).

All language-specific wrappers expose identical API semantics under the hood. This makes pqcrypto ideal for cross-platform experiments, research, and educational purposes.


High-Level Components

  1. Low-Level Primitives

    • H(x, y, s): hash-based seed
    • sqrt_mod(a, p): modular square root (Tonelli–Shanks)
    • T(point, s, a, p): one LAI transform step
  2. Binary Exponentiation
    Implements exponentiation by squaring for repeated application of $$(T)$$.

  3. High-Level API

    • keygen(p, a, P0)(k, Q)
    • encrypt(m, Q, k, p, a, P0)(C1, C2, r)
    • decrypt(C1, C2, k, r, a, p)m
    • decryptAll(jsonPayload)byte[]

Back to Home | Footer