Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/jihoonjang98/hqc-x86-simd
Embedded Systems SecurityEncryption/Decryption ToolsIoT SecurityCryptographyHardware & IoT SecurityPapers & Research
GitHubjihoonjang98/hqc-x86-simd

hqc-x86-simd

Optimized HQC post-quantum KEM implementations for AVX2 and AVX-512 with GFNI, plus a unified benchmarking and NIST KAT suite for x86 IoT gateways.

View Repository
121 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Optimized HQC Implementations for AVX2 and AVX-512

This repository contains the optimized HQC implementations and benchmarking code accompanying the paper "Accelerating HQC for Post-Quantum TLS 1.3 on x86 IoT Gateways". It is a fork of the official HQC repository, extended with AVX-512 + GFNI implementations and a unified measurement suite that builds every compared implementation from the same code base, compiler flags, and benchmark protocol.

All implementations pass the NIST known-answer tests (KAT) for HQC-1, HQC-3, and HQC-5, and keep the input-independent control flow and memory-access pattern of the reference implementation.

Implementations

Each variant under src/x86_64/ is selected at configure time with -DHQC_X86_IMPL=<variant> and builds into its own library and test binaries.

VariantPaper labelISADescription
avx256HQC referenceAVX2official optimized implementation (baseline)
avx256_TC_JangJang et al.AVX2GFmulOpt Toom-Cook/Karatsuba multiplication
avx256_TC_GFNIOurs (AVX2)AVX2+GFNIour GFNI Reed-Solomon / Reed-Muller decoders on the AVX2 build
avx256_FAFFT_GFNI_chenChen et al.AVX2+GFNIFAFFT multiplication, original non-cached flow
avx256_FAFFT_GFNI_chen_x2Chen et al. (dagger)AVX2+GFNIFAFFT with the shared-operand ring_mul_x2 flow
avx256_FAFFT_GFNI_oursOurs FAFFT (AVX2)AVX2+GFNIFAFFT + zero-tail basis conversion + our decoders
avx512_RobertRobert–VéronAVX-512Robert–Véron AVX-512 polynomial multiplication
avx512_CabralCabral et al.AVX-512+GFNIsource code from Cabral et al. (includes their upstream HQC-3 hash_j fix of 2026-07-21)
avx512_TC_GFNIOurs TC/Karat (AVX-512)AVX-512+GFNIAVX-512 Toom-Cook/Karatsuba, GFNI decoders, AVX-512 Keccak
avx512_FAFFT_GFNIOurs FAFFT (AVX-512)AVX-512+GFNIAVX-512 port of Chen et al.'s AVX2 implementation

The two Ours builds of each ISA differ only in the polynomial multiplier, so their end-to-end comparison isolates the multiplier choice.

Building

Requirements: GCC >= 12, CMake >= 3.21, an x86-64 CPU. The AVX-512 variants require AVX-512F/BW/DQ/VL/VBMI/VBMI2/IFMA/BITALG/VPOPCNTDQ, VPCLMULQDQ, and GFNI (Ice Lake / Tiger Lake / Rocket Lake / Zen 4 or newer).

# one variant
mkdir build-avx512_TC_GFNI && cd build-avx512_TC_GFNI
cmake -DHQC_ARCH=x86_64 -DHQC_X86_IMPL=avx512_TC_GFNI ..
cmake --build . -j

# or every variant at once (creates build-<variant>/ directories)
./build_all.sh

Known-answer tests

# from the repository root, after building
bash scripts/run_kat.sh                      # all variants
bash scripts/run_kat.sh avx512_TC_GFNI       # one variant

Note: test_kat_hqc_* prints nothing on success and lines containing bad on a mismatch; the script greps the output accordingly.

Benchmarks

The paper's protocol: Turbo Boost and SMT disabled, the process pinned to one physical core, and every reported value the median of 1,000 samples of 100 iterations after 10,000 warm-up iterations. The scripts pin to core 0 with taskset.

bash scripts/measure_build.sh <variant> [...]  # end-to-end KEM benchmark of the given variants

Raw logs are written to benchmark_results/raw/; the benchmark reports min/median/mean, and the median is the value quoted in the paper.

Repository layout

src/common/          parameter-set independent HQC code (KEM layer, coding)
src/ref/             reference implementation
src/x86_64/common/   AVX2-era shared code
src/x86_64/<variant> one directory per compared implementation (see table)
lib/fips202/         Keccak (scalar PQClean + optional XKCP AVX-512 permutation)
tests/               KAT, API, unit tests, benchmarks
kats/                known-answer files used by the KAT tests
scripts/             KAT and measurement helper scripts

License and attribution

The base repository and our additions are released into the public domain (see LICENSE). This repository additionally vendors third-party implementations for measurement purposes; see THIRD_PARTY_NOTICES.md for their publications, origins, and licenses.

Download Tool