GithubHelp home page GithubHelp logo

ctaes's Introduction

ctaes

Simple C module for constant-time AES encryption and decryption.

Features:

  • Simple, pure C code without any dependencies.
  • No tables or data-dependent branches whatsoever, but using bit sliced approach from https://eprint.iacr.org/2009/129.pdf.
  • Very small object code: slightly over 4k of executable code when compiled with -Os.
  • Slower than implementations based on precomputed tables or specialized instructions, but can do ~15 MB/s on modern CPUs.

Performance

Compiled with GCC 5.3.1 with -O3, on an Intel(R) Core(TM) i7-4800MQ CPU, numbers in CPU cycles:

Algorithm Key schedule Encryption per byte Decryption per byte
AES-128 2.8k 154 161
AES-192 3.1k 169 181
AES-256 4.0k 191 203

Build steps

Object code:

$ gcc -O3 ctaes.c -c -o ctaes.o

Tests:

$ gcc -O3 ctaes.c test.c -o test

Benchmark:

$ gcc -O3 ctaes.c bench.c -o bench

Review

Results of a formal review of the code can be found in http://bitcoin.sipa.be/ctaes/review.zip

ctaes's People

Contributors

danra avatar fsb4000 avatar fwolfst avatar gmaxwell avatar isle2983 avatar kristapsk avatar paveljanik avatar rex4539 avatar sipa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.