diff --git a/x509_cert/x509_cert.go b/x509_cert/x509_cert.go index 6b3578a..18b9c36 100644 --- a/x509_cert/x509_cert.go +++ b/x509_cert/x509_cert.go @@ -10,7 +10,6 @@ import ( "errors" "fmt" "github.com/lestrrat-go/jwx/v2/cert" - "golang.org/x/crypto/sha3" "regexp" "strings" ) @@ -40,7 +39,7 @@ func Hash(data []byte, alg string) ([]byte, error) { sum := sha256.Sum256(data) return sum[:], nil case "sha384": - sum := sha3.Sum384(data) + sum := sha512.Sum384(data) return sum[:], nil case "sha512": sum := sha512.Sum512(data) diff --git a/x509_cert/x509_cert_test.go b/x509_cert/x509_cert_test.go index 4f24a19..ca33e45 100644 --- a/x509_cert/x509_cert_test.go +++ b/x509_cert/x509_cert_test.go @@ -9,7 +9,6 @@ import ( "encoding/pem" "fmt" "github.com/stretchr/testify/assert" - "golang.org/x/crypto/sha3" "strings" "testing" ) @@ -17,7 +16,7 @@ import ( func TestHash(t *testing.T) { sha1sum := sha1.Sum([]byte("test")) sha256sum := sha256.Sum256([]byte("test")) - sha384sum := sha3.Sum384([]byte("test")) + sha384sum := sha512.Sum384([]byte("test")) sha512sum := sha512.Sum512([]byte("test")) testCases := []struct { name string