Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

107 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CHOW-TIME

CHOW; a custom fast (sorta) ARX stream cipher featuring a 1024-bit state, 128-bit nonce, and with the TIME tag. The cipher gains authentication with a 4-lane interleaved sponge MAC; thus giving us CHOW-TIME.

The cipher was originally created as a parody version of XChaCha20-Poly1305. Of course, CHOW-TIME is not better than most audited ciphers like AES-256-GCM or XChaCha.

Aside that; the cipher was designed in mind to be relatively simple, authenticated with a simple sponge MAC algorithm and be decently fast with AVX2 / NEON optimizations in Assembly.

Features

  • CHOW-TIME uses a custom 10 round ARX core similar to XChaCha20; which operates on a 1024-bit state.
  • Custom sponge MAC which generates a 256-bit with a TIME tag which provides integrity, confidentiality and prevents ciphertext (or the tag itself) from being tampered with.
  • AVX2 & NEON Assembly optimized backends; processes 4 blocks simultaneously using 256-bit ymm registers on x86-64, and 2 blocks simultaneously using 128-bit v registers on ARM64. In other words, really fucking fast registers!
  • Hardended API, the CHOW-TIME API is proven to be resistant against certain attacks like salamander attacks, boundary shifting and payload tampering.

Documentation

The libraries documentation is located in the docs\ folder...

Building

CHOW-TIME is (hopefully) cross-platform and supports native compilation across Windows and Linux (for both x86-64 and ARM64). With CMake it will mostly configure everything to the standard liking; if it does not, manually edit the config.cmake file in the .cmake folder.

Shit you also need

You'll need CMake and a C11-compatible compiler (GCC or Clang). If you are compiling on x86-64, you will also need the NASM assembler.

For Windows (x86_64) just use the MSYS2 UCRT64 terminal...

pacman -Syu
pacman -S --needed mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-nasm mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-cmake

For Linux (x86_64) just use whatever bash terminal you normally use...

sudo apt update
sudo apt install build-essential cmake ninja-build nasm

For ARM64 Linux you do not need NASM since ARM Assembly uses the GNU Assembler.

sudo apt update
sudo apt install build-essential cmake ninja-build

Compiling

Now, to actually compile CHOW / CHOW-TIME you'll run the following commands in your respective terminal...

git clone https://github.com/Commonwealthrocks/chow-time/
cd chow-time
mkdir build
cd build
cmake -G "Ninja" ..
ninja

## optionally run ctest to catch a few edge cases before they end up catching you
ctest --output-on-failure
## or just manaully run the EXE / ELF files

Or run everything at once if you are lazy!

git clone https://github.com/Commonwealthrocks/chow-time/ ; cd chow-time ; mkdir build ; cd build ; cmake -G "Ninja" .. ; ninja

Python bindings

Since CHOW / CHOW-TIME are currently NOT on the Python Package Index; to install this cipher you will have to pip install it locally.

So in the same terminal in which you envoke python or pip, make sure you are in the bindings\python folder and run the following...

pip install .

That's basically all for installing CHOW / CHOW-TIME for Python.

About

A custom 10 round, 64-bit ARX fully custom written in C and optimized Assembly backends (AVX2, NEON, AVX512).

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages