From cb2a7e9ac556249ebc9c6ccdd044d73de1ce6bbc Mon Sep 17 00:00:00 2001 From: erg Date: Fri, 29 Sep 2006 18:22:35 +0000 Subject: [PATCH] sha2 - optimize boolean logic --- contrib/crypto/sha2.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/crypto/sha2.factor b/contrib/crypto/sha2.factor index ce4f7272b1..bdd0400d59 100644 --- a/contrib/crypto/sha2.factor +++ b/contrib/crypto/sha2.factor @@ -71,10 +71,10 @@ SYMBOL: >word ] each-with ; : ch ( x y z -- x' ) - pick bitnot bitand >r bitand r> bitxor ; + [ bitxor bitand ] keep bitxor ; : maj ( x y z -- x' ) - >r [ bitand ] 2keep r> [ rot bitand ] keep rot bitand bitxor bitxor ; + >r [ bitand ] 2keep bitor r> bitand bitor ; : S0-256 ( x -- x' ) [ -2 bitroll-32 ] keep