diff options
Diffstat (limited to 'src/cmd/compile/internal/staticdata/data.go')
-rw-r--r-- | src/cmd/compile/internal/staticdata/data.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/staticdata/data.go b/src/cmd/compile/internal/staticdata/data.go index b114bb2df6..b8b645f246 100644 --- a/src/cmd/compile/internal/staticdata/data.go +++ b/src/cmd/compile/internal/staticdata/data.go @@ -5,7 +5,6 @@ package staticdata import ( - "crypto/sha256" "fmt" "go/constant" "io" @@ -20,6 +19,7 @@ import ( "cmd/compile/internal/objw" "cmd/compile/internal/typecheck" "cmd/compile/internal/types" + "cmd/internal/notsha256" "cmd/internal/obj" "cmd/internal/objabi" "cmd/internal/src" @@ -73,7 +73,7 @@ func StringSym(pos src.XPos, s string) (data *obj.LSym) { // Indulge in some paranoia by writing the length of s, too, // as protection against length extension attacks. // Same pattern is known to fileStringSym below. - h := sha256.New() + h := notsha256.New() io.WriteString(h, s) symname = fmt.Sprintf(stringSymPattern, len(s), h.Sum(nil)) } else { @@ -131,7 +131,7 @@ func fileStringSym(pos src.XPos, file string, readonly bool, hash []byte) (*obj. sym = slicedata(pos, string(data)).Linksym() } if len(hash) > 0 { - sum := sha256.Sum256(data) + sum := notsha256.Sum256(data) copy(hash, sum[:]) } return sym, size, nil @@ -148,7 +148,7 @@ func fileStringSym(pos src.XPos, file string, readonly bool, hash []byte) (*obj. // Compute hash if needed for read-only content hashing or if the caller wants it. var sum []byte if readonly || len(hash) > 0 { - h := sha256.New() + h := notsha256.New() n, err := io.Copy(h, f) if err != nil { return nil, 0, err |