Skip to content

skeeto/emacs-chacha20

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

ChaCha20 in Emacs Lisp

This is a pure Emacs Lisp implementation of the ChaCha20 stream cipher.

This library requires an Emacs built with integers at least 32 bits wide. This typically means a 64-bit build of Emacs. If it passes the test (make check), then you're good to go.

As you would expect, performance is abysmal. It's around 1000x slower than the C reference.

API

(chacha20-create key iv)

Create a new ChaCha20 context initialized with the given 256-bit key and 64-bit nonce. Both key and iv must be unibyte strings.

(chacha20 context)

Generate the next 64 bytes of output in the form of a unibyte string.

(chacha20-unpacked context)

Generate the next 64 bytes of output in the form of 16 32-bit integers. Useful when using ChaCha20 as a PRNG.

About

ChaCha20 implemented in Emacs Lisp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published