From d933d8205ec04947b4da3597b3a6431e4f4a364c Mon Sep 17 00:00:00 2001 From: Bradley Hart Date: Wed, 29 Jan 2020 15:06:31 -0500 Subject: [PATCH] bn.js toArray zero pads to length argument --- src/Signature.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Signature.ts b/src/Signature.ts index 26475475a..c3d39b768 100644 --- a/src/Signature.ts +++ b/src/Signature.ts @@ -24,8 +24,8 @@ export class Signature { /** Instantiate Signature from an `elliptic`-format Signature */ public static fromElliptic(ellipticSig: EC.Signature, keyType: KeyType, ec?: EC): Signature { - const r = ellipticSig.r.toArray(); - const s = ellipticSig.s.toArray(); + const r = ellipticSig.r.toArray('be', 32); + const s = ellipticSig.s.toArray('be', 32); let eosioRecoveryParam; if (keyType === KeyType.k1) { eosioRecoveryParam = ellipticSig.recoveryParam + 27;