Package-level declarations

Properties

Link copied to clipboard
@get:JvmName(name = "nonceAuthenticating")
val KeyWithNonceAuthenticating<*, *>.nonce: ByteArray

Functions

Link copied to clipboard
@JvmName(name = "authedKeyWithNonce")
fun <K : KeyType, A : AuthCapability.Authenticated<out K>> SymmetricKey<out A, NonceTrait.Required, out K>.andPredefinedNonce(    nonce: ByteArray): KmmResult<KeyWithNonceAuthenticating<A, K>>
fun <K : KeyType, A : AuthCapability<out K>> SymmetricKey<A, NonceTrait.Required, out K>.andPredefinedNonce(    nonce: ByteArray): KmmResult<KeyWithNonce<A, K>>

This function can be used to feed a pre-set nonce into encryption functions. This is usually not required, since all algorithms requiting a nonce/IV generate them by default

Link copied to clipboard
@JvmName(name = "encryptWithNonce")
suspend fun <K : KeyType, A : AuthCapability<out K>> KeyWithNonce<A, out K>.encrypt(    data: ByteArray): KmmResult<SealedBox.WithNonce<A, out K>>
@JvmName(name = "encryptAuthenticatedWithNonce")
suspend fun <K : KeyType, A : AuthCapability.Authenticated<out K>> KeyWithNonceAuthenticating<A, out K>.encrypt(    data: ByteArray,     authenticatedData: ByteArray? = null): KmmResult<SealedBox<A, NonceTrait.Required, out K>>

Encrypts data using the manually specified nonce. Check yourself, before you really, really wreck yourself!