From 3a3d3f74333e654a9a3ffd496fa9e97e6550cdb7 Mon Sep 17 00:00:00 2001 From: Harrison Houghton Date: Mon, 11 Dec 2017 14:38:18 -0500 Subject: [PATCH] Remove hand-written ScalaSodium boilerplate! Replace with a combo sun.tools + scalameta + scalafmt Frankenstein monster of a scala script ran from within SBT. Simply type > gensodium whenever the `sodium.i` file is changed, and `ScalaSodium0.scala` will be updated as necessary. Also tweak the setup scripts to work mo' bettah on OS X, for brainwashed mac users like myself. --- .gitignore | 3 +- project/GenSodiumPlugin.scala | 24 + project/boiler/gensodium.scala | 108 + project/plugins.sbt | 35 +- sodium_setup.sh | 18 +- tsec-libsodium/jni/setup.sh | 18 +- tsec-libsodium/jni/sodium.i | 4 + .../main/scala/tsec/jni/ScalaSodium0.scala | 1733 +++++++++++++++++ .../src/main/scala/tsec/jni/SodiumJNI.java | 2 +- .../scala/tsec/libsodium/ScalaSodium.scala | 1164 +---------- 10 files changed, 1934 insertions(+), 1175 deletions(-) create mode 100644 project/GenSodiumPlugin.scala create mode 100644 project/boiler/gensodium.scala mode change 100644 => 100755 tsec-libsodium/jni/setup.sh create mode 100644 tsec-libsodium/src/main/scala/tsec/jni/ScalaSodium0.scala diff --git a/.gitignore b/.gitignore index 3f88affa..f8daf436 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ t.scala *.log tsec-libsodium/jni/*.java tsec-libsodium/jni/*.c -tsec-libsodium/jni/*.so \ No newline at end of file +tsec-libsodium/jni/*.so +tsec-libsodium/jni/*.dylib diff --git a/project/GenSodiumPlugin.scala b/project/GenSodiumPlugin.scala new file mode 100644 index 00000000..e0e530fb --- /dev/null +++ b/project/GenSodiumPlugin.scala @@ -0,0 +1,24 @@ +package tsec.build + +object GenSodiumPlugin extends sbt.AutoPlugin { + import sbt._ + + override def requires = empty + override def trigger = allRequirements + + object autoImport { + lazy val gensodium = taskKey[Unit]("Generate ScalaSodium0.scala") + } + import autoImport._ + + override def buildSettings = Seq( + /* See plugins.sbt for why this is dynamically loaded */ + gensodium := { + getClass.getClassLoader + .loadClass("tsec.build.GenSodium") + .getMethod("main", classOf[Array[String]]) + .invoke(null, Array.empty[String]) + } + ) + +} diff --git a/project/boiler/gensodium.scala b/project/boiler/gensodium.scala new file mode 100644 index 00000000..12061204 --- /dev/null +++ b/project/boiler/gensodium.scala @@ -0,0 +1,108 @@ +package tsec.build + +import scala.collection.JavaConverters._ + +object GenSodium extends App { + + val FormatConfig = { + import org.scalafmt.config._ + ScalafmtConfig.intellij.copy( + align = Align.none, + newlines = ScalafmtConfig.intellij.newlines.copy( + alwaysBeforeTopLevelStatements = true, + ) + ) + } + + import com.sun.source.{tree => jtree} + import javax.lang.model.`type`.TypeKind + import java.nio.charset._ + + val jMethods: Seq[jtree.MethodTree] = { + import com.sun.tools.javac._ + import tree.{JCTree => tree} + import scala.io._ + + val source = Source + .fromFile("tsec-libsodium/jni/Sodium.java") // looking here b/c param names not in SodiumJNI + .mkString + val ctx = new util.Context() + new file.JavacFileManager(ctx, true, StandardCharsets.UTF_8) + util.Options.instance(ctx).put(com.sun.tools.javac.main.Option.PARAMETERS, "true") + val parse = parser.ParserFactory + .instance(ctx) + .newParser(source, false, false, false) + val unit = parse.parseCompilationUnit() + val clasz = unit.getTypeDecls.asScala.collectFirst { + case decl: tree.JCClassDecl if decl.name.toString == "Sodium" => decl + }.getOrElse(sys.error("could not find Sodium class")) + + clasz.defs.asScala.collect { + case decl: tree.JCMethodDecl => decl + } + } + + import scala.meta._ + + def transType(jt: jtree.Tree): Type = jt match { + case prim: jtree.PrimitiveTypeTree => prim.getPrimitiveTypeKind match { + case TypeKind.BOOLEAN => t"Boolean" + case TypeKind.BYTE => t"Byte" + case TypeKind.SHORT => t"Short" + case TypeKind.INT => t"Int" + case TypeKind.LONG => t"Long" + case TypeKind.CHAR => t"Char" + case TypeKind.FLOAT => t"Float" + case TypeKind.DOUBLE => t"Double" + case TypeKind.VOID => t"Unit" + case other => sys.error(s"Unsupported primitive type kind $other") + } + case arr: jtree.ArrayTypeTree => t"Array[${transType(arr.getType)}]" + } + + val sMethods = jMethods.map { jm => + val params: List[Term.Param] = jm.getParameters.asScala.map { jp => + val name = Term.Name(jp.getName.toString) + val tpe = transType(jp.getType) + Term.Param(mods = Nil, name = name, decltpe = Some(tpe), default = None) + }.toList + val name = Term.Name(jm.getName.toString) + val tpe = transType(jm.getReturnType) + val args = params.map { p => Term.Name(p.name.value) } + val rhs = q"SodiumJNI.$name(..$args)" + Defn.Def( + mods = Mod.Final() :: Nil, + name = name, + tparams = Nil, + paramss = List(params), + decltpe = Some(tpe), + body = rhs + ) + }.sortBy(_.name.value).toList + + val noSelfType = Term.Param(Nil, Name.Anonymous(), None, None) + + val clsDef = Defn.Class( + mods = Mod.Abstract() :: Mod.Protected(within = Term.Name("tsec")):: Nil, + name = Type.Name("ScalaSodium0"), + tparams = Nil, + ctor = Ctor.Primary(Mod.Private(within = Term.Name("tsec")) :: Nil, name = Ctor.Name("ScalaSodium0"), paramss = Nil), + templ = Template(early = Nil, parents = Nil, self = noSelfType, Some(sMethods)) + ) + + val warning = + s"""/* !!! GENERATED CODE: DO NOT EDIT !!! */ + |/* This file is generated by project/boiler/gensodium.scala from tsec-libsodium/jni/sodium.i */ + |/* Timestamp: ${java.time.Instant.now.toString} */ + | + """.stripMargin + + val pkg = Pkg(q"tsec.jni", clsDef :: Nil) + + val src = org.scalafmt.Scalafmt.format(warning + pkg.toString, style = FormatConfig).get + + import java.io._ + + new FileOutputStream(new File("tsec-libsodium/src/main/scala/tsec/jni/ScalaSodium0.scala")) + .write(src.getBytes(StandardCharsets.UTF_8)) +} diff --git a/project/plugins.sbt b/project/plugins.sbt index 9fc6dfdd..106f890c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,4 +4,37 @@ addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1") addSbtPlugin("com.47deg" % "sbt-microsites" % "0.7.4") addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.5.5") addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2") -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.27") \ No newline at end of file +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.27") + +libraryDependencies ++= List( + //"org.scalameta" %% "scalameta" % "2.1.2", + "com.geirsson" %% "scalafmt-core" % "1.3.0", + "com.geirsson" %% "scalafmt-cli" % "1.3.0", +) + +unmanagedJars in Compile ++= { + val log = streams.value.log + sys.env.get("JAVA_HOME").map(jh => new File(s"$jh/lib/tools.jar")) match { + case Some(tools) => Seq(Attributed.blank(tools)) + case None => + log.info( + """Could not find tools.jar! + | This is surprising, as it is included with the JDK. Maybe look into that. + | If everything else works, comment out gensodium (don't check that in, though!) + """.stripMargin + ) + Nil + } +} + + +sources in Compile ++= { + /* Sad hack for intellij, which doesn't recognize the unmanagedSources key: + * only compile the gensodium script if we're not inside IntelliJ. + * We dynamically load it from the `gensodium` task, so as long as we compile + * it from inside sbt, we'll be fine. + */ + if (!sys.env.getOrElse("XPC_SERVICE_NAME", "").toLowerCase.contains("intellij")) + file("project/boiler/gensodium.scala").getAbsoluteFile :: Nil + else Nil +} \ No newline at end of file diff --git a/sodium_setup.sh b/sodium_setup.sh index f412a5d0..a4411a59 100755 --- a/sodium_setup.sh +++ b/sodium_setup.sh @@ -26,17 +26,25 @@ swig -java -package tsec.jni sodium.i rm -f ../src/main/scala/tsec/jni/SodiumJNI.java cp SodiumJNI.java ../src/main/scala/tsec/jni +case "$OSTYPE" in + darwin*) + jnilib=libsodiumjni.dylib + destlib=/Library/Java/Extensions + sudo update_dyld_shared_cache + ;; + *) + jnilib=libsodiumjni.so + destlib=/usr/lib + sudo ldconfig + ;; +esac - -jnilib=libsodiumjni.so -destlib=/usr/lib -sudo ldconfig echo $jnilib echo $destlib echo $destlib/$jnilib -gcc -I../usr/local/include/sodium -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux sodium_wrap.c -shared -fPIC -L/usr/local/lib -L/usr/lib -lsodium -o $jnilib +gcc -I../usr/local/include/sodium -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -I${JAVA_HOME}/include/darwin sodium_wrap.c -shared -fPIC -L/usr/local/lib -L/usr/lib -lsodium -o $jnilib sudo rm -f $destlib/$jnilib sudo cp $jnilib $destlib rm -f *.java diff --git a/tsec-libsodium/jni/setup.sh b/tsec-libsodium/jni/setup.sh old mode 100644 new mode 100755 index b577aab0..96c69414 --- a/tsec-libsodium/jni/setup.sh +++ b/tsec-libsodium/jni/setup.sh @@ -23,14 +23,24 @@ export PATH=/usr/local/bin:$PATH swig -java -package tsec.jni sodium.i -jnilib=libsodiumjni.so -destlib=/usr/lib -sudo ldconfig +case "$OSTYPE" in + darwin*) + jnilib=libsodiumjni.dylib + destlib=/Library/Java/Extensions + sudo update_dyld_shared_cache + ;; + *) + jnilib=libsodiumjni.so + destlib=/usr/lib + sudo ldconfig + ;; +esac + echo $jnilib echo $destlib echo $destlib/$jnilib -gcc -I../usr/local/include/sodium -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux sodium_wrap.c -shared -fPIC -L/usr/local/lib -L/usr/lib -lsodium -o $jnilib +gcc -I../usr/local/include/sodium -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -I${JAVA_HOME}/include/darwin sodium_wrap.c -shared -fPIC -L/usr/local/lib -L/usr/lib -lsodium -o $jnilib sudo rm -f $destlib/$jnilib sudo cp $jnilib $destlib diff --git a/tsec-libsodium/jni/sodium.i b/tsec-libsodium/jni/sodium.i index 22a886af..35e7b8db 100644 --- a/tsec-libsodium/jni/sodium.i +++ b/tsec-libsodium/jni/sodium.i @@ -1,4 +1,8 @@ /* sodium.i */ +/* NOTE WELL that if you change this file, you must update the interface files thusly: + * - run `./setup.sh` to generate the SWIG JNI files + * - run `sbt gensodium` to generate the Scala interface + */ %module Sodium %include "typemaps.i" diff --git a/tsec-libsodium/src/main/scala/tsec/jni/ScalaSodium0.scala b/tsec-libsodium/src/main/scala/tsec/jni/ScalaSodium0.scala new file mode 100644 index 00000000..5ce6cd99 --- /dev/null +++ b/tsec-libsodium/src/main/scala/tsec/jni/ScalaSodium0.scala @@ -0,0 +1,1733 @@ +/* !!! GENERATED CODE: DO NOT EDIT !!! */ +/* This file is generated by project/boiler/gensodium.scala from tsec-libsodium/jni/sodium.i */ +/* Timestamp: 2017-12-11T19:37:44.622Z */ + +package tsec.jni +abstract protected[tsec] class ScalaSodium0 private[tsec] { + final def crypto_aead_aes256gcm_decrypt( + m: Array[Byte], + mlen_p: Array[Int], + nsec: Array[Byte], + c: Array[Byte], + clen: Int, + ad: Array[Byte], + adlen: Int, + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_aes256gcm_decrypt( + m, + mlen_p, + nsec, + c, + clen, + ad, + adlen, + npub, + k + ) + final def crypto_aead_aes256gcm_decrypt_detached( + m: Array[Byte], + nsec: Array[Byte], + c: Array[Byte], + clen: Int, + mac: Array[Byte], + ad: Array[Byte], + adlen: Int, + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_aes256gcm_decrypt_detached( + m, + nsec, + c, + clen, + mac, + ad, + adlen, + npub, + k + ) + final def crypto_aead_aes256gcm_encrypt( + c: Array[Byte], + clen_p: Array[Int], + m: Array[Byte], + mlen: Int, + ad: Array[Byte], + adlen: Int, + nsec: Array[Byte], + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_aes256gcm_encrypt( + c, + clen_p, + m, + mlen, + ad, + adlen, + nsec, + npub, + k + ) + final def crypto_aead_aes256gcm_encrypt_detached( + c: Array[Byte], + mac: Array[Byte], + maclen_p: Array[Int], + m: Array[Byte], + mlen: Int, + ad: Array[Byte], + adlen: Int, + nsec: Array[Byte], + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_aes256gcm_encrypt_detached( + c, + mac, + maclen_p, + m, + mlen, + ad, + adlen, + nsec, + npub, + k + ) + final def crypto_aead_chacha20poly1305_decrypt( + m: Array[Byte], + mlen_p: Array[Int], + nsec: Array[Byte], + c: Array[Byte], + clen: Int, + ad: Array[Byte], + adlen: Int, + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_chacha20poly1305_decrypt( + m, + mlen_p, + nsec, + c, + clen, + ad, + adlen, + npub, + k + ) + final def crypto_aead_chacha20poly1305_decrypt_detached( + m: Array[Byte], + nsec: Array[Byte], + c: Array[Byte], + clen: Int, + mac: Array[Byte], + ad: Array[Byte], + adlen: Int, + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_chacha20poly1305_decrypt_detached( + m, + nsec, + c, + clen, + mac, + ad, + adlen, + npub, + k + ) + final def crypto_aead_chacha20poly1305_encrypt( + c: Array[Byte], + clen_p: Array[Int], + m: Array[Byte], + mlen: Int, + ad: Array[Byte], + adlen: Int, + nsec: Array[Byte], + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_chacha20poly1305_encrypt( + c, + clen_p, + m, + mlen, + ad, + adlen, + nsec, + npub, + k + ) + final def crypto_aead_chacha20poly1305_encrypt_detached( + c: Array[Byte], + mac: Array[Byte], + maclen_p: Array[Int], + m: Array[Byte], + mlen: Int, + ad: Array[Byte], + adlen: Int, + nsec: Array[Byte], + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_chacha20poly1305_encrypt_detached( + c, + mac, + maclen_p, + m, + mlen, + ad, + adlen, + nsec, + npub, + k + ) + final def crypto_aead_chacha20poly1305_ietf_decrypt( + m: Array[Byte], + mlen_p: Array[Int], + nsec: Array[Byte], + c: Array[Byte], + clen: Int, + ad: Array[Byte], + adlen: Int, + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_chacha20poly1305_ietf_decrypt( + m, + mlen_p, + nsec, + c, + clen, + ad, + adlen, + npub, + k + ) + final def crypto_aead_chacha20poly1305_ietf_decrypt_detached( + m: Array[Byte], + nsec: Array[Byte], + c: Array[Byte], + clen: Int, + mac: Array[Byte], + ad: Array[Byte], + adlen: Int, + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_chacha20poly1305_ietf_decrypt_detached( + m, + nsec, + c, + clen, + mac, + ad, + adlen, + npub, + k + ) + final def crypto_aead_chacha20poly1305_ietf_encrypt( + c: Array[Byte], + clen_p: Array[Int], + m: Array[Byte], + mlen: Int, + ad: Array[Byte], + adlen: Int, + nsec: Array[Byte], + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_chacha20poly1305_ietf_encrypt( + c, + clen_p, + m, + mlen, + ad, + adlen, + nsec, + npub, + k + ) + final def crypto_aead_chacha20poly1305_ietf_encrypt_detached( + c: Array[Byte], + mac: Array[Byte], + maclen_p: Array[Int], + m: Array[Byte], + mlen: Int, + ad: Array[Byte], + adlen: Int, + nsec: Array[Byte], + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_chacha20poly1305_ietf_encrypt_detached( + c, + mac, + maclen_p, + m, + mlen, + ad, + adlen, + nsec, + npub, + k + ) + final def crypto_aead_xchacha20poly1305_ietf_decrypt( + m: Array[Byte], + mlen_p: Array[Int], + nsec: Array[Byte], + c: Array[Byte], + clen: Int, + ad: Array[Byte], + adlen: Int, + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_xchacha20poly1305_ietf_decrypt( + m, + mlen_p, + nsec, + c, + clen, + ad, + adlen, + npub, + k + ) + final def crypto_aead_xchacha20poly1305_ietf_decrypt_detached( + m: Array[Byte], + nsec: Array[Byte], + c: Array[Byte], + clen: Int, + mac: Array[Byte], + ad: Array[Byte], + adlen: Int, + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_xchacha20poly1305_ietf_decrypt_detached( + m, + nsec, + c, + clen, + mac, + ad, + adlen, + npub, + k + ) + final def crypto_aead_xchacha20poly1305_ietf_encrypt( + c: Array[Byte], + clen_p: Array[Int], + m: Array[Byte], + mlen: Int, + ad: Array[Byte], + adlen: Int, + nsec: Array[Byte], + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_xchacha20poly1305_ietf_encrypt( + c, + clen_p, + m, + mlen, + ad, + adlen, + nsec, + npub, + k + ) + final def crypto_aead_xchacha20poly1305_ietf_encrypt_detached( + c: Array[Byte], + mac: Array[Byte], + maclen_p: Array[Int], + m: Array[Byte], + mlen: Int, + ad: Array[Byte], + adlen: Int, + nsec: Array[Byte], + npub: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_aead_xchacha20poly1305_ietf_encrypt_detached( + c, + mac, + maclen_p, + m, + mlen, + ad, + adlen, + nsec, + npub, + k + ) + final def crypto_auth( + dst_mac: Array[Byte], + src_input: Array[Byte], + input_len: Int, + src_key: Array[Byte] + ): Int = SodiumJNI.crypto_auth(dst_mac, src_input, input_len, src_key) + final def crypto_auth_bytes(): Int = SodiumJNI.crypto_auth_bytes() + final def crypto_auth_hmacsha256( + out: Array[Byte], + in: Array[Byte], + inlen: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_auth_hmacsha256(out, in, inlen, k) + final def crypto_auth_hmacsha256_bytes(): Int = + SodiumJNI.crypto_auth_hmacsha256_bytes() + final def crypto_auth_hmacsha256_final( + state: Array[Byte], + out: Array[Byte] + ): Int = SodiumJNI.crypto_auth_hmacsha256_final(state, out) + final def crypto_auth_hmacsha256_init( + state: Array[Byte], + key: Array[Byte], + keylen: Int + ): Int = SodiumJNI.crypto_auth_hmacsha256_init(state, key, keylen) + final def crypto_auth_hmacsha256_keybytes(): Int = + SodiumJNI.crypto_auth_hmacsha256_keybytes() + final def crypto_auth_hmacsha256_statebytes(): Int = + SodiumJNI.crypto_auth_hmacsha256_statebytes() + final def crypto_auth_hmacsha256_update( + state: Array[Byte], + in: Array[Byte], + inlen: Int + ): Int = SodiumJNI.crypto_auth_hmacsha256_update(state, in, inlen) + final def crypto_auth_hmacsha256_verify( + h: Array[Byte], + in: Array[Byte], + inlen: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_auth_hmacsha256_verify(h, in, inlen, k) + final def crypto_auth_hmacsha512( + out: Array[Byte], + in: Array[Byte], + inlen: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_auth_hmacsha512(out, in, inlen, k) + final def crypto_auth_hmacsha512256( + out: Array[Byte], + in: Array[Byte], + inlen: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_auth_hmacsha512256(out, in, inlen, k) + final def crypto_auth_hmacsha512256_bytes(): Int = + SodiumJNI.crypto_auth_hmacsha512256_bytes() + final def crypto_auth_hmacsha512256_final( + state: Array[Byte], + out: Array[Byte] + ): Int = SodiumJNI.crypto_auth_hmacsha512256_final(state, out) + final def crypto_auth_hmacsha512256_init( + state: Array[Byte], + key: Array[Byte], + keylen: Int + ): Int = SodiumJNI.crypto_auth_hmacsha512256_init(state, key, keylen) + final def crypto_auth_hmacsha512256_keybytes(): Int = + SodiumJNI.crypto_auth_hmacsha512256_keybytes() + final def crypto_auth_hmacsha512256_statebytes(): Int = + SodiumJNI.crypto_auth_hmacsha512256_statebytes() + final def crypto_auth_hmacsha512256_update( + state: Array[Byte], + in: Array[Byte], + inlen: Int + ): Int = SodiumJNI.crypto_auth_hmacsha512256_update(state, in, inlen) + final def crypto_auth_hmacsha512256_verify( + h: Array[Byte], + in: Array[Byte], + inlen: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_auth_hmacsha512256_verify(h, in, inlen, k) + final def crypto_auth_hmacsha512_bytes(): Int = + SodiumJNI.crypto_auth_hmacsha512_bytes() + final def crypto_auth_hmacsha512_final( + state: Array[Byte], + out: Array[Byte] + ): Int = SodiumJNI.crypto_auth_hmacsha512_final(state, out) + final def crypto_auth_hmacsha512_init( + state: Array[Byte], + key: Array[Byte], + keylen: Int + ): Int = SodiumJNI.crypto_auth_hmacsha512_init(state, key, keylen) + final def crypto_auth_hmacsha512_keybytes(): Int = + SodiumJNI.crypto_auth_hmacsha512_keybytes() + final def crypto_auth_hmacsha512_statebytes(): Int = + SodiumJNI.crypto_auth_hmacsha512_statebytes() + final def crypto_auth_hmacsha512_update( + state: Array[Byte], + in: Array[Byte], + inlen: Int + ): Int = SodiumJNI.crypto_auth_hmacsha512_update(state, in, inlen) + final def crypto_auth_hmacsha512_verify( + h: Array[Byte], + in: Array[Byte], + inlen: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_auth_hmacsha512_verify(h, in, inlen, k) + final def crypto_auth_keybytes(): Int = SodiumJNI.crypto_auth_keybytes() + final def crypto_auth_primitive(): Array[Byte] = + SodiumJNI.crypto_auth_primitive() + final def crypto_auth_verify( + src_mac: Array[Byte], + src_input: Array[Byte], + input_len: Int, + src_key: Array[Byte] + ): Int = SodiumJNI.crypto_auth_verify(src_mac, src_input, input_len, src_key) + final def crypto_box( + dst_cipher: Array[Byte], + src_msg: Array[Byte], + msg_len: Int, + src_nonce: Array[Byte], + src_pub: Array[Byte], + src_secret: Array[Byte] + ): Int = + SodiumJNI.crypto_box( + dst_cipher, + src_msg, + msg_len, + src_nonce, + src_pub, + src_secret + ) + final def crypto_box_afternm( + dst_cipher: Array[Byte], + src_msg: Array[Byte], + msg_len: Int, + src_nonce: Array[Byte], + src_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_afternm( + dst_cipher, + src_msg, + msg_len, + src_nonce, + src_key + ) + final def crypto_box_beforenm( + dst_shared_key: Array[Byte], + remote_public_key: Array[Byte], + local_private_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_beforenm( + dst_shared_key, + remote_public_key, + local_private_key + ) + final def crypto_box_beforenmbytes(): Int = + SodiumJNI.crypto_box_beforenmbytes() + final def crypto_box_boxzerobytes(): Int = SodiumJNI.crypto_box_boxzerobytes() + final def crypto_box_curve25519xsalsa20poly1305( + c: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + pk: Array[Byte], + sk: Array[Byte] + ): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305(c, m, mlen, n, pk, sk) + final def crypto_box_curve25519xsalsa20poly1305_afternm( + c: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305_afternm(c, m, mlen, n, k) + final def crypto_box_curve25519xsalsa20poly1305_beforenm( + k: Array[Byte], + pk: Array[Byte], + sk: Array[Byte] + ): Int = SodiumJNI.crypto_box_curve25519xsalsa20poly1305_beforenm(k, pk, sk) + final def crypto_box_curve25519xsalsa20poly1305_beforenmbytes(): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305_beforenmbytes() + final def crypto_box_curve25519xsalsa20poly1305_boxzerobytes(): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305_boxzerobytes() + final def crypto_box_curve25519xsalsa20poly1305_keypair( + pk: Array[Byte], + sk: Array[Byte] + ): Int = SodiumJNI.crypto_box_curve25519xsalsa20poly1305_keypair(pk, sk) + final def crypto_box_curve25519xsalsa20poly1305_macbytes(): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305_macbytes() + final def crypto_box_curve25519xsalsa20poly1305_noncebytes(): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305_noncebytes() + final def crypto_box_curve25519xsalsa20poly1305_open( + m: Array[Byte], + c: Array[Byte], + clen: Int, + n: Array[Byte], + pk: Array[Byte], + sk: Array[Byte] + ): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305_open(m, c, clen, n, pk, sk) + final def crypto_box_curve25519xsalsa20poly1305_open_afternm( + m: Array[Byte], + c: Array[Byte], + clen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305_open_afternm( + m, + c, + clen, + n, + k + ) + final def crypto_box_curve25519xsalsa20poly1305_publickeybytes(): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305_publickeybytes() + final def crypto_box_curve25519xsalsa20poly1305_secretkeybytes(): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305_secretkeybytes() + final def crypto_box_curve25519xsalsa20poly1305_seed_keypair( + pk: Array[Byte], + sk: Array[Byte], + seed: Array[Byte] + ): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305_seed_keypair(pk, sk, seed) + final def crypto_box_curve25519xsalsa20poly1305_seedbytes(): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305_seedbytes() + final def crypto_box_curve25519xsalsa20poly1305_zerobytes(): Int = + SodiumJNI.crypto_box_curve25519xsalsa20poly1305_zerobytes() + final def crypto_box_detached( + dst_cipher: Array[Byte], + dst_mac: Array[Byte], + src_plain: Array[Byte], + plain_len: Int, + nonces: Array[Byte], + remote_public_key: Array[Byte], + local_private_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_detached( + dst_cipher, + dst_mac, + src_plain, + plain_len, + nonces, + remote_public_key, + local_private_key + ) + final def crypto_box_detached_afternm( + dst_cipher: Array[Byte], + dst_mac: Array[Byte], + src_plain: Array[Byte], + plain_len: Int, + nonce: Array[Byte], + shared_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_detached_afternm( + dst_cipher, + dst_mac, + src_plain, + plain_len, + nonce, + shared_key + ) + final def crypto_box_easy( + dst_cipher: Array[Byte], + src_plain: Array[Byte], + plain_len: Int, + nonce: Array[Byte], + remote_public_key: Array[Byte], + local_private_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_easy( + dst_cipher, + src_plain, + plain_len, + nonce, + remote_public_key, + local_private_key + ) + final def crypto_box_easy_afternm( + dst_cipher: Array[Byte], + src_plain: Array[Byte], + plain_len: Int, + nonce: Array[Byte], + shared_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_easy_afternm( + dst_cipher, + src_plain, + plain_len, + nonce, + shared_key + ) + final def crypto_box_keypair( + dst_public_Key: Array[Byte], + dst_private_key: Array[Byte] + ): Int = SodiumJNI.crypto_box_keypair(dst_public_Key, dst_private_key) + final def crypto_box_macbytes(): Int = SodiumJNI.crypto_box_macbytes() + final def crypto_box_noncebytes(): Int = SodiumJNI.crypto_box_noncebytes() + final def crypto_box_open( + dst_msg: Array[Byte], + src_cipher: Array[Byte], + cipher_len: Int, + src_nonce: Array[Byte], + src_pub: Array[Byte], + src_secret: Array[Byte] + ): Int = + SodiumJNI.crypto_box_open( + dst_msg, + src_cipher, + cipher_len, + src_nonce, + src_pub, + src_secret + ) + final def crypto_box_open_afternm( + dst_msg: Array[Byte], + src_cipher: Array[Byte], + cipher_len: Int, + src_nonce: Array[Byte], + src_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_open_afternm( + dst_msg, + src_cipher, + cipher_len, + src_nonce, + src_key + ) + final def crypto_box_open_detached( + dst_plain: Array[Byte], + src_cipher: Array[Byte], + src_mac: Array[Byte], + cipher_len: Int, + nonce: Array[Byte], + remote_public_key: Array[Byte], + local_private_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_open_detached( + dst_plain, + src_cipher, + src_mac, + cipher_len, + nonce, + remote_public_key, + local_private_key + ) + final def crypto_box_open_detached_afternm( + dst_plain: Array[Byte], + src_cipher: Array[Byte], + src_mac: Array[Byte], + cipher_len: Int, + nonce: Array[Byte], + shared_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_open_detached_afternm( + dst_plain, + src_cipher, + src_mac, + cipher_len, + nonce, + shared_key + ) + final def crypto_box_open_easy( + dst_plain: Array[Byte], + src_cipher: Array[Byte], + cipher_len: Int, + nonce: Array[Byte], + remote_public_key: Array[Byte], + local_private_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_open_easy( + dst_plain, + src_cipher, + cipher_len, + nonce, + remote_public_key, + local_private_key + ) + final def crypto_box_open_easy_afternm( + dst_plain: Array[Byte], + src_cipher: Array[Byte], + cipher_len: Int, + nonce: Array[Byte], + shared_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_open_easy_afternm( + dst_plain, + src_cipher, + cipher_len, + nonce, + shared_key + ) + final def crypto_box_primitive(): Array[Byte] = + SodiumJNI.crypto_box_primitive() + final def crypto_box_publickeybytes(): Int = + SodiumJNI.crypto_box_publickeybytes() + final def crypto_box_seal( + dst_cipher: Array[Byte], + src_plain: Array[Byte], + plain_len: Int, + remote_public_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_seal( + dst_cipher, + src_plain, + plain_len, + remote_public_key + ) + final def crypto_box_seal_open( + dst_plain: Array[Byte], + src_cipher: Array[Byte], + cipher_len: Int, + local_public_key: Array[Byte], + local_private_key: Array[Byte] + ): Int = + SodiumJNI.crypto_box_seal_open( + dst_plain, + src_cipher, + cipher_len, + local_public_key, + local_private_key + ) + final def crypto_box_sealbytes(): Int = SodiumJNI.crypto_box_sealbytes() + final def crypto_box_secretkeybytes(): Int = + SodiumJNI.crypto_box_secretkeybytes() + final def crypto_box_seed_keypair( + dst_public_key: Array[Byte], + dst_private_key: Array[Byte], + src_seed: Array[Byte] + ): Int = + SodiumJNI.crypto_box_seed_keypair(dst_public_key, dst_private_key, src_seed) + final def crypto_box_seedbytes(): Int = SodiumJNI.crypto_box_seedbytes() + final def crypto_box_zerobytes(): Int = SodiumJNI.crypto_box_zerobytes() + final def crypto_core_hsalsa20( + out: Array[Byte], + in: Array[Byte], + k: Array[Byte], + c: Array[Byte] + ): Int = SodiumJNI.crypto_core_hsalsa20(out, in, k, c) + final def crypto_core_hsalsa20_constbytes(): Int = + SodiumJNI.crypto_core_hsalsa20_constbytes() + final def crypto_core_hsalsa20_inputbytes(): Int = + SodiumJNI.crypto_core_hsalsa20_inputbytes() + final def crypto_core_hsalsa20_keybytes(): Int = + SodiumJNI.crypto_core_hsalsa20_keybytes() + final def crypto_core_hsalsa20_outputbytes(): Int = + SodiumJNI.crypto_core_hsalsa20_outputbytes() + final def crypto_core_salsa20( + out: Array[Byte], + in: Array[Byte], + k: Array[Byte], + c: Array[Byte] + ): Int = SodiumJNI.crypto_core_salsa20(out, in, k, c) + final def crypto_core_salsa20_constbytes(): Int = + SodiumJNI.crypto_core_salsa20_constbytes() + final def crypto_core_salsa20_inputbytes(): Int = + SodiumJNI.crypto_core_salsa20_inputbytes() + final def crypto_core_salsa20_keybytes(): Int = + SodiumJNI.crypto_core_salsa20_keybytes() + final def crypto_core_salsa20_outputbytes(): Int = + SodiumJNI.crypto_core_salsa20_outputbytes() + final def crypto_generichash( + dst_hash: Array[Byte], + dst_len: Int, + src_input: Array[Byte], + input_len: Int, + src_key: Array[Byte], + key_len: Int + ): Int = + SodiumJNI.crypto_generichash( + dst_hash, + dst_len, + src_input, + input_len, + src_key, + key_len + ) + final def crypto_generichash_blake2b( + out: Array[Byte], + outlen: Int, + in: Array[Byte], + inlen: Int, + key: Array[Byte], + keylen: Int + ): Int = + SodiumJNI.crypto_generichash_blake2b(out, outlen, in, inlen, key, keylen) + final def crypto_generichash_blake2b_bytes(): Int = + SodiumJNI.crypto_generichash_blake2b_bytes() + final def crypto_generichash_blake2b_bytes_max(): Int = + SodiumJNI.crypto_generichash_blake2b_bytes_max() + final def crypto_generichash_blake2b_bytes_min(): Int = + SodiumJNI.crypto_generichash_blake2b_bytes_min() + final def crypto_generichash_blake2b_final( + state: Array[Byte], + out: Array[Byte], + outlen: Int + ): Int = SodiumJNI.crypto_generichash_blake2b_final(state, out, outlen) + final def crypto_generichash_blake2b_init( + state: Array[Byte], + key: Array[Byte], + keylen: Int, + outlen: Int + ): Int = SodiumJNI.crypto_generichash_blake2b_init(state, key, keylen, outlen) + final def crypto_generichash_blake2b_init_salt_personal( + state: Array[Byte], + key: Array[Byte], + keylen: Int, + outlen: Int, + salt: Array[Byte], + personal: Array[Byte] + ): Int = + SodiumJNI.crypto_generichash_blake2b_init_salt_personal( + state, + key, + keylen, + outlen, + salt, + personal + ) + final def crypto_generichash_blake2b_keybytes(): Int = + SodiumJNI.crypto_generichash_blake2b_keybytes() + final def crypto_generichash_blake2b_keybytes_max(): Int = + SodiumJNI.crypto_generichash_blake2b_keybytes_max() + final def crypto_generichash_blake2b_keybytes_min(): Int = + SodiumJNI.crypto_generichash_blake2b_keybytes_min() + final def crypto_generichash_blake2b_personalbytes(): Int = + SodiumJNI.crypto_generichash_blake2b_personalbytes() + final def crypto_generichash_blake2b_salt_personal( + out: Array[Byte], + outlen: Int, + in: Array[Byte], + inlen: Int, + key: Array[Byte], + keylen: Int, + salt: Array[Byte], + personal: Array[Byte] + ): Int = + SodiumJNI.crypto_generichash_blake2b_salt_personal( + out, + outlen, + in, + inlen, + key, + keylen, + salt, + personal + ) + final def crypto_generichash_blake2b_saltbytes(): Int = + SodiumJNI.crypto_generichash_blake2b_saltbytes() + final def crypto_generichash_blake2b_update( + state: Array[Byte], + in: Array[Byte], + inlen: Int + ): Int = SodiumJNI.crypto_generichash_blake2b_update(state, in, inlen) + final def crypto_generichash_bytes(): Int = + SodiumJNI.crypto_generichash_bytes() + final def crypto_generichash_bytes_max(): Int = + SodiumJNI.crypto_generichash_bytes_max() + final def crypto_generichash_bytes_min(): Int = + SodiumJNI.crypto_generichash_bytes_min() + final def crypto_generichash_final( + state: Array[Byte], + dst_out: Array[Byte], + out_len: Int + ): Int = SodiumJNI.crypto_generichash_final(state, dst_out, out_len) + final def crypto_generichash_init( + state: Array[Byte], + src_key: Array[Byte], + key_len: Int, + out_len: Int + ): Int = SodiumJNI.crypto_generichash_init(state, src_key, key_len, out_len) + final def crypto_generichash_keybytes(): Int = + SodiumJNI.crypto_generichash_keybytes() + final def crypto_generichash_keybytes_max(): Int = + SodiumJNI.crypto_generichash_keybytes_max() + final def crypto_generichash_keybytes_min(): Int = + SodiumJNI.crypto_generichash_keybytes_min() + final def crypto_generichash_primitive(): Array[Byte] = + SodiumJNI.crypto_generichash_primitive() + final def crypto_generichash_statebytes(): Int = + SodiumJNI.crypto_generichash_statebytes() + final def crypto_generichash_update( + state: Array[Byte], + src_input: Array[Byte], + input_len: Int + ): Int = SodiumJNI.crypto_generichash_update(state, src_input, input_len) + final def crypto_hash_sha256( + out: Array[Byte], + in: Array[Byte], + inlen: Int + ): Int = SodiumJNI.crypto_hash_sha256(out, in, inlen) + final def crypto_hash_sha256_bytes(): Int = + SodiumJNI.crypto_hash_sha256_bytes() + final def crypto_hash_sha256_final( + state: Array[Byte], + out: Array[Byte] + ): Int = SodiumJNI.crypto_hash_sha256_final(state, out) + final def crypto_hash_sha256_init(state: Array[Byte]): Int = + SodiumJNI.crypto_hash_sha256_init(state) + final def crypto_hash_sha256_statebytes(): Int = + SodiumJNI.crypto_hash_sha256_statebytes() + final def crypto_hash_sha256_update( + state: Array[Byte], + in: Array[Byte], + inlen: Int + ): Int = SodiumJNI.crypto_hash_sha256_update(state, in, inlen) + final def crypto_hash_sha512( + out: Array[Byte], + in: Array[Byte], + inlen: Int + ): Int = SodiumJNI.crypto_hash_sha512(out, in, inlen) + final def crypto_hash_sha512_bytes(): Int = + SodiumJNI.crypto_hash_sha512_bytes() + final def crypto_hash_sha512_final( + state: Array[Byte], + out: Array[Byte] + ): Int = SodiumJNI.crypto_hash_sha512_final(state, out) + final def crypto_hash_sha512_init(state: Array[Byte]): Int = + SodiumJNI.crypto_hash_sha512_init(state) + final def crypto_hash_sha512_statebytes(): Int = + SodiumJNI.crypto_hash_sha512_statebytes() + final def crypto_hash_sha512_update( + state: Array[Byte], + in: Array[Byte], + inlen: Int + ): Int = SodiumJNI.crypto_hash_sha512_update(state, in, inlen) + final def crypto_kx_client_session_keys( + rx: Array[Byte], + tx: Array[Byte], + client_pk: Array[Byte], + client_sk: Array[Byte], + server_pk: Array[Byte] + ): Int = + SodiumJNI.crypto_kx_client_session_keys( + rx, + tx, + client_pk, + client_sk, + server_pk + ) + final def crypto_kx_keypair(pk: Array[Byte], sk: Array[Byte]): Int = + SodiumJNI.crypto_kx_keypair(pk, sk) + final def crypto_kx_seed_keypair( + pk: Array[Byte], + sk: Array[Byte], + seed: Array[Byte] + ): Int = SodiumJNI.crypto_kx_seed_keypair(pk, sk, seed) + final def crypto_kx_server_session_keys( + rx: Array[Byte], + tx: Array[Byte], + server_pk: Array[Byte], + server_sk: Array[Byte], + client_pk: Array[Byte] + ): Int = + SodiumJNI.crypto_kx_server_session_keys( + rx, + tx, + server_pk, + server_sk, + client_pk + ) + final def crypto_onetimeauth( + dst_out: Array[Byte], + src_input: Array[Byte], + input_len: Int, + src_key: Array[Byte] + ): Int = SodiumJNI.crypto_onetimeauth(dst_out, src_input, input_len, src_key) + final def crypto_onetimeauth_bytes(): Int = + SodiumJNI.crypto_onetimeauth_bytes() + final def crypto_onetimeauth_final( + final_state: Array[Byte], + dst_out: Array[Byte] + ): Int = SodiumJNI.crypto_onetimeauth_final(final_state, dst_out) + final def crypto_onetimeauth_init( + dst_state: Array[Byte], + src_key: Array[Byte] + ): Int = SodiumJNI.crypto_onetimeauth_init(dst_state, src_key) + final def crypto_onetimeauth_keybytes(): Int = + SodiumJNI.crypto_onetimeauth_keybytes() + final def crypto_onetimeauth_poly1305( + out: Array[Byte], + in: Array[Byte], + inlen: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_onetimeauth_poly1305(out, in, inlen, k) + final def crypto_onetimeauth_poly1305_bytes(): Int = + SodiumJNI.crypto_onetimeauth_poly1305_bytes() + final def crypto_onetimeauth_poly1305_final( + state: Array[Byte], + out: Array[Byte] + ): Int = SodiumJNI.crypto_onetimeauth_poly1305_final(state, out) + final def crypto_onetimeauth_poly1305_init( + state: Array[Byte], + key: Array[Byte] + ): Int = SodiumJNI.crypto_onetimeauth_poly1305_init(state, key) + final def crypto_onetimeauth_poly1305_keybytes(): Int = + SodiumJNI.crypto_onetimeauth_poly1305_keybytes() + final def crypto_onetimeauth_poly1305_update( + state: Array[Byte], + in: Array[Byte], + inlen: Int + ): Int = SodiumJNI.crypto_onetimeauth_poly1305_update(state, in, inlen) + final def crypto_onetimeauth_poly1305_verify( + h: Array[Byte], + in: Array[Byte], + inlen: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_onetimeauth_poly1305_verify(h, in, inlen, k) + final def crypto_onetimeauth_primitive(): Array[Byte] = + SodiumJNI.crypto_onetimeauth_primitive() + final def crypto_onetimeauth_statebytes(): Int = + SodiumJNI.crypto_onetimeauth_statebytes() + final def crypto_onetimeauth_update( + dst_state: Array[Byte], + src_input: Array[Byte], + input_len: Int + ): Int = SodiumJNI.crypto_onetimeauth_update(dst_state, src_input, input_len) + final def crypto_onetimeauth_verify( + src_mac: Array[Byte], + src_input: Array[Byte], + input_len: Int, + src_key: Array[Byte] + ): Int = + SodiumJNI.crypto_onetimeauth_verify(src_mac, src_input, input_len, src_key) + final def crypto_pwhash( + out: Array[Byte], + outlen: Int, + passwd: Array[Byte], + passwdlen: Int, + salt: Array[Byte], + opslimit: Int, + memlimit: Int, + alg: Int + ): Int = + SodiumJNI.crypto_pwhash( + out, + outlen, + passwd, + passwdlen, + salt, + opslimit, + memlimit, + alg + ) + final def crypto_pwhash_alg_argon2i13(): Int = + SodiumJNI.crypto_pwhash_alg_argon2i13() + final def crypto_pwhash_alg_default(): Int = + SodiumJNI.crypto_pwhash_alg_default() + final def crypto_pwhash_bytes_max(): Int = SodiumJNI.crypto_pwhash_bytes_max() + final def crypto_pwhash_bytes_min(): Int = SodiumJNI.crypto_pwhash_bytes_min() + final def crypto_pwhash_memlimit_interactive(): Int = + SodiumJNI.crypto_pwhash_memlimit_interactive() + final def crypto_pwhash_memlimit_max(): Int = + SodiumJNI.crypto_pwhash_memlimit_max() + final def crypto_pwhash_memlimit_min(): Int = + SodiumJNI.crypto_pwhash_memlimit_min() + final def crypto_pwhash_memlimit_moderate(): Int = + SodiumJNI.crypto_pwhash_memlimit_moderate() + final def crypto_pwhash_memlimit_sensitive(): Int = + SodiumJNI.crypto_pwhash_memlimit_sensitive() + final def crypto_pwhash_opslimit_interactive(): Int = + SodiumJNI.crypto_pwhash_opslimit_interactive() + final def crypto_pwhash_opslimit_max(): Int = + SodiumJNI.crypto_pwhash_opslimit_max() + final def crypto_pwhash_opslimit_min(): Int = + SodiumJNI.crypto_pwhash_opslimit_min() + final def crypto_pwhash_opslimit_moderate(): Int = + SodiumJNI.crypto_pwhash_opslimit_moderate() + final def crypto_pwhash_opslimit_sensitive(): Int = + SodiumJNI.crypto_pwhash_opslimit_sensitive() + final def crypto_pwhash_passwd_max(): Int = + SodiumJNI.crypto_pwhash_passwd_max() + final def crypto_pwhash_passwd_min(): Int = + SodiumJNI.crypto_pwhash_passwd_min() + final def crypto_pwhash_primitive(): Array[Byte] = + SodiumJNI.crypto_pwhash_primitive() + final def crypto_pwhash_saltbytes(): Int = SodiumJNI.crypto_pwhash_saltbytes() + final def crypto_pwhash_scryptsalsa208sha256( + out: Array[Byte], + outlen: Int, + passwd: Array[Byte], + passwdlen: Int, + salt: Array[Byte], + opslimit: Int, + memlimit: Int + ): Int = + SodiumJNI.crypto_pwhash_scryptsalsa208sha256( + out, + outlen, + passwd, + passwdlen, + salt, + opslimit, + memlimit + ) + final def crypto_pwhash_scryptsalsa208sha256_ll( + passwd: Array[Byte], + passwdlen: Int, + salt: Array[Byte], + saltlen: Int, + N: Int, + r: Int, + p: Int, + buf: Array[Byte], + buflen: Int + ): Int = + SodiumJNI.crypto_pwhash_scryptsalsa208sha256_ll( + passwd, + passwdlen, + salt, + saltlen, + N, + r, + p, + buf, + buflen + ) + final def crypto_pwhash_scryptsalsa208sha256_memlimit_interactive(): Int = + SodiumJNI.crypto_pwhash_scryptsalsa208sha256_memlimit_interactive() + final def crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive(): Int = + SodiumJNI.crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive() + final def crypto_pwhash_scryptsalsa208sha256_opslimit_interactive(): Int = + SodiumJNI.crypto_pwhash_scryptsalsa208sha256_opslimit_interactive() + final def crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive(): Int = + SodiumJNI.crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive() + final def crypto_pwhash_scryptsalsa208sha256_saltbytes(): Int = + SodiumJNI.crypto_pwhash_scryptsalsa208sha256_saltbytes() + final def crypto_pwhash_scryptsalsa208sha256_str( + out: Array[Byte], + passwd: Array[Byte], + passwdlen: Int, + opslimit: Int, + memlimit: Int + ): Int = + SodiumJNI.crypto_pwhash_scryptsalsa208sha256_str( + out, + passwd, + passwdlen, + opslimit, + memlimit + ) + final def crypto_pwhash_scryptsalsa208sha256_str_needs_rehash( + str: Array[Byte], + opslimit: Int, + memlimit: Int + ): Int = + SodiumJNI.crypto_pwhash_scryptsalsa208sha256_str_needs_rehash( + str, + opslimit, + memlimit + ) + final def crypto_pwhash_scryptsalsa208sha256_str_verify( + str: Array[Byte], + passwd: Array[Byte], + passwdlen: Int + ): Int = + SodiumJNI.crypto_pwhash_scryptsalsa208sha256_str_verify( + str, + passwd, + passwdlen + ) + final def crypto_pwhash_scryptsalsa208sha256_strbytes(): Int = + SodiumJNI.crypto_pwhash_scryptsalsa208sha256_strbytes() + final def crypto_pwhash_scryptsalsa208sha256_strprefix(): Array[Byte] = + SodiumJNI.crypto_pwhash_scryptsalsa208sha256_strprefix() + final def crypto_pwhash_str( + out: Array[Byte], + passwd: Array[Byte], + passwdlen: Int, + opslimit: Int, + memlimit: Int + ): Int = + SodiumJNI.crypto_pwhash_str(out, passwd, passwdlen, opslimit, memlimit) + final def crypto_pwhash_str_verify( + str: Array[Byte], + passwd: Array[Byte], + passwdlen: Int + ): Int = SodiumJNI.crypto_pwhash_str_verify(str, passwd, passwdlen) + final def crypto_pwhash_strbytes(): Int = SodiumJNI.crypto_pwhash_strbytes() + final def crypto_pwhash_strprefix(): Array[Byte] = + SodiumJNI.crypto_pwhash_strprefix() + final def crypto_scalarmult( + q: Array[Byte], + n: Array[Byte], + p: Array[Byte] + ): Int = SodiumJNI.crypto_scalarmult(q, n, p) + final def crypto_scalarmult_base(q: Array[Byte], n: Array[Byte]): Int = + SodiumJNI.crypto_scalarmult_base(q, n) + final def crypto_scalarmult_bytes(): Int = SodiumJNI.crypto_scalarmult_bytes() + final def crypto_scalarmult_curve25519( + q: Array[Byte], + n: Array[Byte], + p: Array[Byte] + ): Int = SodiumJNI.crypto_scalarmult_curve25519(q, n, p) + final def crypto_scalarmult_curve25519_base( + q: Array[Byte], + n: Array[Byte] + ): Int = SodiumJNI.crypto_scalarmult_curve25519_base(q, n) + final def crypto_scalarmult_curve25519_bytes(): Int = + SodiumJNI.crypto_scalarmult_curve25519_bytes() + final def crypto_scalarmult_curve25519_scalarbytes(): Int = + SodiumJNI.crypto_scalarmult_curve25519_scalarbytes() + final def crypto_scalarmult_primitive(): Array[Byte] = + SodiumJNI.crypto_scalarmult_primitive() + final def crypto_scalarmult_scalarbytes(): Int = + SodiumJNI.crypto_scalarmult_scalarbytes() + final def crypto_secretbox_boxzerobytes(): Int = + SodiumJNI.crypto_secretbox_boxzerobytes() + final def crypto_secretbox_detached( + dst_cipher: Array[Byte], + mac: Array[Byte], + src_plain: Array[Byte], + plain_len: Int, + nonce: Array[Byte], + secretkey: Array[Byte] + ): Int = + SodiumJNI.crypto_secretbox_detached( + dst_cipher, + mac, + src_plain, + plain_len, + nonce, + secretkey + ) + final def crypto_secretbox_easy( + dst_cipher: Array[Byte], + src_plain: Array[Byte], + plain_len: Int, + nonce: Array[Byte], + secret_key: Array[Byte] + ): Int = + SodiumJNI.crypto_secretbox_easy( + dst_cipher, + src_plain, + plain_len, + nonce, + secret_key + ) + final def crypto_secretbox_keybytes(): Int = + SodiumJNI.crypto_secretbox_keybytes() + final def crypto_secretbox_macbytes(): Int = + SodiumJNI.crypto_secretbox_macbytes() + final def crypto_secretbox_noncebytes(): Int = + SodiumJNI.crypto_secretbox_noncebytes() + final def crypto_secretbox_open_detached( + dst_plain: Array[Byte], + src_cipher: Array[Byte], + mac: Array[Byte], + cipher_len: Int, + nonce: Array[Byte], + secretkey: Array[Byte] + ): Int = + SodiumJNI.crypto_secretbox_open_detached( + dst_plain, + src_cipher, + mac, + cipher_len, + nonce, + secretkey + ) + final def crypto_secretbox_open_easy( + dst_plain: Array[Byte], + src_cipher: Array[Byte], + cipher_len: Int, + nonce: Array[Byte], + secret_key: Array[Byte] + ): Int = + SodiumJNI.crypto_secretbox_open_easy( + dst_plain, + src_cipher, + cipher_len, + nonce, + secret_key + ) + final def crypto_secretbox_primitive(): Array[Byte] = + SodiumJNI.crypto_secretbox_primitive() + final def crypto_secretbox_xchacha20poly1305_detached( + c: Array[Byte], + mac: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_secretbox_xchacha20poly1305_detached(c, mac, m, mlen, n, k) + final def crypto_secretbox_xchacha20poly1305_easy( + c: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = SodiumJNI.crypto_secretbox_xchacha20poly1305_easy(c, m, mlen, n, k) + final def crypto_secretbox_xchacha20poly1305_open_detached( + m: Array[Byte], + c: Array[Byte], + mac: Array[Byte], + clen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_secretbox_xchacha20poly1305_open_detached( + m, + c, + mac, + clen, + n, + k + ) + final def crypto_secretbox_xchacha20poly1305_open_easy( + m: Array[Byte], + c: Array[Byte], + clen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_secretbox_xchacha20poly1305_open_easy(m, c, clen, n, k) + final def crypto_secretbox_xsalsa20poly1305( + c: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = SodiumJNI.crypto_secretbox_xsalsa20poly1305(c, m, mlen, n, k) + final def crypto_secretbox_xsalsa20poly1305_boxzerobytes(): Int = + SodiumJNI.crypto_secretbox_xsalsa20poly1305_boxzerobytes() + final def crypto_secretbox_xsalsa20poly1305_keybytes(): Int = + SodiumJNI.crypto_secretbox_xsalsa20poly1305_keybytes() + final def crypto_secretbox_xsalsa20poly1305_macbytes(): Int = + SodiumJNI.crypto_secretbox_xsalsa20poly1305_macbytes() + final def crypto_secretbox_xsalsa20poly1305_noncebytes(): Int = + SodiumJNI.crypto_secretbox_xsalsa20poly1305_noncebytes() + final def crypto_secretbox_xsalsa20poly1305_open( + m: Array[Byte], + c: Array[Byte], + clen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = SodiumJNI.crypto_secretbox_xsalsa20poly1305_open(m, c, clen, n, k) + final def crypto_secretbox_xsalsa20poly1305_zerobytes(): Int = + SodiumJNI.crypto_secretbox_xsalsa20poly1305_zerobytes() + final def crypto_secretbox_zerobytes(): Int = + SodiumJNI.crypto_secretbox_zerobytes() + final def crypto_secretstream_xchacha20poly1305_init_pull( + state: Array[Byte], + header: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_secretstream_xchacha20poly1305_init_pull(state, header, k) + final def crypto_secretstream_xchacha20poly1305_init_push( + state: Array[Byte], + header: Array[Byte], + k: Array[Byte] + ): Int = + SodiumJNI.crypto_secretstream_xchacha20poly1305_init_push(state, header, k) + final def crypto_secretstream_xchacha20poly1305_pull( + state: Array[Byte], + m: Array[Byte], + mlen_p: Array[Int], + tag_p: Array[Byte], + c: Array[Byte], + clen: Int, + ad: Array[Byte], + adlen: Int + ): Int = + SodiumJNI.crypto_secretstream_xchacha20poly1305_pull( + state, + m, + mlen_p, + tag_p, + c, + clen, + ad, + adlen + ) + final def crypto_secretstream_xchacha20poly1305_push( + state: Array[Byte], + c: Array[Byte], + clen_p: Array[Int], + m: Array[Byte], + mlen: Int, + ad: Array[Byte], + adlen: Int, + tag: Short + ): Int = + SodiumJNI.crypto_secretstream_xchacha20poly1305_push( + state, + c, + clen_p, + m, + mlen, + ad, + adlen, + tag + ) + final def crypto_secretstream_xchacha20poly1305_statebytes(): Int = + SodiumJNI.crypto_secretstream_xchacha20poly1305_statebytes() + final def crypto_shorthash( + dst_out: Array[Byte], + src_input: Array[Byte], + input_len: Int, + src_key: Array[Byte] + ): Int = SodiumJNI.crypto_shorthash(dst_out, src_input, input_len, src_key) + final def crypto_shorthash_bytes(): Int = SodiumJNI.crypto_shorthash_bytes() + final def crypto_shorthash_keybytes(): Int = + SodiumJNI.crypto_shorthash_keybytes() + final def crypto_shorthash_primitive(): Array[Byte] = + SodiumJNI.crypto_shorthash_primitive() + final def crypto_shorthash_siphash24( + out: Array[Byte], + in: Array[Byte], + inlen: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_shorthash_siphash24(out, in, inlen, k) + final def crypto_shorthash_siphash24_bytes(): Int = + SodiumJNI.crypto_shorthash_siphash24_bytes() + final def crypto_shorthash_siphash24_keybytes(): Int = + SodiumJNI.crypto_shorthash_siphash24_keybytes() + final def crypto_sign( + dst_signed_msg: Array[Byte], + signed_msg_len: Array[Int], + src_msg: Array[Byte], + msg_len: Int, + local_private_key: Array[Byte] + ): Int = + SodiumJNI.crypto_sign( + dst_signed_msg, + signed_msg_len, + src_msg, + msg_len, + local_private_key + ) + final def crypto_sign_bytes(): Int = SodiumJNI.crypto_sign_bytes() + final def crypto_sign_detached( + dst_signature: Array[Byte], + signature_len: Array[Int], + src_msg: Array[Byte], + msg_len: Int, + local_private_key: Array[Byte] + ): Int = + SodiumJNI.crypto_sign_detached( + dst_signature, + signature_len, + src_msg, + msg_len, + local_private_key + ) + final def crypto_sign_ed25519( + sm: Array[Byte], + smlen_p: Array[Int], + m: Array[Byte], + mlen: Int, + sk: Array[Byte] + ): Int = SodiumJNI.crypto_sign_ed25519(sm, smlen_p, m, mlen, sk) + final def crypto_sign_ed25519_bytes(): Int = + SodiumJNI.crypto_sign_ed25519_bytes() + final def crypto_sign_ed25519_detached( + sig: Array[Byte], + siglen_p: Array[Int], + m: Array[Byte], + mlen: Int, + sk: Array[Byte] + ): Int = SodiumJNI.crypto_sign_ed25519_detached(sig, siglen_p, m, mlen, sk) + final def crypto_sign_ed25519_keypair(pk: Array[Byte], sk: Array[Byte]): Int = + SodiumJNI.crypto_sign_ed25519_keypair(pk, sk) + final def crypto_sign_ed25519_open( + m: Array[Byte], + mlen_p: Array[Int], + sm: Array[Byte], + smlen: Int, + pk: Array[Byte] + ): Int = SodiumJNI.crypto_sign_ed25519_open(m, mlen_p, sm, smlen, pk) + final def crypto_sign_ed25519_pk_to_curve25519( + curve25519_pk: Array[Byte], + ed25519_pk: Array[Byte] + ): Int = + SodiumJNI.crypto_sign_ed25519_pk_to_curve25519(curve25519_pk, ed25519_pk) + final def crypto_sign_ed25519_publickeybytes(): Int = + SodiumJNI.crypto_sign_ed25519_publickeybytes() + final def crypto_sign_ed25519_secretkeybytes(): Int = + SodiumJNI.crypto_sign_ed25519_secretkeybytes() + final def crypto_sign_ed25519_seed_keypair( + pk: Array[Byte], + sk: Array[Byte], + seed: Array[Byte] + ): Int = SodiumJNI.crypto_sign_ed25519_seed_keypair(pk, sk, seed) + final def crypto_sign_ed25519_seedbytes(): Int = + SodiumJNI.crypto_sign_ed25519_seedbytes() + final def crypto_sign_ed25519_sk_to_curve25519( + curve25519_sk: Array[Byte], + ed25519_sk: Array[Byte] + ): Int = + SodiumJNI.crypto_sign_ed25519_sk_to_curve25519(curve25519_sk, ed25519_sk) + final def crypto_sign_ed25519_sk_to_pk( + dst_public_key: Array[Byte], + src_private_key: Array[Byte] + ): Int = + SodiumJNI.crypto_sign_ed25519_sk_to_pk(dst_public_key, src_private_key) + final def crypto_sign_ed25519_sk_to_seed( + dst_seed: Array[Byte], + src_private_key: Array[Byte] + ): Int = SodiumJNI.crypto_sign_ed25519_sk_to_seed(dst_seed, src_private_key) + final def crypto_sign_ed25519_verify_detached( + sig: Array[Byte], + m: Array[Byte], + mlen: Int, + pk: Array[Byte] + ): Int = SodiumJNI.crypto_sign_ed25519_verify_detached(sig, m, mlen, pk) + final def crypto_sign_keypair( + dst_public_Key: Array[Byte], + dst_private_key: Array[Byte] + ): Int = SodiumJNI.crypto_sign_keypair(dst_public_Key, dst_private_key) + final def crypto_sign_open( + dst_msg: Array[Byte], + msg_len: Array[Int], + src_signed_msg: Array[Byte], + signed_msg_len: Int, + remote_public_key: Array[Byte] + ): Int = + SodiumJNI.crypto_sign_open( + dst_msg, + msg_len, + src_signed_msg, + signed_msg_len, + remote_public_key + ) + final def crypto_sign_primitive(): Array[Byte] = + SodiumJNI.crypto_sign_primitive() + final def crypto_sign_publickeybytes(): Int = + SodiumJNI.crypto_sign_publickeybytes() + final def crypto_sign_secretkeybytes(): Int = + SodiumJNI.crypto_sign_secretkeybytes() + final def crypto_sign_seed_keypair( + dst_public_Key: Array[Byte], + dst_private_key: Array[Byte], + src_seed: Array[Byte] + ): Int = + SodiumJNI.crypto_sign_seed_keypair( + dst_public_Key, + dst_private_key, + src_seed + ) + final def crypto_sign_seedbytes(): Int = SodiumJNI.crypto_sign_seedbytes() + final def crypto_sign_verify_detached( + src_signature: Array[Byte], + src_msg: Array[Byte], + msg_len: Int, + remote_public_key: Array[Byte] + ): Int = + SodiumJNI.crypto_sign_verify_detached( + src_signature, + src_msg, + msg_len, + remote_public_key + ) + final def crypto_stream_chacha20( + c: Array[Byte], + clen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = SodiumJNI.crypto_stream_chacha20(c, clen, n, k) + final def crypto_stream_chacha20_ietf( + c: Array[Byte], + clen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = SodiumJNI.crypto_stream_chacha20_ietf(c, clen, n, k) + final def crypto_stream_chacha20_ietf_noncebytes(): Int = + SodiumJNI.crypto_stream_chacha20_ietf_noncebytes() + final def crypto_stream_chacha20_ietf_xor( + c: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = SodiumJNI.crypto_stream_chacha20_ietf_xor(c, m, mlen, n, k) + final def crypto_stream_chacha20_ietf_xor_ic( + c: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + ic: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_stream_chacha20_ietf_xor_ic(c, m, mlen, n, ic, k) + final def crypto_stream_chacha20_keybytes(): Int = + SodiumJNI.crypto_stream_chacha20_keybytes() + final def crypto_stream_chacha20_noncebytes(): Int = + SodiumJNI.crypto_stream_chacha20_noncebytes() + final def crypto_stream_chacha20_xor( + c: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = SodiumJNI.crypto_stream_chacha20_xor(c, m, mlen, n, k) + final def crypto_stream_chacha20_xor_ic( + c: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + ic: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_stream_chacha20_xor_ic(c, m, mlen, n, ic, k) + final def crypto_stream_salsa20( + c: Array[Byte], + clen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = SodiumJNI.crypto_stream_salsa20(c, clen, n, k) + final def crypto_stream_salsa20_keybytes(): Int = + SodiumJNI.crypto_stream_salsa20_keybytes() + final def crypto_stream_salsa20_noncebytes(): Int = + SodiumJNI.crypto_stream_salsa20_noncebytes() + final def crypto_stream_salsa20_xor( + c: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = SodiumJNI.crypto_stream_salsa20_xor(c, m, mlen, n, k) + final def crypto_stream_salsa20_xor_ic( + c: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + ic: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_stream_salsa20_xor_ic(c, m, mlen, n, ic, k) + final def crypto_stream_xsalsa20( + c: Array[Byte], + clen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = SodiumJNI.crypto_stream_xsalsa20(c, clen, n, k) + final def crypto_stream_xsalsa20_keybytes(): Int = + SodiumJNI.crypto_stream_xsalsa20_keybytes() + final def crypto_stream_xsalsa20_noncebytes(): Int = + SodiumJNI.crypto_stream_xsalsa20_noncebytes() + final def crypto_stream_xsalsa20_xor( + c: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + k: Array[Byte] + ): Int = SodiumJNI.crypto_stream_xsalsa20_xor(c, m, mlen, n, k) + final def crypto_stream_xsalsa20_xor_ic( + c: Array[Byte], + m: Array[Byte], + mlen: Int, + n: Array[Byte], + ic: Int, + k: Array[Byte] + ): Int = SodiumJNI.crypto_stream_xsalsa20_xor_ic(c, m, mlen, n, ic, k) + final def randombytes(dst_buf: Array[Byte], buf_len: Int): Unit = + SodiumJNI.randombytes(dst_buf, buf_len) + final def randombytes_buf(buff: Array[Byte], buff_len: Int): Unit = + SodiumJNI.randombytes_buf(buff, buff_len) + final def randombytes_close(): Int = SodiumJNI.randombytes_close() + final def randombytes_random(): Int = SodiumJNI.randombytes_random() + final def randombytes_stir(): Unit = SodiumJNI.randombytes_stir() + final def randombytes_uniform(upper_bound: Int): Int = + SodiumJNI.randombytes_uniform(upper_bound) + final def sodium_increment( + src_dst_number: Array[Byte], + number_len: Int + ): Unit = SodiumJNI.sodium_increment(src_dst_number, number_len) + final def sodium_init(): Int = SodiumJNI.sodium_init() + final def sodium_version_string(): Array[Byte] = + SodiumJNI.sodium_version_string() +} diff --git a/tsec-libsodium/src/main/scala/tsec/jni/SodiumJNI.java b/tsec-libsodium/src/main/scala/tsec/jni/SodiumJNI.java index d11286d4..79bb4541 100644 --- a/tsec-libsodium/src/main/scala/tsec/jni/SodiumJNI.java +++ b/tsec-libsodium/src/main/scala/tsec/jni/SodiumJNI.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.10 + * Version 3.0.12 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/tsec-libsodium/src/main/scala/tsec/libsodium/ScalaSodium.scala b/tsec-libsodium/src/main/scala/tsec/libsodium/ScalaSodium.scala index a369a38b..23325b50 100644 --- a/tsec-libsodium/src/main/scala/tsec/libsodium/ScalaSodium.scala +++ b/tsec-libsodium/src/main/scala/tsec/libsodium/ScalaSodium.scala @@ -7,1169 +7,7 @@ import tsec.jni._ /** Our libsodium interface class * Copied to scala from the java version that interfaces with the JNI code, generated by swig. */ -sealed class ScalaSodium { - def sodium_init: Int = SodiumJNI.sodium_init - - def sodium_version_string: Array[Byte] = SodiumJNI.sodium_version_string - - def randombytes(dst_buf: Array[Byte], buf_len: Int): Unit = - SodiumJNI.randombytes(dst_buf, buf_len) - - def randombytes_random: Int = SodiumJNI.randombytes_random - - def randombytes_uniform(upper_bound: Int): Int = SodiumJNI.randombytes_uniform(upper_bound) - - def randombytes_buf(buff: Array[Byte], buff_len: Int): Unit = - SodiumJNI.randombytes_buf(buff, buff_len) - - def randombytes_close: Int = SodiumJNI.randombytes_close - - def randombytes_stir(): Unit = - SodiumJNI.randombytes_stir - - def sodium_increment(src_dst_number: Array[Byte], number_len: Int): Unit = - SodiumJNI.sodium_increment(src_dst_number, number_len) - - def crypto_secretbox_keybytes: Int = SodiumJNI.crypto_secretbox_keybytes - - def crypto_secretbox_noncebytes: Int = SodiumJNI.crypto_secretbox_noncebytes - - def crypto_secretbox_macbytes: Int = SodiumJNI.crypto_secretbox_macbytes - - def crypto_secretbox_zerobytes: Int = SodiumJNI.crypto_secretbox_zerobytes - - def crypto_secretbox_boxzerobytes: Int = SodiumJNI.crypto_secretbox_boxzerobytes - - def crypto_secretbox_primitive: Array[Byte] = SodiumJNI.crypto_secretbox_primitive - - def crypto_secretbox_easy( - dst_cipher: Array[Byte], - src_plain: Array[Byte], - plain_len: Int, - nonce: Array[Byte], - secret_key: Array[Byte] - ): Int = SodiumJNI.crypto_secretbox_easy(dst_cipher, src_plain, plain_len, nonce, secret_key) - - def crypto_secretbox_open_easy( - dst_plain: Array[Byte], - src_cipher: Array[Byte], - cipher_len: Int, - nonce: Array[Byte], - secret_key: Array[Byte] - ): Int = SodiumJNI.crypto_secretbox_open_easy(dst_plain, src_cipher, cipher_len, nonce, secret_key) - - def crypto_secretstream_xchacha20poly1305_init_push(state: Array[Byte], header: Array[Byte], k: Array[Byte]): Int = - SodiumJNI.crypto_secretstream_xchacha20poly1305_init_push(state, header, k) - - def crypto_secretstream_xchacha20poly1305_push( - state: Array[Byte], - c: Array[Byte], - clen_p: Array[Int], - m: Array[Byte], - mlen: Int, - ad: Array[Byte], - adlen: Int, - tag: Short - ): Int = SodiumJNI.crypto_secretstream_xchacha20poly1305_push(state, c, clen_p, m, mlen, ad, adlen, tag) - - def crypto_secretstream_xchacha20poly1305_init_pull(state: Array[Byte], header: Array[Byte], k: Array[Byte]): Int = - SodiumJNI.crypto_secretstream_xchacha20poly1305_init_pull(state, header, k) - - def crypto_secretstream_xchacha20poly1305_pull( - state: Array[Byte], - m: Array[Byte], - mlen_p: Array[Int], - tag_p: Array[Byte], - c: Array[Byte], - clen: Int, - ad: Array[Byte], - adlen: Int - ): Int = SodiumJNI.crypto_secretstream_xchacha20poly1305_pull(state, m, mlen_p, tag_p, c, clen, ad, adlen) - - def crypto_secretstream_xchacha20poly1305_statebytes: Int = SodiumJNI.crypto_secretstream_xchacha20poly1305_statebytes - - def crypto_secretbox_detached( - dst_cipher: Array[Byte], - mac: Array[Byte], - src_plain: Array[Byte], - plain_len: Int, - nonce: Array[Byte], - secretkey: Array[Byte] - ): Int = SodiumJNI.crypto_secretbox_detached(dst_cipher, mac, src_plain, plain_len, nonce, secretkey) - - def crypto_secretbox_open_detached( - dst_plain: Array[Byte], - src_cipher: Array[Byte], - mac: Array[Byte], - cipher_len: Int, - nonce: Array[Byte], - secretkey: Array[Byte] - ): Int = SodiumJNI.crypto_secretbox_open_detached(dst_plain, src_cipher, mac, cipher_len, nonce, secretkey) - - def crypto_scalarmult_bytes: Int = SodiumJNI.crypto_scalarmult_bytes - - def crypto_scalarmult_scalarbytes: Int = SodiumJNI.crypto_scalarmult_scalarbytes - - def crypto_scalarmult_primitive: Array[Byte] = SodiumJNI.crypto_scalarmult_primitive - - def crypto_scalarmult_base(q: Array[Byte], n: Array[Byte]): Int = SodiumJNI.crypto_scalarmult_base(q, n) - - def crypto_scalarmult(q: Array[Byte], n: Array[Byte], p: Array[Byte]): Int = SodiumJNI.crypto_scalarmult(q, n, p) - - def crypto_box_seedbytes: Int = SodiumJNI.crypto_box_seedbytes - - def crypto_box_publickeybytes: Int = SodiumJNI.crypto_box_publickeybytes - - def crypto_box_secretkeybytes: Int = SodiumJNI.crypto_box_secretkeybytes - - def crypto_box_noncebytes: Int = SodiumJNI.crypto_box_noncebytes - - def crypto_box_macbytes: Int = SodiumJNI.crypto_box_macbytes - - def crypto_box_primitive: Array[Byte] = SodiumJNI.crypto_box_primitive - - def crypto_box_keypair(dst_public_Key: Array[Byte], dst_private_key: Array[Byte]): Int = - SodiumJNI.crypto_box_keypair(dst_public_Key, dst_private_key) - - def crypto_box_seed_keypair(dst_public_key: Array[Byte], dst_private_key: Array[Byte], src_seed: Array[Byte]): Int = - SodiumJNI.crypto_box_seed_keypair(dst_public_key, dst_private_key, src_seed) - - def crypto_box_easy( - dst_cipher: Array[Byte], - src_plain: Array[Byte], - plain_len: Int, - nonce: Array[Byte], - remote_public_key: Array[Byte], - local_private_key: Array[Byte] - ): Int = SodiumJNI.crypto_box_easy(dst_cipher, src_plain, plain_len, nonce, remote_public_key, local_private_key) - - def crypto_box_open_easy( - dst_plain: Array[Byte], - src_cipher: Array[Byte], - cipher_len: Int, - nonce: Array[Byte], - remote_public_key: Array[Byte], - local_private_key: Array[Byte] - ): Int = - SodiumJNI.crypto_box_open_easy(dst_plain, src_cipher, cipher_len, nonce, remote_public_key, local_private_key) - - def crypto_box_detached( - dst_cipher: Array[Byte], - dst_mac: Array[Byte], - src_plain: Array[Byte], - plain_len: Int, - nonces: Array[Byte], - remote_public_key: Array[Byte], - local_private_key: Array[Byte] - ): Int = - SodiumJNI.crypto_box_detached( - dst_cipher, - dst_mac, - src_plain, - plain_len, - nonces, - remote_public_key, - local_private_key - ) - - def crypto_box_open_detached( - dst_plain: Array[Byte], - src_cipher: Array[Byte], - src_mac: Array[Byte], - cipher_len: Int, - nonce: Array[Byte], - remote_public_key: Array[Byte], - local_private_key: Array[Byte] - ): Int = - SodiumJNI.crypto_box_open_detached( - dst_plain, - src_cipher, - src_mac, - cipher_len, - nonce, - remote_public_key, - local_private_key - ) - - def crypto_box_beforenmbytes: Int = SodiumJNI.crypto_box_beforenmbytes - - def crypto_box_beforenm( - dst_shared_key: Array[Byte], - remote_public_key: Array[Byte], - local_private_key: Array[Byte] - ): Int = SodiumJNI.crypto_box_beforenm(dst_shared_key, remote_public_key, local_private_key) - - def crypto_box_easy_afternm( - dst_cipher: Array[Byte], - src_plain: Array[Byte], - plain_len: Int, - nonce: Array[Byte], - shared_key: Array[Byte] - ): Int = SodiumJNI.crypto_box_easy_afternm(dst_cipher, src_plain, plain_len, nonce, shared_key) - - def crypto_box_open_easy_afternm( - dst_plain: Array[Byte], - src_cipher: Array[Byte], - cipher_len: Int, - nonce: Array[Byte], - shared_key: Array[Byte] - ): Int = SodiumJNI.crypto_box_open_easy_afternm(dst_plain, src_cipher, cipher_len, nonce, shared_key) - - def crypto_box_detached_afternm( - dst_cipher: Array[Byte], - dst_mac: Array[Byte], - src_plain: Array[Byte], - plain_len: Int, - nonce: Array[Byte], - shared_key: Array[Byte] - ): Int = SodiumJNI.crypto_box_detached_afternm(dst_cipher, dst_mac, src_plain, plain_len, nonce, shared_key) - - def crypto_box_open_detached_afternm( - dst_plain: Array[Byte], - src_cipher: Array[Byte], - src_mac: Array[Byte], - cipher_len: Int, - nonce: Array[Byte], - shared_key: Array[Byte] - ): Int = SodiumJNI.crypto_box_open_detached_afternm(dst_plain, src_cipher, src_mac, cipher_len, nonce, shared_key) - - def crypto_box_sealbytes: Int = SodiumJNI.crypto_box_sealbytes - - def crypto_box_seal( - dst_cipher: Array[Byte], - src_plain: Array[Byte], - plain_len: Int, - remote_public_key: Array[Byte] - ): Int = SodiumJNI.crypto_box_seal(dst_cipher, src_plain, plain_len, remote_public_key) - - def crypto_box_seal_open( - dst_plain: Array[Byte], - src_cipher: Array[Byte], - cipher_len: Int, - local_public_key: Array[Byte], - local_private_key: Array[Byte] - ): Int = SodiumJNI.crypto_box_seal_open(dst_plain, src_cipher, cipher_len, local_public_key, local_private_key) - - def crypto_box_zerobytes: Int = SodiumJNI.crypto_box_zerobytes - - def crypto_box_boxzerobytes: Int = SodiumJNI.crypto_box_boxzerobytes - - def crypto_box( - dst_cipher: Array[Byte], - src_msg: Array[Byte], - msg_len: Int, - src_nonce: Array[Byte], - src_pub: Array[Byte], - src_secret: Array[Byte] - ): Int = SodiumJNI.crypto_box(dst_cipher, src_msg, msg_len, src_nonce, src_pub, src_secret) - - def crypto_box_open( - dst_msg: Array[Byte], - src_cipher: Array[Byte], - cipher_len: Int, - src_nonce: Array[Byte], - src_pub: Array[Byte], - src_secret: Array[Byte] - ): Int = SodiumJNI.crypto_box_open(dst_msg, src_cipher, cipher_len, src_nonce, src_pub, src_secret) - - def crypto_box_afternm( - dst_cipher: Array[Byte], - src_msg: Array[Byte], - msg_len: Int, - src_nonce: Array[Byte], - src_key: Array[Byte] - ): Int = SodiumJNI.crypto_box_afternm(dst_cipher, src_msg, msg_len, src_nonce, src_key) - - def crypto_box_open_afternm( - dst_msg: Array[Byte], - src_cipher: Array[Byte], - cipher_len: Int, - src_nonce: Array[Byte], - src_key: Array[Byte] - ): Int = SodiumJNI.crypto_box_open_afternm(dst_msg, src_cipher, cipher_len, src_nonce, src_key) - - def crypto_sign_bytes: Int = SodiumJNI.crypto_sign_bytes - - def crypto_sign_seedbytes: Int = SodiumJNI.crypto_sign_seedbytes - - def crypto_sign_publickeybytes: Int = SodiumJNI.crypto_sign_publickeybytes - - def crypto_sign_secretkeybytes: Int = SodiumJNI.crypto_sign_secretkeybytes - - def crypto_sign_primitive: Array[Byte] = SodiumJNI.crypto_sign_primitive - - def crypto_sign_keypair(dst_public_Key: Array[Byte], dst_private_key: Array[Byte]): Int = - SodiumJNI.crypto_sign_keypair(dst_public_Key, dst_private_key) - - def crypto_sign_seed_keypair(dst_public_Key: Array[Byte], dst_private_key: Array[Byte], src_seed: Array[Byte]): Int = - SodiumJNI.crypto_sign_seed_keypair(dst_public_Key, dst_private_key, src_seed) - - def crypto_sign( - dst_signed_msg: Array[Byte], - signed_msg_len: Array[Int], - src_msg: Array[Byte], - msg_len: Int, - local_private_key: Array[Byte] - ): Int = SodiumJNI.crypto_sign(dst_signed_msg, signed_msg_len, src_msg, msg_len, local_private_key) - - def crypto_sign_open( - dst_msg: Array[Byte], - msg_len: Array[Int], - src_signed_msg: Array[Byte], - signed_msg_len: Int, - remote_public_key: Array[Byte] - ): Int = SodiumJNI.crypto_sign_open(dst_msg, msg_len, src_signed_msg, signed_msg_len, remote_public_key) - - def crypto_sign_detached( - dst_signature: Array[Byte], - signature_len: Array[Int], - src_msg: Array[Byte], - msg_len: Int, - local_private_key: Array[Byte] - ): Int = SodiumJNI.crypto_sign_detached(dst_signature, signature_len, src_msg, msg_len, local_private_key) - - def crypto_sign_verify_detached( - src_signature: Array[Byte], - src_msg: Array[Byte], - msg_len: Int, - remote_public_key: Array[Byte] - ): Int = SodiumJNI.crypto_sign_verify_detached(src_signature, src_msg, msg_len, remote_public_key) - - def crypto_sign_ed25519_sk_to_seed(dst_seed: Array[Byte], src_private_key: Array[Byte]): Int = - SodiumJNI.crypto_sign_ed25519_sk_to_seed(dst_seed, src_private_key) - - def crypto_sign_ed25519_sk_to_pk(dst_public_key: Array[Byte], src_private_key: Array[Byte]): Int = - SodiumJNI.crypto_sign_ed25519_sk_to_pk(dst_public_key, src_private_key) - - def crypto_generichash_bytes: Int = SodiumJNI.crypto_generichash_bytes - - def crypto_generichash_bytes_min: Int = SodiumJNI.crypto_generichash_bytes_min - - def crypto_generichash_bytes_max: Int = SodiumJNI.crypto_generichash_bytes_max - - def crypto_generichash_keybytes: Int = SodiumJNI.crypto_generichash_keybytes - - def crypto_generichash_keybytes_min: Int = SodiumJNI.crypto_generichash_keybytes_min - - def crypto_generichash_keybytes_max: Int = SodiumJNI.crypto_generichash_keybytes_max - - def crypto_generichash_primitive: Array[Byte] = SodiumJNI.crypto_generichash_primitive - - def crypto_generichash( - dst_hash: Array[Byte], - dst_len: Int, - src_input: Array[Byte], - input_len: Int, - src_key: Array[Byte], - key_len: Int - ): Int = SodiumJNI.crypto_generichash(dst_hash, dst_len, src_input, input_len, src_key, key_len) - - def crypto_generichash_statebytes: Int = SodiumJNI.crypto_generichash_statebytes - - def crypto_generichash_init(state: Array[Byte], src_key: Array[Byte], key_len: Int, out_len: Int): Int = - SodiumJNI.crypto_generichash_init(state, src_key, key_len, out_len) - - def crypto_generichash_update(state: Array[Byte], src_input: Array[Byte], input_len: Int): Int = - SodiumJNI.crypto_generichash_update(state, src_input, input_len) - - def crypto_generichash_final(state: Array[Byte], dst_out: Array[Byte], out_len: Int): Int = - SodiumJNI.crypto_generichash_final(state, dst_out, out_len) - - def crypto_shorthash_bytes: Int = SodiumJNI.crypto_shorthash_bytes - - def crypto_shorthash_keybytes: Int = SodiumJNI.crypto_shorthash_keybytes - - def crypto_shorthash_primitive: Array[Byte] = SodiumJNI.crypto_shorthash_primitive - - def crypto_shorthash(dst_out: Array[Byte], src_input: Array[Byte], input_len: Int, src_key: Array[Byte]): Int = - SodiumJNI.crypto_shorthash(dst_out, src_input, input_len, src_key) - - def crypto_auth_bytes: Int = SodiumJNI.crypto_auth_bytes - - def crypto_auth_keybytes: Int = SodiumJNI.crypto_auth_keybytes - - def crypto_auth_primitive: Array[Byte] = SodiumJNI.crypto_auth_primitive - - def crypto_auth(dst_mac: Array[Byte], src_input: Array[Byte], input_len: Int, src_key: Array[Byte]): Int = - SodiumJNI.crypto_auth(dst_mac, src_input, input_len, src_key) - - def crypto_auth_verify(src_mac: Array[Byte], src_input: Array[Byte], input_len: Int, src_key: Array[Byte]): Int = - SodiumJNI.crypto_auth_verify(src_mac, src_input, input_len, src_key) - - def crypto_onetimeauth_bytes: Int = SodiumJNI.crypto_onetimeauth_bytes - - def crypto_onetimeauth_keybytes: Int = SodiumJNI.crypto_onetimeauth_keybytes - - def crypto_onetimeauth_primitive: Array[Byte] = SodiumJNI.crypto_onetimeauth_primitive - - def crypto_onetimeauth(dst_out: Array[Byte], src_input: Array[Byte], input_len: Int, src_key: Array[Byte]): Int = - SodiumJNI.crypto_onetimeauth(dst_out, src_input, input_len, src_key) - - def crypto_onetimeauth_verify( - src_mac: Array[Byte], - src_input: Array[Byte], - input_len: Int, - src_key: Array[Byte] - ): Int = SodiumJNI.crypto_onetimeauth_verify(src_mac, src_input, input_len, src_key) - - def crypto_onetimeauth_statebytes: Int = SodiumJNI.crypto_onetimeauth_statebytes - - def crypto_onetimeauth_init(dst_state: Array[Byte], src_key: Array[Byte]): Int = - SodiumJNI.crypto_onetimeauth_init(dst_state, src_key) - - def crypto_onetimeauth_update(dst_state: Array[Byte], src_input: Array[Byte], input_len: Int): Int = - SodiumJNI.crypto_onetimeauth_update(dst_state, src_input, input_len) - - def crypto_onetimeauth_final(final_state: Array[Byte], dst_out: Array[Byte]): Int = - SodiumJNI.crypto_onetimeauth_final(final_state, dst_out) - - def crypto_aead_aes256gcm_encrypt( - c: Array[Byte], - clen_p: Array[Int], - m: Array[Byte], - mlen: Int, - ad: Array[Byte], - adlen: Int, - nsec: Array[Byte], - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_aes256gcm_encrypt(c, clen_p, m, mlen, ad, adlen, nsec, npub, k) - - def crypto_aead_aes256gcm_decrypt( - m: Array[Byte], - mlen_p: Array[Int], - nsec: Array[Byte], - c: Array[Byte], - clen: Int, - ad: Array[Byte], - adlen: Int, - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_aes256gcm_decrypt(m, mlen_p, nsec, c, clen, ad, adlen, npub, k) - - def crypto_aead_aes256gcm_encrypt_detached( - c: Array[Byte], - mac: Array[Byte], - maclen_p: Array[Int], - m: Array[Byte], - mlen: Int, - ad: Array[Byte], - adlen: Int, - nsec: Array[Byte], - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_aes256gcm_encrypt_detached(c, mac, maclen_p, m, mlen, ad, adlen, nsec, npub, k) - - def crypto_aead_aes256gcm_decrypt_detached( - m: Array[Byte], - nsec: Array[Byte], - c: Array[Byte], - clen: Int, - mac: Array[Byte], - ad: Array[Byte], - adlen: Int, - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_aes256gcm_decrypt_detached(m, nsec, c, clen, mac, ad, adlen, npub, k) - - def crypto_aead_chacha20poly1305_encrypt( - c: Array[Byte], - clen_p: Array[Int], - m: Array[Byte], - mlen: Int, - ad: Array[Byte], - adlen: Int, - nsec: Array[Byte], - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_chacha20poly1305_encrypt(c, clen_p, m, mlen, ad, adlen, nsec, npub, k) - - def crypto_aead_chacha20poly1305_decrypt( - m: Array[Byte], - mlen_p: Array[Int], - nsec: Array[Byte], - c: Array[Byte], - clen: Int, - ad: Array[Byte], - adlen: Int, - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_chacha20poly1305_decrypt(m, mlen_p, nsec, c, clen, ad, adlen, npub, k) - - def crypto_aead_chacha20poly1305_encrypt_detached( - c: Array[Byte], - mac: Array[Byte], - maclen_p: Array[Int], - m: Array[Byte], - mlen: Int, - ad: Array[Byte], - adlen: Int, - nsec: Array[Byte], - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_chacha20poly1305_encrypt_detached(c, mac, maclen_p, m, mlen, ad, adlen, nsec, npub, k) - - def crypto_aead_chacha20poly1305_decrypt_detached( - m: Array[Byte], - nsec: Array[Byte], - c: Array[Byte], - clen: Int, - mac: Array[Byte], - ad: Array[Byte], - adlen: Int, - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_chacha20poly1305_decrypt_detached(m, nsec, c, clen, mac, ad, adlen, npub, k) - - def crypto_aead_chacha20poly1305_ietf_encrypt( - c: Array[Byte], - clen_p: Array[Int], - m: Array[Byte], - mlen: Int, - ad: Array[Byte], - adlen: Int, - nsec: Array[Byte], - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_chacha20poly1305_ietf_encrypt(c, clen_p, m, mlen, ad, adlen, nsec, npub, k) - - def crypto_aead_chacha20poly1305_ietf_decrypt( - m: Array[Byte], - mlen_p: Array[Int], - nsec: Array[Byte], - c: Array[Byte], - clen: Int, - ad: Array[Byte], - adlen: Int, - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_chacha20poly1305_ietf_decrypt(m, mlen_p, nsec, c, clen, ad, adlen, npub, k) - - def crypto_aead_chacha20poly1305_ietf_encrypt_detached( - c: Array[Byte], - mac: Array[Byte], - maclen_p: Array[Int], - m: Array[Byte], - mlen: Int, - ad: Array[Byte], - adlen: Int, - nsec: Array[Byte], - npub: Array[Byte], - k: Array[Byte] - ): Int = - SodiumJNI.crypto_aead_chacha20poly1305_ietf_encrypt_detached(c, mac, maclen_p, m, mlen, ad, adlen, nsec, npub, k) - - def crypto_aead_chacha20poly1305_ietf_decrypt_detached( - m: Array[Byte], - nsec: Array[Byte], - c: Array[Byte], - clen: Int, - mac: Array[Byte], - ad: Array[Byte], - adlen: Int, - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_chacha20poly1305_ietf_decrypt_detached(m, nsec, c, clen, mac, ad, adlen, npub, k) - - def crypto_aead_xchacha20poly1305_ietf_encrypt( - c: Array[Byte], - clen_p: Array[Int], - m: Array[Byte], - mlen: Int, - ad: Array[Byte], - adlen: Int, - nsec: Array[Byte], - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_xchacha20poly1305_ietf_encrypt(c, clen_p, m, mlen, ad, adlen, nsec, npub, k) - - def crypto_aead_xchacha20poly1305_ietf_decrypt( - m: Array[Byte], - mlen_p: Array[Int], - nsec: Array[Byte], - c: Array[Byte], - clen: Int, - ad: Array[Byte], - adlen: Int, - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_xchacha20poly1305_ietf_decrypt(m, mlen_p, nsec, c, clen, ad, adlen, npub, k) - - def crypto_aead_xchacha20poly1305_ietf_encrypt_detached( - c: Array[Byte], - mac: Array[Byte], - maclen_p: Array[Int], - m: Array[Byte], - mlen: Int, - ad: Array[Byte], - adlen: Int, - nsec: Array[Byte], - npub: Array[Byte], - k: Array[Byte] - ): Int = - SodiumJNI.crypto_aead_xchacha20poly1305_ietf_encrypt_detached(c, mac, maclen_p, m, mlen, ad, adlen, nsec, npub, k) - - def crypto_aead_xchacha20poly1305_ietf_decrypt_detached( - m: Array[Byte], - nsec: Array[Byte], - c: Array[Byte], - clen: Int, - mac: Array[Byte], - ad: Array[Byte], - adlen: Int, - npub: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_aead_xchacha20poly1305_ietf_decrypt_detached(m, nsec, c, clen, mac, ad, adlen, npub, k) - - def crypto_auth_hmacsha256_bytes: Int = SodiumJNI.crypto_auth_hmacsha256_bytes - - def crypto_auth_hmacsha256_keybytes: Int = SodiumJNI.crypto_auth_hmacsha256_keybytes - - def crypto_auth_hmacsha256(out: Array[Byte], in: Array[Byte], inlen: Int, k: Array[Byte]): Int = - SodiumJNI.crypto_auth_hmacsha256(out, in, inlen, k) - - def crypto_auth_hmacsha256_verify(h: Array[Byte], in: Array[Byte], inlen: Int, k: Array[Byte]): Int = - SodiumJNI.crypto_auth_hmacsha256_verify(h, in, inlen, k) - - def crypto_auth_hmacsha256_statebytes: Int = SodiumJNI.crypto_auth_hmacsha256_statebytes - - def crypto_auth_hmacsha256_init(state: Array[Byte], key: Array[Byte], keylen: Int): Int = - SodiumJNI.crypto_auth_hmacsha256_init(state, key, keylen) - - def crypto_auth_hmacsha256_update(state: Array[Byte], in: Array[Byte], inlen: Int): Int = - SodiumJNI.crypto_auth_hmacsha256_update(state, in, inlen) - - def crypto_auth_hmacsha256_final(state: Array[Byte], out: Array[Byte]): Int = - SodiumJNI.crypto_auth_hmacsha256_final(state, out) - - def crypto_auth_hmacsha512_bytes: Int = SodiumJNI.crypto_auth_hmacsha512_bytes - - def crypto_auth_hmacsha512_keybytes: Int = SodiumJNI.crypto_auth_hmacsha512_keybytes - - def crypto_auth_hmacsha512(out: Array[Byte], in: Array[Byte], inlen: Int, k: Array[Byte]): Int = - SodiumJNI.crypto_auth_hmacsha512(out, in, inlen, k) - - def crypto_auth_hmacsha512_verify(h: Array[Byte], in: Array[Byte], inlen: Int, k: Array[Byte]): Int = - SodiumJNI.crypto_auth_hmacsha512_verify(h, in, inlen, k) - - def crypto_auth_hmacsha512_statebytes: Int = SodiumJNI.crypto_auth_hmacsha512_statebytes - - def crypto_auth_hmacsha512_init(state: Array[Byte], key: Array[Byte], keylen: Int): Int = - SodiumJNI.crypto_auth_hmacsha512_init(state, key, keylen) - - def crypto_auth_hmacsha512_update(state: Array[Byte], in: Array[Byte], inlen: Int): Int = - SodiumJNI.crypto_auth_hmacsha512_update(state, in, inlen) - - def crypto_auth_hmacsha512_final(state: Array[Byte], out: Array[Byte]): Int = - SodiumJNI.crypto_auth_hmacsha512_final(state, out) - - def crypto_auth_hmacsha512256_bytes: Int = SodiumJNI.crypto_auth_hmacsha512256_bytes - - def crypto_auth_hmacsha512256_keybytes: Int = SodiumJNI.crypto_auth_hmacsha512256_keybytes - - def crypto_auth_hmacsha512256(out: Array[Byte], in: Array[Byte], inlen: Int, k: Array[Byte]): Int = - SodiumJNI.crypto_auth_hmacsha512256(out, in, inlen, k) - - def crypto_auth_hmacsha512256_verify(h: Array[Byte], in: Array[Byte], inlen: Int, k: Array[Byte]): Int = - SodiumJNI.crypto_auth_hmacsha512256_verify(h, in, inlen, k) - - def crypto_auth_hmacsha512256_statebytes: Int = SodiumJNI.crypto_auth_hmacsha512256_statebytes - - def crypto_auth_hmacsha512256_init(state: Array[Byte], key: Array[Byte], keylen: Int): Int = - SodiumJNI.crypto_auth_hmacsha512256_init(state, key, keylen) - - def crypto_auth_hmacsha512256_update(state: Array[Byte], in: Array[Byte], inlen: Int): Int = - SodiumJNI.crypto_auth_hmacsha512256_update(state, in, inlen) - - def crypto_auth_hmacsha512256_final(state: Array[Byte], out: Array[Byte]): Int = - SodiumJNI.crypto_auth_hmacsha512256_final(state, out) - - def crypto_box_curve25519xsalsa20poly1305_seedbytes: Int = SodiumJNI.crypto_box_curve25519xsalsa20poly1305_seedbytes - - def crypto_box_curve25519xsalsa20poly1305_publickeybytes: Int = - SodiumJNI.crypto_box_curve25519xsalsa20poly1305_publickeybytes - - def crypto_box_curve25519xsalsa20poly1305_secretkeybytes: Int = - SodiumJNI.crypto_box_curve25519xsalsa20poly1305_secretkeybytes - - def crypto_box_curve25519xsalsa20poly1305_beforenmbytes: Int = - SodiumJNI.crypto_box_curve25519xsalsa20poly1305_beforenmbytes - - def crypto_box_curve25519xsalsa20poly1305_noncebytes: Int = SodiumJNI.crypto_box_curve25519xsalsa20poly1305_noncebytes - - def crypto_box_curve25519xsalsa20poly1305_zerobytes: Int = SodiumJNI.crypto_box_curve25519xsalsa20poly1305_zerobytes - - def crypto_box_curve25519xsalsa20poly1305_boxzerobytes: Int = - SodiumJNI.crypto_box_curve25519xsalsa20poly1305_boxzerobytes - - def crypto_box_curve25519xsalsa20poly1305_macbytes: Int = SodiumJNI.crypto_box_curve25519xsalsa20poly1305_macbytes - - def crypto_box_curve25519xsalsa20poly1305( - c: Array[Byte], - m: Array[Byte], - mlen: Int, - n: Array[Byte], - pk: Array[Byte], - sk: Array[Byte] - ): Int = SodiumJNI.crypto_box_curve25519xsalsa20poly1305(c, m, mlen, n, pk, sk) - - def crypto_box_curve25519xsalsa20poly1305_open( - m: Array[Byte], - c: Array[Byte], - clen: Int, - n: Array[Byte], - pk: Array[Byte], - sk: Array[Byte] - ): Int = SodiumJNI.crypto_box_curve25519xsalsa20poly1305_open(m, c, clen, n, pk, sk) - - def crypto_box_curve25519xsalsa20poly1305_seed_keypair(pk: Array[Byte], sk: Array[Byte], seed: Array[Byte]): Int = - SodiumJNI.crypto_box_curve25519xsalsa20poly1305_seed_keypair(pk, sk, seed) - - def crypto_box_curve25519xsalsa20poly1305_keypair(pk: Array[Byte], sk: Array[Byte]): Int = - SodiumJNI.crypto_box_curve25519xsalsa20poly1305_keypair(pk, sk) - - def crypto_box_curve25519xsalsa20poly1305_beforenm(k: Array[Byte], pk: Array[Byte], sk: Array[Byte]): Int = - SodiumJNI.crypto_box_curve25519xsalsa20poly1305_beforenm(k, pk, sk) - - def crypto_box_curve25519xsalsa20poly1305_afternm( - c: Array[Byte], - m: Array[Byte], - mlen: Int, - n: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_box_curve25519xsalsa20poly1305_afternm(c, m, mlen, n, k) - - def crypto_box_curve25519xsalsa20poly1305_open_afternm( - m: Array[Byte], - c: Array[Byte], - clen: Int, - n: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_box_curve25519xsalsa20poly1305_open_afternm(m, c, clen, n, k) - - def crypto_core_hsalsa20_outputbytes: Int = SodiumJNI.crypto_core_hsalsa20_outputbytes - - def crypto_core_hsalsa20_inputbytes: Int = SodiumJNI.crypto_core_hsalsa20_inputbytes - - def crypto_core_hsalsa20_keybytes: Int = SodiumJNI.crypto_core_hsalsa20_keybytes - - def crypto_core_hsalsa20_constbytes: Int = SodiumJNI.crypto_core_hsalsa20_constbytes - - def crypto_core_hsalsa20(out: Array[Byte], in: Array[Byte], k: Array[Byte], c: Array[Byte]): Int = - SodiumJNI.crypto_core_hsalsa20(out, in, k, c) - - def crypto_core_salsa20_outputbytes: Int = SodiumJNI.crypto_core_salsa20_outputbytes - - def crypto_core_salsa20_inputbytes: Int = SodiumJNI.crypto_core_salsa20_inputbytes - - def crypto_core_salsa20_keybytes: Int = SodiumJNI.crypto_core_salsa20_keybytes - - def crypto_core_salsa20_constbytes: Int = SodiumJNI.crypto_core_salsa20_constbytes - - def crypto_core_salsa20(out: Array[Byte], in: Array[Byte], k: Array[Byte], c: Array[Byte]): Int = - SodiumJNI.crypto_core_salsa20(out, in, k, c) - - def crypto_generichash_blake2b_bytes_min: Int = SodiumJNI.crypto_generichash_blake2b_bytes_min - - def crypto_generichash_blake2b_bytes_max: Int = SodiumJNI.crypto_generichash_blake2b_bytes_max - - def crypto_generichash_blake2b_bytes: Int = SodiumJNI.crypto_generichash_blake2b_bytes - - def crypto_generichash_blake2b_keybytes_min: Int = SodiumJNI.crypto_generichash_blake2b_keybytes_min - - def crypto_generichash_blake2b_keybytes_max: Int = SodiumJNI.crypto_generichash_blake2b_keybytes_max - - def crypto_generichash_blake2b_keybytes: Int = SodiumJNI.crypto_generichash_blake2b_keybytes - - def crypto_generichash_blake2b_saltbytes: Int = SodiumJNI.crypto_generichash_blake2b_saltbytes - - def crypto_generichash_blake2b_personalbytes: Int = SodiumJNI.crypto_generichash_blake2b_personalbytes - - def crypto_generichash_blake2b( - out: Array[Byte], - outlen: Int, - in: Array[Byte], - inlen: Int, - key: Array[Byte], - keylen: Int - ): Int = SodiumJNI.crypto_generichash_blake2b(out, outlen, in, inlen, key, keylen) - - def crypto_generichash_blake2b_salt_personal( - out: Array[Byte], - outlen: Int, - in: Array[Byte], - inlen: Int, - key: Array[Byte], - keylen: Int, - salt: Array[Byte], - personal: Array[Byte] - ): Int = SodiumJNI.crypto_generichash_blake2b_salt_personal(out, outlen, in, inlen, key, keylen, salt, personal) - - def crypto_generichash_blake2b_init(state: Array[Byte], key: Array[Byte], keylen: Int, outlen: Int): Int = - SodiumJNI.crypto_generichash_blake2b_init(state, key, keylen, outlen) - - def crypto_generichash_blake2b_init_salt_personal( - state: Array[Byte], - key: Array[Byte], - keylen: Int, - outlen: Int, - salt: Array[Byte], - personal: Array[Byte] - ): Int = SodiumJNI.crypto_generichash_blake2b_init_salt_personal(state, key, keylen, outlen, salt, personal) - - def crypto_generichash_blake2b_update(state: Array[Byte], in: Array[Byte], inlen: Int): Int = - SodiumJNI.crypto_generichash_blake2b_update(state, in, inlen) - - def crypto_generichash_blake2b_final(state: Array[Byte], out: Array[Byte], outlen: Int): Int = - SodiumJNI.crypto_generichash_blake2b_final(state, out, outlen) - - def crypto_hash_sha256_bytes: Int = SodiumJNI.crypto_hash_sha256_bytes - - def crypto_hash_sha256(out: Array[Byte], in: Array[Byte], inlen: Int): Int = - SodiumJNI.crypto_hash_sha256(out, in, inlen) - - def crypto_hash_sha256_statebytes: Int = SodiumJNI.crypto_hash_sha256_statebytes - - def crypto_hash_sha256_init(state: Array[Byte]): Int = SodiumJNI.crypto_hash_sha256_init(state) - - def crypto_hash_sha256_update(state: Array[Byte], in: Array[Byte], inlen: Int): Int = - SodiumJNI.crypto_hash_sha256_update(state, in, inlen) - - def crypto_hash_sha256_final(state: Array[Byte], out: Array[Byte]): Int = - SodiumJNI.crypto_hash_sha256_final(state, out) - - def crypto_hash_sha512_bytes: Int = SodiumJNI.crypto_hash_sha512_bytes - - def crypto_hash_sha512(out: Array[Byte], in: Array[Byte], inlen: Int): Int = - SodiumJNI.crypto_hash_sha512(out, in, inlen) - - def crypto_hash_sha512_statebytes: Int = SodiumJNI.crypto_hash_sha512_statebytes - - def crypto_hash_sha512_init(state: Array[Byte]): Int = SodiumJNI.crypto_hash_sha512_init(state) - - def crypto_hash_sha512_update(state: Array[Byte], in: Array[Byte], inlen: Int): Int = - SodiumJNI.crypto_hash_sha512_update(state, in, inlen) - - def crypto_hash_sha512_final(state: Array[Byte], out: Array[Byte]): Int = - SodiumJNI.crypto_hash_sha512_final(state, out) - - def crypto_onetimeauth_poly1305_bytes: Int = SodiumJNI.crypto_onetimeauth_poly1305_bytes - - def crypto_onetimeauth_poly1305_keybytes: Int = SodiumJNI.crypto_onetimeauth_poly1305_keybytes - - def crypto_onetimeauth_poly1305(out: Array[Byte], in: Array[Byte], inlen: Int, k: Array[Byte]): Int = - SodiumJNI.crypto_onetimeauth_poly1305(out, in, inlen, k) - - def crypto_onetimeauth_poly1305_verify(h: Array[Byte], in: Array[Byte], inlen: Int, k: Array[Byte]): Int = - SodiumJNI.crypto_onetimeauth_poly1305_verify(h, in, inlen, k) - - def crypto_onetimeauth_poly1305_init(state: Array[Byte], key: Array[Byte]): Int = - SodiumJNI.crypto_onetimeauth_poly1305_init(state, key) - - def crypto_onetimeauth_poly1305_update(state: Array[Byte], in: Array[Byte], inlen: Int): Int = - SodiumJNI.crypto_onetimeauth_poly1305_update(state, in, inlen) - - def crypto_onetimeauth_poly1305_final(state: Array[Byte], out: Array[Byte]): Int = - SodiumJNI.crypto_onetimeauth_poly1305_final(state, out) - - def crypto_pwhash_alg_argon2i13: Int = SodiumJNI.crypto_pwhash_alg_argon2i13 - - def crypto_pwhash_alg_default: Int = SodiumJNI.crypto_pwhash_alg_default - - def crypto_pwhash_bytes_min: Int = SodiumJNI.crypto_pwhash_bytes_min - - def crypto_pwhash_bytes_max: Int = SodiumJNI.crypto_pwhash_bytes_max - - def crypto_pwhash_passwd_min: Int = SodiumJNI.crypto_pwhash_passwd_min - - def crypto_pwhash_passwd_max: Int = SodiumJNI.crypto_pwhash_passwd_max - - def crypto_pwhash_saltbytes: Int = SodiumJNI.crypto_pwhash_saltbytes - - def crypto_pwhash_strbytes: Int = SodiumJNI.crypto_pwhash_strbytes - - def crypto_pwhash_strprefix: Array[Byte] = SodiumJNI.crypto_pwhash_strprefix - - def crypto_pwhash_opslimit_min: Int = SodiumJNI.crypto_pwhash_opslimit_min - - def crypto_pwhash_opslimit_max: Int = SodiumJNI.crypto_pwhash_opslimit_max - - def crypto_pwhash_memlimit_min: Int = SodiumJNI.crypto_pwhash_memlimit_min - - def crypto_pwhash_memlimit_max: Int = SodiumJNI.crypto_pwhash_memlimit_max - - def crypto_pwhash_opslimit_interactive: Int = SodiumJNI.crypto_pwhash_opslimit_interactive - - def crypto_pwhash_memlimit_interactive: Int = SodiumJNI.crypto_pwhash_memlimit_interactive - - def crypto_pwhash_opslimit_moderate: Int = SodiumJNI.crypto_pwhash_opslimit_moderate - - def crypto_pwhash_memlimit_moderate: Int = SodiumJNI.crypto_pwhash_memlimit_moderate - - def crypto_pwhash_opslimit_sensitive: Int = SodiumJNI.crypto_pwhash_opslimit_sensitive - - def crypto_pwhash_memlimit_sensitive: Int = SodiumJNI.crypto_pwhash_memlimit_sensitive - - def crypto_pwhash( - out: Array[Byte], - outlen: Int, - passwd: Array[Byte], - passwdlen: Int, - salt: Array[Byte], - opslimit: Int, - memlimit: Int, - alg: Int - ): Int = SodiumJNI.crypto_pwhash(out, outlen, passwd, passwdlen, salt, opslimit, memlimit, alg) - - def crypto_pwhash_str(out: Array[Byte], passwd: Array[Byte], passwdlen: Int, opslimit: Int, memlimit: Int): Int = - SodiumJNI.crypto_pwhash_str(out, passwd, passwdlen, opslimit, memlimit) - - def crypto_pwhash_str_verify(str: Array[Byte], passwd: Array[Byte], passwdlen: Int): Int = - SodiumJNI.crypto_pwhash_str_verify(str, passwd, passwdlen) - - def crypto_pwhash_primitive: Array[Byte] = SodiumJNI.crypto_pwhash_primitive - - def crypto_pwhash_scryptsalsa208sha256_saltbytes: Int = SodiumJNI.crypto_pwhash_scryptsalsa208sha256_saltbytes - - def crypto_pwhash_scryptsalsa208sha256_strbytes: Int = SodiumJNI.crypto_pwhash_scryptsalsa208sha256_strbytes - - def crypto_pwhash_scryptsalsa208sha256_strprefix: Array[Byte] = SodiumJNI.crypto_pwhash_scryptsalsa208sha256_strprefix - - def crypto_pwhash_scryptsalsa208sha256_opslimit_interactive: Int = - SodiumJNI.crypto_pwhash_scryptsalsa208sha256_opslimit_interactive - - def crypto_pwhash_scryptsalsa208sha256_memlimit_interactive: Int = - SodiumJNI.crypto_pwhash_scryptsalsa208sha256_memlimit_interactive - - def crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive: Int = - SodiumJNI.crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive - - def crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive: Int = - SodiumJNI.crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive - - def crypto_pwhash_scryptsalsa208sha256( - out: Array[Byte], - outlen: Int, - passwd: Array[Byte], - passwdlen: Int, - salt: Array[Byte], - opslimit: Int, - memlimit: Int - ): Int = SodiumJNI.crypto_pwhash_scryptsalsa208sha256(out, outlen, passwd, passwdlen, salt, opslimit, memlimit) - - def crypto_pwhash_scryptsalsa208sha256_str( - out: Array[Byte], - passwd: Array[Byte], - passwdlen: Int, - opslimit: Int, - memlimit: Int - ): Int = SodiumJNI.crypto_pwhash_scryptsalsa208sha256_str(out, passwd, passwdlen, opslimit, memlimit) - - def crypto_pwhash_scryptsalsa208sha256_str_verify(str: Array[Byte], passwd: Array[Byte], passwdlen: Int): Int = - SodiumJNI.crypto_pwhash_scryptsalsa208sha256_str_verify(str, passwd, passwdlen) - - def crypto_pwhash_scryptsalsa208sha256_ll( - passwd: Array[Byte], - passwdlen: Int, - salt: Array[Byte], - saltlen: Int, - N: Int, - r: Int, - p: Int, - buf: Array[Byte], - buflen: Int - ): Int = SodiumJNI.crypto_pwhash_scryptsalsa208sha256_ll(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen) - - def crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(str: Array[Byte], opslimit: Int, memlimit: Int): Int = - SodiumJNI.crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(str, opslimit, memlimit) - - def crypto_scalarmult_curve25519_bytes: Int = SodiumJNI.crypto_scalarmult_curve25519_bytes - - def crypto_scalarmult_curve25519_scalarbytes: Int = SodiumJNI.crypto_scalarmult_curve25519_scalarbytes - - def crypto_scalarmult_curve25519(q: Array[Byte], n: Array[Byte], p: Array[Byte]): Int = - SodiumJNI.crypto_scalarmult_curve25519(q, n, p) - - def crypto_scalarmult_curve25519_base(q: Array[Byte], n: Array[Byte]): Int = - SodiumJNI.crypto_scalarmult_curve25519_base(q, n) - - def crypto_secretbox_xsalsa20poly1305_keybytes: Int = SodiumJNI.crypto_secretbox_xsalsa20poly1305_keybytes - - def crypto_secretbox_xsalsa20poly1305_noncebytes: Int = SodiumJNI.crypto_secretbox_xsalsa20poly1305_noncebytes - - def crypto_secretbox_xsalsa20poly1305_zerobytes: Int = SodiumJNI.crypto_secretbox_xsalsa20poly1305_zerobytes - - def crypto_secretbox_xsalsa20poly1305_boxzerobytes: Int = SodiumJNI.crypto_secretbox_xsalsa20poly1305_boxzerobytes - - def crypto_secretbox_xsalsa20poly1305_macbytes: Int = SodiumJNI.crypto_secretbox_xsalsa20poly1305_macbytes - - def crypto_secretbox_xsalsa20poly1305( - c: Array[Byte], - m: Array[Byte], - mlen: Int, - n: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_secretbox_xsalsa20poly1305(c, m, mlen, n, k) - - def crypto_secretbox_xsalsa20poly1305_open( - m: Array[Byte], - c: Array[Byte], - clen: Int, - n: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_secretbox_xsalsa20poly1305_open(m, c, clen, n, k) - - def crypto_secretbox_xchacha20poly1305_easy( - c: Array[Byte], - m: Array[Byte], - mlen: Int, - n: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_secretbox_xchacha20poly1305_easy(c, m, mlen, n, k) - - def crypto_secretbox_xchacha20poly1305_open_easy( - m: Array[Byte], - c: Array[Byte], - clen: Int, - n: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_secretbox_xchacha20poly1305_open_easy(m, c, clen, n, k) - - def crypto_secretbox_xchacha20poly1305_detached( - c: Array[Byte], - mac: Array[Byte], - m: Array[Byte], - mlen: Int, - n: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_secretbox_xchacha20poly1305_detached(c, mac, m, mlen, n, k) - - def crypto_secretbox_xchacha20poly1305_open_detached( - m: Array[Byte], - c: Array[Byte], - mac: Array[Byte], - clen: Int, - n: Array[Byte], - k: Array[Byte] - ): Int = SodiumJNI.crypto_secretbox_xchacha20poly1305_open_detached(m, c, mac, clen, n, k) - - def crypto_shorthash_siphash24_bytes: Int = SodiumJNI.crypto_shorthash_siphash24_bytes - - def crypto_shorthash_siphash24_keybytes: Int = SodiumJNI.crypto_shorthash_siphash24_keybytes - - def crypto_shorthash_siphash24(out: Array[Byte], in: Array[Byte], inlen: Int, k: Array[Byte]): Int = - SodiumJNI.crypto_shorthash_siphash24(out, in, inlen, k) - - def crypto_sign_ed25519_bytes: Int = SodiumJNI.crypto_sign_ed25519_bytes - - def crypto_sign_ed25519_seedbytes: Int = SodiumJNI.crypto_sign_ed25519_seedbytes - - def crypto_sign_ed25519_publickeybytes: Int = SodiumJNI.crypto_sign_ed25519_publickeybytes - - def crypto_sign_ed25519_secretkeybytes: Int = SodiumJNI.crypto_sign_ed25519_secretkeybytes - - def crypto_sign_ed25519(sm: Array[Byte], smlen_p: Array[Int], m: Array[Byte], mlen: Int, sk: Array[Byte]): Int = - SodiumJNI.crypto_sign_ed25519(sm, smlen_p, m, mlen, sk) - - def crypto_sign_ed25519_open(m: Array[Byte], mlen_p: Array[Int], sm: Array[Byte], smlen: Int, pk: Array[Byte]): Int = - SodiumJNI.crypto_sign_ed25519_open(m, mlen_p, sm, smlen, pk) - - def crypto_stream_xsalsa20(c: Array[Byte], clen: Int, n: Array[Byte], k: Array[Byte]): Int = - SodiumJNI.crypto_stream_xsalsa20(c, clen, n, k) - - def crypto_sign_ed25519_detached( - sig: Array[Byte], - siglen_p: Array[Int], - m: Array[Byte], - mlen: Int, - sk: Array[Byte] - ): Int = SodiumJNI.crypto_sign_ed25519_detached(sig, siglen_p, m, mlen, sk) - - def crypto_sign_ed25519_verify_detached(sig: Array[Byte], m: Array[Byte], mlen: Int, pk: Array[Byte]): Int = - SodiumJNI.crypto_sign_ed25519_verify_detached(sig, m, mlen, pk) - - def crypto_sign_ed25519_keypair(pk: Array[Byte], sk: Array[Byte]): Int = SodiumJNI.crypto_sign_ed25519_keypair(pk, sk) - - def crypto_sign_ed25519_seed_keypair(pk: Array[Byte], sk: Array[Byte], seed: Array[Byte]): Int = - SodiumJNI.crypto_sign_ed25519_seed_keypair(pk, sk, seed) - - def crypto_sign_ed25519_pk_to_curve25519(curve25519_pk: Array[Byte], ed25519_pk: Array[Byte]): Int = - SodiumJNI.crypto_sign_ed25519_pk_to_curve25519(curve25519_pk, ed25519_pk) - - def crypto_sign_ed25519_sk_to_curve25519(curve25519_sk: Array[Byte], ed25519_sk: Array[Byte]): Int = - SodiumJNI.crypto_sign_ed25519_sk_to_curve25519(curve25519_sk, ed25519_sk) - - def crypto_stream_chacha20_keybytes: Int = SodiumJNI.crypto_stream_chacha20_keybytes - - def crypto_stream_chacha20_noncebytes: Int = SodiumJNI.crypto_stream_chacha20_noncebytes - - def crypto_stream_chacha20(c: Array[Byte], clen: Int, n: Array[Byte], k: Array[Byte]): Int = - SodiumJNI.crypto_stream_chacha20(c, clen, n, k) - - def crypto_stream_chacha20_xor(c: Array[Byte], m: Array[Byte], mlen: Int, n: Array[Byte], k: Array[Byte]): Int = - SodiumJNI.crypto_stream_chacha20_xor(c, m, mlen, n, k) - - def crypto_stream_chacha20_xor_ic( - c: Array[Byte], - m: Array[Byte], - mlen: Int, - n: Array[Byte], - ic: Int, - k: Array[Byte] - ): Int = SodiumJNI.crypto_stream_chacha20_xor_ic(c, m, mlen, n, ic, k) - - def crypto_stream_chacha20_ietf_noncebytes: Int = SodiumJNI.crypto_stream_chacha20_ietf_noncebytes - - def crypto_stream_chacha20_ietf(c: Array[Byte], clen: Int, n: Array[Byte], k: Array[Byte]): Int = - SodiumJNI.crypto_stream_chacha20_ietf(c, clen, n, k) - - def crypto_stream_chacha20_ietf_xor(c: Array[Byte], m: Array[Byte], mlen: Int, n: Array[Byte], k: Array[Byte]): Int = - SodiumJNI.crypto_stream_chacha20_ietf_xor(c, m, mlen, n, k) - - def crypto_stream_chacha20_ietf_xor_ic( - c: Array[Byte], - m: Array[Byte], - mlen: Int, - n: Array[Byte], - ic: Int, - k: Array[Byte] - ): Int = SodiumJNI.crypto_stream_chacha20_ietf_xor_ic(c, m, mlen, n, ic, k) - - def crypto_stream_salsa20_keybytes: Int = SodiumJNI.crypto_stream_salsa20_keybytes - - def crypto_stream_salsa20_noncebytes: Int = SodiumJNI.crypto_stream_salsa20_noncebytes - - def crypto_stream_salsa20(c: Array[Byte], clen: Int, n: Array[Byte], k: Array[Byte]): Int = - SodiumJNI.crypto_stream_salsa20(c, clen, n, k) - - def crypto_stream_salsa20_xor(c: Array[Byte], m: Array[Byte], mlen: Int, n: Array[Byte], k: Array[Byte]): Int = - SodiumJNI.crypto_stream_salsa20_xor(c, m, mlen, n, k) - - def crypto_stream_salsa20_xor_ic( - c: Array[Byte], - m: Array[Byte], - mlen: Int, - n: Array[Byte], - ic: Int, - k: Array[Byte] - ): Int = SodiumJNI.crypto_stream_salsa20_xor_ic(c, m, mlen, n, ic, k) - - def crypto_stream_xsalsa20_keybytes: Int = SodiumJNI.crypto_stream_xsalsa20_keybytes - - def crypto_stream_xsalsa20_noncebytes: Int = SodiumJNI.crypto_stream_xsalsa20_noncebytes - - def crypto_stream_xsalsa20_xor(c: Array[Byte], m: Array[Byte], mlen: Int, n: Array[Byte], k: Array[Byte]): Int = - SodiumJNI.crypto_stream_xsalsa20_xor(c, m, mlen, n, k) - - def crypto_stream_xsalsa20_xor_ic( - c: Array[Byte], - m: Array[Byte], - mlen: Int, - n: Array[Byte], - ic: Int, - k: Array[Byte] - ): Int = SodiumJNI.crypto_stream_xsalsa20_xor_ic(c, m, mlen, n, ic, k) -} +final class ScalaSodium private extends ScalaSodium0 object ScalaSodium extends Argon2Constants