Loading base85.fs +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ 85 buffer: 85>chars s" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~" 85>chars swap move 85>chars 85 smove $80 buffer: chars>85 85 0 [DO] [I] dup 85>chars + c@ chars>85 + c! [LOOP] Loading crypto-api.fs +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ require user-object.fs 2dup + 1- c@ dup >r safe/string r> skip nip 0= ; : >padded { addr1 u1 addr2 u2 -- } addr1 addr2 u1 u2 umin move addr1 u1 addr2 u2 smove u1 u2 u< IF addr2 u1 u2 >pad 2drop THEN ; \ For wurstkessel compatibility, the states are all 128 bytes Loading hash-table.fs +0 −14 Original line number Diff line number Diff line \ generic hash table functions require string.fs \ require wurstkessel.fs require rng.fs 2 64s buffer: hashinit Loading Loading @@ -32,19 +31,6 @@ hash-init-rng false hash-state hashkey2 ; : hash$ ( -- addr u ) hash-state [ 2 64s ]L ; [IFDEF] use-hash-wurst \ hash of the first 510 bytes of the input string, 3 times slower state# 8 * Constant message# : string-hash ( addr u -- ) 'hashinit wurst-source state# 2* move message message# erase dup message message# xc!+? drop rot umin dup >r move message r> 6 rshift $11 + rounds message 2 rounds ; : hash$ ( -- addr u ) wurst-state state# ; [THEN] \ hierarchical hash table Loading kregion.fs +2 −2 Original line number Diff line number Diff line Loading @@ -49,12 +49,12 @@ $10 Constant crypt-align : sec-off ( addr -- ) dup @ dup IF kfree64 off EXIT THEN 2drop ; : sec! ( addr1 u1 addr2 -- ) over 0= IF sec-off 2drop EXIT THEN >r r@ kalloc64? dup r> ! swap $40 umin move ; >r r@ kalloc64? dup r> ! $40 smove ; : sec@ ( addr -- addr1 u1 ) @ dup IF $40 over $20 + $20 zero32 over str= IF 2/ THEN ELSE 0 THEN ; : sec+! ( addr1 u1 addr2 -- ) dup @ 0= IF sec! ELSE sec@ dup >r + swap $40 r> - umin move THEN ; dup @ 0= IF sec! ELSE sec@ dup >r + $40 r> - smove THEN ; : sec+[]! ( addr1 u1 addr2 -- ) >r 0 { w^ sec } sec sec! sec cell r> $+! ; Loading net2o-addr.fs +2 −2 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ $11 net2o: addr-pri# ( n -- ) \g priority +net2o: addr-ipv4 ( n -- ) \g ip address 64>n host-ipv4 be-l! ; +net2o: addr-ipv6 ( $:ipv6 -- ) \g ipv6 address $> host-ipv6 swap $10 umin move ; $> host-ipv6 $10 smove ; +net2o: addr-portv4 ( n -- ) \g ipv4 port 64>n host-portv4 w! ; +net2o: addr-portv6 ( n -- ) \g ipv6 port Loading Loading @@ -127,7 +127,7 @@ previous o my-addr[] $[]# my-addr[] $[] ! ; : !my-addrs ( -- ) n2o:new-addr >o global-ip6 tuck host-ipv6 swap $10 umin move global-ip6 tuck host-ipv6 $10 smove global-ip4 IF be-ul@ host-ipv4 be-l! ELSE drop THEN my-port# +my-addrs o> 0= IF local-ipv6 IF Loading Loading
base85.fs +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ 85 buffer: 85>chars s" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~" 85>chars swap move 85>chars 85 smove $80 buffer: chars>85 85 0 [DO] [I] dup 85>chars + c@ chars>85 + c! [LOOP] Loading
crypto-api.fs +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ require user-object.fs 2dup + 1- c@ dup >r safe/string r> skip nip 0= ; : >padded { addr1 u1 addr2 u2 -- } addr1 addr2 u1 u2 umin move addr1 u1 addr2 u2 smove u1 u2 u< IF addr2 u1 u2 >pad 2drop THEN ; \ For wurstkessel compatibility, the states are all 128 bytes Loading
hash-table.fs +0 −14 Original line number Diff line number Diff line \ generic hash table functions require string.fs \ require wurstkessel.fs require rng.fs 2 64s buffer: hashinit Loading Loading @@ -32,19 +31,6 @@ hash-init-rng false hash-state hashkey2 ; : hash$ ( -- addr u ) hash-state [ 2 64s ]L ; [IFDEF] use-hash-wurst \ hash of the first 510 bytes of the input string, 3 times slower state# 8 * Constant message# : string-hash ( addr u -- ) 'hashinit wurst-source state# 2* move message message# erase dup message message# xc!+? drop rot umin dup >r move message r> 6 rshift $11 + rounds message 2 rounds ; : hash$ ( -- addr u ) wurst-state state# ; [THEN] \ hierarchical hash table Loading
kregion.fs +2 −2 Original line number Diff line number Diff line Loading @@ -49,12 +49,12 @@ $10 Constant crypt-align : sec-off ( addr -- ) dup @ dup IF kfree64 off EXIT THEN 2drop ; : sec! ( addr1 u1 addr2 -- ) over 0= IF sec-off 2drop EXIT THEN >r r@ kalloc64? dup r> ! swap $40 umin move ; >r r@ kalloc64? dup r> ! $40 smove ; : sec@ ( addr -- addr1 u1 ) @ dup IF $40 over $20 + $20 zero32 over str= IF 2/ THEN ELSE 0 THEN ; : sec+! ( addr1 u1 addr2 -- ) dup @ 0= IF sec! ELSE sec@ dup >r + swap $40 r> - umin move THEN ; dup @ 0= IF sec! ELSE sec@ dup >r + $40 r> - smove THEN ; : sec+[]! ( addr1 u1 addr2 -- ) >r 0 { w^ sec } sec sec! sec cell r> $+! ; Loading
net2o-addr.fs +2 −2 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ $11 net2o: addr-pri# ( n -- ) \g priority +net2o: addr-ipv4 ( n -- ) \g ip address 64>n host-ipv4 be-l! ; +net2o: addr-ipv6 ( $:ipv6 -- ) \g ipv6 address $> host-ipv6 swap $10 umin move ; $> host-ipv6 $10 smove ; +net2o: addr-portv4 ( n -- ) \g ipv4 port 64>n host-portv4 w! ; +net2o: addr-portv6 ( n -- ) \g ipv6 port Loading Loading @@ -127,7 +127,7 @@ previous o my-addr[] $[]# my-addr[] $[] ! ; : !my-addrs ( -- ) n2o:new-addr >o global-ip6 tuck host-ipv6 swap $10 umin move global-ip6 tuck host-ipv6 $10 smove global-ip4 IF be-ul@ host-ipv4 be-l! ELSE drop THEN my-port# +my-addrs o> 0= IF local-ipv6 IF Loading