X-Git-Url: http://www.git.cypherpunks.ru/?p=govpn.git;a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgovpn%2Faont%2Foaep.go;h=3d1a1c6731722eecef657ffa3a6e9074b7368d6e;hp=35d92fecf36c722404efae2c2f01f6485869565b;hb=da9420230cd4ed2ff1d8685c96b99043e529da62;hpb=696d610336e0cf8cecc40ec94c138bec8cc42afa diff --git a/src/cypherpunks.ru/govpn/aont/oaep.go b/src/cypherpunks.ru/govpn/aont/oaep.go index 35d92fe..3d1a1c6 100644 --- a/src/cypherpunks.ru/govpn/aont/oaep.go +++ b/src/cypherpunks.ru/govpn/aont/oaep.go @@ -38,7 +38,7 @@ import ( "crypto/subtle" "errors" - "github.com/dchest/blake2b" + "golang.org/x/crypto/blake2b" "golang.org/x/crypto/salsa20" ) @@ -56,7 +56,10 @@ var ( func Encode(r *[RSize]byte, in []byte) ([]byte, error) { out := make([]byte, len(in)+HSize+RSize) copy(out, in) - h := blake2b.New256() + h, err := blake2b.New256(nil) + if err != nil { + return nil, err + } h.Write(r[:]) h.Write(in) copy(out[len(in):], h.Sum(nil)) @@ -77,7 +80,10 @@ func Decode(in []byte) ([]byte, error) { if len(in) < HSize+RSize { return nil, errors.New("Too small input buffer") } - h := blake2b.New256() + h, err := blake2b.New256(nil) + if err != nil { + return nil, err + } h.Write(in[:len(in)-RSize]) salsaKey := new([32]byte) for i, b := range h.Sum(nil)[:RSize] {