Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # PQ Crypto Catalog
  2. Implementation of quantum-safe signature and KEM schemes submitted to NIST PQC Standardization Process.
  3. The goal is to provide an easy-to-use API in C and Rust to enable experimentation. The code is derived from the submission to the NIST Post-Quantum Standardization, either directly or by leveraging [PQClean](https://github.com/PQClean/PQClean) project.
  4. Users shouldn't expect any level of security provided by this code. The library is not meant to be used on live production systems.
  5. ## Supported schemes
  6. | Name | NIST Round | x86 optimized |
  7. |--------------------------|------------|---------------|
  8. | Kyber | 3 | x |
  9. | SABER | 3 | x |
  10. | FrodoKEM | 3 | |
  11. | Dilithium | 3 | x |
  12. | Falcon | 3 | |
  13. | SPHINCS+ SHA256/SHAKE256 | 3 | x |
  14. | NTRU | 3 | x |
  15. | NTRU Prime | 3 | x |
  16. | HQC-RMRS | 3 | x |
  17. | Rainbow | 3 | |
  18. | SIKE/p434 | 3 | x |
  19. | McEliece | 3 | |
  20. ## Building
  21. CMake is used to build the library:
  22. ```bash
  23. mkdir build
  24. cd build
  25. cmake -DCMAKE_BUILD_TYPE=Release ..
  26. make
  27. ```
  28. Build outputs two libraries, a static ``libpqc_s.a`` and dynamic ``libpqc.so``, which can be linked with a project.
  29. ## API
  30. Library provides simple API, wrapping PQClean. For example to use KEM, one should call the library in following way:
  31. ```c
  32. #include <pqc/pqc.h>
  33. const params_t *p = pqc_kem_alg_by_id(KYBER512);
  34. std::vector<uint8_t> ct(ciphertext_bsz(p));
  35. std::vector<uint8_t> ss1(shared_secret_bsz(p));
  36. std::vector<uint8_t> ss2(shared_secret_bsz(p));
  37. std::vector<uint8_t> sk(private_key_bsz(p));
  38. std::vector<uint8_t> pk(public_key_bsz(p));
  39. pqc_keygen(p, pk.data(), sk.data());
  40. pqc_kem_encapsulate(p, ct.data(), ss1.data(), pk.data());
  41. pqc_kem_decapsulate(p, ss2.data(), ct.data(), sk.data());
  42. p = pqc_sig_alg_by_id(DILITHIUM2);
  43. size_t sigsz = sig.capacity();
  44. pqc_keygen(p, pk.data(), sk.data());
  45. pqc_sig_create(p, sig.data(), &sigsz, msg.data(), msg.size(), sk.data());
  46. pqc_sig_verify(p, sig.data(), sig.size(), msg.data(), msg.size(), pk.data());
  47. ```
  48. See test implemetnation in ``test/ut.cpp`` for more details.
  49. ## Rust binding
  50. Rust bindgings are provided in the ``src/rustapi/pqc-sys`` and can be regenerated automatically by running ``cargo build`` in that directory.
  51. ## Testing against Known Answer Tests
  52. Algorithms are tested against KATs, by the Rust-based runner implemented in the ``test/katrunner`` (only verification/decpaulation). The runner uses ``katwalk`` crate for parsing NIST format. To run it:
  53. ```bash
  54. cd test/katrunner
  55. curl http://amongbytes.com/~flowher/permalinks/kat.zip --output kat.zip
  56. unzip kat.zip
  57. cargo run -- --katdir KAT
  58. ```