Skip to content
Adam Bliss edited this page Oct 25, 2013 · 1 revision

Implementation

++  fe                                                  ::  modulo bloq
  |_  a=bloq
  ++  dif  |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c))))
  ++  inv  |=(b=@ (sub (dec out) (sit b)))
  ++  net  |=  b=@  ^-  @
           =>  .(b (sit b))
           ?:  (lte a 3)
             b
           =+  c=(dec a) 
           %+  con
             (lsh c 1 $(a c, b (cut c [0 1] b)))
           $(a c, b (cut c [1 1] b))
  ++  out  (bex (bex a))
  ++  rol  |=  [b=@ c=@]  ^-  @
           =+  d=(sit c)
           =+  e=(bex a)
           =+  f=(mod b e)
           =+  g=(sub e f)
           (con (lsh 0 f (end 0 g d)) (rsh 0 g d))
  ++  ror  |=  [b=@ c=@]  ^-  @
           =+  d=(sit c)
           =+  e=(bex a)
           =+  f=(mod b e)
           =+  g=(sub e f)
           (con (rsh 0 f d) (lsh 0 g (end 0 f d)))
  ++  sum  |=([b=@ c=@] (sit (add b c)))
  ++  sit  |=(b=@ (end a 1 b))
  --

Comments



Parts of this document are generated automatically. Edits within the comments section will be preserved.

Clone this wiki locally