diff options
author | lloyd <[email protected]> | 2006-08-13 16:59:43 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-08-13 16:59:43 +0000 |
commit | 82f6a73359657f0e2fb95ff9c0749a8bec14877f (patch) | |
tree | c27af27918776dadf41263d69712a5aeca4e3dac /modules/alg_ia32 | |
parent | c4613e5d54c0d94773ae2c0ce4fead9654a7450c (diff) |
Use LEA with the magic constant and A, rather than the magic and the
boolean; same trick as in MD5. Roughly a 5% speedup.
Diffstat (limited to 'modules/alg_ia32')
-rw-r--r-- | modules/alg_ia32/sha1core.S | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/alg_ia32/sha1core.S b/modules/alg_ia32/sha1core.S index 7578685b2..ab5f1e7af 100644 --- a/modules/alg_ia32/sha1core.S +++ b/modules/alg_ia32/sha1core.S @@ -99,19 +99,19 @@ LOOP_UNTIL(ESI, IMM(80), .EXPANSION) AND(T2, B) ; \ XOR(T2, D) ; \ ROTR_IMM(B, 2) ; \ - ADD(E, A) ; \ - ADD3_IMM(E, T2, MAGIC1) ; \ + ADD3_IMM(E, A, MAGIC1) ; \ + ADD(E, T2) ; \ ROTR_IMM(A, 5) ; -#define F2_OR_F4(A, B, C, D, E, MSG, MAGIC) \ +#define F2_4(A, B, C, D, E, MSG, MAGIC) \ ROTL_IMM(A, 5) ; \ ADD(E, ARRAY4(EDI, MSG)) ; \ ASSIGN(T2, D) ; \ XOR(T2, C) ; \ XOR(T2, B) ; \ ROTR_IMM(B, 2) ; \ - ADD(E, A) ; \ - ADD3_IMM(E, T2, MAGIC) ; \ + ADD3_IMM(E, A, MAGIC) ; \ + ADD(E, T2) ; \ ROTR_IMM(A, 5) ; #define F3(A, B, C, D, E, MSG) \ @@ -124,15 +124,15 @@ LOOP_UNTIL(ESI, IMM(80), .EXPANSION) AND(ARRAY4(EDI, MSG), C) ; \ OR(T2, ARRAY4(EDI, MSG)) ; \ ROTR_IMM(B, 2) ; \ - ADD(E, A) ; \ - ADD3_IMM(E, T2, MAGIC3) ; \ + ADD3_IMM(E, A, MAGIC3) ; \ + ADD(E, T2) ; \ ROTR_IMM(A, 5) ; #define F2(A, B, C, D, E, MSG) \ - F2_OR_F4(A, B, C, D, E, MSG, MAGIC2) + F2_4(A, B, C, D, E, MSG, MAGIC2) #define F4(A, B, C, D, E, MSG) \ - F2_OR_F4(A, B, C, D, E, MSG, MAGIC4) + F2_4(A, B, C, D, E, MSG, MAGIC4) #define F_BLOCK(F, MSG) \ F(EAX, EBX, ECX, EDX, ESI, (MSG+0)) \ |