puantum 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ Cargo.lock
2
+ target/
@@ -0,0 +1,473 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "aho-corasick"
7
+ version = "1.1.3"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
10
+ dependencies = [
11
+ "memchr",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "autocfg"
16
+ version = "1.5.0"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
19
+
20
+ [[package]]
21
+ name = "bindgen"
22
+ version = "0.71.1"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3"
25
+ dependencies = [
26
+ "bitflags",
27
+ "cexpr",
28
+ "clang-sys",
29
+ "itertools",
30
+ "log",
31
+ "prettyplease",
32
+ "proc-macro2",
33
+ "quote",
34
+ "regex",
35
+ "rustc-hash",
36
+ "shlex",
37
+ "syn",
38
+ ]
39
+
40
+ [[package]]
41
+ name = "bitflags"
42
+ version = "2.9.1"
43
+ source = "registry+https://github.com/rust-lang/crates.io-index"
44
+ checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
45
+
46
+ [[package]]
47
+ name = "build-deps"
48
+ version = "0.1.4"
49
+ source = "registry+https://github.com/rust-lang/crates.io-index"
50
+ checksum = "64f14468960818ce4f3e3553c32d524446687884f8e7af5d3e252331d8a87e43"
51
+ dependencies = [
52
+ "glob",
53
+ ]
54
+
55
+ [[package]]
56
+ name = "cc"
57
+ version = "1.2.27"
58
+ source = "registry+https://github.com/rust-lang/crates.io-index"
59
+ checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc"
60
+ dependencies = [
61
+ "shlex",
62
+ ]
63
+
64
+ [[package]]
65
+ name = "cexpr"
66
+ version = "0.6.0"
67
+ source = "registry+https://github.com/rust-lang/crates.io-index"
68
+ checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
69
+ dependencies = [
70
+ "nom",
71
+ ]
72
+
73
+ [[package]]
74
+ name = "cfg-if"
75
+ version = "1.0.1"
76
+ source = "registry+https://github.com/rust-lang/crates.io-index"
77
+ checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
78
+
79
+ [[package]]
80
+ name = "clang-sys"
81
+ version = "1.8.1"
82
+ source = "registry+https://github.com/rust-lang/crates.io-index"
83
+ checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
84
+ dependencies = [
85
+ "glob",
86
+ "libc",
87
+ "libloading",
88
+ ]
89
+
90
+ [[package]]
91
+ name = "cmake"
92
+ version = "0.1.54"
93
+ source = "registry+https://github.com/rust-lang/crates.io-index"
94
+ checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0"
95
+ dependencies = [
96
+ "cc",
97
+ ]
98
+
99
+ [[package]]
100
+ name = "cstr_core"
101
+ version = "0.2.6"
102
+ source = "registry+https://github.com/rust-lang/crates.io-index"
103
+ checksum = "dd98742e4fdca832d40cab219dc2e3048de17d873248f83f17df47c1bea70956"
104
+ dependencies = [
105
+ "cty",
106
+ "memchr",
107
+ ]
108
+
109
+ [[package]]
110
+ name = "cty"
111
+ version = "0.2.2"
112
+ source = "registry+https://github.com/rust-lang/crates.io-index"
113
+ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
114
+
115
+ [[package]]
116
+ name = "either"
117
+ version = "1.15.0"
118
+ source = "registry+https://github.com/rust-lang/crates.io-index"
119
+ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
120
+
121
+ [[package]]
122
+ name = "glob"
123
+ version = "0.3.2"
124
+ source = "registry+https://github.com/rust-lang/crates.io-index"
125
+ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
126
+
127
+ [[package]]
128
+ name = "heck"
129
+ version = "0.5.0"
130
+ source = "registry+https://github.com/rust-lang/crates.io-index"
131
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
132
+
133
+ [[package]]
134
+ name = "indoc"
135
+ version = "2.0.6"
136
+ source = "registry+https://github.com/rust-lang/crates.io-index"
137
+ checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd"
138
+
139
+ [[package]]
140
+ name = "itertools"
141
+ version = "0.13.0"
142
+ source = "registry+https://github.com/rust-lang/crates.io-index"
143
+ checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
144
+ dependencies = [
145
+ "either",
146
+ ]
147
+
148
+ [[package]]
149
+ name = "libc"
150
+ version = "0.2.174"
151
+ source = "registry+https://github.com/rust-lang/crates.io-index"
152
+ checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
153
+
154
+ [[package]]
155
+ name = "libloading"
156
+ version = "0.8.8"
157
+ source = "registry+https://github.com/rust-lang/crates.io-index"
158
+ checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
159
+ dependencies = [
160
+ "cfg-if",
161
+ "windows-targets",
162
+ ]
163
+
164
+ [[package]]
165
+ name = "log"
166
+ version = "0.4.27"
167
+ source = "registry+https://github.com/rust-lang/crates.io-index"
168
+ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
169
+
170
+ [[package]]
171
+ name = "memchr"
172
+ version = "2.7.5"
173
+ source = "registry+https://github.com/rust-lang/crates.io-index"
174
+ checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
175
+
176
+ [[package]]
177
+ name = "memoffset"
178
+ version = "0.9.1"
179
+ source = "registry+https://github.com/rust-lang/crates.io-index"
180
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
181
+ dependencies = [
182
+ "autocfg",
183
+ ]
184
+
185
+ [[package]]
186
+ name = "minimal-lexical"
187
+ version = "0.2.1"
188
+ source = "registry+https://github.com/rust-lang/crates.io-index"
189
+ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
190
+
191
+ [[package]]
192
+ name = "nom"
193
+ version = "7.1.3"
194
+ source = "registry+https://github.com/rust-lang/crates.io-index"
195
+ checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
196
+ dependencies = [
197
+ "memchr",
198
+ "minimal-lexical",
199
+ ]
200
+
201
+ [[package]]
202
+ name = "once_cell"
203
+ version = "1.21.3"
204
+ source = "registry+https://github.com/rust-lang/crates.io-index"
205
+ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
206
+
207
+ [[package]]
208
+ name = "oqs"
209
+ version = "0.11.0"
210
+ source = "registry+https://github.com/rust-lang/crates.io-index"
211
+ checksum = "48caac02cf42ba00b865a747e332828a75341d97ae35ad1ae9785e56de212e78"
212
+ dependencies = [
213
+ "cstr_core",
214
+ "libc",
215
+ "oqs-sys",
216
+ ]
217
+
218
+ [[package]]
219
+ name = "oqs-sys"
220
+ version = "0.11.0+liboqs-0.13.0"
221
+ source = "registry+https://github.com/rust-lang/crates.io-index"
222
+ checksum = "ac6d66ee528a895ce5cc08851698d109c5d7ee5d7a0b3b40d61550eda91e414f"
223
+ dependencies = [
224
+ "bindgen",
225
+ "build-deps",
226
+ "cmake",
227
+ "libc",
228
+ "pkg-config",
229
+ ]
230
+
231
+ [[package]]
232
+ name = "pkg-config"
233
+ version = "0.3.32"
234
+ source = "registry+https://github.com/rust-lang/crates.io-index"
235
+ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
236
+
237
+ [[package]]
238
+ name = "portable-atomic"
239
+ version = "1.11.1"
240
+ source = "registry+https://github.com/rust-lang/crates.io-index"
241
+ checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
242
+
243
+ [[package]]
244
+ name = "prettyplease"
245
+ version = "0.2.35"
246
+ source = "registry+https://github.com/rust-lang/crates.io-index"
247
+ checksum = "061c1221631e079b26479d25bbf2275bfe5917ae8419cd7e34f13bfc2aa7539a"
248
+ dependencies = [
249
+ "proc-macro2",
250
+ "syn",
251
+ ]
252
+
253
+ [[package]]
254
+ name = "proc-macro2"
255
+ version = "1.0.95"
256
+ source = "registry+https://github.com/rust-lang/crates.io-index"
257
+ checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
258
+ dependencies = [
259
+ "unicode-ident",
260
+ ]
261
+
262
+ [[package]]
263
+ name = "puantum"
264
+ version = "1.0.0"
265
+ dependencies = [
266
+ "oqs",
267
+ "pyo3",
268
+ ]
269
+
270
+ [[package]]
271
+ name = "pyo3"
272
+ version = "0.25.1"
273
+ source = "registry+https://github.com/rust-lang/crates.io-index"
274
+ checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a"
275
+ dependencies = [
276
+ "indoc",
277
+ "libc",
278
+ "memoffset",
279
+ "once_cell",
280
+ "portable-atomic",
281
+ "pyo3-build-config",
282
+ "pyo3-ffi",
283
+ "pyo3-macros",
284
+ "unindent",
285
+ ]
286
+
287
+ [[package]]
288
+ name = "pyo3-build-config"
289
+ version = "0.25.1"
290
+ source = "registry+https://github.com/rust-lang/crates.io-index"
291
+ checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598"
292
+ dependencies = [
293
+ "once_cell",
294
+ "target-lexicon",
295
+ ]
296
+
297
+ [[package]]
298
+ name = "pyo3-ffi"
299
+ version = "0.25.1"
300
+ source = "registry+https://github.com/rust-lang/crates.io-index"
301
+ checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c"
302
+ dependencies = [
303
+ "libc",
304
+ "pyo3-build-config",
305
+ ]
306
+
307
+ [[package]]
308
+ name = "pyo3-macros"
309
+ version = "0.25.1"
310
+ source = "registry+https://github.com/rust-lang/crates.io-index"
311
+ checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50"
312
+ dependencies = [
313
+ "proc-macro2",
314
+ "pyo3-macros-backend",
315
+ "quote",
316
+ "syn",
317
+ ]
318
+
319
+ [[package]]
320
+ name = "pyo3-macros-backend"
321
+ version = "0.25.1"
322
+ source = "registry+https://github.com/rust-lang/crates.io-index"
323
+ checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc"
324
+ dependencies = [
325
+ "heck",
326
+ "proc-macro2",
327
+ "pyo3-build-config",
328
+ "quote",
329
+ "syn",
330
+ ]
331
+
332
+ [[package]]
333
+ name = "quote"
334
+ version = "1.0.40"
335
+ source = "registry+https://github.com/rust-lang/crates.io-index"
336
+ checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
337
+ dependencies = [
338
+ "proc-macro2",
339
+ ]
340
+
341
+ [[package]]
342
+ name = "regex"
343
+ version = "1.11.1"
344
+ source = "registry+https://github.com/rust-lang/crates.io-index"
345
+ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
346
+ dependencies = [
347
+ "aho-corasick",
348
+ "memchr",
349
+ "regex-automata",
350
+ "regex-syntax",
351
+ ]
352
+
353
+ [[package]]
354
+ name = "regex-automata"
355
+ version = "0.4.9"
356
+ source = "registry+https://github.com/rust-lang/crates.io-index"
357
+ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
358
+ dependencies = [
359
+ "aho-corasick",
360
+ "memchr",
361
+ "regex-syntax",
362
+ ]
363
+
364
+ [[package]]
365
+ name = "regex-syntax"
366
+ version = "0.8.5"
367
+ source = "registry+https://github.com/rust-lang/crates.io-index"
368
+ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
369
+
370
+ [[package]]
371
+ name = "rustc-hash"
372
+ version = "2.1.1"
373
+ source = "registry+https://github.com/rust-lang/crates.io-index"
374
+ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
375
+
376
+ [[package]]
377
+ name = "shlex"
378
+ version = "1.3.0"
379
+ source = "registry+https://github.com/rust-lang/crates.io-index"
380
+ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
381
+
382
+ [[package]]
383
+ name = "syn"
384
+ version = "2.0.104"
385
+ source = "registry+https://github.com/rust-lang/crates.io-index"
386
+ checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
387
+ dependencies = [
388
+ "proc-macro2",
389
+ "quote",
390
+ "unicode-ident",
391
+ ]
392
+
393
+ [[package]]
394
+ name = "target-lexicon"
395
+ version = "0.13.2"
396
+ source = "registry+https://github.com/rust-lang/crates.io-index"
397
+ checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a"
398
+
399
+ [[package]]
400
+ name = "unicode-ident"
401
+ version = "1.0.18"
402
+ source = "registry+https://github.com/rust-lang/crates.io-index"
403
+ checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
404
+
405
+ [[package]]
406
+ name = "unindent"
407
+ version = "0.2.4"
408
+ source = "registry+https://github.com/rust-lang/crates.io-index"
409
+ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
410
+
411
+ [[package]]
412
+ name = "windows-targets"
413
+ version = "0.53.2"
414
+ source = "registry+https://github.com/rust-lang/crates.io-index"
415
+ checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef"
416
+ dependencies = [
417
+ "windows_aarch64_gnullvm",
418
+ "windows_aarch64_msvc",
419
+ "windows_i686_gnu",
420
+ "windows_i686_gnullvm",
421
+ "windows_i686_msvc",
422
+ "windows_x86_64_gnu",
423
+ "windows_x86_64_gnullvm",
424
+ "windows_x86_64_msvc",
425
+ ]
426
+
427
+ [[package]]
428
+ name = "windows_aarch64_gnullvm"
429
+ version = "0.53.0"
430
+ source = "registry+https://github.com/rust-lang/crates.io-index"
431
+ checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
432
+
433
+ [[package]]
434
+ name = "windows_aarch64_msvc"
435
+ version = "0.53.0"
436
+ source = "registry+https://github.com/rust-lang/crates.io-index"
437
+ checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
438
+
439
+ [[package]]
440
+ name = "windows_i686_gnu"
441
+ version = "0.53.0"
442
+ source = "registry+https://github.com/rust-lang/crates.io-index"
443
+ checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
444
+
445
+ [[package]]
446
+ name = "windows_i686_gnullvm"
447
+ version = "0.53.0"
448
+ source = "registry+https://github.com/rust-lang/crates.io-index"
449
+ checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
450
+
451
+ [[package]]
452
+ name = "windows_i686_msvc"
453
+ version = "0.53.0"
454
+ source = "registry+https://github.com/rust-lang/crates.io-index"
455
+ checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
456
+
457
+ [[package]]
458
+ name = "windows_x86_64_gnu"
459
+ version = "0.53.0"
460
+ source = "registry+https://github.com/rust-lang/crates.io-index"
461
+ checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
462
+
463
+ [[package]]
464
+ name = "windows_x86_64_gnullvm"
465
+ version = "0.53.0"
466
+ source = "registry+https://github.com/rust-lang/crates.io-index"
467
+ checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
468
+
469
+ [[package]]
470
+ name = "windows_x86_64_msvc"
471
+ version = "0.53.0"
472
+ source = "registry+https://github.com/rust-lang/crates.io-index"
473
+ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
@@ -0,0 +1,12 @@
1
+ [package]
2
+ name = "puantum"
3
+ version = "1.0.0"
4
+ edition = "2024"
5
+
6
+ [lib]
7
+ crate-type = ["cdylib"]
8
+ path = "rust/python.rs"
9
+
10
+ [dependencies]
11
+ oqs = { version = "0.11.0", features = ["sigs", "kems"], default-features = false }
12
+ pyo3 = { version = "0.25.1", features = ["extension-module"] }
puantum-1.0.0/Makefile ADDED
@@ -0,0 +1,7 @@
1
+ # Makefile
2
+ release:
3
+ cargo clean
4
+ cargo build --release
5
+
6
+ python:
7
+ maturin build --release
puantum-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,63 @@
1
+ Metadata-Version: 2.4
2
+ Name: puantum
3
+ Version: 1.0.0
4
+ Classifier: Programming Language :: Python :: 3
5
+ Classifier: Programming Language :: Rust
6
+ Classifier: Operating System :: OS Independent
7
+ Classifier: License :: Public Domain
8
+ Classifier: License :: OSI Approved :: The Unlicense (Unlicense)
9
+ Summary: Python Cryptography
10
+ Keywords: python,cryptography,quantum,security
11
+ Author-email: Anonymous <no@thanks.com>
12
+ License: Unlicense
13
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
14
+
15
+ # 🔐 Python Cryptography
16
+
17
+ A blazing-fast cryptography library for Python, built on Rust.
18
+
19
+ Puantum supports an extensive set of **post-quantum** key encapsulation mechanisms (KEM) and digital signature algorithms (DSA), and will soon support **classic cryptography** as well.
20
+
21
+ ---
22
+ ## ⚡ Features
23
+ - ✅ Dozens of NIST PQC candidates
24
+ - 🦀 Rust core for speed and safety
25
+ - 📦 Easy installation via [`pip`](https://pip.pypa.io)
26
+ ---
27
+
28
+ ### 🧬 Supported Algorithms
29
+
30
+ ### 🛡️ KEM
31
+ - #### Bike
32
+ - #### ClassicMcEliece
33
+ - #### Hqc
34
+ - #### Kyber
35
+ - #### MLKEM
36
+ - #### NtruPrime
37
+ - #### FrodoKem
38
+
39
+ ### ✍️ DSA
40
+ - #### Cross
41
+ - #### Dilithium
42
+ - #### Falcon
43
+ - #### Mayo
44
+ - #### MLDSA
45
+ - #### Sphincs
46
+ - #### Uov
47
+
48
+ ### 🚧 Coming Soon
49
+ - #### AES, ChaCha20, XChaCha20
50
+ - #### RSA, EC
51
+ - #### Argon2, Bcrypt
52
+
53
+ ### 📦 Install
54
+ ```shell
55
+ pip install puantum
56
+ ```
57
+ #### or from source:
58
+ ```shell
59
+ make python
60
+ ```
61
+
62
+ ### 🥳 Enjoy!
63
+
@@ -0,0 +1,23 @@
1
+ # IMPORT
2
+ from puantum.quantum.dsa import Algorithm, KeyPair
3
+
4
+ # MAIN
5
+ def main():
6
+ # Step 1: Generate a digital signature key pair for Alice
7
+ # - alicesk: Alice's private signing key
8
+ # - alicepk: Alice's public key (used for verification)
9
+ alicesk, alicepk = KeyPair(Algorithm.MLDSA.MLDSA87)
10
+ # Step 2: Define the message to be signed
11
+ msg = "Hello".encode() # Convert the string to bytes, as cryptographic functions work with bytes
12
+ # Step 3: Sign the message using Alice's private key
13
+ sig = alicesk.sign(msg)
14
+ # Step 4: Verify the signature using Alice's public key
15
+ valid = alicepk.verify(sig, msg)
16
+ # Step 5: Display the result
17
+ print(f"Message : {msg.decode()}")
18
+ print(f"Signature valid? : {valid}")
19
+ # Optional: raise an error if the signature fails (useful in tests)
20
+ assert valid, "Signature verification failed!"
21
+
22
+ if __name__ == "__main__":
23
+ main()
@@ -0,0 +1,21 @@
1
+ # IMPORT
2
+ from puantum.quantum.kem import Algorithm, KeyPair
3
+
4
+ # MAIN
5
+ def main():
6
+ # Generate Alice's KEM keypair (secret and public keys)
7
+ alicesk, alicepk = KeyPair(Algorithm.MLKEM.MLKEM1024)
8
+ # Generate Bob's KEM keypair (optional here unless Bob also receives messages)
9
+ _bobsk, _bobpk = KeyPair(Algorithm.MLKEM.MLKEM1024)
10
+ # Bob uses Alice's public key to encapsulate a shared secret and a ciphertext
11
+ bob_shared_secret, ciphertext = alicepk.encapsulate()
12
+ # Alice decapsulates the ciphertext from bob to derive the same shared secret
13
+ alice_shared_secret = alicesk.decapsulate(ciphertext)
14
+ # Print shared secrets in hex format
15
+ print(f"Alice's Shared Secret : [{alice_shared_secret.sharedsecret.hex()}]")
16
+ print(f"Bob's Shared Secret : [{bob_shared_secret.sharedsecret.hex()}]")
17
+ # Optional check
18
+ assert alice_shared_secret.sharedsecret == bob_shared_secret.sharedsecret, "Shared secrets do not match!"
19
+
20
+ if __name__ == "__main__":
21
+ main()
puantum-1.0.0/license ADDED
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <https://unlicense.org/>
@@ -0,0 +1 @@
1
+ # EMPTY
@@ -0,0 +1,2 @@
1
+ # MAIN
2
+ raise NotImplementedError()
@@ -0,0 +1 @@
1
+ # EMPTY
@@ -0,0 +1,5 @@
1
+ # IMPORT
2
+ from puantum.quantum.dsa.__internal__ import Algorithm, KeyPair
3
+
4
+ # MAIN
5
+ __all__: list[str] = ["Algorithm", "KeyPair"]