Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ __pycache__/
*.csv
*.png

# Testing
/Testing/

# Logs
*.log

Expand Down
10 changes: 5 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[submodule "third_party/shipovnik"]
[submodule "third_party/shipovnik"]
path = third_party/shipovnik
url = https://github.com/QAPP-tech/shipovnik_tc26.git
[submodule "third_party/hypericum"]
[submodule "third_party/hypericum"]
path = third_party/hypericum
url = https://github.com/QAPP-tech/hypericum_tc26.git
[submodule "third_party/kryzhovnik"]
[submodule "third_party/kryzhovnik"]
path = third_party/kryzhovnik
url = https://github.com/ElenaKirshanova/pqc_LWR_signature.git
[submodule "third_party/iaik_merkle_tree"]
url = https://github.com/cherninkiy/kryzhovnik-wrapper-tc26.git
[submodule "third_party/iaik_merkle_tree"]
path = third_party/iaik_merkle_tree
url = https://github.com/IAIK/merkle-tree.git
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.14)
project(SubmodulesProject VERSION 1.0.0 LANGUAGES C CXX)

option(BUILD_TESTING "Build and run tests" ON)
if(BUILD_TESTING)
enable_testing()
include(CTest)
endif()

add_subdirectory(third_party)
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ The goal is to measure the speedup of signing a batch of messages with a single
- Microbenchmarks: sequential vs batch signing, verification overhead
- Results exported as CSV + plots

The original Kryzhovnik implementation is documented above. In this repository, the `third_party/kryzhovnik` submodule is pinned to a compatibility fork used for integration with Hypericum and Shipovnik.

## Repository Structure

```
batch-pqc/
├── third_party/ # git submodules
│ ├── shipovnik/ → https://github.com/QAPP-tech/shipovnik_tc26
│ ├── hypericum/ → https://github.com/QAPP-tech/hypericum_tc26
│ ├── kryzhovnik/ → https://github.com/ElenaKirshanova/pqc_LWR_signature
│ ├── kryzhovnik/ → https://github.com/cherninkiy/kryzhovnik-wrapper-tc26
│ └── iaik_merkle_tree/ → https://github.com/IAIK/merkle-tree
├── src/
│ ├── hash/ # hash provider (uses Streebog from hypericum, SHA-256 fallback)
Expand Down Expand Up @@ -68,16 +70,18 @@ batch-pqc/
git clone --recursive https://github.com/cherninkiy/batch-pqc.git
cd batch-pqc

# Build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
# Sync submodule URLs in case .gitmodules changed
git submodule sync --recursive
git submodule update --init --recursive

# Build third-party dependencies and tests
./scripts/third_party.sh build

# Run tests
ctest --output-on-failure
./scripts/third_party.sh tests

# Run benchmarks (sequential vs batch)
./bench/bench_batch --algo hypericum --batch-size 16 --iterations 100
./build/bench/bench_batch --algo hypericum --batch-size 16 --iterations 100
```

### Expected Output (after MVP)
Expand Down Expand Up @@ -121,4 +125,9 @@ Third-party components have their own licenses:

- [IAIK/merkle-tree](https://github.com/IAIK/merkle-tree) – Merkle tree implementation (public domain / BSD‑like)
- [QAPP-tech](https://github.com/QAPP-tech) – Shipovnik and Hypericum (including Streebog hash) PQC signatures
- [Elena Kirshanova](https://github.com/ElenaKirshanova) – Kryzhovnik (lattice‑based) signature
- [Elena Kirshanova](https://github.com/ElenaKirshanova) – original Kryzhovnik implementation: [pqc_LWR_signature](https://github.com/ElenaKirshanova/pqc_LWR_signature)
- A compatibility fork is used in this project to integrate Kryzhovnik with Hypericum and Shipovnik

---

**Warning:** This is an open-source PoC for portfolio and partnership purposes. The code is released under the MIT license. It is not intended for production use. Use at your own risk.
21 changes: 13 additions & 8 deletions README_ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
- Микробенчмарки: последовательная vs пакетная подпись, накладные расходы на верификацию
- Экспорт результатов в CSV и графики

Выше указана ссылка на оригинальную реализацию Крыжовника. В этом репозитории сабмодуль `third_party/kryzhovnik` зафиксирован на форке совместимости, который используется для интеграции с Hypericum и Shipovnik.

## Структура репозитория

```
Expand All @@ -42,7 +44,7 @@ batch-pqc/
├── third_party/ # git submodules
│ ├── shipovnik/ → https://github.com/QAPP-tech/shipovnik_tc26
│ ├── hypericum/ → https://github.com/QAPP-tech/hypericum_tc26
│ ├── kryzhovnik/ → https://github.com/ElenaKirshanova/pqc_LWR_signature
│ ├── kryzhovnik/ → https://github.com/cherninkiy/kryzhovnik-wrapper-tc26
│ └── iaik_merkle_tree/ → https://github.com/IAIK/merkle-tree
├── src/
│ ├── hash/ # провайдер хешей (Стрибог из hypericum, SHA-256 как запасной)
Expand Down Expand Up @@ -73,16 +75,18 @@ batch-pqc/
git clone --recursive https://github.com/cherninkiy/batch-pqc.git
cd batch-pqc

# Сборка
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
# Синхронизация URL сабмодулей после обновления .gitmodules
git submodule sync --recursive
git submodule update --init --recursive

# Сборка сторонних зависимостей и тестов
./scripts/third_party.sh build

# Запуск тестов
ctest --output-on-failure
./scripts/third_party.sh tests

# Запуск бенчмарков (последовательная vs пакетная)
./bench/bench_batch --algo hypericum --batch-size 16 --iterations 100
./build/bench/bench_batch --algo hypericum --batch-size 16 --iterations 100
```

### Ожидаемые результаты (после MVP)
Expand Down Expand Up @@ -127,7 +131,8 @@ ctest --output-on-failure

- [IAIK/merkle-tree](https://github.com/IAIK/merkle-tree) – реализация дерева Меркла (public domain / BSD‑like)
- [QAPP-tech](https://github.com/QAPP-tech) – подписи Шиповник и Гиперикум (включая хеш Стрибог)
- [Elena Kirshanova](https://github.com/ElenaKirshanova) – подпись Крыжовник (на решётках)
- [Elena Kirshanova](https://github.com/ElenaKirshanova) – оригинальная реализация Крыжовника: [pqc_LWR_signature](https://github.com/ElenaKirshanova/pqc_LWR_signature)
- В этом проекте используется форк совместимости для интеграции Крыжовника с Гиперикум и Шиповник

---

Expand Down
98 changes: 98 additions & 0 deletions scripts/third_party.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/bin/bash
# Script for managing third_party dependencies: install, build, test, clean
set -e



## Usage: ./third_party.sh [install|build|tests|all|clear|rebuild|help]
#
# install - install dependencies and initialize submodules
# build - build all third_party
# tests - run all tests (CTest and manual)
# clear - remove build directory
# rebuild - clear and build
# all - full cycle: install, build, tests (default)
# help - show this help message
ACTION="${1:-all}"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
BUILD_DIR="$SCRIPT_DIR/../build"
do_clear() {
echo "[clear] Removing build directory..."
rm -rf "$BUILD_DIR"
}

do_rebuild() {
do_clear
do_build
}

do_install() {
echo "[1/3] Installing dependencies..."
sudo apt-get update
sudo apt-get install -y cmake build-essential pkg-config libssl-dev libcppunit-dev libntl-dev
echo "[2/3] Initializing/updating git submodules..."
git submodule sync --recursive
git submodule update --init --recursive
}

do_build() {
echo "[3/3] Building all third_party..."
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
cmake -S "$PROJECT_ROOT" -B "$BUILD_DIR"
cmake --build "$BUILD_DIR" --parallel
}

do_tests() {
echo "[4/4] Running tests..."
cd "$BUILD_DIR"
ctest --output-on-failure || true
if [ -x third_party/shipovnik_example ]; then
echo "Running shipovnik_example..."
./third_party/shipovnik_example
fi
if [ -x third_party/hypericum_example ]; then
echo "Running hypericum_example..."
./third_party/hypericum_example
fi
if [ -x third_party/PQCgenKAT_sign ]; then
echo "Running PQCgenKAT_sign..."
./third_party/PQCgenKAT_sign
fi
if [ -x third_party/kryzhovnik_test ]; then
echo "Running kryzhovnik_test..."
./third_party/kryzhovnik_test
fi
}


case "$ACTION" in
install)
do_install
;;
build)
do_build
;;
tests)
do_tests
;;
clear)
do_clear
;;
rebuild)
do_rebuild
;;
all)
do_install
do_build
do_tests
;;
help)
grep '^#' "$0" | sed 's/^# \{0,1\}//'
exit 0
;;
*)
echo "Usage: $0 [install|build|tests|all|clear|rebuild|help]"
exit 1
;;
esac

Loading
Loading