Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ML-KEM vectors to final FIPS-203 version #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions ML-KEM/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# ML-KEM test vectors

https://c2sp.org/CCTV/ML-KEM
[https://c2sp.org/CCTV/ML-KEM](https://c2sp.org/CCTV/ML-KEM)

This directory collects resources for testing (and developing) ML-KEM
implementations, as specified in FIPS 203.

In particular, it provides:

* Intermediate values for testing and debugging each intermediate step and
partial algorithm.
* Intermediate values for testing and debugging each intermediate step and
partial algorithm.

* Negative test vectors for invalid encapsulation keys.
* Negative test vectors for invalid encapsulation keys.

* "Unlucky" vectors that require an unusually large number of XOF reads.
* "Unlucky" vectors that require an unusually large number of XOF reads.

* Vectors that fail if `strcmp()` is used in ML-KEM.Decaps.
* Vectors that fail if `strcmp()` is used in ML-KEM.Decaps.

* Accumulated vectors (derived from the reference pq-crystals implementation)
for testing randomly reachable edge cases without checking in large amounts
of data, including an extended run of one million tests.
* Accumulated vectors (derived from the reference pq-crystals implementation)
for testing randomly reachable edge cases without checking in large amounts
of data, including an extended run of one million tests.

* References to other test vectors.
* References to other test vectors.

All test vectors are made available under the terms of the
[CC0 1.0](http://creativecommons.org/publicdomain/zero/1.0).
@@ -38,8 +38,9 @@ vectors in this directory implement the following two changes:
2. The order of the input i and j to the XOF at step 6 in Algorithm 13
(K-PKE.Encrypt) is switched.

This reverts [an unintentional change][pqc-forum discussion] that will probably
be reverted in the final document and makes K-PKE consistent with Kyber round 3.
This reverts [an unintentional change][pqc-forum discussion] that is also reverted in the final document and makes K-PKE consistent with Kyber round 3.

Moreover, the value of `k` is now appended to the key seed `d` before deriving it with SHA3-512.

[NIST vectors]: https://csrc.nist.gov/Projects/post-quantum-cryptography/post-quantum-cryptography-standardization/example-files
[pqc-forum discussion]: https://groups.google.com/a/list.nist.gov/g/pqc-forum/c/s-C-zIAeKfE/m/eZJmXYsSAQAJ
@@ -128,31 +129,30 @@ The deterministic RNG is a single SHAKE-128 instance with an empty input.

For each test, the following values are drawn from the RNG in order:

* `d` for K-PKE.KeyGen
* `z` for ML-KEM.KeyGen
* `m` for ML-KEM.Encaps
* `ct` as an invalid ciphertext input to ML-KEM.Decaps
* `d` for K-PKE.KeyGen (don't forget to append `k` as the 33rd byte)
* `z` for ML-KEM.KeyGen
* `m` for ML-KEM.Encaps
* `ct` as an invalid ciphertext input to ML-KEM.Decaps

Then, the following values are written to a running SHAKE-128 instance in order:

* `ek` from ML-KEM.KeyGen
* `dk` from ML-KEM.KeyGen
* `ct` from ML-KEM.Encaps
* `k` from ML-KEM.Encaps (which should be checked to match the output of
ML-KEM.Decaps when provided with the correct `ct`)
* `k` from ML-KEM.Decaps when provided with the random `ct`
* `ek` from ML-KEM.KeyGen
* `dk` from ML-KEM.KeyGen
* `ct` from ML-KEM.Encaps
* `k` from ML-KEM.Encaps (which should be checked to match the output of ML-KEM.Decaps when provided with the correct `ct`)
* `k` from ML-KEM.Decaps when provided with the random `ct`

The resulting hashes for 10 000 consecutive tests are:

* ML-KEM-512: `845913ea5a308b803c764a9ed8e9d814ca1fd9c82ba43c7b1e64b79c7a6ec8e4`
* ML-KEM-768: `f7db260e1137a742e05fe0db9525012812b004d29040a5b606aad3d134b548d3`
* ML-KEM-1024: `47ac888fe61544efc0518f46094b4f8a600965fc89822acb06dc7169d24f3543`
* ML-KEM-512: `705dcffc87f4e67e35a09dcaa31772e86f3341bd3ccf1e78a5fef99ae6a35a13`
* ML-KEM-768: `f959d18d3d1180121433bf0e05f11e7908cf9d03edc150b2b07cb90bef5bc1c1`
* ML-KEM-1024: `e3bf82b013307b2e9d47dde791ff6dfc82e694e6382404abdb948b908b75bad5`

The resulting hashes for 1 000 000 consecutive tests are:

* ML-KEM-512: `578eeaa1156848cbf7a15bafef963b4ccabe3308ddfb7dbdd20ad965f634e81d`
* ML-KEM-768: `70090cc5842aad0ec43d5042c783fae9bc320c047b5dafcb6e134821db02384d`
* ML-KEM-1024: `7ccc6d803739d3db3c5ce39c7130f459db32a199c6605e3be210e5a89d4c4b95`
* ML-KEM-512: `21dd330d4355f2ae2876b9fa2b9de62ecaf76aca1d598de8db2b467d36e36a6a`
* ML-KEM-768: `3b108396a277f2952ff3243a985c9709bcb95788c39b7b36a2c4e19d1a41e51e`
* ML-KEM-1024: `6377c4f0ecfdb32e63f7b58227960828784fe0b3e0e5e5e9f77be300f003512a`

## Other Known Answer Tests

10 changes: 5 additions & 5 deletions ML-KEM/unluckysample/ML-KEM-1024.txt

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions ML-KEM/unluckysample/ML-KEM-512.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
d = 8c7238e1965ddd73b1114b897e1bf4b308c0d9cc710d0482ab8b9e737405354a
d = 2d391adbf4f7e004b09449c48dca574e590c59bd1c8e8095c942b7dd99f7b5da
z = 8476013560151d986dc7834dcb57c75f845f8d7ee71558d0955f3f4feb723cf2
ek = adba5f8200668806c2b53b3f9f8c7ab73a615a7a211f90c8d5b37f59048f66e59d4fd8284d10517ec29157798c7a28a0f02881bf4a10a5bca3440484fb0349a61a229c3773eb60c77e201b9d63cda769306b6558bb023e2147508d8836fbd042ec8842a7f6b20d401b0d9c36d320cb0e6374ebdba7c43c8ebf5085d1e2255c01a050d26602c486afc7a3425c90fff079f9e13d6b45c8e3ea778dc28c4a1835a992b8caf2711a3a812fe65eb4aa1b3ed44d84f85b6cfa3fafab2d9df20b191586b1d6befbd87f787c7a65037f20d354e3e14578172a653804b335351122b5ee73b355496abc8a2a478b7c784c59925b161b3117e8d22dccc33026931d88495ba4d47397598998dbb164300549323084688fd07a950d292a83c19df352cf26d51681e9866745871d775e292cbb556018fa19a51191306009a9b5b9cee99a594820057dcc7f32966151588f0ae17149a41de70912ab9366ec86be7a1b152b559fa6992de4f007dec3ba73693b9de4cce8f7bf42cb53e1c535e7113754cca126178892e935fc21675d687f629c77bbf22ed3e574c375a82bf2b73f16a553f95ab5d45a80f612b164b01e6552fdc7aa31c4ba8691963821ac6559732c338e3aa71803861d10f171c907713b323ef2a75c2007a72be0b3df1c8d812c2687da6f0a86bf2a754ddb7517a1c55d65993f73903cb2ac58f48cb23dd8adbad7a3fc375ce706c996c66926b69d32b8b497c073f3679cc075836716ad4f4470572391320a0eb217876dcb2688c02cce659d6269a1ac7401a64a2fa4acb85ea58879337444075252f85978b56c59b89f166bc3f5f2a85a0449e50266f7a7a76ac8113ec40fe273117ce704a257bee9982cfa682c6a1887c53bc5fa121bfad3c64579c4823110bdd2794d91757d2c928807b74d902b38e9b1f872af91f6799a53b50470a31d937101879e3c3961e59385e50a8aa40cb22141054aba3136cc6b7738244228031689c65503632bc7cc144c095af70e078bacfcb75026592ef2b93d0e66439258666b6811899456c027c941f5c7ce686d20fa2f02f11cfcd658318b1e7785b219dcc35c3c6fe50d06fc1bbbffafc56ab7050f2773ee8ef8d28ca4b97b43c8d7202e71
dk = 4ddc7f1c67865333aa622260b8d1230745b00db64c77d2977094031f48181c8860daf7339b947d1170cd66b847f7b0335fb74845a94da6a22eafa638e11c4e5d459d04548d28ec5f28115a8e5a290138ae198423e9f640d94609ec926d1f0bba4c7cca9b0b6ca061bbe579c6f3a3c31698cc79fb80b70b9e1d22bffc449b5f5851bdb1a08ffc4b58c7ba955454cdcbbc38602ca6ab9a7ada778826c0d89c1cef6297549ab2d22a0cd2594e922b0912a792d0ba037143c70676c813e08e3378c0902baf0418009a5910625c5703b105caf7b0864643389b51a98c8ec1d106f8a9192af2bbe2a16584805bfdd1177093c5eac149869172ff63a88a7973bbc80672598899a2483bcc141e3cc6e0f33f36281e7a518881b2210a354b9284afb024c4ec1b341414ac9d6885dcb5115150b312f9476f1ccc28692b00f52f0625a37ddb0b3ffb23fdca0caaf560314686225c2e3f039f31229032d026644b43e18a5a91290e2e382b562b1002b408f5b411e240767f03740178ba7d4737db644b159192dce611a30bb950d2795d2c85c123472ca16665d469e7c04dd3c5785e104fbd745d00442534c77aa024be0d8287bba9bf6408302a40a12e3743fbdb187b874bf5c99c1398a088265744657809a4457dd157bccb42d21ccf251986e182c2b723cab8fb176030775f28a038357953bcc8c8714b3e669dd3f1c92278b91c339767c0aa2eb4880e87b544ca11e09339031571abb97eb1dc7c354405db23b153153b8d3088b983180af9bef77738725b9e919c2a00a85cbe097aff21714ca946a133ab51818652c78a1a23c61829894a4865c1a601ea555f6b846dbababe7bd36183d8ba7836397c3336b0ca59e8ea92a99cc8cf381bf524bb83709dff3086a386b4646703f362aadb792dad09480494ca7b372c7181c31de06c9a0b6a7ce52d7c74331337a1337c447bc73e9fd1a4e5921463b8248a96cb26417963207889152432b223edd48b5416c82ae35a0680c2a9c5cd1cba9c16d09b4374250ed375c103848ccb8b51b2871af9beb0057c9ee8879f596633456185c75335168126dc028ca96eadba5f8200668806c2b53b3f9f8c7ab73a615a7a211f90c8d5b37f59048f66e59d4fd8284d10517ec29157798c7a28a0f02881bf4a10a5bca3440484fb0349a61a229c3773eb60c77e201b9d63cda769306b6558bb023e2147508d8836fbd042ec8842a7f6b20d401b0d9c36d320cb0e6374ebdba7c43c8ebf5085d1e2255c01a050d26602c486afc7a3425c90fff079f9e13d6b45c8e3ea778dc28c4a1835a992b8caf2711a3a812fe65eb4aa1b3ed44d84f85b6cfa3fafab2d9df20b191586b1d6befbd87f787c7a65037f20d354e3e14578172a653804b335351122b5ee73b355496abc8a2a478b7c784c59925b161b3117e8d22dccc33026931d88495ba4d47397598998dbb164300549323084688fd07a950d292a83c19df352cf26d51681e9866745871d775e292cbb556018fa19a51191306009a9b5b9cee99a594820057dcc7f32966151588f0ae17149a41de70912ab9366ec86be7a1b152b559fa6992de4f007dec3ba73693b9de4cce8f7bf42cb53e1c535e7113754cca126178892e935fc21675d687f629c77bbf22ed3e574c375a82bf2b73f16a553f95ab5d45a80f612b164b01e6552fdc7aa31c4ba8691963821ac6559732c338e3aa71803861d10f171c907713b323ef2a75c2007a72be0b3df1c8d812c2687da6f0a86bf2a754ddb7517a1c55d65993f73903cb2ac58f48cb23dd8adbad7a3fc375ce706c996c66926b69d32b8b497c073f3679cc075836716ad4f4470572391320a0eb217876dcb2688c02cce659d6269a1ac7401a64a2fa4acb85ea58879337444075252f85978b56c59b89f166bc3f5f2a85a0449e50266f7a7a76ac8113ec40fe273117ce704a257bee9982cfa682c6a1887c53bc5fa121bfad3c64579c4823110bdd2794d91757d2c928807b74d902b38e9b1f872af91f6799a53b50470a31d937101879e3c3961e59385e50a8aa40cb22141054aba3136cc6b7738244228031689c65503632bc7cc144c095af70e078bacfcb75026592ef2b93d0e66439258666b6811899456c027c941f5c7ce686d20fa2f02f11cfcd658318b1e7785b219dcc35c3c6fe50d06fc1bbbffafc56ab7050f2773ee8ef8d28ca4b97b43c8d7202e71c520653c1786ba01e323d525cf53eddcd12db9977e4630cc2ac10a6a81406b218476013560151d986dc7834dcb57c75f845f8d7ee71558d0955f3f4feb723cf2
ek = 84b78d4f30c37ee1a132261ee925bd09ab77cf2b329a49b742abbe2c53a1188c6359557faab6335275ad3a355eb0f287e399b678f15d1d98262bf4bb1e8ca9254a70b46121c584284a70c832b02b2966a2a886277672573dda3c7fcb587c66aaedbc9b5aac4fff2ba0e4160362272dbedb616f027f1cf08d4cbb5a52781959d71c61602b908c1e3be8a5ea83538f57b3392acbac692db56717bab26d27945aee5307db358e162639cbe7b49824c4f9692f8df43aab7b193fbca60f3ba5429cb73316904c0ca3a8297550284be01c5dd3041d28288bcd713186a552cf280cf44a05781a6788c31abc9336700615cdb970c40a3f2df016bb66a0001303cd5c55c8919eee40a531c240f2034db6f4684f05a25b290bdfd4138d93267df34e8760391690278280239cd1a1946296164a0dc2934d3e349fa3c6a17a69677013754c3a1d208ab3e72623e68517d3b696dcc9c25f2a479b983a13fa6193511fa9c34111649697f89c8ab0bcab975c18c8a5b873231f718668820c97c1c3db26a5b505c3d55b34ee10a6db8924512014904468ec0aa197b5734f0001bc7a2776f478687cb470d583ed885dc94b08de9676e12775aeb436a0a84b31460ca0d1c034d2683ddb2f3c6bcff5d65b7be14d154a5a5316239c902cf6f8c4b2235450fc46defb118935cc3f952d771b6dc9b2b02eeb476bf1404370405c1582268157a4024ff1414fd1591acf2259f07c6140134e41dc6e24a1a057073820024c826994bd61941ed48e5e4710de875af524b03719c95e9bb77ea2200ee65183c8ad8796b7d2708837994513b265e51600fd6380a98a5222727270f070c0cb92bff9ca5383023c884a24059289563273d8917600595a3515f7827912487a0cd372385cbc0c4b33d140adef308096f59aa94227bf6cc2ece1ce7249a5bd934c04c8c47db247980b0167113cb435b131d295ab59a55cb86ab4709cf9aa5ffd4b249b47192a58388e94b41f1167ec7686d56cb44a39af0b0319b7899322c82de607488c26a5022b38a4b97bcfbac42c20a4949b9b8e8a9501b1111ff5c7ef3783963a56e373636bf1adfab62dd5efd3fdbb874dbbc8196ed6cb78bcf63d856024685f1524292da81947
dk = 1ada413858b6735b80bbe74b5bf601974003ea378505d394ec033384b55f5f1120268634393cb9f48c127f14a6afb6208d8422a367957e3c27aca704cb29af84eccc6a8128e7d15daee5c2ae4205d4841f41738642ec806ca49e58267abe1692ea643218f79136e5842c935a379b6cb7bb4891c2681432bb5ad13d26b7734a483ca2c99501c223c50c9d7eec63d8730e9ce07a867594456248117c454ee4cb6c190379e00dffdcce29ca1da5e2640f928963254ae0d5b41d9bb769422173c41c1d38a05a5c0e3be843e09ba9a02b0fbe0c414f0919d04734a2dcc4e7b45b58274a01130c49d0c998181b95330db81c9e31c6ba2c9505982494cdd569a1e730fca36cdfa44bdd751c46b192ee0a2ba838969ee934a47256da4a16a3a35a7c400f868070798111b14225c1653eca6c52e88971b7c3629de95a3b328d22771633551c36f3c7b8296f672b1209b1892ca84a385c7563541e7ee8ba4bd36c9b30748502b3f9b27978c4b7ba67754f09184d3b906e2830403201fdf866f228a3d414a586e911acf3c3575c4b24cab5d9428dc282baac639d23c526caeca8a03778da8c6a97f19f034c879faab383ca7199333e808195782914f13299eb54a2474bcd899c4a09516516f69b4fe63c7bf42516265f5df57e65479c70c61ab6a023b564baaa7b1cf0371931a3cca0e22b09a991b1c6763247a4e7127460c160995c976bd04545d865a6d6282511a2cfb8453921bec0eb93b608bddeb491e06a947bb7b2bdd453f2c9a9a99cb166c8081372b0ce30657f0256b6c93b633035dc123a73e08965e9ba199160a5b349f819bbcf15aa7b61055948c98929b83611b614138103fca01dc2cd3bd8830d3c13b8007827daa6b5b12b8d75337e8acd1ab75fe0d50f49b2a5a7b316b6f99784b98839a118fac94012d643ed353c6c85503e7465f0f97976dc29f1e965588b6a7df759a2b3cdf6a189f54ccae804272bc09c0ea79a1bb52c84e70357d980f9d7961c9bbf1bb9a2aaf560431799c02c3444397dd063269b0aa35449a382926a47e4b62ffb6edb462d9aa821a5f35d07c7c7255a7d5c795c84b78d4f30c37ee1a132261ee925bd09ab77cf2b329a49b742abbe2c53a1188c6359557faab6335275ad3a355eb0f287e399b678f15d1d98262bf4bb1e8ca9254a70b46121c584284a70c832b02b2966a2a886277672573dda3c7fcb587c66aaedbc9b5aac4fff2ba0e4160362272dbedb616f027f1cf08d4cbb5a52781959d71c61602b908c1e3be8a5ea83538f57b3392acbac692db56717bab26d27945aee5307db358e162639cbe7b49824c4f9692f8df43aab7b193fbca60f3ba5429cb73316904c0ca3a8297550284be01c5dd3041d28288bcd713186a552cf280cf44a05781a6788c31abc9336700615cdb970c40a3f2df016bb66a0001303cd5c55c8919eee40a531c240f2034db6f4684f05a25b290bdfd4138d93267df34e8760391690278280239cd1a1946296164a0dc2934d3e349fa3c6a17a69677013754c3a1d208ab3e72623e68517d3b696dcc9c25f2a479b983a13fa6193511fa9c34111649697f89c8ab0bcab975c18c8a5b873231f718668820c97c1c3db26a5b505c3d55b34ee10a6db8924512014904468ec0aa197b5734f0001bc7a2776f478687cb470d583ed885dc94b08de9676e12775aeb436a0a84b31460ca0d1c034d2683ddb2f3c6bcff5d65b7be14d154a5a5316239c902cf6f8c4b2235450fc46defb118935cc3f952d771b6dc9b2b02eeb476bf1404370405c1582268157a4024ff1414fd1591acf2259f07c6140134e41dc6e24a1a057073820024c826994bd61941ed48e5e4710de875af524b03719c95e9bb77ea2200ee65183c8ad8796b7d2708837994513b265e51600fd6380a98a5222727270f070c0cb92bff9ca5383023c884a24059289563273d8917600595a3515f7827912487a0cd372385cbc0c4b33d140adef308096f59aa94227bf6cc2ece1ce7249a5bd934c04c8c47db247980b0167113cb435b131d295ab59a55cb86ab4709cf9aa5ffd4b249b47192a58388e94b41f1167ec7686d56cb44a39af0b0319b7899322c82de607488c26a5022b38a4b97bcfbac42c20a4949b9b8e8a9501b1111ff5c7ef3783963a56e373636bf1adfab62dd5efd3fdbb874dbbc8196ed6cb78bcf63d856024685f1524292da81947f7b83eaa3f1d52b697b73e8df67ee32a7d6c9f9fd7ffdb4fd6b1269f0a7e350e8476013560151d986dc7834dcb57c75f845f8d7ee71558d0955f3f4feb723cf2
m = e48f74ad416e99631003ded1478aec62a02c245d88ed7f2fae92aedf13ca03b3
K = 9ce7b7117dcae1317ba2427d19796275502a0417ed2e8c346a65b923cfb2f23c
c = 7b41356c004b5e6a53a2027e33b15309838010e78c64ef7d61a21c99354367f6cf4b80949a155bca61b287b57fe318c142ba09f485eaa82e2e5f3d845458bf06ad65ef0801aca999b564f6a97d1a7b388a685df1bb5c966d3d3185bf25872d60eda369bb8004c993bb81f7e6d05c6ac77e49aecce075f0032eeca9d7b19f4b16f79f0fbb17c289218dfcff32cbb61cda905bd87005abd6bc8825bcb3af30e61581ca73a9daf8bdd5c9b8805e1bcef85eaaed03a7ccdd3c87af0fdb8ea8696cceb6bd1d59774398ee401b28ff3f8bc6cd8716ce3f9339a905babfef089d766de4a86914311d8b9a02586003c65b1b521db706a75d85316bf04e3f13c80d95adc7f7f47a111127157435bcba36b6e87601d059324d76c528eb122942e6b6ff69e1d80015cda3d19f76b09e97f9b1d274bde9e0d37c9f6e8418049400f27c0adf662ac64d3063952f1c792b6b871689c37f0d2c400e1d77a935db5e94784fc02747c55a577645809d380dc131300b4ab17688b7545062b4928aa920e4f34481c8e5db368e7c455eb38cade5e88b1f8bf1c354d127db669f9b6860fa8ede17dbe6eca2a4ac1ea4476880e141f8821061272affd05e6ebd5695fd4b7514266cd4c35043398be9fba4a2eb7a3c09084f8a91fcab3d9037f0f5206250fe6405ce13a6b909e755e3288efae0a29a83ac53b2330109a4c347a55ae13feec19d7cdfc8765c0fe3529b4486da9b587f4a517caf9f84c9f6d9f1299757267f4b2c167dfc130255926863c1d90ce05fb521c854a2edca3eb820055e0881c1b7069b13b76bc28496812068e4f705204560c9953bb13186950fdd06f5eae38de70184326759c89a1a006c9fc41bf3877aac7dad74d899a06492c968ca31b729b52495a90932f3fc242a6c99a29afa54a9980268a20e4e0f5364a7cef68212c20fe57d93d7296bf61c63128d94cdfac778f39138eacc563586bd42c04c14e468d60de55536822340c793c8407c6031672de701018fcdbe351bcc32010d4053046f68aa377e12a888f48fecd44ef7497b6653277f5177b37530a7c23ea0d55a2c1b50bea733884674
K = 1fbae951c9bc549639ea851d44e21da5fb9bd25407e09c1a888a309ca00b5f43
c = a10e9652929a9bcee465a0bbc90959e6fc6cf887f3dad2d4ade3970fd4b2d497df11bb98b1bc2f8b2d12caa099bfe563c80f4465ef031096539b3963aa864ad215eecc77feca2b37b00efda11cd0554999fe6941390ef72bcd0ff5c67a6df604b346bb1d62d02fbdd968a1e560416615485beb36f16e115d44385cbe1083e9083bbc41ffa1b109d3658012642f24d151cecbbb5882394f5a32be6e7814a2ae5a320088660a50707f8f24ccdca237ed3fff0742cf418dd250034e988abffb079b0c5ad5f79e430d92a3edb81fa22bac8f6e64871030878f5411ad82e930fb18c408758c13c69bdb4cb9b70d5c37b0e37b74a9cf47ca415e97e3c4d27fde0b321e2f5b94c0fe66307c196408c28a3901df85d05fba017ac8c845a182f8c9a4d9cb5837197b035e6c940c77b9c7922e706ed9f138f9571907fe3824db26e18f5c5e4b55335625fa414731bc765286458f94fe83e9549980bf95a75b08bfefefb52061be2108faaec1d571ec3b584675bd56a858bf1b2bd23110963a761a706d77aaf82e50c9cea725c3fe8d0b256616762b8ac54efac25142fd7eb65259c5f1fae948d9d9caaa77cd5dc0e3559bf0b9b6c81dca849a8a8d61ff5fed575b738ea3869a6ba2f4cd84b1e9ed4bdfd342b6f14586e70102a41bc9941841da42ace36f94af3b82264f05107c14aee11809480066d9f1116f24d3281360a4621b2db84b11ac4adefae9033d08189a848e7b3d291b6d4572c293d0c04d8677270a673ace711ed16e4ea9f30e6dda558c9cf10e9d633b7e7f9737c458f0acd41296833d4042e7ef430ec61cb95e53f6a40091b6664740bce02654dfa1e334e4c21c727c9f134f829fa2f1715c750d40d4a408898e8a040e81eeb9a0e4e1abeed031d4b47d0f1bed2b0209524f3766102fc05cdc7125bef440d594e5d5f39883c86924dcbc19d493a5fee9a44f45b1ca234fa34cc0070332e607042cace8eaa192e0a21b4dc0b25a30da7e3774957f128aa0ab8e56ddc3e7205961f09e06bc18a13e7bfbd192de11dac193b9678ffa1e17295b60a50a8d366ba552ad24dc01960ab4ea1807ab
10 changes: 5 additions & 5 deletions ML-KEM/unluckysample/ML-KEM-768.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
d = 8c7238e1965ddd73b1114b897e1bf4b308c0d9cc710d0482ab8b9e737405354a
d = 82c4a361586b9715c2375a45fb85c32d04be7fe6e26acd820ec5d4080093afe1
z = 8476013560151d986dc7834dcb57c75f845f8d7ee71558d0955f3f4feb723cf2
ek = f029cc40c924b4ac401a14b4bbfb4012989042b3c11df73eb8b6ac35808b1b1bb4bc82cf970b83ce5c09e008caca9c364a2a6d7964b76aaa574532407fe293f507a0937b3f4f124a2f5946d2c78191d0cd7ff6bbc0ac4386259aad68b83b07164e35a24eb7a169c0191fb698db22b9e1f46a7b389fbc648f1ee7850459b60335316e33171ce81d9fb5a35c2c7531248479e14bd0f4904009701ae9404fea0e5c6765b21b74be55252ee9c4c7d97b38807c74a73ff5e9406c53079ed13baa96b195396567366bef571aedf9c108b7462800605f1c8a44fa8316521287b19339603d16dc9df8bbcf249cae26a0bdb2f899dfab8168ba648d648ac47b27ae3731024ac012910e5479ca7d913e1b350fc7282cd8f8b10c8bcade27081e760c41713ebe25bb4cd10952310c4c23c68de567019a8978ca3649f17a2c1270e3a78237d81ad6971cd62815467a8472d290e9f78f7fa755b9b882a236cef03407c5d7177627c568e344c32c35fd5116f38020338a1b8e706efcf3b02284b79f8964af027e8b686cd769153e31c8284243e44c44c7b8caace43fdcd02c0da14fe6b17811c42686710642289ce7eb3bf648902f0c019e48b8508b764e3b6b67a90437616ad088a82928b4c61128abc2c8ff72add3ab85a2c3572b8a445dc519e6b50f71dbaa15977d3b66810f880ba6e037caf36146d2b72eb16e435bac8e114461bb2bbd7598aff3c01046395d0347f062b5488c3460f489589756ecb9c3dcc044c01c078d14592caa1a497baff0e3444e123549bc19a4f229d967ca05d940a2354a673b9fe8b2cac9f55b2bb4081fb68e4dd436ebe12a024569d83284a60a25cd089a81401cf2b7344432c6cbf2430de1446f5204851cca9bbbcc3f134083f1b8c25144bc399817539074e90c23a3669c55667158ce3b24cebea93b3325590408b2642c9b07d07aab1c524021af746477d45132b64771816000a582bc9aa8880f723540cb36766c46fbbbb14b418650b8c70443559b6b94c07caa584067c7aa216ce50d2a2c08d0ca6280fb488b28b75e794f405948b4ca8a66006bea75050a795086cb33b607b75cb2678b8276ff2aa07eb26805c3c64034115e7491e8b2cf434cc523648b9c4727502c402466299f985ec221565c990ce2c4b7fbb98c591ca9a78911959a4035d2a1389c53b4aba0e407969998b2d93b18ba074f2f90911bbca80109ce5af819b09205ce78a38d15c602e2b950a95df3d3371a938749345424dc8b9d0944419a01f3b59b5c5c0369ebade574bcb1cb553514307f7356b95a812deb1df218c2b671ab2e5c4b800c37fd0c60d3fa8eabe895e020ba1d59018ffa263e17956f97360265918432b2c92a046c63adbcd88a3acb1099ac9ddd372d6f866f2017ca58a1664cd65525f95910a3a4149b08b63cb7f250798b9ca82d40377c4c2994309fdce095f101c23b25ba98fa9d377228d8799f5d035a069a0ce39cbc7fe7167a7b283684a38a3011774885ef50b642c615317ccd5fa342acd415970b5630eb52e246b3d1856ff2c69c92e25dccf99e38b0482807ab7b34133d30112cd5c12bac272ec05c17d2810848ab835a2f387b2a8d451dc18c31cc2b43ac95954f202a5c3c6fe50d06fc1bbbffafc56ab7050f2773ee8ef8d28ca4b97b43c8d7202e71
dk = 38b3964f66210f78a9c59cc189cca21d3605692c015e8197c089303af1884a977649d7c262828938d23c7716557241927876862538a5da53bba1311bc111862a30cb5148b1d3c49a7dd9c5dde0c05ca3c15637a8ebf3c5d2155b458546a9411ca1cb735eea5cb4d0953559acf9f7985ae86adb2ca0b086c69961c89115990f0543f5d65349886894182f11dbaeeb3cc5740c6bdfbc8ccab88f8583292be46b1666be3b053cd1230641e83d686a9186501759ec2dfca01ea3725f3f5846699b8321bb90e2d3b567e32b70ecca53b5ab1f421a99ab01a5d4bd8531261a86cf676553a51cccd8d3c027176c2e5abf341cc3571c8bf249c76828cef9e52052247f2ff1a6e5b231ef99907a524e4540ba067875675719d13821f67633d9b3c810078c7a66220c385374a2759a693339227f90745eeb83c7005ac6dbab52d4526e673c92a2160563191646e246090b5969a8a37436c3dcf433f626887900ab7fb65b00590817684ec9e826cb86b156c48c81a59dc9633266f6422e2ba95a8b5e7d06b96db36cdd3c5bd984caf036634e80484871c7b53387c4645da4d40214d2cbb5597b85706273ba0a3618a3cee7397fdb336ef5c5b1f418dc1b8f077c2e7ffcb9d96b6c61486751a516eaac34c98692f2296fe5d041ec9302c072ad847b1610aaa93e2572e2c045e4eacc7da437e11965b0106803f9c84035b741499583f958c2d7c2699a421b451aa0f17af4c33a7d8ccaca5a2230402e63d1973e56ba44236542a21844557643c9a606ca0aed651d98e19f800c4f22b78b9c170901f4485fab5d382351e1f8c49a7642c92b58fe1a163e61bff335760184cd3bb827184b4e0772096b69c802a9b72c754014905556679b136105bd05a77a292756a39a4237a1b746c9f98a51a52b526aec6368c4b6f56386ab23474672b03b90bee473b06053497db540ddcc42fe85b434c734e9d0b71b48177860473435986d86caf24708800aa6abc1a5d8591f3fd6bbaa9bc923bcc89bb2bfd1ac34fc4062d452b7116c0f532577f8351b33f08100695998eb18a2f46ebb7a4d001913300193a9e6cc666c30b72722caf0c027dbb98af124aaa06b43c53f10751916533c15582081235192c13266b86c88e09f276011a617a63e038637a618ad0c3164c354c223283b5b7a363c7773506ae8471e85ca7670bc209ee949f0b791e3b58e0c934a5f0898f2e73994bb96423251255072c69862b7142df8b37af586939d6b8639b426da940a0eb6b5987c733302452494a73327356567cb8c0c8f6e79424e23ba86c08d75474be52191bb344f06b929b3eb61bf27a077a679df00489c9ac352d75482461636695968118608a26f45e0c88f870fe3210ebd114c2df3081e786aeb5b2d00a51689780a99bb4c3d8c5fdd579ea1e628bbfb59858704b4fa6315285384a5b3b0982c329a1476d4b9d7840fcee04753c78a41848c33e1a0b93a26ed3a657eaa084deb48747cc5003b4acc8107e2411f08897e60b750aa29bc74c69759b361ec92504c922b28387eb97b50a2790f3fec75619bc3ab069502aa5e46076e20b80b256798ac2125edb870d3b764b6534098777379c389a26422981128b04192e8bcacef3b68f029cc40c924b4ac401a14b4bbfb4012989042b3c11df73eb8b6ac35808b1b1bb4bc82cf970b83ce5c09e008caca9c364a2a6d7964b76aaa574532407fe293f507a0937b3f4f124a2f5946d2c78191d0cd7ff6bbc0ac4386259aad68b83b07164e35a24eb7a169c0191fb698db22b9e1f46a7b389fbc648f1ee7850459b60335316e33171ce81d9fb5a35c2c7531248479e14bd0f4904009701ae9404fea0e5c6765b21b74be55252ee9c4c7d97b38807c74a73ff5e9406c53079ed13baa96b195396567366bef571aedf9c108b7462800605f1c8a44fa8316521287b19339603d16dc9df8bbcf249cae26a0bdb2f899dfab8168ba648d648ac47b27ae3731024ac012910e5479ca7d913e1b350fc7282cd8f8b10c8bcade27081e760c41713ebe25bb4cd10952310c4c23c68de567019a8978ca3649f17a2c1270e3a78237d81ad6971cd62815467a8472d290e9f78f7fa755b9b882a236cef03407c5d7177627c568e344c32c35fd5116f38020338a1b8e706efcf3b02284b79f8964af027e8b686cd769153e31c8284243e44c44c7b8caace43fdcd02c0da14fe6b17811c42686710642289ce7eb3bf648902f0c019e48b8508b764e3b6b67a90437616ad088a82928b4c61128abc2c8ff72add3ab85a2c3572b8a445dc519e6b50f71dbaa15977d3b66810f880ba6e037caf36146d2b72eb16e435bac8e114461bb2bbd7598aff3c01046395d0347f062b5488c3460f489589756ecb9c3dcc044c01c078d14592caa1a497baff0e3444e123549bc19a4f229d967ca05d940a2354a673b9fe8b2cac9f55b2bb4081fb68e4dd436ebe12a024569d83284a60a25cd089a81401cf2b7344432c6cbf2430de1446f5204851cca9bbbcc3f134083f1b8c25144bc399817539074e90c23a3669c55667158ce3b24cebea93b3325590408b2642c9b07d07aab1c524021af746477d45132b64771816000a582bc9aa8880f723540cb36766c46fbbbb14b418650b8c70443559b6b94c07caa584067c7aa216ce50d2a2c08d0ca6280fb488b28b75e794f405948b4ca8a66006bea75050a795086cb33b607b75cb2678b8276ff2aa07eb26805c3c64034115e7491e8b2cf434cc523648b9c4727502c402466299f985ec221565c990ce2c4b7fbb98c591ca9a78911959a4035d2a1389c53b4aba0e407969998b2d93b18ba074f2f90911bbca80109ce5af819b09205ce78a38d15c602e2b950a95df3d3371a938749345424dc8b9d0944419a01f3b59b5c5c0369ebade574bcb1cb553514307f7356b95a812deb1df218c2b671ab2e5c4b800c37fd0c60d3fa8eabe895e020ba1d59018ffa263e17956f97360265918432b2c92a046c63adbcd88a3acb1099ac9ddd372d6f866f2017ca58a1664cd65525f95910a3a4149b08b63cb7f250798b9ca82d40377c4c2994309fdce095f101c23b25ba98fa9d377228d8799f5d035a069a0ce39cbc7fe7167a7b283684a38a3011774885ef50b642c615317ccd5fa342acd415970b5630eb52e246b3d1856ff2c69c92e25dccf99e38b0482807ab7b34133d30112cd5c12bac272ec05c17d2810848ab835a2f387b2a8d451dc18c31cc2b43ac95954f202a5c3c6fe50d06fc1bbbffafc56ab7050f2773ee8ef8d28ca4b97b43c8d7202e714092928c2fb67cf2c96d9de44a4bf4773593d0ff8019dc69e0c23626a7d8569a8476013560151d986dc7834dcb57c75f845f8d7ee71558d0955f3f4feb723cf2
ek = ad568015b87690ebbe1fb438ee8a22b9ac4379a12422e34037c231341c316bc0be74d49aaeb09d9039ad875a6b81f48b20b73c517533f85ba5ce46029319382e00012020297f475d906bc3b6ea08f3e10069d3095c87c1a6456c18b92ef25bcb5e59363bb1acaa0627c1ec3811251b9f7487d7b70fadea527e67ace1049ee74303c6220ed8807b1936b4d02b2b5c7b3795e13c40654a47d72784d3c09b4b7b3969a633001f37c7cabc51773b1586843045059337587983c5f88c5e62619f47ae784c292779a30c8a93eb40a9921c10b461128af7c29a92a348db86a303b6031376cc6768a8e06caab48e33a073ae06cbd225972fb47c28d46a57471b133a3ad18a95a35b838a469bf4e820e78570c72946b9f3b44bc7778e4a05dd106b8e14b093a49239d22a9eecb664454126b75ae24c600b3c4d167699d841842fb956119209af596e20cca0e2a53980232ee2f3916e570fffa805f6241488106d57d39c9219afaeb5b7379c5347270c7dccc280e34dae801153285dc8421a95c7a2f4cc8389ac9316da0816dacc3bf71c5619802e0a691e4a323836428e6587330a52c2f76578035986e7c15d500a2ec36dc7f430fc03813453b1a666946571641e32b4cafbbae6ea1d7f47c43549c802d97cd839689517b80b619da8137296a5be4a9c3b32e6375984b1ca00557f960583582c5503a48f5309ca802b6967a9488314bb51909536187c2082ab200c8344c4fa2c262915ac582796d3007db7566f64031a4cc48c975b593b424b04855a6af98065474560e7cb48ac043f25b65116981f17cfc11b0ccd62200d7a2d70f54994087d0056400e1525fa498386241dc10c95c372361330919f773765f730405c23a5c7a088b8a422251b0153c750e6c2b33aa1cc1c7288d536c405a6ae7b40626aac52488ad5522e3f5696ae26b7cb592d1c4690fc8602a4c833b1f57ba5bb255f3359924b98da49b757127686750f301b87058a3b66b9cd98d8c611cc472e243f8d2aa631ca98e8c162a9b87e406471698349d236119f78b98c61a83648880d7875f450975f49ca3dc29082d2a07b91ab834b6ddcc0c5495b6b5de24c735852b917bf749b0f1f3034f346475355018989c4cef23745a352f6680104ab59c2643405a24f89a8232fe33ed667be9c282adef009b585bda08c64dc169c41344c6d570020b02cdbc26437c046719bbc02b39c8f9b01d020c242080bf221000594bab19668d9f7cfbfb50583b45e71c230a93a16a20a9c81a269544bafd00bba65e48ba99582587a360da68f68b2ba7f2432d8976c9a0990a4d34714064e1bd960e8f12c27dc1bd410a856f16b5eca293891152e724b58fc7940852cdd9c39231671bd278f38e18c886a4b0c714a432c9c354a304aec6c65fc85ebaaa143f181e2b10e40300ff7913346eb315c499b68343b5e70395755745f4775524cc223bc635582680f5cbea9269650393231a31b8a6b2364985c4d9b9275d417c7c327e6525a0370766a508f087c437ac105cbba4646a0bc3ab7a3a68307f100a7545b6c08d38501e404833c19f4eb6ec73792a8c5253b67a398e79aa1cb3c2433a4bacba5f4fc135751987d071be157bbd976a9cb029cc0e2b99a795daadc9cce56db4bfd02cf1893c6441a1b78f1bdd9b13626b9f21b7c6161
dk = c50385c7c4b17639049f390088bac9d5549acc166b2db7ba00344527fc2d31c29f0ea39fe8070de84223ea24aa06eca94b8674c4287141507bd09c5825399d16644e42bb76a8e993ec9ab8c05ab5c7986a92e26129b56446697f7c209b27da15283819c8a4a217507188009d575a79a6ac0aecf73bc0775c0994aeb62267d495c418906800ac0b7db501f8f06c6127c2e11cc963bbc7819595d36407cb416432c921de82c54c1b7f8675b3366208cd4278b7498db28674d786c78484cee2d02d381247adc687755b319ea319db965d76162a59f228e9708423fbba00761902d0309a3b3ad209b0b8249eb96537d562683b3339056558c41bc2e9a77d6436120503bdc813596b97c67e174bfa6563b54b58b7ebb2183abdff888937f6b85b6a514ba8339b873373d1b7a7c08bc4b6c6677610c673cc8ae3c1ad9b00021bc743525e95997b9ae87341eb74aa5b6941a2b036dc4926fb57f124163b3cab7fa6cee2ec2e2c45bcf2dba57f119986d1038a8527ddfc32ba31290afc7d54481b5701c35c954fc3387c669c726b6a6b76c57bdaeb57ad3c77221996b5508206e180ae165a1e3cca801746718a826a481189c301fc07283b558649a903081b73c8408ef981b47b8c348e80cf5e4c166b80349f04ce30c74192a5aea7b395306aa844c194b1b21759cb93d7ea363adb15e8cb1ca6b7089a528f7a16346da83371a641e1691990578fd54a350c71a0cf273797649258f45589662e040314e7f731b55852cf381da8fb429d76adc240882681b150507faa46c0977522b7d545897bba709aca99499a3ab1107c6b4430ec92d0a9aa79d4bcf97b2a705659f390299d1839f7f2292ea81affb45ffea41b1802d098e4a1893bca4a2a589335c531aac99e88cd759309a6a1c7a3397ce5987679e1b8cc00ad1a44b0b11356dbc540baa4b3002dcc30699ad8f4c20ac4874da318f089b12a7a43699b9d02918cf4fb0977196e987c55c2125e5a4a7d2ae3a935256f2aaa7e3f2a6b11f1adc879c15179651cdcb9e7d620b72811f418956b878716448320f27cfb4992b5872789a17be3558bb20871832c27785352d3f53ddb2c8dd99b16035b7f2e0c1feef183f1698dee8106c6b54eb984cb09a88ffa3899e4daac64930618b0c108fb939c188129c542589b6fcf764d7a61690ebb8794bc7d8df59f83f189097bcf9f638782f35fee956f66940c71ba79c30c7af5e18146175a3fd1a492d14f299839f642cddb945b9a053821728d22b033d334c38cd349f3b69c03f39dc20751fae027d074751f347c776484b8f1c0e0d678ebc9a63ebbc534d9afd9c70080695bd3c9965aa46fd6014180f27c97084829350f0a5ab9518636d4e83294571255b81c63944893481f22bb44d4137568085f3c419710667ad0d3cbbd59cbe6c8190a479742d728640494b4181c0ea1b219a12220cb0d617c39f3b876043526c3c32d13ca94d2ec248d259c0f047a069905f9d54aa6318a1f594207d6b000a45783812c53b98a8a342d4fd70460e9af44ea740516afc7670d9c9c46af64cfe0616aafea516098cd54e48fea087a6b7373fb52a4dad46d28253837a0c309520362416907636f32015a9642aaf23858ad568015b87690ebbe1fb438ee8a22b9ac4379a12422e34037c231341c316bc0be74d49aaeb09d9039ad875a6b81f48b20b73c517533f85ba5ce46029319382e00012020297f475d906bc3b6ea08f3e10069d3095c87c1a6456c18b92ef25bcb5e59363bb1acaa0627c1ec3811251b9f7487d7b70fadea527e67ace1049ee74303c6220ed8807b1936b4d02b2b5c7b3795e13c40654a47d72784d3c09b4b7b3969a633001f37c7cabc51773b1586843045059337587983c5f88c5e62619f47ae784c292779a30c8a93eb40a9921c10b461128af7c29a92a348db86a303b6031376cc6768a8e06caab48e33a073ae06cbd225972fb47c28d46a57471b133a3ad18a95a35b838a469bf4e820e78570c72946b9f3b44bc7778e4a05dd106b8e14b093a49239d22a9eecb664454126b75ae24c600b3c4d167699d841842fb956119209af596e20cca0e2a53980232ee2f3916e570fffa805f6241488106d57d39c9219afaeb5b7379c5347270c7dccc280e34dae801153285dc8421a95c7a2f4cc8389ac9316da0816dacc3bf71c5619802e0a691e4a323836428e6587330a52c2f76578035986e7c15d500a2ec36dc7f430fc03813453b1a666946571641e32b4cafbbae6ea1d7f47c43549c802d97cd839689517b80b619da8137296a5be4a9c3b32e6375984b1ca00557f960583582c5503a48f5309ca802b6967a9488314bb51909536187c2082ab200c8344c4fa2c262915ac582796d3007db7566f64031a4cc48c975b593b424b04855a6af98065474560e7cb48ac043f25b65116981f17cfc11b0ccd62200d7a2d70f54994087d0056400e1525fa498386241dc10c95c372361330919f773765f730405c23a5c7a088b8a422251b0153c750e6c2b33aa1cc1c7288d536c405a6ae7b40626aac52488ad5522e3f5696ae26b7cb592d1c4690fc8602a4c833b1f57ba5bb255f3359924b98da49b757127686750f301b87058a3b66b9cd98d8c611cc472e243f8d2aa631ca98e8c162a9b87e406471698349d236119f78b98c61a83648880d7875f450975f49ca3dc29082d2a07b91ab834b6ddcc0c5495b6b5de24c735852b917bf749b0f1f3034f346475355018989c4cef23745a352f6680104ab59c2643405a24f89a8232fe33ed667be9c282adef009b585bda08c64dc169c41344c6d570020b02cdbc26437c046719bbc02b39c8f9b01d020c242080bf221000594bab19668d9f7cfbfb50583b45e71c230a93a16a20a9c81a269544bafd00bba65e48ba99582587a360da68f68b2ba7f2432d8976c9a0990a4d34714064e1bd960e8f12c27dc1bd410a856f16b5eca293891152e724b58fc7940852cdd9c39231671bd278f38e18c886a4b0c714a432c9c354a304aec6c65fc85ebaaa143f181e2b10e40300ff7913346eb315c499b68343b5e70395755745f4775524cc223bc635582680f5cbea9269650393231a31b8a6b2364985c4d9b9275d417c7c327e6525a0370766a508f087c437ac105cbba4646a0bc3ab7a3a68307f100a7545b6c08d38501e404833c19f4eb6ec73792a8c5253b67a398e79aa1cb3c2433a4bacba5f4fc135751987d071be157bbd976a9cb029cc0e2b99a795daadc9cce56db4bfd02cf1893c6441a1b78f1bdd9b13626b9f21b7c6161451f9b6547b8f6e927fbfe7598658160206040fdb57dd39ba8bf1f3a5ff89b9c8476013560151d986dc7834dcb57c75f845f8d7ee71558d0955f3f4feb723cf2
m = e48f74ad416e99631003ded1478aec62a02c245d88ed7f2fae92aedf13ca03b3
K = 821a5e7294086332d139f210070ad873a80f28c550dc38e78a1a9f0023332d47
c = afff2412117fdc6d06798e131fba62479e711a349fb873c7017f53c82092dcbf1a22410cb918d7def83fa0a9679390f3ce3f93b6da5c441591d38ff81b7ae2d2cc8411380c5c791f94deebc74850123a5b148456884824d36037d0d9f162ab2b57fc82dac938dc68c10590b5ec6d169e6a80bd07e6bd33ff2076022dd2f722217fe2358e455fd9ff6280af169f9cbc6d1d7cf06bc78ad1dce143256057a6b25dedb655ab4e56ecfcc7f1d1cd0e4c64264ea2c50757e71a50ab56415e2b57ac9ac358f3897dcad8999f877bf01e94cd5110c6b6371c5e2b43cc694840678100a8e0deacd959732910b46136ca27ae9a71ee4ba9c1174faf8cc7b3fde0d66721f8e788c0fb1943f6fab1cbf27fff96b4e2accaf21d82273687786f914bed4995ebfe8a2536582accfea43dd0bb76f50d74f66d71678571f6b219bb397a58f93a0ee9996194a23c1274af0efdcf2b7e9b4806beaaa070fc39e5cd8c4ff8fc1f5c9ff675a270159ea5f94ca0491c51f0e35a04a8e899e826d04473eb83a7a21d4efc12361420d657e495f537ce02aba10235276ffe3439093cdcc24aa62de1f80a1207814122682fa63bd02e184419ce386b08a9e94cf377e345695306c055936a1a38e934f5921b9909e173415bf15864ffeec146b3ff52493dd59ba376dd1d167e71f4406751f6ca1c0e844075264cf6a865a235ab6cbcd45e6ea879172d3bea233e1e41be0d79be5fa396233310e0b0c55e3b6f0344a3a52f0ccf11dc4b6e82c337f64c1702c0a78b0112e786a935e9b61d7bf9ec93daffbc93c8a019aa55a81b5fd5f33b3eb87c1538324f6c6d29325c7428ecfa2d1c54e204de9ceec4238ae270993424045690ef99cd855545078595fe24c98c11bf24199771ac1c183502103d695055b2c0cd1052d141bb40217ed3c7de62dbe4b9e892bbdcff4222a0c824b1538091377fe255c88412d095c5fc34ab70b77265d80092e88e9a943e282645231c8fe9cf7455d157759377975e3208e766c4292921fdc2137e475cdaf7c61929c52238b45800e322ca8fcf795301632db92b9509a98376f9fc05d3316df02e7a1efecc71826940babe9909b49271af157f6149c1a61036c2eed723bce56a69f843942902c599755de1dc8fc8bf25627679f7bfdbad7357b982188a06a051411b3bbead85bb62c82c86a079b4e7f0d986dfb1294c2353893950496bb806380f24be5e12c2d2a2e3eb618756170c048f3a39a6775baa65c67597deea7c6ba0175e8d42fee21308e7b7c0a4dff3bc26c7b292b514649b97f45b37579b465b27335973f867f468e3aa30e9fb85c4bfecf767324dd60e27d599e44de7b7926675376897cf42fa4884619fcdc3b89495a9064a5c11cd5b8bffea50863738601dc45887ead684f99e2d456346e55be6efc18a4b665c356bb334de56374f4536108609e600b975f18ccc16f012df946dd5ee1b337728115a04b9cbdd81246c1b765cb1ac3ed60677956e7feb4c1a4389bf1def9579d34501e68fcb3c1e58353651b01c
K = 4f7cc64c040fc4e335a539691f4638caf8b1bf5da6455754afe699e41813801b
c = 696ef1699d5ac2aa9a012a64c60c6c214dcedec75ff87fb3a5850044202a790bfdaa6fb517a8c714a6685b1eea8ac01d28e2f1e7350e79b1371b2aab98723f40ac1adb809751118a53eb56f13cf9fadf698c7a2ae127746bb661f6772d8227777c22d388e2a0f635f97913191033d3c487a9d2822348be19710e5f47d2b740c044f39ddae838699f62a1056dbc43364046d36a972f7110c88e900ca37daec64039b0c96319cef8ea01d5974c5da29392222b838e7c3d19892aa70f3a232b64f94ae72ff2032941a70dd71e2e24c987fe4c2f5027fd435618288f50e8d248fbe009d93af8b0dea451414f2cbaceda51b3a7aabff1faed24293e0d5d57da89868630e1b09a6b27a034bd5da40d622e0b9507e64d81669a1074b5f67728a9fadb600bc57d55d9c3a0fe376fdefd32a30b1931315210bd8622ff0b2ad9bf6d00749942e07a90572d0468d5f5a95aa6c338b2e5e5175dd8f4bd118e8849be829e3fb08628101a33b1295b1c7ee3e9158d4beaea203a22c1b97af6ad7fc004f0f9895a51da0c26a7b46734c418afe98ddbaada3fffcd4642075bd23e044154cfe19a0b6a05e24e83c55057a50d24f956617534dfcf99f134bbc539b1e7c9c3d00f59de4351e9ecfbec3f66374ecea6ab72d0fd00e0f91461db0a74fc5ab63b30a2caf455fea339878ba665aeeee0b52d427a4e4ccad8526386951f5b1d61778a56dfa243d3f6186aa4f8fd953127599bc14da3e8e918aaa5b4182a9bde4b5bb1871a972ef526b9f4417373001842f2b3eae1fe0d4693220b843bf265c59a647930946bdd72aa54a1af18daa3864327d91b80611c30bc1e16a89f71ddc51cf6fce4a179239d0f21a0bce88c86499ef9ca1219039be087664c365149b3683b94fcb06dc858dea2f5bb7edb32fdc09cd91c74bfe29608b48d0db29061099671f6cf8dfbba2b1db456eca1c8657de5e982f11da9c3173a633ba7ec0066a717bc6eadde242f3e03cddab1c42def35f9cc2d6fa2f4222bfa096d321dd504d6c8dd6e6d18937151330be89bf2a218752442f8a50df3075463476db1e0a5275fd7958f7b650a11a36db809cee7074bc763d035245c3c6da7fcc93425175e0cb3f7407000fb6c0b7a7450ada28c05c34f883af2cd0965826cec71435d87e8cd192137e3abae4050d68be1d97fa3af08728daa4ba05aa7f61b8a7f52701d6c969b25fd2fd1a68a5b2098a348273337782ec52143e1f51e5a512e91f2469da136e8d8f96af7cc6fe21f929203bcd12de6826bba19cfe5a69bc2c3d3f503a14cab590591cd134b375feaae76c764c95dae6644551c6d5bce2665f9c1dd4c33694100d88fcc4e3282eb8c1766917956199273f0f80c67dc3e944a449ab2ed9d58554c62ee43bdc2d1408d784f08c0c71d6171176ca6c912626c45eb1fa1292774885a73bd614ae833797a1c84afee1a7e7c105eca8273b304cbc44acab0305aba4ef6ba671739d1f80d09c7640acea982655b3294ee0371019b134559be391c29d990f82f8a1dd4a715
24 changes: 12 additions & 12 deletions ML-KEM/unluckysample/unluckysample.go
Original file line number Diff line number Diff line change
@@ -11,31 +11,31 @@ import (
"golang.org/x/crypto/sha3"
)

const (
n = 256
q = 3329
k = 2 // Change depending on parameter set! {2, 3, 4} for ML-KEM-{512,768,1024}
)

func main() {
go func() {
log.Println(http.ListenAndServe("localhost:6060", nil))
}()

var max int
d := make([]byte, 32)
d := make([]byte, 33)
for {
rand.Read(d)
rand.Read(d[:32])
d[32] = k
samples := sampleNTT(d)
if samples > max {
if samples > max || samples >= 384 {
max = samples
// 518aa157193090c8bb464f8f645ed3ea4e0bbfe6cda70f86f9768782321f1f2d: 380 samples
// 851cf0ee43b802c538e5b4ee4d1991a28af90eeb87fe34d54095332821e65730: 381 samples
// 8c7238e1965ddd73b1114b897e1bf4b308c0d9cc710d0482ab8b9e737405354a: 384 samples
fmt.Printf("%x: %d samples\n", d, samples)
fmt.Printf("%x: %d samples (k = %d)\n", d[:32], samples, k)
}

}
}

const (
n = 256
q = 3329
)

func sampleNTT(d []byte) int {
G := sha3.Sum512(d)
rho := G[:32]