Bitcoin Forum
April 25, 2024, 02:46:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: 1 2 [All]
  Print  
Author Topic: SHA256 Compression?  (Read 2157 times)
Reclaim3r (OP)
Full Member
***
Offline Offline

Activity: 139
Merit: 100


View Profile
March 01, 2015, 02:15:06 AM
 #1

I have been trying to design my own SHA256 ASIC for a while now and I'm starting to nearly grasp how the entire hashing algorithm works.
The only thing I seem to have difficulty understanding is how the hash function deals with "extended" strings of data.

That is, its ability to deal with varying lengths of data.
How does it deal with it and does it interfere much with ASIC hashing?
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714056367
Hero Member
*
Offline Offline

Posts: 1714056367

View Profile Personal Message (Offline)

Ignore
1714056367
Reply with quote  #2

1714056367
Report to moderator
ncsupanda
Legendary
*
Offline Offline

Activity: 1628
Merit: 1012



View Profile
March 01, 2015, 02:22:31 AM
 #2

You might have more luck in the technical forum.

https://bitcointalk.org/index.php?board=6.0
Reclaim3r (OP)
Full Member
***
Offline Offline

Activity: 139
Merit: 100


View Profile
March 01, 2015, 02:24:18 AM
 #3

Thanks. Is it possible to get this moved?
ncsupanda
Legendary
*
Offline Offline

Activity: 1628
Merit: 1012



View Profile
March 01, 2015, 02:37:04 AM
 #4

Thanks. Is it possible to get this moved?

Yep, you can even do it yourself. Look at the bottom left.
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
March 01, 2015, 02:59:12 AM
Last edit: March 01, 2015, 04:27:00 PM by btchris
 #5

I don't know the first thing about ASIC programming.... but if you're writing software that requires a large iteration count (PBKDF2, etc.) I'd probably take the "easy" way out and just do the first iteration in software, and do the rest with a single hash block and a hard-coded data length in the ASIC (what I lazily do with GPU/OpenCL-based stuff).
TheRealSteve
Hero Member
*****
Offline Offline

Activity: 686
Merit: 500

FUN > ROI


View Profile
March 01, 2015, 03:22:03 AM
 #6

Are you trying to design a generic SHA256 ASIC, or a Bitcoin mining ASIC?  There's a fair bit of difference there.

If the latter, I'd suggest looking at some of the public documents for the older FPGA miners, Avalon's chips, the data mining software sends to simple chips (i.e. not miners with their own controller board). etc.
For a quick "ahhh", see: http://crypto.stackexchange.com/questions/1862/how-can-i-calculate-the-sha-256-midstate

hhanh00
Sr. Member
****
Offline Offline

Activity: 467
Merit: 266


View Profile
March 01, 2015, 03:22:56 AM
 #7

1. In the general case, you add padding.
2. In the bitcoin case, the header has a fixed size. In fact, the nonce is in the 2nd block so you can reuse the state after you have done the first block.

Reclaim3r (OP)
Full Member
***
Offline Offline

Activity: 139
Merit: 100


View Profile
March 01, 2015, 03:29:13 PM
 #8

Are you trying to design a generic SHA256 ASIC, or a Bitcoin mining ASIC?  There's a fair bit of difference there.

If the latter, I'd suggest looking at some of the public documents for the older FPGA miners, Avalon's chips, the data mining software sends to simple chips (i.e. not miners with their own controller board). etc.
For a quick "ahhh", see: http://crypto.stackexchange.com/questions/1862/how-can-i-calculate-the-sha-256-midstate

Bitcoin mining ASIC. Thanks for the link. I'll look it over  Smiley
Sergio_Demian_Lerner
Hero Member
*****
expert
Offline Offline

Activity: 549
Merit: 608


View Profile WWW
March 01, 2015, 10:03:48 PM
 #9

You could start reading Dadda's paper.
"The design of a high speed ASIC unit for the hash function SHA-256 (384, 512)"
 
jeffhuys
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250



View Profile
March 02, 2015, 01:11:40 AM
 #10

You could start reading Dadda's paper.
"The design of a high speed ASIC unit for the hash function SHA-256 (384, 512)"
 

Great info! Thanks for sharing.

EDIT: Hmm. Probably no place to get this without paywall, right?

Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1006


View Profile
March 02, 2015, 03:09:23 AM
 #11

Maybe at university libraries?

https://www.coinlend.org <-- automated lending at various exchanges.
https://www.bitfinex.com <-- Trade BTC for other currencies and vice versa.
TheRealSteve
Hero Member
*****
Offline Offline

Activity: 686
Merit: 500

FUN > ROI


View Profile
March 02, 2015, 03:38:34 AM
 #12

Google → filetype:pdf "design of a high speed ASIC unit"
( you'll want to "View more results" on the last page - unless you get a different result order )

Or just pay the $31.. if you're designing an ASIC, that should be one of the rather small line items in your expenses Smiley

ncsupanda
Legendary
*
Offline Offline

Activity: 1628
Merit: 1012



View Profile
March 02, 2015, 03:43:59 AM
 #13

Let me know if this is the one. If it is, I'll email you a copy and take this one down.

Reclaim3r (OP)
Full Member
***
Offline Offline

Activity: 139
Merit: 100


View Profile
March 02, 2015, 02:54:21 PM
 #14

That looks like real useful piece of information. Is it possible to get that e-mailed please?
TheRealSteve
Hero Member
*****
Offline Offline

Activity: 686
Merit: 500

FUN > ROI


View Profile
March 02, 2015, 03:01:55 PM
 #15

That looks like real useful piece of information. Is it possible to get that e-mailed please?

Instructions are hard, I guess:
Google → filetype:pdf "design of a high speed ASIC unit"
( you'll want to "View more results" on the last page - unless you get a different result order )
http://www.date-conference.com/proceedings/PAPERS/2004/DATE04/DF_FILES/04D_5.PDF

Reclaim3r (OP)
Full Member
***
Offline Offline

Activity: 139
Merit: 100


View Profile
March 02, 2015, 03:05:34 PM
 #16

The instructions were easy. I had difficulty finding the right PDF. Thank you and sorry for the extra work you had to put in to link it.  Wink
TheRealSteve
Hero Member
*****
Offline Offline

Activity: 686
Merit: 500

FUN > ROI


View Profile
March 02, 2015, 03:11:55 PM
 #17

The instructions were easy. I had difficulty finding the right PDF. Thank you and sorry for the extra work you had to put in to link it.  Wink
Tip me a coffee, I think that's fair recompense Wink
( wait, does that tip bot thing even monitor BCT yet? Dangit. )

Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1006


View Profile
March 02, 2015, 03:16:35 PM
 #18

No, that tip bot thingie is pure spam and only a centralized service - there would be next to no difference if Changetip was used together with PayPal instead of Bitcoin.

https://www.coinlend.org <-- automated lending at various exchanges.
https://www.bitfinex.com <-- Trade BTC for other currencies and vice versa.
Reclaim3r (OP)
Full Member
***
Offline Offline

Activity: 139
Merit: 100


View Profile
March 02, 2015, 04:38:27 PM
 #19

The instructions were easy. I had difficulty finding the right PDF. Thank you and sorry for the extra work you had to put in to link it.  Wink
Tip me a coffee, I think that's fair recompense Wink
( wait, does that tip bot thing even monitor BCT yet? Dangit. )

Maybe when I actually have BTC to start with.
TheRealSteve
Hero Member
*****
Offline Offline

Activity: 686
Merit: 500

FUN > ROI


View Profile
March 02, 2015, 05:36:41 PM
 #20

Tip me a coffee, I think that's fair recompense Wink
( wait, does that tip bot thing even monitor BCT yet? Dangit. )
Maybe when I actually have BTC to start with.
Hah - was firmly tongue-in-cheek, though now I almost wish I could tip you Wink

No, that tip bot thingie is pure spam and only a centralized service - there would be next to no difference if Changetip was used together with PayPal instead of Bitcoin.
See above - don't want to derail the thread with a discussion on tipping systems Smiley

Reclaim3r (OP)
Full Member
***
Offline Offline

Activity: 139
Merit: 100


View Profile
March 02, 2015, 06:26:54 PM
 #21

I've got a pretty good idea of how the hashing actually woks although I have difficulty wrapping my head around the compression.

From what I've gathered, the data is split into suitable chunks and then hashed. If its less then ideal, it becomes padded although I doubt Bitcoin hashing requires it.

The Avalon data sheets point to a method of sorts for preprocessing where the data is split up outside the chip before being sent to it.

I also remember TheRealSteve telling me that a difference exists between typical SHA256 and the Merkle-Damgard construct...or Merkle Tree, if my vernacular is correct.
Pages: 1 2 [All]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!