constant-time-eq-kotlin
0.1.1indexedConstant-time comparison of equal-length byte strings to prevent timing attacks; faithful line-by-line transliteration of upstream implementation, includes provenance headers, tests, and CI.
Constant-time comparison of equal-length byte strings to prevent timing attacks; faithful line-by-line transliteration of upstream implementation, includes provenance headers, tests, and CI.
This is a Kotlin Multiplatform line-by-line transliteration port of cesarb/constant_time_eq.
Original Project: This port is based on cesarb/constant_time_eq. All design credit and project intent belong to the upstream authors; this repository is a faithful port to Kotlin Multiplatform with no behavioural changes intended.
This is a completed port of cesarb/constant_time_eq to Kotlin Multiplatform. Focused Kotlin source and test files are organized under io.github.kotlinmania.constanttimeeq with ConstantTimeEq.kt matching upstream src/lib.rs behavior across all 17 retained KMP targets (while upstream Linux ptrace-based instruction counting and Criterion benchmarks remain documented as unportable per AGENTS.md §6).
cesarb/constant_time_eqThe text below is reproduced and lightly edited from
https://github.com/cesarb/constant_time_eq. It is the upstream project's own description and remains under the upstream authors' authorship; links have been rewritten to absolute upstream URLs so they continue to resolve from this repository.
Compares two equal-sized byte strings in constant time.
Inspired by the Linux kernel's crypto_memneq.
Licensed under either of
at your option.
dependencies {
implementation("io.github.kotlinmania:constant-time-eq-kotlin:0.1.2")
}
./gradlew build
./gradlew test
See AGENTS.md for translator discipline and Rust → Kotlin idiom mapping.
Keep the upstream Rust checkout in tmp/constant_time_eq/ as the translation ground truth.
This Kotlin port is distributed under the same CC0-1.0 license as the upstream cesarb/constant_time_eq. See LICENSE (and any sibling LICENSE-* / NOTICE files mirrored from upstream) for the full text.
Original work copyrighted by the constant_time_eq authors.
Kotlin port: Copyright (c) 2026 Sydney Renee and The Solace Project.
Thanks to the cesarb/constant_time_eq maintainers and contributors for the original Rust implementation. This port reproduces their work in Kotlin Multiplatform; bug reports about upstream design or behavior should go to the upstream repository.
androidNativeArm64, androidNativeX64)macosArm64, iosArm64, iosSimulatorArm64, tvosArm64, tvosSimulatorArm64, watchosDeviceArm64, watchosSimulatorArm64) + Swift Export (ConstantTimeEq)linuxX64, linuxArm64)mingwX64)js, wasmJs, wasmWasi)Surfaced from shared tags and platforms — no rankings paid for.