Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Zero padding Signature r-value/s-value to 32 bytes (release/21.0.x branch) #668

Merged
merged 2 commits into from
Feb 4, 2020
Merged
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
4 changes: 2 additions & 2 deletions src/Signature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down