@@ -34,7 +34,7 @@ Subject: [PATCH] Add crypto backend foundation
34
34
.../internal/backend/fips140/isrequirefips.go | 9 +
35
35
.../internal/backend/fips140/norequirefips.go | 9 +
36
36
.../backend/fips140/nosystemcrypto.go | 11 +
37
- src/crypto/internal/backend/nobackend.go | 229 ++++++++++++++++++
37
+ src/crypto/internal/backend/nobackend.go | 233 ++++++++++++++++++
38
38
src/crypto/internal/backend/stub.s | 10 +
39
39
src/crypto/internal/cryptotest/allocations.go | 2 +-
40
40
.../internal/cryptotest/implementations.go | 2 +-
@@ -68,15 +68,15 @@ Subject: [PATCH] Add crypto backend foundation
68
68
src/crypto/tls/handshake_server.go | 10 +-
69
69
src/crypto/tls/handshake_server_tls13.go | 25 +-
70
70
src/crypto/tls/internal/fips140tls/fipstls.go | 3 +-
71
- src/crypto/tls/prf.go | 41 ++++
71
+ src/crypto/tls/prf.go | 41 +++
72
72
src/go/build/deps_test.go | 8 +-
73
73
src/hash/boring_test.go | 9 +
74
74
src/hash/example_test.go | 2 +
75
75
src/hash/marshal_test.go | 9 +
76
76
src/hash/notboring_test.go | 9 +
77
77
src/net/smtp/smtp_test.go | 72 ++++--
78
78
src/runtime/runtime_boring.go | 5 +
79
- 72 files changed, 1217 insertions(+), 89 deletions(-)
79
+ 72 files changed, 1221 insertions(+), 89 deletions(-)
80
80
create mode 100644 src/crypto/dsa/boring.go
81
81
create mode 100644 src/crypto/dsa/notboring.go
82
82
create mode 100644 src/crypto/ed25519/boring.go
@@ -556,10 +556,10 @@ index 275c60b4de49eb..ff8bddf28c4545 100644
556
556
"math/big"
557
557
)
558
558
diff --git a/src/crypto/ecdsa/ecdsa.go b/src/crypto/ecdsa/ecdsa.go
559
- index 0f9749975ffba9..41ac17df22d7d7 100644
559
+ index f682e6b1c6cfa6..049da55bd70f2c 100644
560
560
--- a/src/crypto/ecdsa/ecdsa.go
561
561
+++ b/src/crypto/ecdsa/ecdsa.go
562
- @@ -18 ,8 +18 ,8 @@ import (
562
+ @@ -20 ,8 +20 ,8 @@ import (
563
563
"crypto"
564
564
"crypto/ecdh"
565
565
"crypto/elliptic"
@@ -590,7 +590,7 @@ index 039bd82ed21f9f..69a97d9bf250be 100644
590
590
panic("boringcrypto: not available")
591
591
diff --git a/src/crypto/ed25519/boring.go b/src/crypto/ed25519/boring.go
592
592
new file mode 100644
593
- index 00000000000000..ff5c426b4fdaea
593
+ index 00000000000000..cce33e4d6cc927
594
594
--- /dev/null
595
595
+++ b/src/crypto/ed25519/boring.go
596
596
@@ -0,0 +1,71 @@
@@ -633,7 +633,7 @@ index 00000000000000..ff5c426b4fdaea
633
633
+
634
634
+ b = new(boringPub)
635
635
+ copy(b.orig[:], pub)
636
- + key, err := boring.NewPublicKeyEd25119 (b.orig[:])
636
+ + key, err := boring.NewPublicKeyEd25519 (b.orig[:])
637
637
+ if err != nil {
638
638
+ return key, err
639
639
+ }
@@ -657,7 +657,7 @@ index 00000000000000..ff5c426b4fdaea
657
657
+
658
658
+ b = new(boringPriv)
659
659
+ copy(b.orig[:], priv)
660
- + key, err := boring.NewPrivateKeyEd25119 (b.orig[:])
660
+ + key, err := boring.NewPrivateKeyEd25519 (b.orig[:])
661
661
+ if err != nil {
662
662
+ return key, err
663
663
+ }
@@ -666,7 +666,7 @@ index 00000000000000..ff5c426b4fdaea
666
666
+ return key, nil
667
667
+ }
668
668
diff --git a/src/crypto/ed25519/ed25519.go b/src/crypto/ed25519/ed25519.go
669
- index c1f8ff784e4a5c..308d814ff6302b 100644
669
+ index c1f8ff784e4a5c..6476bfbe896d6c 100644
670
670
--- a/src/crypto/ed25519/ed25519.go
671
671
+++ b/src/crypto/ed25519/ed25519.go
672
672
@@ -17,6 +17,7 @@ package ed25519
@@ -767,7 +767,7 @@ index c1f8ff784e4a5c..308d814ff6302b 100644
767
767
+ 0x22, 0xab, 0xbe, 0xe6, 0x85, 0xfd, 0xa4, 0x42, 0x0f, 0x88, 0x34,
768
768
+ 0xb1, 0x08, 0xc3, 0xbd, 0xae, 0x36, 0x9e, 0xf5, 0x49, 0xfa,
769
769
+ }
770
- + pub, err := boring.NewPublicKeyEd25119 (pkey)
770
+ + pub, err := boring.NewPublicKeyEd25519 (pkey)
771
771
+ if err != nil {
772
772
+ return false
773
773
+ }
@@ -1148,10 +1148,10 @@ index 00000000000000..83691d7dd42d51
1148
1148
+ }
1149
1149
diff --git a/src/crypto/internal/backend/nobackend.go b/src/crypto/internal/backend/nobackend.go
1150
1150
new file mode 100644
1151
- index 00000000000000..06e19c55345187
1151
+ index 00000000000000..3ebb6d5e4b4bb5
1152
1152
--- /dev/null
1153
1153
+++ b/src/crypto/internal/backend/nobackend.go
1154
- @@ -0,0 +1,229 @@
1154
+ @@ -0,0 +1,233 @@
1155
1155
+ // Copyright 2017 The Go Authors. All rights reserved.
1156
1156
+ // Use of this source code is governed by a BSD-style
1157
1157
+ // license that can be found in the LICENSE file.
@@ -1180,19 +1180,23 @@ index 00000000000000..06e19c55345187
1180
1180
+
1181
1181
+ func SupportsHash(h crypto.Hash) bool { panic("cryptobackend: not available") }
1182
1182
+
1183
- + func NewMD5() hash.Hash { panic("cryptobackend: not available") }
1184
- + func NewSHA1() hash.Hash { panic("cryptobackend: not available") }
1185
- + func NewSHA224() hash.Hash { panic("cryptobackend: not available") }
1186
- + func NewSHA256() hash.Hash { panic("cryptobackend: not available") }
1187
- + func NewSHA384() hash.Hash { panic("cryptobackend: not available") }
1188
- + func NewSHA512() hash.Hash { panic("cryptobackend: not available") }
1189
- +
1190
- + func MD5(p []byte) (sum [16]byte) { panic("cryptobackend: not available") }
1191
- + func SHA1(p []byte) (sum [20]byte) { panic("cryptobackend: not available") }
1192
- + func SHA224(p []byte) (sum [28]byte) { panic("cryptobackend: not available") }
1193
- + func SHA256(p []byte) (sum [32]byte) { panic("cryptobackend: not available") }
1194
- + func SHA384(p []byte) (sum [48]byte) { panic("cryptobackend: not available") }
1195
- + func SHA512(p []byte) (sum [64]byte) { panic("cryptobackend: not available") }
1183
+ + func NewMD5() hash.Hash { panic("cryptobackend: not available") }
1184
+ + func NewSHA1() hash.Hash { panic("cryptobackend: not available") }
1185
+ + func NewSHA224() hash.Hash { panic("cryptobackend: not available") }
1186
+ + func NewSHA256() hash.Hash { panic("cryptobackend: not available") }
1187
+ + func NewSHA384() hash.Hash { panic("cryptobackend: not available") }
1188
+ + func NewSHA512() hash.Hash { panic("cryptobackend: not available") }
1189
+ + func NewSHA512_224() hash.Hash { panic("cryptobackend: not available") }
1190
+ + func NewSHA512_256() hash.Hash { panic("cryptobackend: not available") }
1191
+ +
1192
+ + func MD5(p []byte) (sum [16]byte) { panic("cryptobackend: not available") }
1193
+ + func SHA1(p []byte) (sum [20]byte) { panic("cryptobackend: not available") }
1194
+ + func SHA224(p []byte) (sum [28]byte) { panic("cryptobackend: not available") }
1195
+ + func SHA256(p []byte) (sum [32]byte) { panic("cryptobackend: not available") }
1196
+ + func SHA384(p []byte) (sum [48]byte) { panic("cryptobackend: not available") }
1197
+ + func SHA512(p []byte) (sum [64]byte) { panic("cryptobackend: not available") }
1198
+ + func SHA512_224(p []byte) (sum [28]byte) { panic("cryptobackend: not available") }
1199
+ + func SHA512_256(p []byte) (sum [32]byte) { panic("cryptobackend: not available") }
1196
1200
+
1197
1201
+ func NewHMAC(h func() hash.Hash, key []byte) hash.Hash { panic("cryptobackend: not available") }
1198
1202
+
@@ -1331,11 +1335,11 @@ index 00000000000000..06e19c55345187
1331
1335
+ panic("cryptobackend: not available")
1332
1336
+ }
1333
1337
+
1334
- + func NewPrivateKeyEd25119 (priv []byte) (PrivateKeyEd25519, error) {
1338
+ + func NewPrivateKeyEd25519 (priv []byte) (* PrivateKeyEd25519, error) {
1335
1339
+ panic("cryptobackend: not available")
1336
1340
+ }
1337
1341
+
1338
- + func NewPublicKeyEd25119 (pub []byte) (PublicKeyEd25519, error) {
1342
+ + func NewPublicKeyEd25519 (pub []byte) (* PublicKeyEd25519, error) {
1339
1343
+ panic("cryptobackend: not available")
1340
1344
+ }
1341
1345
+
@@ -2430,7 +2434,7 @@ index e7369542a73270..ff52175e4ac636 100644
2430
2434
}
2431
2435
}
2432
2436
diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go
2433
- index d9d985dca4ade4..de88160bcf3a1c 100644
2437
+ index a62a5173b9c6bc..b39db00839ab43 100644
2434
2438
--- a/src/go/build/deps_test.go
2435
2439
+++ b/src/go/build/deps_test.go
2436
2440
@@ -493,6 +493,8 @@ var depsRules = `
0 commit comments