en:pfw:sha-256
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:pfw:sha-256 [2024-10-17 12:50] – jeroenh | en:pfw:sha-256 [2024-10-17 13:09] (current) – jeroenh | ||
---|---|---|---|
Line 187: | Line 187: | ||
</ | </ | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
+ | |||
**Testing the SHA-256 algorithm** | **Testing the SHA-256 algorithm** | ||
Testing the SHA-256 algorithm can be done with the following code. The ' | Testing the SHA-256 algorithm can be done with the following code. The ' | ||
- | + | ||
+ | |||
< | < | ||
Line 233: | Line 233: | ||
</ | </ | ||
- | + | ||
- | + | ||
- | + | ||
+ | |||
+ | |||
**Optimising performance of the SHA-256 hash generator - step 1 ** | **Optimising performance of the SHA-256 hash generator - step 1 ** | ||
Line 243: | Line 244: | ||
One way of optimising performance is to use Forth-Macros, | One way of optimising performance is to use Forth-Macros, | ||
- | + | ||
- | + | ||
+ | |||
< | < | ||
- | + | ||
+ | |||
\ ======================================================== | \ ======================================================== | ||
\ ANS Forth code for Secure Hash Algorithms SHA-256 | \ ANS Forth code for Secure Hash Algorithms SHA-256 | ||
Line 473: | Line 474: | ||
- | </code\ | + | </code> |
- | + | ||
- | + | ||
- | + | ||
+ | |||
**Optimising performance of the SHA-256 hash generator - step 2 ** | **Optimising performance of the SHA-256 hash generator - step 2 ** | ||
- | A more thorough optimisation | + | A more thorough optimisation |
Line 495: | Line 496: | ||
The following is an example where ARM32 assembly is used for the subloop and the HASH1BLOCK word: | The following is an example where ARM32 assembly is used for the subloop and the HASH1BLOCK word: | ||
- | + | ||
+ | |||
< | < | ||
Line 775: | Line 776: | ||
</ | </ | ||
- | + | ||
- | + | ||
- | + | ||
+ | |||
Please note that this is all done using bog-standard ARM32 assembly, no SHA-256 specific opcodes are used. These SHA_256 specific opcodes would increase the performance even more. Another option would be to use the NEON coprocessor. This is available on Raspberry Pi2 and later and would allow some parallel processing of the subloop. If this really raises throughput is as yet unproven. | Please note that this is all done using bog-standard ARM32 assembly, no SHA-256 specific opcodes are used. These SHA_256 specific opcodes would increase the performance even more. Another option would be to use the NEON coprocessor. This is available on Raspberry Pi2 and later and would allow some parallel processing of the subloop. If this really raises throughput is as yet unproven. | ||
en/pfw/sha-256.1729162244.txt.gz · Last modified: 2024-10-17 12:50 by jeroenh