diff --git a/README.md b/README.md index 015a8a0..47b0d29 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![badge-latest-release]][url-latest-release] [![badge-kotlin]][url-kotlin] +[![badge-error]][url-error] ![badge-platform-android] ![badge-platform-jvm] @@ -80,6 +81,7 @@ dependencies { [badge-kotlin]: https://img.shields.io/badge/kotlin-1.9.24-blue.svg?logo=kotlin +[badge-error]: https://img.shields.io/badge/kotlincrypto.error-0.1.0-blue.svg [badge-platform-android]: http://img.shields.io/badge/-android-6EDB8D.svg?style=flat @@ -102,5 +104,6 @@ dependencies { [url-latest-release]: https://github.com/KotlinCrypto/core/releases/latest [url-license]: https://www.apache.org/licenses/LICENSE-2.0.txt [url-kotlin]: https://kotlinlang.org +[url-error]: https://github.com/KotlinCrypto/error [url-version-catalog]: https://github.com/KotlinCrypto/version-catalog [url-docs]: https://core.kotlincrypto.org diff --git a/build-logic/src/main/kotlin/dokka.gradle.kts b/build-logic/src/main/kotlin/dokka.gradle.kts index efcf32d..c490319 100644 --- a/build-logic/src/main/kotlin/dokka.gradle.kts +++ b/build-logic/src/main/kotlin/dokka.gradle.kts @@ -28,6 +28,10 @@ tasks.withType().configureEach { includes.from("README.md") noStdlibLink = true + externalDocumentationLink { + url = URI("https://error.kotlincrypto.org/").toURL() + } + sourceLink { localDirectory = rootDir remoteUrl = URI("https://github.com/KotlinCrypto/core/tree/master").toURL() diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 117b8c4..6c31d31 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,12 +9,16 @@ gradle-kmp-configuration = "0.3.2" gradle-kotlin = "1.9.24" gradle-publish-maven = "0.29.0" +kotlincrypto-error = "0.1.0" + [libraries] gradle-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "gradle-dokka" } gradle-kmp-configuration = { module = "io.matthewnelson:gradle-kmp-configuration-plugin", version.ref = "gradle-kmp-configuration" } gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "gradle-kotlin" } gradle-publish-maven = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "gradle-publish-maven" } +kotlincrypto-error = { module = "org.kotlincrypto.error:error", version.ref = "kotlincrypto-error" } + # tests & tools androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test-runner" } benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime", version.ref = "gradle-benchmark" } diff --git a/library/core/api/core.klib.api b/library/core/api/core.klib.api index db0a5c5..2f8de61 100644 --- a/library/core/api/core.klib.api +++ b/library/core/api/core.klib.api @@ -31,65 +31,3 @@ abstract interface org.kotlincrypto.core/Updatable { // org.kotlincrypto.core/Up abstract fun update(kotlin/ByteArray) // org.kotlincrypto.core/Updatable.update|update(kotlin.ByteArray){}[0] abstract fun update(kotlin/ByteArray, kotlin/Int, kotlin/Int) // org.kotlincrypto.core/Updatable.update|update(kotlin.ByteArray;kotlin.Int;kotlin.Int){}[0] } - -open class org.kotlincrypto.core/BadPaddingException : org.kotlincrypto.core/GeneralSecurityException { // org.kotlincrypto.core/BadPaddingException|null[0] - constructor () // org.kotlincrypto.core/BadPaddingException.|(){}[0] - constructor (kotlin/String?) // org.kotlincrypto.core/BadPaddingException.|(kotlin.String?){}[0] -} - -open class org.kotlincrypto.core/CertificateEncodingException : org.kotlincrypto.core/CertificateException { // org.kotlincrypto.core/CertificateEncodingException|null[0] - constructor () // org.kotlincrypto.core/CertificateEncodingException.|(){}[0] - constructor (kotlin/String?) // org.kotlincrypto.core/CertificateEncodingException.|(kotlin.String?){}[0] - constructor (kotlin/String?, kotlin/Throwable?) // org.kotlincrypto.core/CertificateEncodingException.|(kotlin.String?;kotlin.Throwable?){}[0] - constructor (kotlin/Throwable?) // org.kotlincrypto.core/CertificateEncodingException.|(kotlin.Throwable?){}[0] -} - -open class org.kotlincrypto.core/CertificateException : org.kotlincrypto.core/GeneralSecurityException { // org.kotlincrypto.core/CertificateException|null[0] - constructor () // org.kotlincrypto.core/CertificateException.|(){}[0] - constructor (kotlin/String?) // org.kotlincrypto.core/CertificateException.|(kotlin.String?){}[0] - constructor (kotlin/String?, kotlin/Throwable?) // org.kotlincrypto.core/CertificateException.|(kotlin.String?;kotlin.Throwable?){}[0] - constructor (kotlin/Throwable?) // org.kotlincrypto.core/CertificateException.|(kotlin.Throwable?){}[0] -} - -open class org.kotlincrypto.core/CertificateParsingException : org.kotlincrypto.core/CertificateException { // org.kotlincrypto.core/CertificateParsingException|null[0] - constructor () // org.kotlincrypto.core/CertificateParsingException.|(){}[0] - constructor (kotlin/String?) // org.kotlincrypto.core/CertificateParsingException.|(kotlin.String?){}[0] - constructor (kotlin/String?, kotlin/Throwable?) // org.kotlincrypto.core/CertificateParsingException.|(kotlin.String?;kotlin.Throwable?){}[0] - constructor (kotlin/Throwable?) // org.kotlincrypto.core/CertificateParsingException.|(kotlin.Throwable?){}[0] -} - -open class org.kotlincrypto.core/GeneralSecurityException : kotlin/Exception { // org.kotlincrypto.core/GeneralSecurityException|null[0] - constructor () // org.kotlincrypto.core/GeneralSecurityException.|(){}[0] - constructor (kotlin/String?) // org.kotlincrypto.core/GeneralSecurityException.|(kotlin.String?){}[0] - constructor (kotlin/String?, kotlin/Throwable?) // org.kotlincrypto.core/GeneralSecurityException.|(kotlin.String?;kotlin.Throwable?){}[0] - constructor (kotlin/Throwable?) // org.kotlincrypto.core/GeneralSecurityException.|(kotlin.Throwable?){}[0] -} - -open class org.kotlincrypto.core/IllegalBlockSizeException : org.kotlincrypto.core/GeneralSecurityException { // org.kotlincrypto.core/IllegalBlockSizeException|null[0] - constructor () // org.kotlincrypto.core/IllegalBlockSizeException.|(){}[0] - constructor (kotlin/String?) // org.kotlincrypto.core/IllegalBlockSizeException.|(kotlin.String?){}[0] -} - -open class org.kotlincrypto.core/InvalidKeyException : org.kotlincrypto.core/KeyException { // org.kotlincrypto.core/InvalidKeyException|null[0] - constructor () // org.kotlincrypto.core/InvalidKeyException.|(){}[0] - constructor (kotlin/String?) // org.kotlincrypto.core/InvalidKeyException.|(kotlin.String?){}[0] - constructor (kotlin/String?, kotlin/Throwable?) // org.kotlincrypto.core/InvalidKeyException.|(kotlin.String?;kotlin.Throwable?){}[0] - constructor (kotlin/Throwable?) // org.kotlincrypto.core/InvalidKeyException.|(kotlin.Throwable?){}[0] -} - -open class org.kotlincrypto.core/InvalidParameterException : kotlin/IllegalArgumentException { // org.kotlincrypto.core/InvalidParameterException|null[0] - constructor () // org.kotlincrypto.core/InvalidParameterException.|(){}[0] - constructor (kotlin/String?) // org.kotlincrypto.core/InvalidParameterException.|(kotlin.String?){}[0] -} - -open class org.kotlincrypto.core/KeyException : org.kotlincrypto.core/GeneralSecurityException { // org.kotlincrypto.core/KeyException|null[0] - constructor () // org.kotlincrypto.core/KeyException.|(){}[0] - constructor (kotlin/String?) // org.kotlincrypto.core/KeyException.|(kotlin.String?){}[0] - constructor (kotlin/String?, kotlin/Throwable?) // org.kotlincrypto.core/KeyException.|(kotlin.String?;kotlin.Throwable?){}[0] - constructor (kotlin/Throwable?) // org.kotlincrypto.core/KeyException.|(kotlin.Throwable?){}[0] -} - -open class org.kotlincrypto.core/ShortBufferException : org.kotlincrypto.core/GeneralSecurityException { // org.kotlincrypto.core/ShortBufferException|null[0] - constructor () // org.kotlincrypto.core/ShortBufferException.|(){}[0] - constructor (kotlin/String?) // org.kotlincrypto.core/ShortBufferException.|(kotlin.String?){}[0] -} diff --git a/library/core/build.gradle.kts b/library/core/build.gradle.kts index d99192c..95106d9 100644 --- a/library/core/build.gradle.kts +++ b/library/core/build.gradle.kts @@ -18,5 +18,13 @@ plugins { } kmpConfiguration { - configureShared(java9ModuleName = "org.kotlincrypto.core", publish = true) {} + configureShared(java9ModuleName = "org.kotlincrypto.core", publish = true) { + common { + sourceSetMain { + dependencies { + api(libs.kotlincrypto.error) + } + } + } + } } diff --git a/library/core/src/commonMain/kotlin/org/kotlincrypto/core/Exceptions.kt b/library/core/src/commonMain/kotlin/org/kotlincrypto/core/Exceptions.kt deleted file mode 100644 index 5e5abd3..0000000 --- a/library/core/src/commonMain/kotlin/org/kotlincrypto/core/Exceptions.kt +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2025 Matthew Nelson - * - * 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. - **/ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.kotlincrypto.core - -/** - * This exception is thrown when an invalid parameter is encountered. - * */ -public expect open class InvalidParameterException: IllegalArgumentException { - public constructor() - public constructor(message: String?) -} - -/** - * The `GeneralSecurityException` class is a generic security exception class that provides type - * safety for all the security-related exception classes that extend from it. - * */ -public expect open class GeneralSecurityException: Exception { - public constructor() - public constructor(message: String?) - public constructor(message: String?, cause: Throwable?) - public constructor(cause: Throwable?) -} - -/** - * This exception is thrown when a particular padding mechanism is expected for the input data but - * the data is not padded properly. - * */ -public expect open class BadPaddingException: GeneralSecurityException { - public constructor() - public constructor(message: String?) -} - -/** - * The `CertificateException` class is a generic security exception class that provides type safety - * for all the certificate-related exception classes that extend from it. - * */ -public expect open class CertificateException: GeneralSecurityException { - public constructor() - public constructor(message: String?) - public constructor(message: String?, cause: Throwable?) - public constructor(cause: Throwable?) -} - -/** - * This exception is thrown when an error occurs while attempting to encode a certificate. - * */ -public expect open class CertificateEncodingException: CertificateException { - public constructor() - public constructor(message: String?) - public constructor(message: String?, cause: Throwable?) - public constructor(cause: Throwable?) -} - -/** - * This exception is thrown whenever an invalid DER-encoded certificate is parsed, or unsupported - * DER features are found in the Certificate. - * */ -public expect open class CertificateParsingException: CertificateException { - public constructor() - public constructor(message: String?) - public constructor(message: String?, cause: Throwable?) - public constructor(cause: Throwable?) -} - -/** - * This exception is thrown when the length of data provided to a block cipher is incorrect, (i.e. - * does not match the block size of the cipher.) - * */ -public expect open class IllegalBlockSizeException: GeneralSecurityException { - public constructor() - public constructor(message: String?) -} - -/** - * The `KeyException` class is a generic security exception class that provides type safety for all - * the key-related exception classes that extend from it. - * */ -public expect open class KeyException: GeneralSecurityException { - public constructor() - public constructor(message: String?) - public constructor(message: String?, cause: Throwable?) - public constructor(cause: Throwable?) -} - -/** - * This exception is thrown when a key is invalid (e.g. invalid encoding, wrong length, etc.). - * */ -public expect open class InvalidKeyException: KeyException { - public constructor() - public constructor(message: String?) - public constructor(message: String?, cause: Throwable?) - public constructor(cause: Throwable?) -} - -/** - * This exception is thrown when a buffer provided by the user is too short to hold the operation result. - * */ -public expect open class ShortBufferException: GeneralSecurityException { - public constructor() - public constructor(message: String?) -} diff --git a/library/core/src/jvmMain/java9/module-info.java b/library/core/src/jvmMain/java9/module-info.java index b8b6b7f..a0590b3 100644 --- a/library/core/src/jvmMain/java9/module-info.java +++ b/library/core/src/jvmMain/java9/module-info.java @@ -1,5 +1,6 @@ module org.kotlincrypto.core { requires transitive kotlin.stdlib; + requires transitive org.kotlincrypto.error; exports org.kotlincrypto.core; } diff --git a/library/core/src/jvmMain/kotlin/org/kotlincrypto/core/JvmExceptions.kt b/library/core/src/jvmMain/kotlin/org/kotlincrypto/core/JvmExceptions.kt deleted file mode 100644 index a3569e9..0000000 --- a/library/core/src/jvmMain/kotlin/org/kotlincrypto/core/JvmExceptions.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 Matthew Nelson - * - * 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. - **/ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.kotlincrypto.core - -public actual typealias InvalidParameterException = java.security.InvalidParameterException -public actual typealias GeneralSecurityException = java.security.GeneralSecurityException -public actual typealias BadPaddingException = javax.crypto.BadPaddingException -public actual typealias CertificateException = java.security.cert.CertificateException -public actual typealias CertificateEncodingException = java.security.cert.CertificateEncodingException -public actual typealias CertificateParsingException = java.security.cert.CertificateParsingException -public actual typealias IllegalBlockSizeException = javax.crypto.IllegalBlockSizeException -public actual typealias KeyException = java.security.KeyException -public actual typealias InvalidKeyException = java.security.InvalidKeyException -public actual typealias ShortBufferException = javax.crypto.ShortBufferException diff --git a/library/core/src/nonJvmMain/kotlin/org/kotlincrypto/core/NonJvmExceptions.kt b/library/core/src/nonJvmMain/kotlin/org/kotlincrypto/core/NonJvmExceptions.kt deleted file mode 100644 index e05a49e..0000000 --- a/library/core/src/nonJvmMain/kotlin/org/kotlincrypto/core/NonJvmExceptions.kt +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2025 Matthew Nelson - * - * 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. - **/ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.kotlincrypto.core - -/** - * This exception is thrown when an invalid parameter is encountered. - * */ -public actual open class InvalidParameterException: IllegalArgumentException { - public actual constructor(): super() - public actual constructor(message: String?): super(message) -} - -/** - * The `GeneralSecurityException` class is a generic security exception class that provides type - * safety for all the security-related exception classes that extend from it. - * */ -public actual open class GeneralSecurityException: Exception { - public actual constructor(): super() - public actual constructor(message: String?): super(message) - public actual constructor(message: String?, cause: Throwable?): super(message, cause) - public actual constructor(cause: Throwable?): super(cause) -} - -/** - * This exception is thrown when a particular padding mechanism is expected for the input data but - * the data is not padded properly. - * */ -public actual open class BadPaddingException: GeneralSecurityException { - public actual constructor(): super() - public actual constructor(message: String?): super(message) -} - -/** - * The `CertificateException` class is a generic security exception class that provides type safety - * for all the certificate-related exception classes that extend from it. - * */ -public actual open class CertificateException: GeneralSecurityException { - public actual constructor(): super() - public actual constructor(message: String?): super(message) - public actual constructor(message: String?, cause: Throwable?): super(message, cause) - public actual constructor(cause: Throwable?): super(cause) -} - -/** - * This exception is thrown when an error occurs while attempting to encode a certificate. - * */ -public actual open class CertificateEncodingException: CertificateException { - public actual constructor(): super() - public actual constructor(message: String?): super(message) - public actual constructor(message: String?, cause: Throwable?): super(message, cause) - public actual constructor(cause: Throwable?): super(cause) -} - -/** - * This exception is thrown whenever an invalid DER-encoded certificate is parsed, or unsupported - * DER features are found in the Certificate. - * */ -public actual open class CertificateParsingException: CertificateException { - public actual constructor(): super() - public actual constructor(message: String?): super(message) - public actual constructor(message: String?, cause: Throwable?): super(message, cause) - public actual constructor(cause: Throwable?): super(cause) -} - -/** - * This exception is thrown when the length of data provided to a block cipher is incorrect, (i.e. - * does not match the block size of the cipher.) - * */ -public actual open class IllegalBlockSizeException: GeneralSecurityException { - public actual constructor(): super() - public actual constructor(message: String?): super(message) -} - -/** - * The `KeyException` class is a generic security exception class that provides type safety for all - * the key-related exception classes that extend from it. - * */ -public actual open class KeyException: GeneralSecurityException { - public actual constructor(): super() - public actual constructor(message: String?): super(message) - public actual constructor(message: String?, cause: Throwable?): super(message, cause) - public actual constructor(cause: Throwable?): super(cause) -} - -/** - * This exception is thrown when a key is invalid (e.g. invalid encoding, wrong length, etc.). - * */ -public actual open class InvalidKeyException: KeyException { - public actual constructor(): super() - public actual constructor(message: String?): super(message) - public actual constructor(message: String?, cause: Throwable?): super(message, cause) - public actual constructor(cause: Throwable?): super(cause) -} - -/** - * This exception is thrown when a buffer provided by the user is too short to hold the operation result. - * */ -public actual open class ShortBufferException: GeneralSecurityException { - public actual constructor(): super() - public actual constructor(message: String?): super(message) -} diff --git a/library/digest/src/commonMain/kotlin/org/kotlincrypto/core/digest/Digest.kt b/library/digest/src/commonMain/kotlin/org/kotlincrypto/core/digest/Digest.kt index 6efe2bf..7bd3272 100644 --- a/library/digest/src/commonMain/kotlin/org/kotlincrypto/core/digest/Digest.kt +++ b/library/digest/src/commonMain/kotlin/org/kotlincrypto/core/digest/Digest.kt @@ -18,6 +18,7 @@ package org.kotlincrypto.core.digest import org.kotlincrypto.core.* +import org.kotlincrypto.error.ShortBufferException /** * Core abstraction for Message Digest implementations. diff --git a/library/digest/src/commonMain/kotlin/org/kotlincrypto/core/digest/internal/-Buffer.kt b/library/digest/src/commonMain/kotlin/org/kotlincrypto/core/digest/internal/-Buffer.kt index 2b14821..ae44cd2 100644 --- a/library/digest/src/commonMain/kotlin/org/kotlincrypto/core/digest/internal/-Buffer.kt +++ b/library/digest/src/commonMain/kotlin/org/kotlincrypto/core/digest/internal/-Buffer.kt @@ -17,8 +17,8 @@ package org.kotlincrypto.core.digest.internal -import org.kotlincrypto.core.ShortBufferException import org.kotlincrypto.core.digest.Digest +import org.kotlincrypto.error.ShortBufferException import kotlin.contracts.ExperimentalContracts import kotlin.contracts.InvocationKind import kotlin.contracts.contract diff --git a/library/digest/src/commonTest/kotlin/org/kotlincrypto/core/digest/DigestUnitTest.kt b/library/digest/src/commonTest/kotlin/org/kotlincrypto/core/digest/DigestUnitTest.kt index 6f0bd8e..210b7e0 100644 --- a/library/digest/src/commonTest/kotlin/org/kotlincrypto/core/digest/DigestUnitTest.kt +++ b/library/digest/src/commonTest/kotlin/org/kotlincrypto/core/digest/DigestUnitTest.kt @@ -15,7 +15,7 @@ **/ package org.kotlincrypto.core.digest -import org.kotlincrypto.core.ShortBufferException +import org.kotlincrypto.error.ShortBufferException import kotlin.random.Random import kotlin.test.* diff --git a/library/digest/src/jvmMain/kotlin/org/kotlincrypto/core/digest/Digest.kt b/library/digest/src/jvmMain/kotlin/org/kotlincrypto/core/digest/Digest.kt index 7218ac9..428ae79 100644 --- a/library/digest/src/jvmMain/kotlin/org/kotlincrypto/core/digest/Digest.kt +++ b/library/digest/src/jvmMain/kotlin/org/kotlincrypto/core/digest/Digest.kt @@ -19,8 +19,7 @@ package org.kotlincrypto.core.digest import org.kotlincrypto.core.* import org.kotlincrypto.core.digest.internal.* -import org.kotlincrypto.core.digest.internal.commonCheckArgs -import org.kotlincrypto.core.digest.internal.commonToString +import org.kotlincrypto.error.ShortBufferException import java.nio.ByteBuffer import java.security.DigestException import java.security.MessageDigest diff --git a/library/digest/src/nonJvmMain/kotlin/org/kotlincrypto/core/digest/Digest.kt b/library/digest/src/nonJvmMain/kotlin/org/kotlincrypto/core/digest/Digest.kt index 02fa7f6..a08aef5 100644 --- a/library/digest/src/nonJvmMain/kotlin/org/kotlincrypto/core/digest/Digest.kt +++ b/library/digest/src/nonJvmMain/kotlin/org/kotlincrypto/core/digest/Digest.kt @@ -19,6 +19,7 @@ package org.kotlincrypto.core.digest import org.kotlincrypto.core.* import org.kotlincrypto.core.digest.internal.* +import org.kotlincrypto.error.ShortBufferException /** * Core abstraction for Message Digest implementations. diff --git a/library/mac/src/commonMain/kotlin/org/kotlincrypto/core/mac/Mac.kt b/library/mac/src/commonMain/kotlin/org/kotlincrypto/core/mac/Mac.kt index 019103c..2441dfd 100644 --- a/library/mac/src/commonMain/kotlin/org/kotlincrypto/core/mac/Mac.kt +++ b/library/mac/src/commonMain/kotlin/org/kotlincrypto/core/mac/Mac.kt @@ -18,6 +18,7 @@ package org.kotlincrypto.core.mac import org.kotlincrypto.core.* +import org.kotlincrypto.error.ShortBufferException import kotlin.jvm.JvmField /** diff --git a/library/mac/src/commonMain/kotlin/org/kotlincrypto/core/mac/internal/-CommonPlatform.kt b/library/mac/src/commonMain/kotlin/org/kotlincrypto/core/mac/internal/-CommonPlatform.kt index 4aaa0f7..62f6240 100644 --- a/library/mac/src/commonMain/kotlin/org/kotlincrypto/core/mac/internal/-CommonPlatform.kt +++ b/library/mac/src/commonMain/kotlin/org/kotlincrypto/core/mac/internal/-CommonPlatform.kt @@ -17,8 +17,8 @@ package org.kotlincrypto.core.mac.internal -import org.kotlincrypto.core.ShortBufferException import org.kotlincrypto.core.mac.Mac +import org.kotlincrypto.error.ShortBufferException import kotlin.contracts.ExperimentalContracts import kotlin.contracts.InvocationKind import kotlin.contracts.contract diff --git a/library/mac/src/commonTest/kotlin/org/kotlincrypto/core/mac/MacUnitTest.kt b/library/mac/src/commonTest/kotlin/org/kotlincrypto/core/mac/MacUnitTest.kt index 0f2dce9..7aace4f 100644 --- a/library/mac/src/commonTest/kotlin/org/kotlincrypto/core/mac/MacUnitTest.kt +++ b/library/mac/src/commonTest/kotlin/org/kotlincrypto/core/mac/MacUnitTest.kt @@ -15,7 +15,7 @@ **/ package org.kotlincrypto.core.mac -import org.kotlincrypto.core.ShortBufferException +import org.kotlincrypto.error.ShortBufferException import kotlin.test.* class MacUnitTest { diff --git a/library/mac/src/jvmMain/kotlin/org/kotlincrypto/core/mac/Mac.kt b/library/mac/src/jvmMain/kotlin/org/kotlincrypto/core/mac/Mac.kt index ec24be6..b8ed187 100644 --- a/library/mac/src/jvmMain/kotlin/org/kotlincrypto/core/mac/Mac.kt +++ b/library/mac/src/jvmMain/kotlin/org/kotlincrypto/core/mac/Mac.kt @@ -19,6 +19,8 @@ package org.kotlincrypto.core.mac import org.kotlincrypto.core.* import org.kotlincrypto.core.mac.internal.* +import org.kotlincrypto.error.InvalidKeyException +import org.kotlincrypto.error.ShortBufferException import java.nio.ByteBuffer import java.security.Key import java.security.spec.AlgorithmParameterSpec diff --git a/library/mac/src/nonJvmMain/kotlin/org/kotlincrypto/core/mac/Mac.kt b/library/mac/src/nonJvmMain/kotlin/org/kotlincrypto/core/mac/Mac.kt index 8765aa7..4bba3fa 100644 --- a/library/mac/src/nonJvmMain/kotlin/org/kotlincrypto/core/mac/Mac.kt +++ b/library/mac/src/nonJvmMain/kotlin/org/kotlincrypto/core/mac/Mac.kt @@ -19,6 +19,7 @@ package org.kotlincrypto.core.mac import org.kotlincrypto.core.* import org.kotlincrypto.core.mac.internal.* +import org.kotlincrypto.error.ShortBufferException import kotlin.jvm.JvmField /**