Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ actual class EdHDKey actual constructor(
*/
actual fun initFromSeed(seed: ByteArray): EdHDKey {
require(seed.size == 64) {
"Seed expected byte length to be ${ECConfig.PRIVATE_KEY_BYTE_SIZE}"
"Seed expected byte length to be ${ECConfig.SEED_BYTE_SIZE}"
}

val keySlice = seed.sliceArray(0 until 32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ actual class EdHDKey actual constructor(
*/
actual fun initFromSeed(seed: ByteArray): EdHDKey {
require(seed.size == 64) {
"Seed expected byte length to be ${ECConfig.PRIVATE_KEY_BYTE_SIZE}"
"Seed expected byte length to be ${ECConfig.SEED_BYTE_SIZE}"
}

val keySlice = seed.sliceArray(0 until 32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class HDKey(
childIndex = childIndex
) {
require(seed.size == 64) {
"Seed expected byte length to be ${ECConfig.PRIVATE_KEY_BYTE_SIZE}"
"Seed expected byte length to be ${ECConfig.SEED_BYTE_SIZE}"
}
}

Expand All @@ -127,7 +127,7 @@ class HDKey(
childIndex = BigIntegerWrapper(childIndex)
) {
require(seed.size == 64) {
"Seed expected byte length to be ${ECConfig.PRIVATE_KEY_BYTE_SIZE}"
"Seed expected byte length to be ${ECConfig.SEED_BYTE_SIZE}"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import kotlin.js.JsExport
@JsExport
object ECConfig {
val PRIVATE_KEY_BYTE_SIZE: Int = 32
val SEED_BYTE_SIZE: Int = 64
internal val PUBLIC_KEY_COORDINATE_BYTE_SIZE: Int = 32
internal val PUBLIC_KEY_COMPRESSED_BYTE_SIZE: Int = PUBLIC_KEY_COORDINATE_BYTE_SIZE + 1
val SIGNATURE_MAX_BYTE_SIZE: Int = 72
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ actual class EdHDKey actual constructor(
*/
actual fun initFromSeed(seed: ByteArray): EdHDKey {
require(seed.size == 64) {
"Seed expected byte length to be ${ECConfig.PRIVATE_KEY_BYTE_SIZE}"
"Seed expected byte length to be ${ECConfig.SEED_BYTE_SIZE}"
}

val key = seed.sliceArray(0 until 32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ actual class EdHDKey actual constructor(
*/
actual fun initFromSeed(seed: ByteArray): EdHDKey {
require(seed.size == 64) {
"Seed expected byte length to be ${ECConfig.PRIVATE_KEY_BYTE_SIZE}"
"Seed expected byte length to be ${ECConfig.SEED_BYTE_SIZE}"
}

val keySlice = seed.sliceArray(0 until 32)
Expand Down
Loading