Various cryptographic function for datkt
npm install @datkt/cryptocrypto
======
Various cryptographic function for datk.
The datkt.crypto package an be installed with NPM.
``sh`
$ npm install @datkt/crypto
* Kotlin/Native and the
konanc command line program.
`shnode_modules/Compile a program in 'main.kt' and link crypto.klib found in
`
$ konanc -r node_modules/@datkt -l crypto/crypto main.kt
where main.kt might be
`kotlin
import datkt.crypto.*
fun main(args: Array
val kp = keyPair()
// @TODO
}
`
A simple data class container for a public and secret key pair
Generates a ed25519 key pair suitable for creating signatures.
`kotlin`
val kp = keyPair("some random seed value".toUtf8())
or
`kotlin`
val kp = keyPair()
Generates a signature for a given message and secret key.
`kotlin`
val ( publicKey, secretKey ) = keyPair()
val message = "hello".toUtf8() // convert to ByteArray
val signature = sign(message, secretKey)
To run the tests, make sure the crypto.klib Kotlin library is built by
running the following command.
`sh`
$ npm run build
When the library is built, run the following command to run the tests.
`sh``
$ npm test
* https://github.com/mafintosh/hypercore-crypto
MIT