From 011628d3ce40918b84c160cdc493cf0da8eec210 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Mon, 3 Jul 2017 15:45:18 -0500 Subject: [PATCH] More rotate optimizations for SHA-256. --- sha256.macros | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sha256.macros b/sha256.macros index 1005ec0..213be00 100644 --- a/sha256.macros +++ b/sha256.macros @@ -362,8 +362,8 @@ sta temp1+2 lda &e+1 sta temp1 - ROTL4CONT temp1,2 - ROTR4MOVE temp2,temp1,5 + ROTR4MOVE temp2,temp1,3 + ROTL4 temp1,2 lda &e-1 and #$FF00 sta temp3 @@ -437,7 +437,16 @@ lda &a+2 sta temp3 ROTL4CONT temp3,3 - ROTR4MOVE temp4,&a,22 + lda &a+1 + sta temp4+2 + lda &a-1 + and #$FF00 + sta temp4 + lda &a+3 + and #$00FF + ora temp4 + sta temp4 + ROTL4CONT temp4,2 lda temp2 eor temp3 eor temp4