-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
60 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
cryptography-core/src/commonMain/kotlin/operations/SecretDerivation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (c) 2024 Oleg Yukhnevich. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package dev.whyoleg.cryptography.operations | ||
|
||
import dev.whyoleg.cryptography.* | ||
import dev.whyoleg.cryptography.materials.key.* | ||
|
||
@SubclassOptInRequired(CryptographyProviderApi::class) | ||
public interface SecretDerivation<K : Key> { | ||
public fun deriveSecret(other: K): ByteArray | ||
} | ||
|
||
@SubclassOptInRequired(CryptographyProviderApi::class) | ||
public interface AsyncSecretDerivation<K : Key> { | ||
public suspend fun deriveSecret(other: K): ByteArray | ||
} | ||
|
||
@CryptographyProviderApi | ||
public fun <K : Key> SecretDerivation<K>.asAsync(): AsyncSecretDerivation<K> = object : AsyncSecretDerivation<K> { | ||
override suspend fun deriveSecret(other: K): ByteArray = this@asAsync.deriveSecret(other) | ||
} |
14 changes: 0 additions & 14 deletions
14
cryptography-core/src/commonMain/kotlin/operations/SharedSecretDerivation.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters