• Stars
    star
    188
  • Rank 205,563 (Top 5 %)
  • Language
    C
  • License
    MIT License
  • Created almost 9 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Very small, readable implementation of the SHA3 hash function.

tiny_sha3

Very small, readable implementation of the FIPS 202 and SHA3 hash function. Public domain.

Updated 27-Dec-15:

Added SHAKE128 and SHAKE256 code and test vectors. The code can actually do a XOF of arbitrary size (like "SHAKE512").

Updated 03-Sep-15:

Made the implementation portable. The API is now pretty much the same that OpenSSL uses.

Updated 07-Aug-15:

Now that SHA3 spec is out, I've updated the package to match with the new padding rules. There is literally one line difference between Keccak 3.0 and SHA-3 implementations:

    temp[inlen++] = 0x06;           // XXX Padding Changed from Keccak 3.0

The 0x06 constant there used to be 0x01. But this of course totally breaks compatibility and test vectors had to be revised.

SHA-3 Spec: http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf

Cheers,

  • markku

Original README.TXT from 19-Nov-11:

Hi.

The SHA-3 competition is nearing it's end and I would personally like to support Keccak as the winner. I have a PhD in hash function cryptanalysis so don't take my word for it, go ahead and look into the code !

Since I couldn't find a compact and/or readable implementation of Keccak anywhere, here's one I cooked up as a service to the curious.

This implementation is intended for study of the algorithm, not for production use.

The code works correctly on 64-bit little-endian platforms with gcc. Like your Linux box. The main.c module contains self-tests for all officially supported hash sizes.

If you're looking for production code, the official multi-megabyte package covers everyting you could possibly need and too much much more: http://keccak.noekeon.org/

Cheers,

  • Markku 19-Nov-11

Dr. Markku-Juhani O. Saarinen [email protected]

More Repositories

1

dekryptize

A ncurses animation to make decryption look like, well, decryption.
C
227
star
2

sm4ni

Demonstration that AES-NI instructions can be used to implement the Chinese Encryption Standard SM4
C
88
star
3

kuznechik

Implementation of the proposed Russian block cipher standard, Kuznechik ("Grasshopper"). 128-bit block size, 256-bit key.
C
51
star
4

chacha-avr

A public domain constant-time implementation of ChaCha20 on 8-bit AVR microcontroller.
C
30
star
5

lwaes_isa

[HISTORICAL] A Lightweight (RISC-V) ISA Extension for AES and SM4
C
26
star
6

pqps

Tools for power measurements of post-quantum cryptographic algorithms
C
23
star
7

brutus

BRUTUS is an alternative, fast testing framework for CAESAR ciphers.
C
20
star
8

blake2_mjosref

A clean & simple implementation of BLAKE2b and BLAKE2s hash functions -- written while writing the RFC.
C
18
star
9

hila5

HILA5 KEM/DEM. Reference and Optimized Implementations + NIST PQC Submission Documents
C
16
star
10

blzzrd

Reference implementation of the BLZZRD variant of the BLISS Ring-LWE Signature Scheme
C
14
star
11

hilabliss

Self-contained educational implementation of the BLISS-B Bimodal Lattice Signature Scheme
C
14
star
12

weesrc

Source code for the experimental, compact "wee" file compression utility.
C
12
star
13

gostbox

GOSTBOX -- A 95-byte program for the 256-byte Streebog/Kuznyechik S-Box.
C
11
star
14

pqcbench

Automated benchmarking and testing of Post-Quantum Public Key Algoritms (work in progress)
C
11
star
15

avr-aes256enc

A constant-time AES-256 implementation for AVR. Just because you never know when you might need one.
Assembly
8
star
16

gost-r34.11-94

Implementation of GOST R34.11-94 hash function. (From 1998. Slightly modernized for 64-bit types and C99 in 2016.)
C
8
star
17

lwsha_isa

[HISTORICAL] RISC-V ISA Extensions and Standard Hash Functions (contributions in 2020)
C
6
star
18

ais31-testsuite-v1.0

AIS 31 Test Suite from BSI, Version 1.0
Java
5
star
19

dme-py

DME-Sign Implementation and Attack PoC
Python
3
star
20

bitpat

Supplementary material (code) for "On Entropy and Bit Patterns of Ring Oscillator Jitter."
C
3
star
21

py-acvp-pqc

Local python access to NIST's ACVP-Server "Golden Reference" crypto code
Python
2
star
22

aim-sym-py

AIM Experiments
Python
1
star
23

alteq-py

ALTEQ 1.0 Implementation and forgery demo
Python
1
star
24

lil-hawk-py

(Self-)educational implementation of the Hawk 1.0 PQC Signature Scheme
Python
1
star