Canonical Byte-String Encoding for Finite-Ring Cryptosystems

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Riabov, Kyrylo, Kryvyi, Serhii
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910208584843264
author Riabov, Kyrylo
Kryvyi, Serhii
author_facet Riabov, Kyrylo
Kryvyi, Serhii
contents Ring-mapping protocols need a canonical byte-to-residue layer before any algebraic encryption step can begin. This paper isolates that layer and presents the base-m length codec, a canonical map from byte strings of length less than 2^64 to lists of residues modulo m. The encoder builds on and adapts an rANS-based system proposed by Duda. Decoding is exact for all moduli satisfying the paper's parameter bounds. Because the encoding carries the byte length in its fixed-width header, decoding is also tolerant to appended valid suffix digits. The paper is accompanied by a Rust implementation of the described protocol, a Lean 4 formalization of the abstract codec with machine-checked proofs, and performance benchmarks. The Lean 4 formalization establishes fixed-width prefix inversion and payload-state bounds below 2^64, stream-level roundtrip correctness, and that every emitted symbol is a valid residue modulo m. We conclude with a complexity analysis and a discussion of practical considerations arising in real-world use of the codec.
format Preprint
id arxiv_https___arxiv_org_abs_2603_23364
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Canonical Byte-String Encoding for Finite-Ring Cryptosystems
Riabov, Kyrylo
Kryvyi, Serhii
Cryptography and Security
Information Theory
Ring-mapping protocols need a canonical byte-to-residue layer before any algebraic encryption step can begin. This paper isolates that layer and presents the base-m length codec, a canonical map from byte strings of length less than 2^64 to lists of residues modulo m. The encoder builds on and adapts an rANS-based system proposed by Duda. Decoding is exact for all moduli satisfying the paper's parameter bounds. Because the encoding carries the byte length in its fixed-width header, decoding is also tolerant to appended valid suffix digits. The paper is accompanied by a Rust implementation of the described protocol, a Lean 4 formalization of the abstract codec with machine-checked proofs, and performance benchmarks. The Lean 4 formalization establishes fixed-width prefix inversion and payload-state bounds below 2^64, stream-level roundtrip correctness, and that every emitted symbol is a valid residue modulo m. We conclude with a complexity analysis and a discussion of practical considerations arising in real-world use of the codec.
title Canonical Byte-String Encoding for Finite-Ring Cryptosystems
topic Cryptography and Security
Information Theory
url https://arxiv.org/abs/2603.23364