[dev.boringcrypto] crypto: move crypto/internal/boring imports to reduce merge conflicts

As suggested by dmitshur@, move them to their own block so they don't
conflict with changes in the upstream imports.

Change-Id: Id46fb7c766066c406023b0355f4c3c860166f0fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/181277
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Filippo Valsorda 2019-06-07 13:48:42 -04:00
parent 324f8365be
commit 9bf9e7d4b2
16 changed files with 38 additions and 18 deletions

View File

@ -6,11 +6,12 @@ package aes
import (
"crypto/cipher"
"crypto/internal/boring"
"crypto/internal/subtle"
"strconv"
)
import "crypto/internal/boring"
// The AES block size in bytes.
const BlockSize = 16

View File

@ -8,11 +8,12 @@ package aes
import (
"crypto/cipher"
"crypto/internal/boring"
"crypto/internal/subtle"
"internal/cpu"
)
import "crypto/internal/boring"
// defined in asm_*.s
//go:noescape

View File

@ -21,17 +21,20 @@ import (
"crypto/aes"
"crypto/cipher"
"crypto/elliptic"
"crypto/internal/boring"
"crypto/sha512"
"encoding/asn1"
"errors"
"io"
"math/big"
"unsafe"
"crypto/internal/randutil"
)
import (
"crypto/internal/boring"
"unsafe"
)
// A invertible implements fast inverse mod Curve.Params().N
type invertible interface {
// Inverse returns the inverse of k in GF(P)

View File

@ -22,11 +22,12 @@ timing side-channels:
package hmac
import (
"crypto/internal/boring"
"crypto/subtle"
"hash"
)
import "crypto/internal/boring"
// FIPS 198-1:
// https://csrc.nist.gov/publications/fips/fips198-1/FIPS-198-1_final.pdf

View File

@ -13,7 +13,6 @@ import (
"bufio"
"crypto/aes"
"crypto/cipher"
"crypto/internal/boring"
"encoding/binary"
"io"
"os"
@ -23,6 +22,8 @@ import (
"time"
)
import "crypto/internal/boring"
const urandomDevice = "/dev/urandom"
// Easy implementation: read from /dev/urandom.

View File

@ -6,7 +6,6 @@ package rsa
import (
"crypto"
"crypto/internal/boring"
"crypto/subtle"
"errors"
"io"
@ -15,6 +14,8 @@ import (
"crypto/internal/randutil"
)
import "crypto/internal/boring"
// This file implements encryption and decryption using PKCS#1 v1.5 padding.
// PKCS1v15DecrypterOpts is for passing options to PKCS#1 v1.5 decryption using

View File

@ -11,13 +11,14 @@ package rsa
import (
"bytes"
"crypto"
"crypto/internal/boring"
"errors"
"hash"
"io"
"math/big"
)
import "crypto/internal/boring"
func emsaPSSEncode(mHash []byte, emBits int, salt []byte, hash hash.Hash) ([]byte, error) {
// See [1], section 9.1.1
hLen := hash.Size()

View File

@ -24,7 +24,6 @@ package rsa
import (
"crypto"
"crypto/internal/boring"
"crypto/rand"
"crypto/subtle"
"errors"
@ -32,11 +31,15 @@ import (
"io"
"math"
"math/big"
"unsafe"
"crypto/internal/randutil"
)
import (
"crypto/internal/boring"
"unsafe"
)
var bigZero = big.NewInt(0)
var bigOne = big.NewInt(1)

View File

@ -7,7 +7,6 @@ package rsa
import (
"bytes"
"crypto"
"crypto/internal/boring"
"crypto/rand"
"crypto/sha1"
"crypto/sha256"
@ -16,6 +15,8 @@ import (
"testing"
)
import "crypto/internal/boring"
func TestKeyGeneration(t *testing.T) {
for _, size := range []int{128, 1024, 2048, 3072} {
priv, err := GenerateKey(rand.Reader, size)

View File

@ -8,7 +8,6 @@ package sha1
import (
"bytes"
"crypto/internal/boring"
"crypto/rand"
"encoding"
"fmt"
@ -17,6 +16,8 @@ import (
"testing"
)
import "crypto/internal/boring"
type sha1Test struct {
out string
in string

View File

@ -8,12 +8,13 @@ package sha256
import (
"crypto"
"crypto/internal/boring"
"encoding/binary"
"errors"
"hash"
)
import "crypto/internal/boring"
func init() {
crypto.RegisterHash(crypto.SHA224, New224)
crypto.RegisterHash(crypto.SHA256, New)

View File

@ -8,7 +8,6 @@ package sha256
import (
"bytes"
"crypto/internal/boring"
"crypto/rand"
"encoding"
"fmt"
@ -17,6 +16,8 @@ import (
"testing"
)
import "crypto/internal/boring"
type sha256Test struct {
out string
in string

View File

@ -12,12 +12,13 @@ package sha512
import (
"crypto"
"crypto/internal/boring"
"encoding/binary"
"errors"
"hash"
)
import "crypto/internal/boring"
func init() {
crypto.RegisterHash(crypto.SHA384, New384)
crypto.RegisterHash(crypto.SHA512, New)

View File

@ -8,7 +8,6 @@ package sha512
import (
"bytes"
"crypto/internal/boring"
"crypto/rand"
"encoding"
"encoding/hex"
@ -18,6 +17,8 @@ import (
"testing"
)
import "crypto/internal/boring"
type sha512Test struct {
out string
in string

View File

@ -10,7 +10,6 @@ import (
"crypto/cipher"
"crypto/des"
"crypto/hmac"
"crypto/internal/boring"
"crypto/rc4"
"crypto/sha1"
"crypto/sha256"
@ -19,6 +18,8 @@ import (
"hash"
)
import "crypto/internal/boring"
// a keyAgreement implements the client and server side of a TLS key agreement
// protocol by generating and processing key exchange messages.
type keyAgreement interface {

View File

@ -7,7 +7,6 @@ package tls
import (
"container/list"
"crypto"
"crypto/internal/boring"
"crypto/rand"
"crypto/sha512"
"crypto/x509"
@ -23,6 +22,8 @@ import (
"time"
)
import "crypto/internal/boring"
const (
VersionSSL30 = 0x0300
VersionTLS10 = 0x0301