common: improve documentation comments (#16701)

This commit adds many comments and removes unused code.
It also removes the EmptyHash function, which had some uses
but was silly.
This commit is contained in:
kiel barry
2018-05-29 03:42:21 -07:00
committed by Felix Lange
parent 998f6564b2
commit 84f8c0cc1f
9 changed files with 84 additions and 138 deletions

View File

@ -78,7 +78,7 @@ func ParseBig256(s string) (*big.Int, bool) {
return bigint, ok
}
// MustParseBig parses s as a 256 bit big integer and panics if the string is invalid.
// MustParseBig256 parses s as a 256 bit big integer and panics if the string is invalid.
func MustParseBig256(s string) *big.Int {
v, ok := ParseBig256(s)
if !ok {
@ -186,9 +186,8 @@ func U256(x *big.Int) *big.Int {
func S256(x *big.Int) *big.Int {
if x.Cmp(tt255) < 0 {
return x
} else {
return new(big.Int).Sub(x, tt256)
}
return new(big.Int).Sub(x, tt256)
}
// Exp implements exponentiation by squaring.