fix: code review
This commit is contained in:
parent
ef264648fc
commit
f1bdb572f4
|
@ -522,12 +522,14 @@ func tweakAdd*(secretKey: var SkSecretKey, tweak: openArray[byte]): SkResult[voi
|
||||||
{.noSideEffect.}: # secp256k1_context_no_precomp is actually const, see above
|
{.noSideEffect.}: # secp256k1_context_no_precomp is actually const, see above
|
||||||
let res = secp256k1_ec_privkey_tweak_add(secp256k1_context_no_precomp, secretKey.data.ptr0, tweak.ptr0)
|
let res = secp256k1_ec_privkey_tweak_add(secp256k1_context_no_precomp, secretKey.data.ptr0, tweak.ptr0)
|
||||||
if res != 1:
|
if res != 1:
|
||||||
return err("Tweak out of range, or invalid private key")
|
err("Tweak out of range, or invalid private key")
|
||||||
return ok()
|
else:
|
||||||
|
ok()
|
||||||
|
|
||||||
func tweakMul*(secretKey: var SkSecretKey, tweak: openArray[byte]): SkResult[void] =
|
func tweakMul*(secretKey: var SkSecretKey, tweak: openArray[byte]): SkResult[void] =
|
||||||
{.noSideEffect.}: # secp256k1_context_no_precomp is actually const, see above
|
{.noSideEffect.}: # secp256k1_context_no_precomp is actually const, see above
|
||||||
let res = secp256k1_ec_privkey_tweak_mul(secp256k1_context_no_precomp, secretKey.data.ptr0, tweak.ptr0)
|
let res = secp256k1_ec_privkey_tweak_mul(secp256k1_context_no_precomp, secretKey.data.ptr0, tweak.ptr0)
|
||||||
if res != 1:
|
if res != 1:
|
||||||
return err("Tweak out of range, or equal to zero")
|
err("Tweak out of range, or equal to zero")
|
||||||
return ok()
|
else:
|
||||||
|
ok()
|
||||||
|
|
Loading…
Reference in New Issue