{"id":13642353,"url":"https://github.com/pq-crystals/kyber","last_synced_at":"2026-01-04T22:55:48.740Z","repository":{"id":41506628,"uuid":"93712960","full_name":"pq-crystals/kyber","owner":"pq-crystals","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-21T23:49:54.000Z","size":923,"stargazers_count":757,"open_issues_count":22,"forks_count":171,"subscribers_count":49,"default_branch":"main","last_synced_at":"2024-08-22T15:59:42.090Z","etag":null,"topics":["crypto","cryptography","key-exchange-algorithms","lattice-based-crypto","module-lattices","post-quantum","post-quantum-cryptography"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pq-crystals.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-08T06:03:36.000Z","updated_at":"2024-08-21T23:50:01.000Z","dependencies_parsed_at":"2023-12-30T06:26:38.086Z","dependency_job_id":"5908b609-0081-4081-aeb3-a13d1e732776","html_url":"https://github.com/pq-crystals/kyber","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pq-crystals%2Fkyber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pq-crystals%2Fkyber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pq-crystals%2Fkyber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pq-crystals%2Fkyber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pq-crystals","download_url":"https://codeload.github.com/pq-crystals/kyber/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223832976,"owners_count":17210757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crypto","cryptography","key-exchange-algorithms","lattice-based-crypto","module-lattices","post-quantum","post-quantum-cryptography"],"created_at":"2024-08-02T01:01:30.365Z","updated_at":"2026-01-04T22:55:48.680Z","avatar_url":"https://github.com/pq-crystals.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# Kyber\n\n[![Build Status](https://travis-ci.org/pq-crystals/kyber.svg?branch=master)](https://travis-ci.org/pq-crystals/kyber) \n[![Coverage Status](https://coveralls.io/repos/github/pq-crystals/kyber/badge.svg?branch=master)](https://coveralls.io/github/pq-crystals/kyber?branch=master)\n\nThis repository contains the official reference implementation of the [Kyber](https://www.pq-crystals.org/kyber/) key encapsulation mechanism, \nand an optimized implementation for x86 CPUs supporting the AVX2 instruction set. \nKyber has been selected for standardization in [round 3](https://csrc.nist.gov/Projects/post-quantum-cryptography/round-3-submissions) \nof the [NIST PQC](https://csrc.nist.gov/projects/post-quantum-cryptography) standardization project.\n\n\n## Build instructions\n\nThe implementations contain several test and benchmarking programs and a Makefile to facilitate compilation.\n\n### Prerequisites\n\nSome of the test programs require [OpenSSL](https://openssl.org). \nIf the OpenSSL header files and/or shared libraries do not lie in one of the standard locations on your system, \nit is necessary to specify their location via compiler and linker flags in the environment variables `CFLAGS`, `NISTFLAGS`, and `LDFLAGS`.\n\nFor example, on macOS you can install OpenSSL via [Homebrew](https://brew.sh) by running\n```sh\nbrew install openssl\n```\nThen, run\n```sh\nexport CFLAGS=\"-I/usr/local/opt/openssl@1.1/include\"\nexport NISTFLAGS=\"-I/usr/local/opt/openssl@1.1/include\"\nexport LDFLAGS=\"-L/usr/local/opt/openssl@1.1/lib\"\n```\nbefore compilation to add the OpenSSL header and library locations to the respective search paths.\n\n### Building all binaries\n\nTo compile the test and benchmarking programs on Linux or macOS, go to the `ref/` or `avx2/` directory and run\n```sh\nmake\n```\nThis produces the executables\n```sh\ntest/test_kyber$ALG\ntest/test_vectors$ALG\ntest/test_speed$ALG\n```\nwhere `$ALG` ranges over the parameter sets 512, 768, 1024.\n\n* `test_kyber$ALG` tests 1000 times to generate keys, encapsulate a random key and correctly decapsulate it again. \n  Also, the program tests that the keys cannot correctly be decapsulated using a random secret key \n  or a ciphertext where a single random byte was randomly distorted in order to test for trivial failures of the CCA security. \n  The program will abort with an error message and return 1 if there was an error. \n  Otherwise it will output the key and ciphertext sizes and return 0.\n* `test_vectors$ALG` generates 10000 sets of test vectors containing keys, ciphertexts and shared secrets \n  whose byte-strings are output in hexadecimal. It also generates test vector for decapsulation of invalid\n  (pseudorandom) ciphertexts.\n  The required random bytes are deterministic and come from SHAKE128 on empty input.\n* `test_speed$ALG` reports the median and average cycle counts of 1000 executions of various internal functions \n  and the API functions for key generation, encapsulation and decapsulation. \n  By default the Time Step Counter is used. \n  If instead you want to obtain the actual cycle counts from the Performance Measurement Counters, export `CFLAGS=\"-DUSE_RDPMC\"` before compilation.\n\nPlease note that the reference implementation in `ref/` is not optimized for any platform, and, since it prioritises clean code, \nis significantly slower than a trivially optimized but still platform-independent implementation. \nHence benchmarking the reference code does not provide particularly meaningful results.\n\n\u003c!--\nOur Kyber implementations are contained in the [SUPERCOP](https://bench.cr.yp.to) benchmarking framework. \nSee [here](http://bench.cr.yp.to/results-kem.html#amd64-kizomba) for cycle counts on an Intel KabyLake CPU.\n--\u003e\n\n## Shared libraries\n\nAll implementations can be compiled into shared libraries by running\n```sh\nmake shared\n```\nFor example in the directory `ref/` of the reference implementation, this produces the libraries\n```sh\nlibpqcrystals_kyber$ALG_ref.so\n```\nfor all parameter sets `$ALG`, and the required symmetric crypto libraries\n```\nlibpqcrystals_aes256ctr_ref.so\nlibpqcrystals_fips202_ref.so\n```\nAll global symbols in the libraries lie in the namespaces `pqcrystals_kyber$ALG_ref`, `libpqcrystals_aes256ctr_ref` and `libpqcrystals_fips202_ref`. Hence it is possible to link a program against all libraries simultaneously and obtain access to all implementations for all parameter sets. The corresponding API header file is `ref/api.h`, which contains prototypes for all API functions and preprocessor defines for the key and signature lengths.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpq-crystals%2Fkyber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpq-crystals%2Fkyber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpq-crystals%2Fkyber/lists"}