QUARKQuark is light-weight cryptography method for hashing. It is defined in three main methods: u-Quark, d-Quark, and s-Quark, and uses a sponge function. It can be used for hashing and in stream encryption. u-Quark has the lowest footprint and provides, at least, 64-bit security on 1379 digital gates, whereas s-Quark provides 112-bit security [paper]. |
Code
The following shows a C++ version of the code:
#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include "quark.h" #define UQUARK #define LEN 64 // length of the data to hash int main(int argc,char *argv[]) { u8 data[LEN], out[DIGEST]; char prefix; int i; argv[1]=""; strcpy(data,argv[1]); printf("%c-Quark: c=%d r=%d b=%d n=%d\n", prefix, CAPACITY, RATE, WIDTH, DIGEST); /* hash the empty string */ quark( out, data,strlen(data)); for(i=0;i<DIGEST;++i) printf("%02x",out[i]); printf("\n"); return 0; }