]> gitweb.factorcode.org Git - factor.git/commitdiff
sodium: move some words into the <PRIVATE> section
authorAlexander Iljin <ajsoft@yandex.ru>
Sun, 23 Dec 2018 23:48:01 +0000 (00:48 +0100)
committerAlexander Iljin <ajsoft@yandex.ru>
Sun, 23 Dec 2018 23:51:08 +0000 (00:51 +0100)
extra/sodium/sodium.factor

index fb1611137312cc5e409f0f9ef8b79839cd02495b..08df893324fd0a9049d09570841000a0a1a4bb86 100644 (file)
@@ -11,6 +11,16 @@ ERROR: buffer-too-small ;
 ! Call this before any other function, may be called multiple times.
 : sodium-init ( -- ) sodium_init 0 < [ sodium-init-fail ] when ;
 
+<PRIVATE
+
+: cipher-buf ( message-length n -- byte-array )
+    crypto_secretbox_macbytes + <byte-array> ;
+
+: message-buf ( cipher-length n -- byte-array )
+    crypto_secretbox_macbytes - <byte-array> ;
+
+PRIVATE>
+
 : random-bytes ( byte-array -- byte-array' )
     dup dup length randombytes_buf ;
 
@@ -30,12 +40,6 @@ ERROR: buffer-too-small ;
 : crypto-generichash ( out-bytes in-bytes key-bytes/f -- out-bytes' )
     [ dup ] 2dip [ dup length ] tri@ crypto_generichash check0 ;
 
-: cipher-buf ( msg-length -- byte-array )
-    crypto_secretbox_macbytes + <byte-array> ;
-
-: message-buf ( msg-length -- byte-array )
-    crypto_secretbox_macbytes - <byte-array> ;
-
 : check-length ( byte-array min-length -- byte-array )
     [ dup length ] dip < [ buffer-too-small ] when ;