Hashing

DocSkyHawk

New Member
Are the PIC microcontrollers capable of performing SHA256 or scrypt hashing? I have seem some examples of MD5 and SH1.
 
To me bitcoin is a bit out of reach for a hobbyist and the price has fluctuated way too much for me to want to keep a balance. There is an endless list of coins still growing that are able to be mined without needing a ton of hardware. If anything, it has been fun messing around with them. Cryptocurrencies have had their share of bad press but when doing further research, I believe it has a real place.

Back to the tech question, what would prevent a PIC from being able to run the C code that generates the hashes?
 
Pic32 should manage it.. It all comes down to variables.... Most small micro's can do the math but when you use a math library you will run out of RAM... The math library itself will need quite a bit...

For a job of this nature you will be looking at 4K + of RAM... dispic and pic24 /32 should be able to cope..
 
With 40-80mhz, what kind of hash per second would this produce? I know it would depend on the code but a ball park would be nice.
 
Pass... I don't know how many calculations there are in a hash.... but to do 33 thousand a second is a big ask for a micro.

You'll notice they use FPGA's to do this... I also notice there are different levels of hashing... sha-256 seems to be the hardest...

If you go to the open source web pages... You can take a peek at the size of the job before you decide.... You may be better off with a FPGA anyway!
 
SHA256 requires lots of 32-bit rotations - about 500 per transform, plus other stuff

PIC18. They can only rotate 8-bit by one position per instruction, so you'll need about 30 to 40 instructions per rotation - 20,000 per transform. At 20MHz - 5MIPS it's about 250/sec. But PIC18 will require lots of overhead, so 100/sec would be a good rate.

PIC24. It has 16-bit rotations by arbitrary amount, so it's 4-5 instructions per rotation - 2500 per transform. At 80MHz - 40MIPS it's about 16k/sec. But other operations will weigh more, so I guess 3-5k/sec may be achived.

In both cases, it'll take a lot of creativity and hard work to achive these rates.

PIC32. It's 32-bit, so should be faster, but I'm not familiar with its instruction set.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…