Skip to content

Commit

Permalink
fix: update usage of the bip32ed25519 wrapper. (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
elribonazo authored Jun 10, 2024
1 parent ef2ae86 commit d1ee804
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.hyperledger.identus.apollo.derivation

import com.ionspin.kotlin.bignum.integer.toBigInteger
import ed25519_bip32_wrapper.deriveBytes
import ed25519_bip32_wrapper.fromNonextendedNoforce
import ed25519_bip32_wrapper.fromNonextended
import org.hyperledger.identus.apollo.utils.ECConfig

/**
Expand Down Expand Up @@ -83,7 +83,7 @@ actual class EdHDKey actual constructor(

val keySlice = seed.sliceArray(0 until 32)
val chainCodeSlice = seed.sliceArray(32 until seed.size)
val result = fromNonextendedNoforce(keySlice, chainCodeSlice)
val result = fromNonextended(keySlice, chainCodeSlice)
val secretKey = result["secret_key"]
val chainCode = result["chain_code"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.hyperledger.identus.apollo.derivation

import com.ionspin.kotlin.bignum.integer.toBigInteger
import ed25519_bip32_wrapper.deriveBytes
import ed25519_bip32_wrapper.fromNonextendedNoforce
import ed25519_bip32_wrapper.fromNonextended
import org.hyperledger.identus.apollo.utils.ECConfig

/**
Expand Down Expand Up @@ -83,7 +83,7 @@ actual class EdHDKey actual constructor(

val keySlice = seed.sliceArray(0 until 32)
val chainCodeSlice = seed.sliceArray(32 until seed.size)
val result = fromNonextendedNoforce(keySlice, chainCodeSlice)
val result = fromNonextended(keySlice, chainCodeSlice)
val secretKey = result["secret_key"]
val chainCode = result["chain_code"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ actual class EdHDKey actual constructor(

val key = seed.sliceArray(0 until 32)
val chainCode = seed.sliceArray(32 until seed.size)
val result = ed25519_bip32.from_nonextended_noforce(key, chainCode)
val result = ed25519_bip32.from_nonextended(key, chainCode)

return EdHDKey(
privateKey = result[0],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.hyperledger.identus.apollo.utils.external

external interface ed25519_bip32_export {
fun from_nonextended_noforce(key: ByteArray, chain_code: ByteArray): Array<ByteArray>
fun from_nonextended(key: ByteArray, chain_code: ByteArray): Array<ByteArray>

fun derive_bytes(key: ByteArray, chain_code: ByteArray, index: Any): Array<ByteArray>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.hyperledger.identus.apollo.derivation

import com.ionspin.kotlin.bignum.integer.toBigInteger
import ed25519_bip32_wrapper.deriveBytes
import ed25519_bip32_wrapper.fromNonextendedNoforce
import ed25519_bip32_wrapper.fromNonextended
import org.hyperledger.identus.apollo.utils.ECConfig

/**
Expand Down Expand Up @@ -83,7 +83,7 @@ actual class EdHDKey actual constructor(

val keySlice = seed.sliceArray(0 until 32)
val chainCodeSlice = seed.sliceArray(32 until seed.size)
val result = fromNonextendedNoforce(keySlice, chainCodeSlice)
val result = fromNonextended(keySlice, chainCodeSlice)
val secretKey = result["secret_key"]
val chainCode = result["chain_code"]

Expand Down
2 changes: 1 addition & 1 deletion rust-ed25519-bip32

0 comments on commit d1ee804

Please sign in to comment.