Skip to content

oconnor663/blake3-6502

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

BLAKE3 in 6502 assembly

BLAKE3 is a cryptographic hash function. The MOS 6502 is the classic 8-bit microprocessor that powered the Apple II, the Commodore 64, and the NES console. This implementation of BLAKE3 runs on Ben Eater's 6502 breadboard computer. Source code is in rom.s.

This program loops over the BLAKE3 test vectors and hashes each one. Then it hashes a couple more inputs, including the one shown in the photo above, 1 MB of all zeros. This is larger than the 6502's 64 KiB of addressable memory, and with a 1 MHz clock it takes 17.7 minutes. You can reproduce the same result with b3sum in the terminal:

$ head -c 1000000 /dev/zero | b3sum --length=8
c211bb2e5afbd0ef  -

You can also run this program in the terminal with make emulate. This requires Rust and Cargo. The emulator is based on the emulator_6502 Rust crate by Garett Cooper.

About

the BLAKE3 hash function implemented in 6502 assembly

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published