-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -390,6 +390,8 @@ export function splitSignature(signature: SignatureLike): Signature { | |||||||||||
if (result.recoveryParam == null) { | ||||||||||||
if (result.v == null) { | ||||||||||||
logger.throwArgumentError("signature missing v and recoveryParam", "signature", signature); | ||||||||||||
} else if (result.v === 0 || result.v === 1) { | ||||||||||||
result.recoveryParam = result.v; | ||||||||||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
feri42
|
if (result.v === 0 || result.v === 1) { | |
result.v += 27; | |
} else { | |
logger.throwArgumentError("signature invalid v byte", "signature", signature); | |
} |
Ah. I see that the binary form input can't generate a v
of 0
of 1
.
Still looks inconsistent with non-binary { v: 0, recoveryParam: 0 }
and { v: 1, recoveryParam: 1 }
codepaths though?
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
ricmoo
Aug 31, 2021
Author
Member
Heya! Just saw this thread. The double-checking of the parameters agreeing has a lot of nuance, but I think it works. Can you give an example where it does not? Is it a problem where a result cannot then be re-serialized?
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
How exactly does this work? This implies that
{ v: 0, recoveryParam: 0 }
and{ v: 1, recoveryParam: 1 }
are correct, but the check below throws an argument error if they were both specified as such?