master
magical 2014-12-31 23:59:40 -08:00
parent e7f1f3541f
commit 7b01515ff6
2 changed files with 17 additions and 17 deletions

10
gen.go
View File

@ -24,13 +24,13 @@ func main() {
// Rotation constants
x, y := 1, 0
for i := 1; i < 25; i++ {
rotc[x][y] = (i*(i+1)/2) % 64
rotc[x][y] = (i * (i + 1) / 2) % 64
x, y = y, (2*x+3*y)%5
}
var ctx = struct {
Rotc [5][5]int
} {
}{
rotc,
}
err := tmpl.Execute(os.Stdout, &ctx)
@ -41,14 +41,14 @@ func main() {
func count(n int) []int {
var out = make([]int, n)
for i := 0; i < n; i ++ {
for i := 0; i < n; i++ {
out[i] = i
}
return out
}
func add(a, b, m int) int {
return (a+b) % m
return (a + b) % m
}
func sub(a, b int) int {
@ -56,7 +56,7 @@ func sub(a, b int) int {
}
func mul(a, b int) int {
return a*b
return a * b
}
var funcs = template.FuncMap{

View File

@ -17,11 +17,11 @@ type digest struct {
size int
}
func New256() hash.Hash { return &digest{size: 256/8, dsbyte: 0x06} }
func New512() hash.Hash { return &digest{size: 512/8, dsbyte: 0x06} }
func New256() hash.Hash { return &digest{size: 256 / 8, dsbyte: 0x06} }
func New512() hash.Hash { return &digest{size: 512 / 8, dsbyte: 0x06} }
func newKeccak256() hash.Hash { return &digest{size: 256/8, dsbyte: 0x01} }
func newKeccak512() hash.Hash { return &digest{size: 512/8, dsbyte: 0x01} }
func newKeccak256() hash.Hash { return &digest{size: 256 / 8, dsbyte: 0x01} }
func newKeccak512() hash.Hash { return &digest{size: 512 / 8, dsbyte: 0x01} }
func (d *digest) Size() int { return d.size }
func (d *digest) BlockSize() int { return 200 - d.size*2 }