Avoid assembly in signature V and S decomposition (#3060)
* Avoid assembly in signature V and S decomposition * Update ECDSA.sol
This commit is contained in:
@ -117,12 +117,8 @@ library ECDSA {
|
||||
bytes32 r,
|
||||
bytes32 vs
|
||||
) internal pure returns (address, RecoverError) {
|
||||
bytes32 s;
|
||||
uint8 v;
|
||||
assembly {
|
||||
s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
|
||||
v := add(shr(255, vs), 27)
|
||||
}
|
||||
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
|
||||
uint8 v = uint8((uint256(vs) >> 255) + 27);
|
||||
return tryRecover(hash, v, r, s);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user