replace all "crypto/sha256" with "github.com/minio/sha256-simd" (#5391)

This change replaces all imports of "crypto/sha256" with
"github.com/minio/sha256-simd". The sha256-simd package
is faster on ARM64 (NEON instructions) and can take advantage
of AVX-512 in certain scenarios.

Fixes #5374
master
Andreas Auernhammer 7 years ago committed by kannappanr
parent a020a70484
commit d0a43af616
  1. 2
      cmd/gateway/azure/gateway-azure.go
  2. 3
      cmd/retry-storage_test.go
  3. 2
      cmd/update-main.go
  4. 2
      cmd/xl-v1-metadata.go
  5. 3
      pkg/hash/reader.go
  6. 3
      pkg/madmin/utils.go

@ -19,7 +19,6 @@ package azure
import ( import (
"bytes" "bytes"
"crypto/rand" "crypto/rand"
"crypto/sha256"
"encoding/base64" "encoding/base64"
"encoding/hex" "encoding/hex"
"encoding/json" "encoding/json"
@ -38,6 +37,7 @@ import (
"github.com/minio/minio/pkg/auth" "github.com/minio/minio/pkg/auth"
"github.com/minio/minio/pkg/errors" "github.com/minio/minio/pkg/errors"
"github.com/minio/minio/pkg/hash" "github.com/minio/minio/pkg/hash"
sha256 "github.com/minio/sha256-simd"
minio "github.com/minio/minio/cmd" minio "github.com/minio/minio/cmd"
) )

@ -18,12 +18,13 @@ package cmd
import ( import (
"bytes" "bytes"
"crypto/sha256"
"errors" "errors"
"os" "os"
"reflect" "reflect"
"testing" "testing"
"time" "time"
sha256 "github.com/minio/sha256-simd"
) )
// Tests retry storage. // Tests retry storage.

@ -19,7 +19,6 @@ package cmd
import ( import (
"bufio" "bufio"
"crypto" "crypto"
_ "crypto/sha256" // Needed for sha256 hash verifier.
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
@ -33,6 +32,7 @@ import (
"github.com/fatih/color" "github.com/fatih/color"
"github.com/inconshreveable/go-update" "github.com/inconshreveable/go-update"
"github.com/minio/cli" "github.com/minio/cli"
_ "github.com/minio/sha256-simd" // Needed for sha256 hash verifier.
"github.com/segmentio/go-prompt" "github.com/segmentio/go-prompt"
) )

@ -18,7 +18,6 @@ package cmd
import ( import (
"crypto" "crypto"
"crypto/sha256"
"encoding/hex" "encoding/hex"
"encoding/json" "encoding/json"
"fmt" "fmt"
@ -30,6 +29,7 @@ import (
"time" "time"
"github.com/minio/minio/pkg/errors" "github.com/minio/minio/pkg/errors"
sha256 "github.com/minio/sha256-simd"
"golang.org/x/crypto/blake2b" "golang.org/x/crypto/blake2b"
) )

@ -19,12 +19,13 @@ package hash
import ( import (
"bytes" "bytes"
"crypto/md5" "crypto/md5"
"crypto/sha256"
"encoding/base64" "encoding/base64"
"encoding/hex" "encoding/hex"
"errors" "errors"
"hash" "hash"
"io" "io"
sha256 "github.com/minio/sha256-simd"
) )
var errNestedReader = errors.New("Nesting of Reader detected, not allowed") var errNestedReader = errors.New("Nesting of Reader detected, not allowed")

@ -18,7 +18,6 @@ package madmin
import ( import (
"crypto/md5" "crypto/md5"
"crypto/sha256"
"encoding/xml" "encoding/xml"
"io" "io"
"io/ioutil" "io/ioutil"
@ -27,6 +26,8 @@ import (
"net/url" "net/url"
"strings" "strings"
sha256 "github.com/minio/sha256-simd"
"github.com/minio/minio-go/pkg/s3utils" "github.com/minio/minio-go/pkg/s3utils"
) )

Loading…
Cancel
Save