Skip to content

Instantly share code, notes, and snippets.

@aleph-v
Created September 28, 2018 16:05
Show Gist options
  • Save aleph-v/e3e9093bf184fa92033d7c75737001d7 to your computer and use it in GitHub Desktop.
Save aleph-v/e3e9093bf184fa92033d7c75737001d7 to your computer and use it in GitHub Desktop.
function negModN(uint256 s) returns(bytes32){
return bytes32(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s);
} //0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 is the order of the Ethereum elliptic curve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment