Skip to content

Commit 28958cf

Browse files
authored
Merge pull request #1143 from dyne/feat/zk-circuit-lang
ZK circuit development language (DSL) for Longfellow-ZK
2 parents 1107b8c + 81514d0 commit 28958cf

283 files changed

Lines changed: 41243 additions & 2306 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright 2017-2025 Dyne.org foundation
2-
# SPDX-FileCopyrightText: 2017-2025 Dyne.org foundation
1+
# Copyright 2017-2026 Dyne.org foundation
2+
# SPDX-FileCopyrightText: 2017-2026 Dyne.org foundation
33
#
44
# SPDX-License-Identifier: AGPL-3.0-or-later
55

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ clean:
123123
$(MAKE) clean -C ${pwd}/lib/pqclean
124124
$(MAKE) clean -C ${pwd}/lib/mlkem
125125
$(MAKE) clean -C ${pwd}/lib/longfellow-zk
126+
$(MAKE) clean -C ${pwd}/lib/zk-circuit-lang
126127
rm -rf ${pwd}/lib/milagro-crypto-c/build
127128
$(MAKE) clean -C ${pwd}/src
128129
if [ -d "bindings" ]; then $(MAKE) clean -C ${pwd}/bindings; fi

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ There are various build targets, just type make to have a list:
132132

133133
## License
134134

135-
Copyright (C) 2017-2025 Dyne.org foundation
135+
Copyright (C) 2017-2026 Dyne.org foundation
136136

137137
Designed and written by Denis "[Jaromil](https://jaromil.dyne.org)"
138138
Roio with the help of [Puria](https://github.com/puria) Nafisi Azizi

REUSE.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2025 Dyne.org foundation
1+
# SPDX-FileCopyrightText: 2026 Dyne.org foundation
22
#
33
# SPDX-License-Identifier: AGPL-3.0-or-later
44

@@ -19,7 +19,13 @@ path = [
1919
"compile_flags.txt"
2020
]
2121
precedence = "aggregate"
22-
SPDX-FileCopyrightText = "2017-2025 Dyne.org foundation"
22+
SPDX-FileCopyrightText = "2017-2026 Dyne.org foundation"
23+
SPDX-License-Identifier = "AGPL-3.0-or-later"
24+
25+
[[annotations]]
26+
path = ["lib/zk-circuit-lang/**"]
27+
precedence = "aggregate"
28+
SPDX-FileCopyrightText = "2025 Dyne.org foundation"
2329
SPDX-License-Identifier = "AGPL-3.0-or-later"
2430

2531
[[annotations]]

bindings/javascript/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ console.log(introspection); // => an object described as https://dev.zenroom.org
164164

165165
## 😍 Acknowledgements
166166

167-
Copyright (C) 2018-2025 by [Dyne.org](https://www.dyne.org) foundation, Amsterdam
167+
Copyright (C) 2018-2026 by [Dyne.org](https://www.dyne.org) foundation, Amsterdam
168168

169169
Designed, written and maintained by Puria Nafisi Azizi.
170170

@@ -190,7 +190,7 @@ Please first take a look at the [Dyne.org - Contributor License Agreement](CONTR
190190
## 💼 License
191191

192192
Zenroom js - a javascript wrapper of zenroom
193-
Copyright (c) 2018-2025 Dyne.org foundation, Amsterdam
193+
Copyright (c) 2018-2026 Dyne.org foundation, Amsterdam
194194

195195
This program is free software: you can redistribute it and/or modify
196196
it under the terms of the GNU Affero General Public License as

build/deps.mk

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ longfellow-zk:
6666
LDFLAGS="${ldflags}" \
6767
${MAKE} -C ${pwd}/lib/longfellow-zk
6868

69+
70+
zk-circuit-lang:
71+
$(info -- Building Longfellow ZK Circuit Lanuage bindings)
72+
CXX="${zk-circuit-lang_cxx}" \
73+
LD=${ld} \
74+
AR=${ar} \
75+
RANLIB=${ranlib} \
76+
CXXFLAGS="${zk-circuit-lang_cxxflags} ${cflags}" \
77+
LDFLAGS="${ldflags}" \
78+
${MAKE} -C ${pwd}/lib/zk-circuit-lang
79+
80+
6981
check-milagro: milagro
7082
CC=${cc} CFLAGS="${cflags}" $(MAKE) -C ${pwd}/lib/milagro-crypto-c test
7183

build/init.mk

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ ZEN_SOURCES := src/zenroom.o src/zen_error.o src/lua_functions.o \
1818

1919
ZEN_INCLUDES += -Isrc -Ilib/lua54/src -Ilib -I/usr/local/include \
2020
-Ilib/milagro-crypto-c/build/include -Ilib/milagro-crypto-c/include \
21-
-Ilib/ed25519-donna -Wall -Wextra
21+
-Ilib/ed25519-donna -Ilib/longfellow-zk -Wall -Wextra
2222

2323
BUILD_DEPS ?= apply-patches milagro lua54 embed-lua mlkem \
24-
quantum-proof ed25519-donna longfellow-zk zstd
24+
quantum-proof ed25519-donna longfellow-zk \
25+
zk-circuit-lang zstd
2526

2627
pwd := $(shell pwd)
2728
mil := ${pwd}/build/milagro
@@ -46,6 +47,7 @@ ldadd += ${pwd}/lib/mlkem/test/build/libmlkem.a
4647
# ldadd += /usr/local/lib/libmdoc.a
4748
ldadd += ${pwd}/lib/longfellow-zk/liblongfellow-zk.a
4849
ldadd += ${pwd}/lib/zstd/libzstd.a
50+
ldadd += ${pwd}/lib/zk-circuit-lang/libzk-circuit-lang.a
4951
ldadd += -lstdc++
5052

5153
# ----------------
@@ -119,6 +121,29 @@ ifeq ($(ARCH),armv7l)
119121
longfellow_cflags += -march=armv7-a -mfpu=neon
120122
endif
121123

124+
125+
#-----------------
126+
# zk circuit language settings
127+
zk-circuit-lang_cxx ?= ${cxx}
128+
zk-circuit-lang_cxxflags += -I ${pwd}/src -I. -I../zstd -fPIC -DLIBRARY
129+
zk-circuit-lang_cxxflags += -I ../lua54/src -I../longfellow-zk
130+
ARCH ?= $(shell uname -m)
131+
ifeq ($(shell uname -s),Darwin)
132+
zk-circuit-lang_cxxflags += -Xarch_x86_64 -mpclmul -Xarch_arm64 ""
133+
endif
134+
ifeq ($(ARCH),x86_64)
135+
zk-circuit-lang_cxxflags += -mpclmul
136+
endif
137+
ifeq ($(ARCH),i686)
138+
zk-circuit-lang_cxxflags += -mpclmul
139+
endif
140+
ifeq ($(ARCH),aarch64)
141+
zk-circuit-lang_cxxflags += -march=armv8-a+crypto
142+
endif
143+
ifeq ($(ARCH),armv7l)
144+
zk-circuit-lang_cxxflags += -march=armv7-a -mfpu=neon
145+
endif
146+
122147
#-----------------
123148
# zstd settings
124149
zstd_cc ?= ${cc}

build/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ endif
6060
## BATS tests in test/zencode
6161
if suite.contains('zencode')
6262
# excluded tests
63-
exclude = 'bindings_exec bindings_logfmt cookbook_hash_pdf ethereum rsa'
63+
exclude = 'bindings_exec bindings_logfmt cookbook_hash_pdf ethereum rsa longfellow'
6464
zencode_cmd = run_command(
6565
find_program('bash'),
6666
'-c',

build/plugins.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ed25519_cc := ${cc}
1010
lua_cc := ${cc}
1111
longfellow_cxx := ${cxx}
1212
zstd_cc := ${cc}
13+
zk-circuit-lang_cxx := ${cxx}
1314

1415
ifdef RELEASE
1516
cflags += -O3 ${cflags_protection}
@@ -35,4 +36,5 @@ ifdef CCACHE
3536
lua_cc := ccache ${cc}
3637
zstd_cc := ccache ${cc}
3738
longfellow_cxx := ccache ${cxx}
39+
zk-circuit-lang_cxx := ccache ${cxx}
3840
endif

build/wasm.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ zenroom_cc := ${cc}
2424
zstd_cc := ${cc}
2525
longfellow_cxx := ${cxx}
2626
longfellow_cflags := -I ${pwd}/src -I. -I../zstd -fPIC -DLIBRARY -msimd128
27+
zk-circuit-lang_cxxflags := -I ${pwd}/src -I. -I../zstd -fPIC -DLIBRARY -msimd128 -I ../lua54/src -I../longfellow-zk
2728

2829
system := Javascript
2930
ld_emsdk_settings := -I ${EMSCRIPTEN}/system/include/libc -DLIBRARY

0 commit comments

Comments
 (0)