Giter Site home page Giter Site logo

valronn / twofish Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drewcsillag/twofish

0.0 0.0 0.0 120 KB

A highly optimized C version and a nonoptimized python implementation of Bruce Schneier's Twofish encryption algorithm

License: MIT License

Makefile 0.57% Python 30.03% C 69.39%

twofish's Introduction

Twofish

Originally written around 2000-2001 or so.

A highly optimized implementation of the twofish encryption algorithm in C, and one not at all optimized in Python.

Basically, I use the Python version in myref.py to precompute some tables into tables.h. From there, there are two C implementations. The first in opt.c, I attempted to do some funky things in copying the function and keying the function directly, as opposed to providing keystate to the function. It turns out, at least at the time, to not be faster than the more sane version, i.e. the one you should actually use, that is in opt2.c. In fact, on more modern Linux versions, opt.c probably doesn't even work because of the weird way it tries to do things.

The Makefile builds the whole thing, and produces an executable named twofish-benchmark. If you want to incorporate this into your own software, just kill the main function and have a blast.

The version in myref.py should be fairly readable, as it was designed with the idea to reflect the algorithm's definition. The optimized C versions are not designed at all to be readable so much as fast.

twofish's People

Contributors

drewcsillag 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.