aboutsummaryrefslogtreecommitdiff
path: root/bhash.go
blob: 04591a206ea2f6714fce9e1eef4cc911d45d7f6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main

import (
	"hash"

	"golang.org/x/crypto/blowfish"
)

var magic = []byte("OxychromaticBlowfishSwatDynamite")

const rounds = 64 // fixed

// blowfish hash
type digest struct {
	c *blowfish.Cipher
}

func (d *digest) Write(p []byte) (n int, err error) {
	panic("not implemented")
}

func (d *digest) Sum(b []byte) []byte {
	panic("not implemented")
}

func (d *digest) Reset() {
	panic("not implemented")
}

func (d *digest) Size() int {
	return blowfish.BlockSize * 4
}

func (d *digest) BlockSize() int {
	return blowfish.BlockSize
}

func NewBHash() hash.Hash {
	d := &digest{}
	d.Reset()
	return d
}