You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your library has a FIPS-202[^FIPS202] implementation, you can use it instead of the one shipped with mldsa-native.
6
+
7
+
1. Replace `mldsa/fips202/*` by your own FIPS-202 implementation.
8
+
2. Provide replacements for the headers [`mldsa/fips202/fips202.h`](mldsa/fips202/fips202.h) and [`mldsa/fips202/fips202x4.h`](mldsa/fips202/fips202x4.h) and the
9
+
functionalities specified therein:
10
+
* Structure definitions for `mld_shake128ctx`, `mld_shake256ctx`, `mld_shake128x4ctx`, and `mld_shake256x4ctx`
11
+
*`mld_shake128_init()`: Initialize a SHAKE-128 context
12
+
*`mld_shake128_absorb()`: Absorb data into a SHAKE-128 context (can be called multiple times)
13
+
*`mld_shake128_finalize()`: Finalize the absorb phase of a SHAKE-128 context
14
+
*`mld_shake128_squeeze()`: Squeeze data from a SHAKE-128 context (can be called multiple times)
15
+
*`mld_shake128_release()`: Release and securely zero a SHAKE-128 context after use
16
+
*`mld_shake256_init()`: Initialize a SHAKE-256 context
17
+
*`mld_shake256_absorb()`: Absorb data into a SHAKE-256 context (can be called multiple times)
18
+
*`mld_shake256_finalize()`: Finalize the absorb phase of a SHAKE-256 context
19
+
*`mld_shake256_squeeze()`: Squeeze data from a SHAKE-256 context (can be called multiple times)
20
+
*`mld_shake256_release()`: Release and securely zero a SHAKE-256 context after use
21
+
*`mld_shake256()`: One-shot SHAKE-256 operation
22
+
*`mld_shake128x4_init()`: Initialize a 4x-batched SHAKE-128 context
23
+
*`mld_shake128x4_absorb_once()`: Initialize and absorb into a 4x-batched SHAKE-128 context in one step
24
+
*`mld_shake128x4_squeezeblocks()`: Squeeze blocks from a 4x-batched SHAKE-128 context
25
+
*`mld_shake128x4_release()`: Release a 4x-batched SHAKE-128 context after use
26
+
*`mld_shake256x4_init()`: Initialize a 4x-batched SHAKE-256 context
27
+
*`mld_shake256x4_absorb_once()`: Initialize and absorb into a 4x-batched SHAKE-256 context in one step
28
+
*`mld_shake256x4_squeezeblocks()`: Squeeze blocks from a 4x-batched SHAKE-256 context
29
+
*`mld_shake256x4_release()`: Release a 4x-batched SHAKE-256 context after use
30
+
31
+
See [`mldsa/fips202/fips202.h`](mldsa/fips202/fips202.h) and [`mldsa/fips202/fips202x4.h`](mldsa/fips202/fips202x4.h) for more details. Note that the structure
32
+
definitions may differ from those shipped with mldsa-native.
33
+
34
+
## Example
35
+
36
+
See [`examples/bring_your_own_fips202/`](examples/bring_your_own_fips202/) for an example how to use a custom FIPS-202
37
+
implementation with tiny_sha3[^tiny_sha3].
38
+
39
+
<!--- bibliography --->
40
+
[^FIPS202]: National Institute of Standards and Technology: FIPS202 SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions, [https://csrc.nist.gov/pubs/fips/202/final](https://csrc.nist.gov/pubs/fips/202/final)
41
+
[^tiny_sha3]: Markku-Juhani O. Saarinen: tiny_sha3, [https://github.com/mjosaarinen/tiny_sha3](https://github.com/mjosaarinen/tiny_sha3)
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,10 +62,11 @@ offers backends for C, AArch64, and x86_64 - if you'd like contribute new backen
62
62
63
63
Once mldsa-native reaches production readiness, you will be able to import [mldsa](mldsa) into your project's source tree and build using your preferred build system. The build system provided in this repository is for development purposes only.
64
64
65
-
### Will I be able to bring my own FIPS-202?
65
+
### Can I bring my own FIPS-202?
66
66
67
67
mldsa-native relies on and comes with an implementation of FIPS-202[^FIPS202]. If your library has its own FIPS-202 implementation, you
68
-
can use it instead of the one shipped with mldsa-native.
68
+
can use it instead of the one shipped with mldsa-native. See [FIPS202.md](FIPS202.md), and [examples/bring_your_own_fips202](examples/bring_your_own_fips202)
69
+
for an example using tiny_sha3[^tiny_sha3].
69
70
70
71
### Will I need to use the assembly backends?
71
72
@@ -124,3 +125,4 @@ through the [PQCA Discord](https://discord.com/invite/xyVnwzfg5R).
124
125
[^NIST_FAQ]: National Institute of Standards and Technology: Post-Quantum Cryptography FAQs, [https://csrc.nist.gov/Projects/post-quantum-cryptography/faqs#Rdc7](https://csrc.nist.gov/Projects/post-quantum-cryptography/faqs#Rdc7)
125
126
[^NIST_FIPS204_SEC6]: National Institute of Standards and Technology: FIPS 204 Section 6 Guidance, [https://csrc.nist.gov/csrc/media/Projects/post-quantum-cryptography/documents/faq/fips204-sec6-03192025.pdf](https://csrc.nist.gov/csrc/media/Projects/post-quantum-cryptography/documents/faq/fips204-sec6-03192025.pdf)
0 commit comments