Coder Social home page Coder Social logo

ocaml-salsa20-core's Introduction

docs Build Status

The Salsa20 core functions, in OCaml

An OCaml implementation of Salsa20 Core functions, both Salsa20/20 Core and the reduced Salsa20/8 Core and Salsa20/12 Core functions. The hot loop is implemented in C for efficiency reasons.

Salsa 20 Core are functions from 64-byte strings to 64-byte strings.

Installation

opam install salsa20-core

Usage

utop[0]> #require "salsa20-core";;
utop[1]> 0
|> Char.chr
|> String.make 64
|> Cstruct.of_string
|> Salsa20_core.salsa20_20_core (* or salsa20_12_core / salsa20_8_core *)
|> Cstruct.to_string;;
- : string =
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"

ocaml-salsa20-core's People

Contributors

abeaumont avatar hannesm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

hannesm

ocaml-salsa20-core's Issues

Implement ChaCha20

Hello!

Would you consider adding support for ChaCha20 as well?

It seems like most new protocols choose ChaCha20 over Salsa20, as recommended by Bernstein in the ChaCha20 paper. I specifically need it for my WireGuard implementation.

It's my impression that it's a relatively small modification to Salsa20, so I thought it would be a reasonable place to have the code rather than fork the repo and replace it with ChaCha20.

performance

did you measure performance of this implementation? was OCaml in the end smart enough to inline the functions in the hot loop? would be nice to have some mentions of the performance characteristics in the README

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.