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

Dilithium pack and unpack #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Dilithium pack and unpack #45

wants to merge 2 commits into from

Conversation

pnwamk
Copy link
Contributor

@pnwamk pnwamk commented Jan 8, 2022

A few additional functions that make it easy for
external users to pack and unpack generated
dilithium keys.

@pnwamk pnwamk requested a review from ajayeeralla January 8, 2022 00:58
@pnwamk
Copy link
Contributor Author

pnwamk commented Jan 8, 2022

CI for b9e7146 matches current HEAD:

== Done checking 148 Cryptol files ===
25 cryptol-spec files failed to load:
  ./McEliece_KEM/high-level/Decapsulation.cry
  ./McEliece_KEM/high-level/Encapsulation.cry
  ./McEliece_KEM/high-level/Gauss.cry
  ./McEliece_KEM/high-level/Key_Generation.cry
  ./McEliece_KEM/high-level/Shared.cry
  ./McEliece_KEM/high-level/benes.cry
  ./McEliece_KEM/high-level/decrypt.cry
  ./McEliece_KEM/high-level/decrypt_helpers.cry
  ./McEliece_KEM/high-level/driver.cry
  ./McEliece_KEM/low-level/benes.cry
  ./McEliece_KEM/low-level/decrypt.cry
  ./McEliece_KEM/low-level/decrypt_helpers.cry
  ./McEliece_KEM/low-level/driver.cry
  ./McEliece_KEM/low-level/encrypt.cry
  ./McEliece_KEM/low-level/gf.cry
  ./McEliece_KEM/low-level/operations.cry
  ./McEliece_KEM/low-level/util.cry
  ./McEliece_KEM/spec/Types.cry
  ./Primitive/Asymmetric/Signature/DSA/p1024_sha1.cry
  ./Primitive/Asymmetric/Signature/DSA/p2048_q224.cry
  ./Primitive/Asymmetric/Signature/ECDSA/ECDSA_sign_tests.cry
  ./Primitive/Symmetric/Cipher/Block/KATAN.cry
  ./Primitive/Symmetric/Cipher/Block/SHACAL.cry
  ./Primitive/Symmetric/KDF/HKDF256.cry
  ./Primitive/Symmetric/MAC/HMAC.cry

genPacked : [3 * SeedBytes * 8] -> ([CryptoPublicKeyBytes * 8], [CryptoSecretKeyBytes * 8])
genPacked s = (packPublicKey pk, packSecretKey sk)
where (pk, sk) = gen s

Copy link
Contributor

@ajayeeralla ajayeeralla Jan 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I have pack/unpack Pk and Sk that way is to match the reference implementation and I would verify those functions using SAW. I would right correctness property to prove that the wrappers you wrote were equivalent to mine there. Also, you could add comments explaining the motivation to have these wrappers.

Otherwise, looks straightforward!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants