]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/crypto/sha1/sha1_test.go
[dev.boringcrypto] all: merge master into dev.boringcrypto
[gostls13.git] / src / crypto / sha1 / sha1_test.go
index ab43c7792d4949800532408cd407fe33ce4c31e1..f1a5448dd2dd75eb18b405c4237b9cf2dc93f063 100644 (file)
@@ -16,6 +16,8 @@ import (
        "testing"
 )
 
+import "crypto/internal/boring"
+
 type sha1Test struct {
        out       string
        in        string
@@ -77,6 +79,9 @@ func TestGolden(t *testing.T) {
                                io.WriteString(c, g.in[len(g.in)/2:])
                                sum = c.Sum(nil)
                        case 3:
+                               if boring.Enabled {
+                                       continue
+                               }
                                io.WriteString(c, g.in[0:len(g.in)/2])
                                c.(*digest).ConstantTimeSum(nil)
                                io.WriteString(c, g.in[len(g.in)/2:])
@@ -141,6 +146,9 @@ func TestBlockSize(t *testing.T) {
 
 // Tests that blockGeneric (pure Go) and block (in assembly for some architectures) match.
 func TestBlockGeneric(t *testing.T) {
+       if boring.Enabled {
+               t.Skip("BoringCrypto doesn't expose digest")
+       }
        for i := 1; i < 30; i++ { // arbitrary factor
                gen, asm := New().(*digest), New().(*digest)
                buf := make([]byte, BlockSize*i)
@@ -211,6 +219,9 @@ func TestLargeHashes(t *testing.T) {
 }
 
 func TestAllocations(t *testing.T) {
+       if boring.Enabled {
+               t.Skip("BoringCrypto doesn't allocate the same way as stdlib")
+       }
        in := []byte("hello, world!")
        out := make([]byte, 0, Size)
        h := New()