Skip to content

Instantly share code, notes, and snippets.

@bobpoekert
bobpoekert / sha256.c
Last active August 29, 2015 14:16
NaCl's sha256 implementation pulled out into a standalone executable, buildable from a single C file
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/mman.h> /* so we don't have to deal with buffering and fread()-ing */
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <string.h>
/* http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/utopic/nacl/utopic/view/head:/crypto_hashblocks/sha256/inplace/blocks.c */