From 67a93f558b27215135ba8bff05c5cff592da0f3a Mon Sep 17 00:00:00 2001 From: cheatfate Date: Mon, 5 Oct 2020 10:39:58 +0300 Subject: [PATCH] Address issue #1714. --- beacon_chain/spec/crypto.nim | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/beacon_chain/spec/crypto.nim b/beacon_chain/spec/crypto.nim index 9e6dddb04..0888bcc1c 100644 --- a/beacon_chain/spec/crypto.nim +++ b/beacon_chain/spec/crypto.nim @@ -25,7 +25,7 @@ import # Standard library - options, tables, + std/[options, tables], # Internal ./digest, # Status @@ -33,6 +33,7 @@ import blscurve, chronicles, json_serialization, + nimcrypto/utils as ncrutils, # Standard library hashes @@ -349,16 +350,16 @@ func shortLog*(x: BlsValue): string = # The prefix must be short # due to the mechanics of the `shortLog` function. if x.kind == Real: - x.blsValue.exportRaw().toOpenArray(0, 3).toHex() + byteutils.toHex(x.blsValue.exportRaw().toOpenArray(0, 3)) else: - "r:" & x.blob.toOpenArray(0, 3).toHex() + "r:" & byteutils.toHex(x.blob.toOpenArray(0, 3)) func shortLog*(x: ValidatorPrivKey): string = ## Logging for raw unwrapped BLS types "" func shortLog*(x: TrustedSig): string = - x.data.toOpenArray(0, 3).toHex() + byteutils.toHex(x.data.toOpenArray(0, 3)) # Initialization # ---------------------------------------------------------------------- @@ -387,4 +388,4 @@ func init*(T: typedesc[ValidatorSig], data: array[RawSigSize, byte]): T {.noInit v[] proc burnMem*(key: var ValidatorPrivKey) = - key = default(ValidatorPrivKey) + ncrutils.burnMem(addr key, sizeof(ValidatorPrivKey))