File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed
cryptography-providers/jdk/src/jvmMain/kotlin Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,9 @@ internal class JdkCryptographyProvider(
8787 RSA .PKCS1 -> JdkRsaPkcs1 (state)
8888 RSA .RAW -> JdkRsaRaw (state)
8989 ECDSA -> JdkEcdsa (state)
90- ECDH -> JdkEcdh (state)
91- PBKDF2 -> JdkPbkdf2 (state)
90+ ECDH -> JdkEcdh (state)
91+ PBKDF2 -> JdkPbkdf2 (state)
92+ HKDF -> JdkHkdf (state, this )
9293 else -> null
9394 }
9495 } as A ?
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2024 Oleg Yukhnevich. Use of this source code is governed by the Apache 2.0 license.
3+ */
4+
5+ package dev.whyoleg.cryptography.providers.jdk.algorithms
6+
7+ import dev.whyoleg.cryptography.*
8+ import dev.whyoleg.cryptography.algorithms.*
9+ import dev.whyoleg.cryptography.providers.base.algorithms.*
10+ import dev.whyoleg.cryptography.providers.jdk.*
11+
12+ internal class JdkHkdf (
13+ private val state : JdkCryptographyState ,
14+ provider : CryptographyProvider ,
15+ ) : BaseHkdf(provider) {
16+ override fun digestSize (digest : CryptographyAlgorithmId <Digest >): Int {
17+ return state.messageDigest(digest.name).use { it.digestLength }
18+ }
19+ }
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ internal class JdkHmac(
4040 }
4141}
4242
43- private fun CryptographyAlgorithmId<Digest>.blockSize (): Int = when (this ) {
43+ internal fun CryptographyAlgorithmId<Digest>.blockSize (): Int = when (this ) {
4444 SHA1 -> 64
4545 SHA224 -> 64
4646 SHA256 -> 64
You can’t perform that action at this time.
0 commit comments