diff --git a/library/driver-test/src/commonTest/kotlin/io/toxicity/sqlite/mc/driver/test/RekeyTest.kt b/library/driver-test/src/commonTest/kotlin/io/toxicity/sqlite/mc/driver/test/RekeyTest.kt index 413c4f4..ac8178f 100644 --- a/library/driver-test/src/commonTest/kotlin/io/toxicity/sqlite/mc/driver/test/RekeyTest.kt +++ b/library/driver-test/src/commonTest/kotlin/io/toxicity/sqlite/mc/driver/test/RekeyTest.kt @@ -55,6 +55,11 @@ abstract class RekeyTest: TestHelperNonEphemeral() { Triple(keyRawWithSalt, keyPassphrase) { encryption { sqlCipher { v4() } } }, Triple(keyRawWithSalt, keyPassphrase) { encryption { chaCha20 { default() } } }, Triple(keyRawWithSalt, keyPassphrase) { encryption { chaCha20 { sqleet() } } }, + + Triple(keyPassphrase, Key.passphrase("new password")) { encryption { ascon128 { default() } } }, + Triple(keyPassphrase, Key.passphrase("new password")) { encryption { rc4 { default() } } }, + Triple(keyPassphrase, Key.passphrase("new password")) { encryption { wxAES128 { default() } } }, + Triple(keyPassphrase, Key.passphrase("new password")) { encryption { wxAES256 { default() } } }, ).forEach { (key1, key2, filesystem) -> testLogger("RUN - ${i++}") diff --git a/library/driver/api/android/driver.api b/library/driver/api/android/driver.api index c552f0d..2f2615d 100644 --- a/library/driver/api/android/driver.api +++ b/library/driver/api/android/driver.api @@ -238,6 +238,10 @@ public final class io/toxicity/sqlite/mc/driver/config/encryption/Cipher$AES256C public static final field INSTANCE Lio/toxicity/sqlite/mc/driver/config/encryption/Cipher$AES256CBC; } +public final class io/toxicity/sqlite/mc/driver/config/encryption/Cipher$ASCON128 : io/toxicity/sqlite/mc/driver/config/encryption/Cipher { + public static final field INSTANCE Lio/toxicity/sqlite/mc/driver/config/encryption/Cipher$ASCON128; +} + public final class io/toxicity/sqlite/mc/driver/config/encryption/Cipher$CHACHA20 : io/toxicity/sqlite/mc/driver/config/encryption/Cipher { public static final field INSTANCE Lio/toxicity/sqlite/mc/driver/config/encryption/Cipher$CHACHA20; } @@ -274,6 +278,10 @@ public final class io/toxicity/sqlite/mc/driver/config/encryption/EncryptionConf } public class io/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder { + public final fun ascon128 (Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; + public final fun ascon128 (Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config;Lkotlin/jvm/functions/Function1;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; + public final fun ascon128 (Lkotlin/jvm/functions/Function1;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; + public static synthetic fun ascon128$default (Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder;Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; public final fun chaCha20 (Lio/toxicity/sqlite/mc/driver/config/encryption/MCChaCha20Config;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; public final fun chaCha20 (Lio/toxicity/sqlite/mc/driver/config/encryption/MCChaCha20Config;Lkotlin/jvm/functions/Function1;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; public final fun chaCha20 (Lkotlin/jvm/functions/Function1;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; @@ -386,6 +394,28 @@ public final class io/toxicity/sqlite/mc/driver/config/encryption/Key$Companion public static synthetic fun raw$default (Lio/toxicity/sqlite/mc/driver/config/encryption/Key$Companion;[B[BZILjava/lang/Object;)Lio/toxicity/sqlite/mc/driver/config/encryption/Key; } +public final class io/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config : io/toxicity/sqlite/mc/driver/config/encryption/MCCipherConfig { + public static final field Companion Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config$Companion; + public static final field Default Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config; + public final field kdfIter I + public synthetic fun (IIILkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class io/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config$Builder { + public final fun default ()V + public final fun kdfIter ()I + public final fun kdfIter (I)Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config$Builder; +} + +public final class io/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config$Companion { +} + +public final class io/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config$Options { + public final fun default ()V + public final fun default (Lkotlin/jvm/functions/Function1;)V + public static synthetic fun default$default (Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config$Options;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V +} + public final class io/toxicity/sqlite/mc/driver/config/encryption/MCChaCha20Config : io/toxicity/sqlite/mc/driver/config/encryption/MCCipherConfig { public static final field Companion Lio/toxicity/sqlite/mc/driver/config/encryption/MCChaCha20Config$Companion; public static final field Default Lio/toxicity/sqlite/mc/driver/config/encryption/MCChaCha20Config; diff --git a/library/driver/api/jvm/driver.api b/library/driver/api/jvm/driver.api index aa17358..e5cc7dc 100644 --- a/library/driver/api/jvm/driver.api +++ b/library/driver/api/jvm/driver.api @@ -234,6 +234,10 @@ public final class io/toxicity/sqlite/mc/driver/config/encryption/Cipher$AES256C public static final field INSTANCE Lio/toxicity/sqlite/mc/driver/config/encryption/Cipher$AES256CBC; } +public final class io/toxicity/sqlite/mc/driver/config/encryption/Cipher$ASCON128 : io/toxicity/sqlite/mc/driver/config/encryption/Cipher { + public static final field INSTANCE Lio/toxicity/sqlite/mc/driver/config/encryption/Cipher$ASCON128; +} + public final class io/toxicity/sqlite/mc/driver/config/encryption/Cipher$CHACHA20 : io/toxicity/sqlite/mc/driver/config/encryption/Cipher { public static final field INSTANCE Lio/toxicity/sqlite/mc/driver/config/encryption/Cipher$CHACHA20; } @@ -270,6 +274,10 @@ public final class io/toxicity/sqlite/mc/driver/config/encryption/EncryptionConf } public class io/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder { + public final fun ascon128 (Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; + public final fun ascon128 (Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config;Lkotlin/jvm/functions/Function1;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; + public final fun ascon128 (Lkotlin/jvm/functions/Function1;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; + public static synthetic fun ascon128$default (Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder;Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; public final fun chaCha20 (Lio/toxicity/sqlite/mc/driver/config/encryption/MCChaCha20Config;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; public final fun chaCha20 (Lio/toxicity/sqlite/mc/driver/config/encryption/MCChaCha20Config;Lkotlin/jvm/functions/Function1;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; public final fun chaCha20 (Lkotlin/jvm/functions/Function1;)Lio/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig$Builder; @@ -382,6 +390,28 @@ public final class io/toxicity/sqlite/mc/driver/config/encryption/Key$Companion public static synthetic fun raw$default (Lio/toxicity/sqlite/mc/driver/config/encryption/Key$Companion;[B[BZILjava/lang/Object;)Lio/toxicity/sqlite/mc/driver/config/encryption/Key; } +public final class io/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config : io/toxicity/sqlite/mc/driver/config/encryption/MCCipherConfig { + public static final field Companion Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config$Companion; + public static final field Default Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config; + public final field kdfIter I + public synthetic fun (IIILkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class io/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config$Builder { + public final fun default ()V + public final fun kdfIter ()I + public final fun kdfIter (I)Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config$Builder; +} + +public final class io/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config$Companion { +} + +public final class io/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config$Options { + public final fun default ()V + public final fun default (Lkotlin/jvm/functions/Function1;)V + public static synthetic fun default$default (Lio/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config$Options;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V +} + public final class io/toxicity/sqlite/mc/driver/config/encryption/MCChaCha20Config : io/toxicity/sqlite/mc/driver/config/encryption/MCCipherConfig { public static final field Companion Lio/toxicity/sqlite/mc/driver/config/encryption/MCChaCha20Config$Companion; public static final field Default Lio/toxicity/sqlite/mc/driver/config/encryption/MCChaCha20Config; diff --git a/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/Cipher.kt b/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/Cipher.kt index 374c855..db78f74 100644 --- a/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/Cipher.kt +++ b/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/Cipher.kt @@ -32,6 +32,7 @@ public sealed class Cipher private constructor( public object CHACHA20: Cipher(name = "chacha20", id = 3) public object SQLCIPHER: Cipher(name = "sqlcipher", id = 4) public object RC4: Cipher(name = "rc4", id = 5) + public object ASCON128: Cipher(name = "ascon128", id = 6) final override fun toString(): String = name final override fun compareTo(other: Cipher): Int = id - other.id @@ -51,6 +52,7 @@ public sealed class Cipher private constructor( name.equals(CHACHA20.name, ignoreCase = true) -> CHACHA20 name.equals(SQLCIPHER.name, ignoreCase = true) -> SQLCIPHER name.equals(RC4.name, ignoreCase = true) -> RC4 + name.equals(ASCON128.name, ignoreCase = true) -> ASCON128 else -> null } } @@ -68,6 +70,7 @@ public sealed class Cipher private constructor( CHACHA20.id -> CHACHA20 SQLCIPHER.id -> SQLCIPHER RC4.id -> RC4 + ASCON128.id -> ASCON128 else -> null } } diff --git a/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig.kt b/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig.kt index ced4561..c84cab4 100644 --- a/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig.kt +++ b/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfig.kt @@ -208,6 +208,24 @@ public class EncryptionConfig private constructor( } } + @MCConfigDsl + public fun ascon128( + block: MCAscon128Config.Options.() -> Unit, + ): Builder { + MCAscon128Config.Options { cipherConfig = it }.apply(block) + return this + } + + @MCConfigDsl + @JvmOverloads + public fun ascon128( + other: MCAscon128Config, + block: MCAscon128Config.Builder.() -> Unit = {}, + ): Builder { + MCAscon128Config.Builder(other).apply(block) + return this + } + @MCConfigDsl public fun chaCha20( block: MCChaCha20Config.Options.() -> Unit, diff --git a/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config.kt b/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config.kt new file mode 100644 index 0000000..f1a8a32 --- /dev/null +++ b/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCAscon128Config.kt @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2023 Toxicity + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +package io.toxicity.sqlite.mc.driver.config.encryption + +import io.toxicity.sqlite.mc.driver.MCCipherConfigDsl +import io.toxicity.sqlite.mc.driver.config.encryption.MCChaCha20Config.Companion.Default +import kotlin.jvm.JvmField +import kotlin.jvm.JvmName +import kotlin.jvm.JvmOverloads +import kotlin.jvm.JvmSynthetic + +/** + * Config for Ascon: Ascon-128 v1.2 + * + * @see [Builder] + * */ +public class MCAscon128Config private constructor( + legacy: Int, + legacyPageSize: Int, + @JvmField + public val kdfIter: Int, +): MCCipherConfig( + cipher = Cipher.ASCON128, + legacy = legacy, + legacyPageSize = legacyPageSize, +) { + + public companion object { + + /** Default config */ + @JvmField + public val Default: MCAscon128Config = Builder(null).apply { default() }.build() + } + + // This forces API consumers to declare a setting to start off at before + // customizations occur (if any) so that the [Builder] is configured + // prior to gaining access to it. + // + // This helps mitigate any foot-guns that could arise out of default values + // changing on a dependency update (new crypto or something). + @MCCipherConfigDsl + public class Options internal constructor( + private val setCipher: (MCAscon128Config) -> Unit, + ) { + + /** + * Initial settings for Default configuration which + * can be further customized (if desired). + * */ + @JvmOverloads + @MCCipherConfigDsl + public fun default(block: Builder.() -> Unit = {}) { + val cipher = Builder(Companion.Default).apply(block).build() + setCipher(cipher) + } + } + + /** + * [Ascon: Ascon-128 v1.2](https://utelle.github.io/SQLite3MultipleCiphers/docs/ciphers/cipher_ascon/) + * + * @see [default] + * */ + @MCCipherConfigDsl + public class Builder internal constructor(other: MCAscon128Config?) { + + /** + * [PRAGMA legacy](https://utelle.github.io/SQLite3MultipleCiphers/docs/configuration/config_sql_pragmas/#pragma-legacy) + * + * Default: 0 + * Min: 0 + * Max 0 + * */ + private val legacy: Int = 0 + + /** + * [PRAGMA legacy_page_size](https://utelle.github.io/SQLite3MultipleCiphers/docs/configuration/config_sql_pragmas/#pragma-legacy_page_size) + * + * Default: 4096 + * Min: 0 + * Max: 65536 + * + * **NOTE:** must be powers of 2 (e.g. 512, 1024, 4096, 8192, ...) + * */ + private val legacyPageSize: Int = 4096 + + + @get:JvmName("kdfIter") + public var kdfIter: Int = 64007 + private set + + /** + * [PRAGMA kdf_iter](https://utelle.github.io/SQLite3MultipleCiphers/docs/configuration/config_sql_pragmas/#pragma-kdf_iter) + * + * Default: 64007 + * Min: 1 + * Max: 2147483647 + * + * @throws [IllegalArgumentException] if less than 1 + * */ + @MCCipherConfigDsl + @Throws(IllegalArgumentException::class) + public fun kdfIter(value: Int): Builder { + value.checkKdfIter() + kdfIter = value + return this + } + + init { + if (other != null) { + kdfIter = other.kdfIter + } + } + /** + * Apply default settings + * + * @see [Default] + * */ + public fun default() { + kdfIter = 64007 + } + + @JvmSynthetic + internal fun build(): MCAscon128Config = MCAscon128Config( + legacy = legacy, + legacyPageSize = legacyPageSize, + kdfIter = kdfIter, + ) + } +} diff --git a/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCCipherConfig.kt b/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCCipherConfig.kt index f39ee92..ffba5b4 100644 --- a/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCCipherConfig.kt +++ b/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCCipherConfig.kt @@ -49,6 +49,7 @@ public sealed class MCCipherConfig( is MCSqlCipherConfig -> config.apply(pragmas, addAll) is MCWxAES128Config -> config.apply(pragmas, addAll) is MCWxAES256Config -> config.apply(pragmas, addAll) + is MCAscon128Config -> config.apply(pragmas, addAll) } } @@ -126,6 +127,13 @@ public sealed class MCCipherConfig( } } + private fun MCAscon128Config.apply(pragmas: MutableMCPragmas, addAll: Boolean) { + val config = MCAscon128Config.Default + if (addAll || kdfIter != config.kdfIter) { + MCPragma.KDF_ITER.put(pragmas, kdfIter) + } + } + final override fun equals(other: Any?): Boolean { return when (this) { is MCChaCha20Config -> { @@ -163,6 +171,12 @@ public sealed class MCCipherConfig( && other.legacyPageSize == legacyPageSize && other.kdfIter == kdfIter } + is MCAscon128Config -> { + other is MCAscon128Config + && other.legacy == legacy + && other.legacyPageSize == legacyPageSize + && other.kdfIter == kdfIter + } } } @@ -200,6 +214,11 @@ public sealed class MCCipherConfig( result = result * 31 + legacyPageSize.hashCode() result = result * 31 + kdfIter.hashCode() } + is MCAscon128Config -> { + result = result * 31 + legacy.hashCode() + result = result * 31 + legacyPageSize.hashCode() + result = result * 31 + kdfIter.hashCode() + } } return result @@ -287,6 +306,17 @@ public sealed class MCCipherConfig( appendColon() appendLine(kdfIter) } + is MCAscon128Config -> { + appendIndent(MCPragma.LEGACY) + appendColon() + appendLine(legacy) + appendIndent(MCPragma.LEGACY_PAGE_SIZE) + appendColon() + appendLine(legacyPageSize) + appendIndent(MCPragma.KDF_ITER) + appendColon() + appendLine(kdfIter) + } } append(']') } diff --git a/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCRC4Config.kt b/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCRC4Config.kt index de9ec7d..d24718f 100644 --- a/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCRC4Config.kt +++ b/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCRC4Config.kt @@ -67,7 +67,7 @@ public class MCRC4Config private constructor( } /** - * [System.Data.SQLite: RC4]https://utelle.github.io/SQLite3MultipleCiphers/docs/ciphers/cipher_sds_rc4/) + * [System.Data.SQLite: RC4](https://utelle.github.io/SQLite3MultipleCiphers/docs/ciphers/cipher_sds_rc4/) * * Nobody should use this, but it's here... * diff --git a/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCWxAES256Config.kt b/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCWxAES256Config.kt index d02cc3a..2d7b578 100644 --- a/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCWxAES256Config.kt +++ b/library/driver/src/commonMain/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCWxAES256Config.kt @@ -103,7 +103,7 @@ public class MCWxAES256Config private constructor( /** * [PRAGMA legacy_page_size](https://utelle.github.io/SQLite3MultipleCiphers/docs/configuration/config_sql_pragmas/#pragma-legacy_page_size) * - * Default: (default = 4096), (sqleet = 4096) + * Default: 4096 * Min: 0 * Max: 65536 * diff --git a/library/driver/src/commonTest/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfigUnitTest.kt b/library/driver/src/commonTest/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfigUnitTest.kt index b498d6e..9820e5c 100644 --- a/library/driver/src/commonTest/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfigUnitTest.kt +++ b/library/driver/src/commonTest/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/EncryptionConfigUnitTest.kt @@ -35,6 +35,15 @@ class EncryptionConfigUnitTest { } } + @Test + fun givenConfig_whenAscon128Default_thenCipherIsSet() { + val config = EncryptionConfig.new(other = null) { + ascon128 { default() } + } + + assertEquals(MCAscon128Config.Default, config.cipherConfig) + } + @Test fun givenConfig_whenChaCha20Default_thenCipherIsSet() { val config = EncryptionConfig.new(other = null) { diff --git a/library/driver/src/commonTest/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCCipherConfigUnitTest.kt b/library/driver/src/commonTest/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCCipherConfigUnitTest.kt index a591a8b..c0bf07b 100644 --- a/library/driver/src/commonTest/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCCipherConfigUnitTest.kt +++ b/library/driver/src/commonTest/kotlin/io/toxicity/sqlite/mc/driver/config/encryption/MCCipherConfigUnitTest.kt @@ -29,6 +29,7 @@ class MCCipherConfigUnitTest { fun givenConfig_whenDefaultNoChanges_thenContainsCipherAndLegacy() { val list = mutableListOf() + list.addPragmas { ascon128 { default() } } list.addPragmas { chaCha20 { default() } } list.addPragmas { rc4 { default() } } list.addPragmas { sqlCipher { default() } } @@ -46,6 +47,7 @@ class MCCipherConfigUnitTest { fun givenConfig_whenLegacyNoChanges_thenContainsLegacy() { val list = mutableListOf() + list.addPragmas { ascon128 { default() } } list.addPragmas { chaCha20 { sqleet() } } // rc4 is always in legacy mode