Solutions to the cryptopals challenges
Find a file
2020-06-12 11:51:09 +02:00
.github/workflows Add challenges tests to the CI 2020-06-12 10:59:37 +02:00
data Move input files to a separate directory 2020-06-12 10:54:23 +02:00
src Move input files to a separate directory 2020-06-12 10:54:23 +02:00
subprojects Add mbedtls dependency 2020-06-05 16:54:20 +02:00
tests Use smarter relative paths for tests 2020-06-12 11:12:24 +02:00
.gitignore Add Python script to test the challenges directly 2020-06-12 10:57:17 +02:00
.gitmodules Add mbedtls dependency 2020-06-05 16:54:20 +02:00
meson.build Reorganise utility functions 2020-06-11 19:25:56 +02:00
README.org Update README 2020-06-12 11:51:09 +02:00

Cryptopals

https://github.com/dlozeve/cryptopals/workflows/CI/badge.svg

Here are my solutions to the cryptopals crypto challenges, implemented in C.

Build

You will need Meson and Ninja, and CMake for the mbedtls dependency, which is a CMake subproject.

  meson build
  cd build
  ninja

Use e.g. CC=clang meson build if you want to use a different compiler.

The build will generate one executable for each challenge, and an additional executable tests.

Building will automatically pull and compile the dependencies: Mbed TLS and µnit.

Test

After building, there is a tests executable in the build directory, that will run the unit tests. You can also run them with the built-in ninja test command.

To test the challenges outputs, run the tests/challenges.py Python script, which will run the executable for each challenge and test it against the expected output.

Development

For editor integration, you might want to link compile_commands.json, which is automatically generated by the build system, at the root of the project:

  ln -s build/compile_commands.json