puantum 1.0.0.0__cp313-cp313-win_amd64.whl
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.
- puantum/__init__.py +1 -0
- puantum/__init__.pyi +1 -0
- puantum/__internal__.cp313-win_amd64.pyd +0 -0
- puantum/classic/__init__.py +2 -0
- puantum/classic/__init__.pyi +1 -0
- puantum/quantum/__init__.py +1 -0
- puantum/quantum/__init__.pyi +1 -0
- puantum/quantum/dsa/__init__.py +5 -0
- puantum/quantum/dsa/__init__.pyi +5 -0
- puantum/quantum/dsa/__internal__.py +550 -0
- puantum/quantum/dsa/__internal__.pyi +388 -0
- puantum/quantum/kem/__init__.py +5 -0
- puantum/quantum/kem/__init__.pyi +5 -0
- puantum/quantum/kem/__internal__.py +526 -0
- puantum/quantum/kem/__internal__.pyi +363 -0
- puantum-1.0.0.0.dist-info/METADATA +100 -0
- puantum-1.0.0.0.dist-info/RECORD +19 -0
- puantum-1.0.0.0.dist-info/WHEEL +4 -0
- puantum-1.0.0.0.dist-info/licenses/license.md +24 -0
@@ -0,0 +1,388 @@
|
|
1
|
+
# IMPORT
|
2
|
+
import typing as _typing
|
3
|
+
import enum as _enum
|
4
|
+
|
5
|
+
# MAIN
|
6
|
+
class Algorithm:
|
7
|
+
class CROSS(_enum.Enum):
|
8
|
+
CROSSR128B = ...
|
9
|
+
CROSSR128F = ...
|
10
|
+
CROSSR128S = ...
|
11
|
+
CROSSR192B = ...
|
12
|
+
CROSSR192F = ...
|
13
|
+
CROSSR192S = ...
|
14
|
+
CROSSR256B = ...
|
15
|
+
CROSSR256F = ...
|
16
|
+
CROSSR256S = ...
|
17
|
+
CROSSRG128B = ...
|
18
|
+
CROSSRG128F = ...
|
19
|
+
CROSSRG128S = ...
|
20
|
+
CROSSRG192B = ...
|
21
|
+
CROSSRG192F = ...
|
22
|
+
CROSSRG192S = ...
|
23
|
+
CROSSRG256B = ...
|
24
|
+
CROSSRG256F = ...
|
25
|
+
CROSSRG256S = ...
|
26
|
+
#
|
27
|
+
class DILITHIUM(_enum.Enum):
|
28
|
+
DILITHIUM2 = ...
|
29
|
+
DILITHIUM3 = ...
|
30
|
+
DILITHIUM5 = ...
|
31
|
+
#
|
32
|
+
class FALCON(_enum.Enum):
|
33
|
+
FALCON512 = ...
|
34
|
+
FALCON1024 = ...
|
35
|
+
#
|
36
|
+
class MAYO(_enum.Enum):
|
37
|
+
MAYO1 = ...
|
38
|
+
MAYO2 = ...
|
39
|
+
MAYO3 = ...
|
40
|
+
MAYO5 = ...
|
41
|
+
#
|
42
|
+
class MLDSA(_enum.Enum):
|
43
|
+
MLDSA44 = ...
|
44
|
+
MLDSA65 = ...
|
45
|
+
MLDSA87 = ...
|
46
|
+
#
|
47
|
+
class SPHINCS(_enum.Enum):
|
48
|
+
SHA2128F = ...
|
49
|
+
SHA2128S = ...
|
50
|
+
SHA2192F = ...
|
51
|
+
SHA2192S = ...
|
52
|
+
SHA2256F = ...
|
53
|
+
SHA2256S = ...
|
54
|
+
SHAKE128F = ...
|
55
|
+
SHAKE128S = ...
|
56
|
+
SHAKE192F = ...
|
57
|
+
SHAKE192S = ...
|
58
|
+
SHAKE256F = ...
|
59
|
+
SHAKE256S = ...
|
60
|
+
#
|
61
|
+
class UOV(_enum.Enum):
|
62
|
+
UOVOVIII = ...
|
63
|
+
UOVOVIIIPKC = ...
|
64
|
+
UOVOVIIIPKCSKC = ...
|
65
|
+
UOVOVIP = ...
|
66
|
+
UOVOVIPPKC = ...
|
67
|
+
UOVOVIPPKCSKC = ...
|
68
|
+
UOVOVIS = ...
|
69
|
+
UOVOVISPKC = ...
|
70
|
+
UOVOVISPKCSKC = ...
|
71
|
+
UOVOVV = ...
|
72
|
+
UOVOVVPKC = ...
|
73
|
+
UOVOVVPKCSKC = ...
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
class PublicKey:
|
78
|
+
def __init__(self, publickey: bytes) -> None:
|
79
|
+
...
|
80
|
+
#
|
81
|
+
def verify(self, signature: _typing.Any, message: _typing.Any) -> _typing.Any:
|
82
|
+
...
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
class CROSSPublicKey(PublicKey):
|
87
|
+
def __init__(self, name: Algorithm.CROSS, publickey: bytes) -> None:
|
88
|
+
...
|
89
|
+
#
|
90
|
+
def verify(self, signature: bytes, message: bytes) -> bool:
|
91
|
+
...
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
class DILITHIUMPublicKey(PublicKey):
|
96
|
+
def __init__(self, name: Algorithm.DILITHIUM, publickey: bytes) -> None:
|
97
|
+
...
|
98
|
+
#
|
99
|
+
def verify(self, signature: bytes, message: bytes) -> bool:
|
100
|
+
...
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
class FALCONPublicKey(PublicKey):
|
105
|
+
def __init__(self, name: Algorithm.FALCON, publickey: bytes) -> None:
|
106
|
+
...
|
107
|
+
#
|
108
|
+
def verify(self, signature: bytes, message: bytes) -> bool:
|
109
|
+
...
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
class MAYOPublicKey(PublicKey):
|
114
|
+
def __init__(self, name: Algorithm.MAYO, publickey: bytes) -> None:
|
115
|
+
...
|
116
|
+
#
|
117
|
+
def verify(self, signature: bytes, message: bytes) -> bool:
|
118
|
+
...
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
class MLDSAPublicKey(PublicKey):
|
123
|
+
def __init__(self, name: Algorithm.MLDSA, publickey: bytes) -> None:
|
124
|
+
...
|
125
|
+
#
|
126
|
+
def verify(self, signature: bytes, message: bytes) -> bool:
|
127
|
+
...
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
class SPHINCSPublicKey(PublicKey):
|
132
|
+
def __init__(self, name: Algorithm.SPHINCS, publickey: bytes) -> None:
|
133
|
+
...
|
134
|
+
#
|
135
|
+
def verify(self, signature: bytes, message: bytes) -> bool:
|
136
|
+
...
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
class UOVPublicKey(PublicKey):
|
141
|
+
def __init__(self, name: Algorithm.UOV, publickey: bytes) -> None:
|
142
|
+
...
|
143
|
+
#
|
144
|
+
def verify(self, signature: bytes, message: bytes) -> bool:
|
145
|
+
...
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
class SecretKey:
|
150
|
+
def __init__(self, secretkey: bytes) -> None:
|
151
|
+
...
|
152
|
+
#
|
153
|
+
def sign(self, message: _typing.Any) -> _typing.Any:
|
154
|
+
...
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
class CROSSSecretKey(SecretKey):
|
159
|
+
def __init__(self, name: Algorithm.CROSS, secretkey: bytes) -> None:
|
160
|
+
...
|
161
|
+
#
|
162
|
+
def sign(self, message: bytes) -> bytes:
|
163
|
+
...
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
class DILITHIUMSecretKey(SecretKey):
|
168
|
+
def __init__(self, name: Algorithm.DILITHIUM, secretkey: bytes) -> None:
|
169
|
+
...
|
170
|
+
#
|
171
|
+
def sign(self, message: bytes) -> bytes:
|
172
|
+
...
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
class FALCONSecretKey(SecretKey):
|
177
|
+
def __init__(self, name: Algorithm.FALCON, secretkey: bytes) -> None:
|
178
|
+
...
|
179
|
+
#
|
180
|
+
def sign(self, message: bytes) -> bytes:
|
181
|
+
...
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
class MAYOSecretKey(SecretKey):
|
186
|
+
def __init__(self, name: Algorithm.MAYO, secretkey: bytes) -> None:
|
187
|
+
...
|
188
|
+
#
|
189
|
+
def sign(self, message: bytes) -> bytes:
|
190
|
+
...
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
class MLDSASecretKey(SecretKey):
|
195
|
+
def __init__(self, name: Algorithm.MLDSA, secretkey: bytes) -> None:
|
196
|
+
...
|
197
|
+
#
|
198
|
+
def sign(self, message: bytes) -> bytes:
|
199
|
+
...
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
class SPHINCSSecretKey(SecretKey):
|
204
|
+
def __init__(self, name: Algorithm.SPHINCS, secretkey: bytes) -> None:
|
205
|
+
...
|
206
|
+
#
|
207
|
+
def sign(self, message: bytes) -> bytes:
|
208
|
+
...
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
class UOVSecretKey(SecretKey):
|
213
|
+
def __init__(self, name: Algorithm.UOV, secretkey: bytes) -> None:
|
214
|
+
...
|
215
|
+
#
|
216
|
+
def sign(self, message: bytes) -> bytes:
|
217
|
+
...
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
@_typing.overload
|
222
|
+
def KeyPair(
|
223
|
+
name: Algorithm,
|
224
|
+
*,
|
225
|
+
secretkey: bytes,
|
226
|
+
publickey: bytes
|
227
|
+
) -> tuple[SecretKey, PublicKey]:
|
228
|
+
...
|
229
|
+
@_typing.overload
|
230
|
+
def KeyPair(name: Algorithm, *, secretkey: bytes) -> SecretKey:
|
231
|
+
...
|
232
|
+
@_typing.overload
|
233
|
+
def KeyPair(name: Algorithm, *, publickey: bytes) -> PublicKey:
|
234
|
+
...
|
235
|
+
@_typing.overload
|
236
|
+
def KeyPair(name: Algorithm) -> tuple[SecretKey, PublicKey]:
|
237
|
+
...
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
@_typing.overload
|
242
|
+
def KeyPair(
|
243
|
+
name: Algorithm.CROSS,
|
244
|
+
*,
|
245
|
+
secretkey: bytes,
|
246
|
+
publickey: bytes
|
247
|
+
) -> tuple[CROSSSecretKey, CROSSPublicKey]:
|
248
|
+
...
|
249
|
+
@_typing.overload
|
250
|
+
def KeyPair(name: Algorithm.CROSS, *, secretkey: bytes) -> CROSSSecretKey:
|
251
|
+
...
|
252
|
+
@_typing.overload
|
253
|
+
def KeyPair(name: Algorithm.CROSS, *, publickey: bytes) -> CROSSPublicKey:
|
254
|
+
...
|
255
|
+
@_typing.overload
|
256
|
+
def KeyPair(name: Algorithm.CROSS) -> tuple[CROSSSecretKey, CROSSPublicKey]:
|
257
|
+
...
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
@_typing.overload
|
262
|
+
def KeyPair(
|
263
|
+
name: Algorithm.DILITHIUM,
|
264
|
+
*,
|
265
|
+
secretkey: bytes,
|
266
|
+
publickey: bytes
|
267
|
+
) -> tuple[DILITHIUMSecretKey, DILITHIUMPublicKey]:
|
268
|
+
...
|
269
|
+
@_typing.overload
|
270
|
+
def KeyPair(name: Algorithm.DILITHIUM, *, secretkey: bytes) -> DILITHIUMSecretKey:
|
271
|
+
...
|
272
|
+
@_typing.overload
|
273
|
+
def KeyPair(name: Algorithm.DILITHIUM, *, publickey: bytes) -> DILITHIUMPublicKey:
|
274
|
+
...
|
275
|
+
@_typing.overload
|
276
|
+
def KeyPair(name: Algorithm.DILITHIUM) -> tuple[DILITHIUMSecretKey, DILITHIUMPublicKey]:
|
277
|
+
...
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
@_typing.overload
|
282
|
+
def KeyPair(
|
283
|
+
name: Algorithm.FALCON,
|
284
|
+
*,
|
285
|
+
secretkey: bytes,
|
286
|
+
publickey: bytes
|
287
|
+
) -> tuple[FALCONSecretKey, FALCONPublicKey]:
|
288
|
+
...
|
289
|
+
@_typing.overload
|
290
|
+
def KeyPair(name: Algorithm.FALCON, *, secretkey: bytes) -> FALCONSecretKey:
|
291
|
+
...
|
292
|
+
@_typing.overload
|
293
|
+
def KeyPair(name: Algorithm.FALCON, *, publickey: bytes) -> FALCONPublicKey:
|
294
|
+
...
|
295
|
+
@_typing.overload
|
296
|
+
def KeyPair(name: Algorithm.FALCON) -> tuple[FALCONSecretKey, FALCONPublicKey]:
|
297
|
+
...
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
@_typing.overload
|
302
|
+
def KeyPair(
|
303
|
+
name: Algorithm.MAYO,
|
304
|
+
*,
|
305
|
+
secretkey: bytes,
|
306
|
+
publickey: bytes
|
307
|
+
) -> tuple[MAYOSecretKey, MAYOPublicKey]:
|
308
|
+
...
|
309
|
+
@_typing.overload
|
310
|
+
def KeyPair(name: Algorithm.MAYO, *, secretkey: bytes) -> MAYOSecretKey:
|
311
|
+
...
|
312
|
+
@_typing.overload
|
313
|
+
def KeyPair(name: Algorithm.MAYO, *, publickey: bytes) -> MAYOPublicKey:
|
314
|
+
...
|
315
|
+
@_typing.overload
|
316
|
+
def KeyPair(name: Algorithm.MAYO) -> tuple[MAYOSecretKey, MAYOPublicKey]:
|
317
|
+
...
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
@_typing.overload
|
322
|
+
def KeyPair(
|
323
|
+
name: Algorithm.MLDSA,
|
324
|
+
*,
|
325
|
+
secretkey: bytes,
|
326
|
+
publickey: bytes
|
327
|
+
) -> tuple[MLDSASecretKey, MLDSAPublicKey]:
|
328
|
+
...
|
329
|
+
@_typing.overload
|
330
|
+
def KeyPair(name: Algorithm.MLDSA, *, secretkey: bytes) -> MLDSASecretKey:
|
331
|
+
...
|
332
|
+
@_typing.overload
|
333
|
+
def KeyPair(name: Algorithm.MLDSA, *, publickey: bytes) -> MLDSAPublicKey:
|
334
|
+
...
|
335
|
+
@_typing.overload
|
336
|
+
def KeyPair(name: Algorithm.MLDSA) -> tuple[MLDSASecretKey, MLDSAPublicKey]:
|
337
|
+
...
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
@_typing.overload
|
342
|
+
def KeyPair(
|
343
|
+
name: Algorithm.SPHINCS,
|
344
|
+
*,
|
345
|
+
secretkey: bytes,
|
346
|
+
publickey: bytes
|
347
|
+
) -> tuple[SPHINCSSecretKey, SPHINCSPublicKey]:
|
348
|
+
...
|
349
|
+
@_typing.overload
|
350
|
+
def KeyPair(name: Algorithm.SPHINCS, *, secretkey: bytes) -> SPHINCSSecretKey:
|
351
|
+
...
|
352
|
+
@_typing.overload
|
353
|
+
def KeyPair(name: Algorithm.SPHINCS, *, publickey: bytes) -> SPHINCSPublicKey:
|
354
|
+
...
|
355
|
+
@_typing.overload
|
356
|
+
def KeyPair(name: Algorithm.SPHINCS) -> tuple[SPHINCSSecretKey, SPHINCSPublicKey]:
|
357
|
+
...
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
@_typing.overload
|
362
|
+
def KeyPair(
|
363
|
+
name: Algorithm.UOV,
|
364
|
+
*,
|
365
|
+
secretkey: bytes,
|
366
|
+
publickey: bytes
|
367
|
+
) -> tuple[UOVSecretKey, UOVPublicKey]:
|
368
|
+
...
|
369
|
+
@_typing.overload
|
370
|
+
def KeyPair(name: Algorithm.UOV, *, secretkey: bytes) -> UOVSecretKey:
|
371
|
+
...
|
372
|
+
@_typing.overload
|
373
|
+
def KeyPair(name: Algorithm.UOV, *, publickey: bytes) -> UOVPublicKey:
|
374
|
+
...
|
375
|
+
@_typing.overload
|
376
|
+
def KeyPair(name: Algorithm.UOV) -> tuple[UOVSecretKey, UOVPublicKey]:
|
377
|
+
...
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
Algorithms = Algorithm.CROSS | Algorithm.DILITHIUM | Algorithm.FALCON | Algorithm.MAYO | Algorithm.MLDSA | Algorithm.SPHINCS | Algorithm.UOV
|
382
|
+
def KeyPair(
|
383
|
+
name: Algorithm | Algorithms,
|
384
|
+
*,
|
385
|
+
secretkey: bytes | None = ...,
|
386
|
+
publickey: bytes | None = ...
|
387
|
+
) -> tuple[SecretKey, PublicKey] | SecretKey | PublicKey:
|
388
|
+
...
|