<blockquote>
<p>SHA256D, which is what Bitcoin uses, is 128 rounds, comprising</p>
<p>768 additions,</p>
<p>640 ORs</p>
<p>896 XORs</p>
<p>And a bunch of bit shifts but bit shifts are free on an ASIC.</p>
</blockquote>
<p>(<a href="https://bitcointalk.org/index.php?topic=1029536.msg11131028#msg11131028" rel="nofollow noreferrer">source</a>)</p>

CC BY-SA 3.0
2015-04-19T08:32:12.340Z
Those numbers don't seem correct. I count 522 additions across one iteration of SHA256, for example. (1044 across two) http://en.wikipedia.org/wiki/SHA-2#Pseudocode
Nick ODell
CC BY-SA 3.0
2015-04-19T15:03:38.317Z
...and I'm counting 600 additions for one SHA256 block: [48*3](https://github.com/gurnec/HashCheck/blob/e08a5683a43fecd08e8127debf81d6c1228c5990/libs/sha256.c#L81-L83) + [64*7](https://github.com/gurnec/HashCheck/blob/e08a5683a43fecd08e8127debf81d6c1228c5990/libs/sha256.c#L98-L109) + [8](https://github.com/gurnec/HashCheck/blob/e08a5683a43fecd08e8127debf81d6c1228c5990/libs/sha256.c#L112-L119). Honestly I think this should be closed as off-topic and re-posted to http://crypto.stackexchange.com/ where you could attract the attention of a crypto expert.
Christopher Gurnee
CC BY-SA 3.0
2015-04-19T05:25:20.110Z
2015-04-19T06:07:10.993Z
2020-06-16T11:10:03.350Z
Geremia
<p>What is the theoretical minimum number of logical operations an ASIC needs to perform to compute double iterated SHA256, i.e., sha(sha(•))?</p>

CC BY-SA 3.0
2015-04-19T08:33:28.253Z
Is this the best way to phrase the question? It seems like you'd want to know 1) the number of gates required to implement it, and 2) how much it can be pipelined (probably quite a lot.)
Nick ODell
<sha256>
Theoretical minimum # of logic operations to perform double iterated SHA256?
Geremia
# Theoretical minimum # of logic operations to perform double iterated SHA256?

(Asked by: username_0 on 2015-04-18)

What is the theoretical minimum number of logical operations an ASIC needs to perform to compute double iterated SHA256, i.e., sha(sha(•))?

**Tags:** sha256

> **Comments:**
> **username_1**: Is this the best way to phrase the question? It seems like you'd want to know 1) the number of gates required to implement it, and 2) how much it can be pipelined (probably quite a lot.)  

---

## 1 answers

### Answer by username_0 on 2015-04-19. Score: 3 | Accepted answer

> SHA256D, which is what Bitcoin uses, is 128 rounds, comprising
>
> 768 additions,
>
> 640 ORs
>
> 896 XORs
>
> And a bunch of bit shifts but bit shifts are free on an ASIC.

([source](https://bitcointalk.org/index.php?topic=1029536.msg11131028#msg11131028))

> **Comments:**
> **username_1**: Those numbers don't seem correct. I count 522 additions across one iteration of SHA256, for example. (1044 across two) http://en.wikipedia.org/wiki/SHA-2#Pseudocode  
> **username_2**: ...and I'm counting 600 additions for one SHA256 block: [48*3](https://github.com/gurnec/HashCheck/blob/e08a5683a43fecd08e8127debf81d6c1228c5990/libs/sha256.c#L81-L83) + [64*7](https://github.com/gurnec/HashCheck/blob/e08a5683a43fecd08e8127debf81d6c1228c5990/libs/sha256.c#L98-L109) + [8](https://github.com/gurnec/HashCheck/blob/e08a5683a43fecd08e8127debf81d6c1228c5990/libs/sha256.c#L112-L119). Honestly I think this should be closed as off-topic and re-posted to http://crypto.stackexchange.com/ where you could attract the attention of a crypto expert.  

---

