45 lines
1.4 KiB
Org Mode
45 lines
1.4 KiB
Org Mode
* Cryptopals
|
|
|
|
[[https://github.com/dlozeve/cryptopals/actions][https://github.com/dlozeve/cryptopals/workflows/CI/badge.svg]]
|
|
|
|
Here are my solutions to the [[https://cryptopals.com/][cryptopals crypto challenges]], implemented
|
|
in C.
|
|
|
|
** Build
|
|
|
|
You will need [[https://mesonbuild.com/][Meson]] and [[https://ninja-build.org/][Ninja]], and CMake for the mbedtls dependency,
|
|
which is a [[https://mesonbuild.com/CMake-module.html][CMake subproject]].
|
|
|
|
#+begin_src sh
|
|
meson build
|
|
cd build
|
|
ninja
|
|
#+end_src
|
|
|
|
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: [[https://github.com/ARMmbed/mbedtls/][Mbed
|
|
TLS]] and [[https://github.com/nemequ/munit/][µ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:
|
|
#+begin_src sh
|
|
ln -s build/compile_commands.json
|
|
#+end_src
|