Skip to content

Instantly share code, notes, and snippets.



Created Jun 14, 2017
What would you like to do?
How to use the KeccakCodePackage

1. Get the KeccakCodePackage from github

git clone

2. Find out what architecture you want:

cd KeccakCodePackage
make | grep libkeccak

4. Make the right library

make generic64/libkeccak.a

5. Example program test_K12.c

#include <stdlib.h>
#include <stdio.h>

#include "KeccakCodePackage.h"

int main(){

	unsigned char output[32];
	unsigned char input[] = "hello";
	unsigned char custom[] = "wong";
	if(KangarooTwelve(input, sizeof(input), output, sizeof(output), custom, sizeof(custom)) != 0) {
		return EXIT_FAILURE;

	for(int i = 0; i<32; i++){
		printf("%02x", output[i]);



6. Build with your custom path

gcc -std=c99 -pedantic -L path/KeccakCodePackage/bin/generic64/ -lkeccak -I path/KeccakCodePackage/bin/generic64/libkeccak.a.headers test_k12.c

This comment has been minimized.

Copy link

@golflegend24 golflegend24 commented Oct 4, 2017

Where is the include file in this line:
#include "KeccakCodePackage.h"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment