An open API service indexing awesome lists of open source software.

https://github.com/empicano/sha2-256

The SHA2-256 hash function in x86 IA-32 assembly
https://github.com/empicano/sha2-256

assembly cryptography hash nasm sha2 sha256 sha512 x86

Last synced: 7 months ago
JSON representation

The SHA2-256 hash function in x86 IA-32 assembly

Awesome Lists containing this project

README

          

This project realizes the SHA2 cryptographic hash function for Linux in NASM syntax IA-32 assembly. An explanation with pseudocode of SHA2 can be found on [Wikipedia](https://en.wikipedia.org/wiki/SHA-2).

I intended it mostly as an assembly programming exercise, whilst also wanting to know how a hash function works on the inside. I had no real aspirations for extraordinary performance. I worked my way down from pseudocode to an implementation in Python, followed by a translation of the latter to assembly code.

**Assemble and run with:**

- `nasm -f elf32 sha2-256.asm -o sha2-256.o`
- `ld -m elf_i386 sha2-256.o -o sha2-256`
- `./sha-256 `

The assembly version as well as the Python version expect ascii strings as input.