diff --git a/auth-handler.go b/auth-handler.go index cc602a26b..e9bb62d0b 100644 --- a/auth-handler.go +++ b/auth-handler.go @@ -19,13 +19,12 @@ package main import ( "bytes" "crypto/md5" + "crypto/sha256" "encoding/base64" "encoding/hex" "io/ioutil" "net/http" "strings" - - fastSha256 "github.com/minio/minio/pkg/crypto/sha256" ) // Verify if request has JWT. @@ -97,7 +96,7 @@ func getRequestAuthType(r *http.Request) authType { // sum256 calculate sha256 sum for an input byte array func sum256(data []byte) []byte { - hash := fastSha256.New() + hash := sha256.New() hash.Write(data) return hash.Sum(nil) } diff --git a/object-handlers.go b/object-handlers.go index 50b3ef165..ae81688b5 100644 --- a/object-handlers.go +++ b/object-handlers.go @@ -17,6 +17,7 @@ package main import ( + "crypto/sha256" "encoding/hex" "encoding/xml" "fmt" @@ -29,8 +30,6 @@ import ( "strings" "time" - fastSha256 "github.com/minio/minio/pkg/crypto/sha256" - mux "github.com/gorilla/mux" ) @@ -574,7 +573,7 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req // Start writing in a routine. go func() { - shaWriter := fastSha256.New() + shaWriter := sha256.New() multiWriter := io.MultiWriter(shaWriter, writer) if _, cerr := io.CopyN(multiWriter, r.Body, size); cerr != nil { errorIf(cerr, "Unable to read HTTP body.", nil) @@ -719,7 +718,7 @@ func (api objectAPIHandlers) PutObjectPartHandler(w http.ResponseWriter, r *http // Start writing in a routine. go func() { - shaWriter := fastSha256.New() + shaWriter := sha256.New() multiWriter := io.MultiWriter(shaWriter, writer) if _, err = io.CopyN(multiWriter, r.Body, size); err != nil { errorIf(err, "Unable to read HTTP body.", nil) diff --git a/pkg/.DS_Store b/pkg/.DS_Store new file mode 100644 index 000000000..6425e2134 Binary files /dev/null and b/pkg/.DS_Store differ diff --git a/pkg/crypto/sha1/sha1_sse3_amd64.syso b/pkg/crypto/sha1/sha1_sse3_amd64.syso new file mode 100644 index 000000000..9af681c95 Binary files /dev/null and b/pkg/crypto/sha1/sha1_sse3_amd64.syso differ diff --git a/signature-v4-utils.go b/signature-v4-utils.go index 33b695213..86c11a117 100644 --- a/signature-v4-utils.go +++ b/signature-v4-utils.go @@ -18,13 +18,12 @@ package main import ( "crypto/hmac" + "crypto/sha256" "encoding/hex" "net/http" "regexp" "strings" "unicode/utf8" - - fastSha256 "github.com/minio/minio/pkg/crypto/sha256" ) // isValidRegion - verify if incoming region value is valid with configured Region. @@ -42,7 +41,7 @@ func isValidRegion(reqRegion string, confRegion string) bool { // sumHMAC calculate hmac between two input byte array. func sumHMAC(key []byte, data []byte) []byte { - hash := hmac.New(fastSha256.New, key) + hash := hmac.New(sha256.New, key) hash.Write(data) return hash.Sum(nil) } diff --git a/signature-v4.go b/signature-v4.go index 2959b7002..e33b5eaff 100644 --- a/signature-v4.go +++ b/signature-v4.go @@ -26,6 +26,7 @@ package main import ( "bytes" + "crypto/sha256" "encoding/hex" "net/http" "net/url" @@ -33,8 +34,6 @@ import ( "strconv" "strings" "time" - - "github.com/minio/minio/pkg/crypto/sha256" ) // AWS Signature Version '4' constants.