- Add #ifndef guard for ZKP_MAX_N in zkp_types.h to allow command-line override - Copy OpenWrt Makefile to package root for proper feed detection - Fix RPCD luci.zkp CLI flags: -r for ratio, -o for output prefix - Add temp directory handling for keygen file generation Tested on MochaBin router: - zkp_keygen: generates graph + key pair - zkp_prover: creates NIZK proof - zkp_verifier: validates proof → ACCEPT Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
62 lines
1.7 KiB
Makefile
62 lines
1.7 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
# Copyright (C) 2026 CyberMind.FR / SecuBox
|
|
#
|
|
# OpenWrt package for ZKP Hamiltonian library
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=zkp-hamiltonian
|
|
PKG_VERSION:=1.0.0
|
|
PKG_RELEASE:=1
|
|
PKG_LICENSE:=GPL-2.0-or-later
|
|
PKG_MAINTAINER:=SecuBox <contact@secubox.fr>
|
|
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
|
PKG_BUILD_PARALLEL:=1
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
include $(INCLUDE_DIR)/cmake.mk
|
|
|
|
define Package/zkp-hamiltonian
|
|
SECTION:=utils
|
|
CATEGORY:=Utilities
|
|
SUBMENU:=Encryption
|
|
TITLE:=Zero-Knowledge Proof Hamiltonian Library
|
|
DEPENDS:=+libopenssl
|
|
URL:=https://github.com/gkerma/secubox-openwrt
|
|
endef
|
|
|
|
define Package/zkp-hamiltonian/description
|
|
Zero-Knowledge Proof library based on the Hamiltonian Cycle problem.
|
|
Implements the Blum 1986 protocol with Fiat-Shamir NIZK transformation.
|
|
Uses SHA3-256 for commitments and provides CLI tools for proof generation
|
|
and verification.
|
|
endef
|
|
|
|
CMAKE_OPTIONS += \
|
|
-DOPENWRT_BUILD=ON \
|
|
-DBUILD_TESTS=OFF \
|
|
-DBUILD_TOOLS=ON \
|
|
-DBUILD_SHARED_LIBS=OFF \
|
|
-DUSE_LIBSODIUM=OFF \
|
|
-DZKP_MAX_N=50
|
|
|
|
define Build/Prepare
|
|
mkdir -p $(PKG_BUILD_DIR)
|
|
$(CP) $(CURDIR)/src $(PKG_BUILD_DIR)/
|
|
$(CP) $(CURDIR)/include $(PKG_BUILD_DIR)/
|
|
$(CP) $(CURDIR)/tools $(PKG_BUILD_DIR)/
|
|
$(CP) $(CURDIR)/CMakeLists.txt $(PKG_BUILD_DIR)/
|
|
endef
|
|
|
|
define Package/zkp-hamiltonian/install
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/zkp_keygen $(1)/usr/bin/
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/zkp_prover $(1)/usr/bin/
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/zkp_verifier $(1)/usr/bin/
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
|
$(CP) $(PKG_BUILD_DIR)/libzkp_hamiltonian.a $(1)/usr/lib/
|
|
endef
|
|
|
|
$(eval $(call BuildPackage,zkp-hamiltonian))
|