diff --git a/basis/checksums/openssl/openssl.factor b/basis/checksums/openssl/openssl.factor index d42febb541..821cbe2f3a 100644 --- a/basis/checksums/openssl/openssl.factor +++ b/basis/checksums/openssl/openssl.factor @@ -28,7 +28,7 @@ M: evp-md-context dispose handle>> EVP_MD_CTX_cleanup drop ; : with-evp-md-context ( quot -- ) - maybe-init-ssl >r r> with-disposal ; inline + maybe-init-ssl [ ] dip with-disposal ; inline : digest-named ( name -- md ) dup EVP_get_digestbyname diff --git a/basis/checksums/sha1/sha1.factor b/basis/checksums/sha1/sha1.factor index bbae421b16..3767af7c55 100644 --- a/basis/checksums/sha1/sha1.factor +++ b/basis/checksums/sha1/sha1.factor @@ -41,9 +41,9 @@ SYMBOLS: h0 h1 h2 h3 h4 A B C D E w K ; : sha1-f ( B C D t -- f_tbcd ) 20 /i { - { 0 [ >r over bitnot r> bitand >r bitand r> bitor ] } + { 0 [ [ over bitnot ] dip bitand [ bitand ] dip bitor ] } { 1 [ bitxor bitxor ] } - { 2 [ 2dup bitand >r pick bitand >r bitand r> r> bitor bitor ] } + { 2 [ 2dup bitand [ pick bitand [ bitand ] dip ] dip bitor bitor ] } { 3 [ bitxor bitxor ] } } case ; diff --git a/basis/checksums/sha2/sha2.factor b/basis/checksums/sha2/sha2.factor index 0a6d8c26ab..beb657bd3e 100644 --- a/basis/checksums/sha2/sha2.factor +++ b/basis/checksums/sha2/sha2.factor @@ -59,7 +59,7 @@ SYMBOLS: vars M K H S0 S1 process-M word-size block-size ; [ 15 - swap nth s0-256 ] 2keep [ 7 - swap nth ] 2keep [ 2 - swap nth s1-256 ] 2keep - >r >r + + w+ r> r> swap set-nth ; inline + [ + + w+ ] 2dip swap set-nth ; inline : prepare-message-schedule ( seq -- w-seq ) word-size get group [ be> ] map block-size get 0 pad-right @@ -71,7 +71,7 @@ SYMBOLS: vars M K H S0 S1 process-M word-size block-size ; [ bitxor bitand ] keep bitxor ; : maj ( x y z -- x' ) - >r [ bitand ] 2keep bitor r> bitand bitor ; + [ [ bitand ] 2keep bitor ] dip bitand bitor ; : S0-256 ( x -- x' ) [ -2 bitroll-32 ] keep @@ -83,7 +83,7 @@ SYMBOLS: vars M K H S0 S1 process-M word-size block-size ; [ -11 bitroll-32 ] keep -25 bitroll-32 bitxor bitxor ; inline -: slice3 ( n seq -- a b c ) >r dup 3 + r> first3 ; inline +: slice3 ( n seq -- a b c ) [ dup 3 + ] dip first3 ; inline : T1 ( W n -- T1 ) [ swap nth ] keep @@ -105,7 +105,7 @@ SYMBOLS: vars M K H S0 S1 process-M word-size block-size ; d c pick exchange c b pick exchange b a pick exchange - >r w+ a r> set-nth ; + [ w+ a ] dip set-nth ; : process-chunk ( M -- ) H get clone vars set @@ -118,7 +118,7 @@ SYMBOLS: vars M K H S0 S1 process-M word-size block-size ; : preprocess-plaintext ( string big-endian? -- padded-string ) #! pad 0x80 then 00 til 8 bytes left, then 64bit length in bits - >r >sbuf r> over [ + [ >sbuf ] dip over [ HEX: 80 , dup length HEX: 3f bitand calculate-pad-length 0 %