Skip to content

Commit

Permalink
Rename module to github.com/ProtonMail/go-crypto (golang#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
twiss authored Dec 8, 2020
1 parent b4bfec6 commit 35941d5
Show file tree
Hide file tree
Showing 146 changed files with 264 additions and 262 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ script:
- go test ./... -run RandomizeFast -count=512
- go test ./... -run RandomizeSlow -count=32

go_import_path: golang.org/x/crypto
go_import_path: github.com/ProtonMail/go-crypto

go:
- 1.10.x
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ This repository holds supplementary Go cryptography libraries.

## Download/Install

Manually `git clone` the repository into `$GOPATH/src/golang.org/x/crypto`.
The easiest way to install is to run `go get -u github.com/ProtonMail/go-crypto/...`. You
can also manually git clone the repository to `$GOPATH/src/github.com/ProtonMail/go-crypto`.
2 changes: 1 addition & 1 deletion acme/autocert/autocert.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"sync"
"time"

"golang.org/x/crypto/acme"
"github.com/ProtonMail/go-crypto/acme"
"golang.org/x/net/idna"
)

Expand Down
4 changes: 2 additions & 2 deletions acme/autocert/autocert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
"testing"
"time"

"golang.org/x/crypto/acme"
"golang.org/x/crypto/acme/autocert/internal/acmetest"
"github.com/ProtonMail/go-crypto/acme"
"github.com/ProtonMail/go-crypto/acme/autocert/internal/acmetest"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion acme/autocert/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"log"
"net/http"

"golang.org/x/crypto/acme/autocert"
"github.com/ProtonMail/go-crypto/acme/autocert"
)

func ExampleNewListener() {
Expand Down
2 changes: 1 addition & 1 deletion acme/autocert/internal/acmetest/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"sync"
"time"

"golang.org/x/crypto/acme"
"github.com/ProtonMail/go-crypto/acme"
)

// CAServer is a simple test server which implements ACME spec bits needed for testing.
Expand Down
2 changes: 1 addition & 1 deletion acme/autocert/renewal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"
"time"

"golang.org/x/crypto/acme"
"github.com/ProtonMail/go-crypto/acme"
)

func TestRenewalNext(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion acme/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ var packageVersion string
// userAgent returns the User-Agent header value. It includes the package name,
// the module version (if available), and the c.UserAgent value (if set).
func (c *Client) userAgent() string {
ua := "golang.org/x/crypto/acme"
ua := "github.com/ProtonMail/go-crypto/acme"
if packageVersion != "" {
ua += "@" + packageVersion
}
Expand Down
2 changes: 1 addition & 1 deletion acme/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func TestUserAgent(t *testing.T) {
for _, custom := range []string{"", "CUSTOM_UA"} {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
t.Log(r.UserAgent())
if s := "golang.org/x/crypto/acme"; !strings.Contains(r.UserAgent(), s) {
if s := "github.com/ProtonMail/go-crypto/acme"; !strings.Contains(r.UserAgent(), s) {
t.Errorf("expected User-Agent to contain %q, got %q", s, r.UserAgent())
}
if !strings.Contains(r.UserAgent(), custom) {
Expand Down
2 changes: 1 addition & 1 deletion acme/internal/acmeprobe/prober.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (
"strings"
"time"

"golang.org/x/crypto/acme"
"github.com/ProtonMail/go-crypto/acme"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion acme/version_go112.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func init() {
return
}
for _, m := range info.Deps {
if m.Path != "golang.org/x/crypto" {
if m.Path != "github.com/ProtonMail/go-crypto" {
continue
}
if m.Replace == nil {
Expand Down
2 changes: 1 addition & 1 deletion argon2/argon2.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
"encoding/binary"
"sync"

"golang.org/x/crypto/blake2b"
"github.com/ProtonMail/go-crypto/blake2b"
)

// The Argon2 version implemented by this package.
Expand Down
2 changes: 1 addition & 1 deletion argon2/blake2b.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"encoding/binary"
"hash"

"golang.org/x/crypto/blake2b"
"github.com/ProtonMail/go-crypto/blake2b"
)

// blake2bHash computes an arbitrary long hash value of in
Expand Down
4 changes: 2 additions & 2 deletions bcrypt/bcrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing
// algorithm. See http://www.usenix.org/event/usenix99/provos/provos.pdf
package bcrypt // import "golang.org/x/crypto/bcrypt"
package bcrypt // import "github.com/ProtonMail/go-crypto/bcrypt"

// The code is a port of Provos and Mazières's C implementation.
import (
Expand All @@ -15,7 +15,7 @@ import (
"io"
"strconv"

"golang.org/x/crypto/blowfish"
"github.com/ProtonMail/go-crypto/blowfish"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion blake2s/blake2s.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//
// BLAKE2X is a construction to compute hash values larger than 32 bytes. It
// can produce hash values between 0 and 65535 bytes.
package blake2s // import "golang.org/x/crypto/blake2s"
package blake2s // import "github.com/ProtonMail/go-crypto/blake2s"

import (
"encoding/binary"
Expand Down
4 changes: 2 additions & 2 deletions blowfish/cipher.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
//
// Deprecated: any new system should use AES (from crypto/aes, if necessary in
// an AEAD mode like crypto/cipher.NewGCM) or XChaCha20-Poly1305 (from
// golang.org/x/crypto/chacha20poly1305).
package blowfish // import "golang.org/x/crypto/blowfish"
// github.com/ProtonMail/go-crypto/chacha20poly1305).
package blowfish // import "github.com/ProtonMail/go-crypto/blowfish"

// The code is a port of Bruce Schneier's C implementation.
// See https://www.schneier.com/blowfish.html.
Expand Down
2 changes: 1 addition & 1 deletion bn256/bn256.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// elliptic curve. This package is frozen, and not implemented in constant time.
// There is a more complete implementation at github.com/cloudflare/bn256, but
// note that it suffers from the same security issues of the underlying curve.
package bn256 // import "golang.org/x/crypto/bn256"
package bn256 // import "github.com/ProtonMail/go-crypto/bn256"

import (
"crypto/rand"
Expand Down
4 changes: 2 additions & 2 deletions cast5/cast5.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
//
// Deprecated: any new system should use AES (from crypto/aes, if necessary in
// an AEAD mode like crypto/cipher.NewGCM) or XChaCha20-Poly1305 (from
// golang.org/x/crypto/chacha20poly1305).
package cast5 // import "golang.org/x/crypto/cast5"
// github.com/ProtonMail/go-crypto/chacha20poly1305).
package cast5 // import "github.com/ProtonMail/go-crypto/cast5"

import "errors"

Expand Down
4 changes: 2 additions & 2 deletions chacha20/chacha_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"errors"
"math/bits"

"golang.org/x/crypto/internal/subtle"
"github.com/ProtonMail/go-crypto/internal/subtle"
)

const (
Expand Down Expand Up @@ -68,7 +68,7 @@ var _ cipher.Stream = (*Cipher)(nil)
// Note that ChaCha20, like all stream ciphers, is not authenticated and allows
// attackers to silently tamper with the plaintext. For this reason, it is more
// appropriate as a building block than as a standalone encryption mechanism.
// Instead, consider using package golang.org/x/crypto/chacha20poly1305.
// Instead, consider using package github.com/ProtonMail/go-crypto/chacha20poly1305.
func NewUnauthenticatedCipher(key, nonce []byte) (*Cipher, error) {
// This function is split into a wrapper so that the Cipher allocation will
// be inlined, and depending on how the caller uses the return value, won't
Expand Down
2 changes: 1 addition & 1 deletion chacha20poly1305/chacha20poly1305.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Package chacha20poly1305 implements the ChaCha20-Poly1305 AEAD and its
// extended nonce variant XChaCha20-Poly1305, as specified in RFC 8439 and
// draft-irtf-cfrg-xchacha-01.
package chacha20poly1305 // import "golang.org/x/crypto/chacha20poly1305"
package chacha20poly1305 // import "github.com/ProtonMail/go-crypto/chacha20poly1305"

import (
"crypto/cipher"
Expand Down
2 changes: 1 addition & 1 deletion chacha20poly1305/chacha20poly1305_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package chacha20poly1305
import (
"encoding/binary"

"golang.org/x/crypto/internal/subtle"
"github.com/ProtonMail/go-crypto/internal/subtle"
"golang.org/x/sys/cpu"
)

Expand Down
6 changes: 3 additions & 3 deletions chacha20poly1305/chacha20poly1305_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ package chacha20poly1305
import (
"encoding/binary"

"golang.org/x/crypto/chacha20"
"golang.org/x/crypto/internal/subtle"
"golang.org/x/crypto/poly1305"
"github.com/ProtonMail/go-crypto/chacha20"
"github.com/ProtonMail/go-crypto/internal/subtle"
"github.com/ProtonMail/go-crypto/poly1305"
)

func writeWithPadding(p *poly1305.MAC, b []byte) {
Expand Down
2 changes: 1 addition & 1 deletion chacha20poly1305/xchacha20poly1305.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"crypto/cipher"
"errors"

"golang.org/x/crypto/chacha20"
"github.com/ProtonMail/go-crypto/chacha20"
)

type xchacha20poly1305 struct {
Expand Down
2 changes: 1 addition & 1 deletion cryptobyte/asn1.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"reflect"
"time"

"golang.org/x/crypto/cryptobyte/asn1"
"github.com/ProtonMail/go-crypto/cryptobyte/asn1"
)

// This file contains ASN.1-related methods for String and Builder.
Expand Down
2 changes: 1 addition & 1 deletion cryptobyte/asn1/asn1.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Package asn1 contains supporting types for parsing and building ASN.1
// messages with the cryptobyte package.
package asn1 // import "golang.org/x/crypto/cryptobyte/asn1"
package asn1 // import "github.com/ProtonMail/go-crypto/cryptobyte/asn1"

// Tag represents an ASN.1 identifier octet, consisting of a tag number
// (indicating a type) and class (such as context-specific or constructed).
Expand Down
2 changes: 1 addition & 1 deletion cryptobyte/asn1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

"golang.org/x/crypto/cryptobyte/asn1"
"github.com/ProtonMail/go-crypto/cryptobyte/asn1"
)

type readASN1Test struct {
Expand Down
4 changes: 2 additions & 2 deletions cryptobyte/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"errors"
"fmt"

"golang.org/x/crypto/cryptobyte"
"golang.org/x/crypto/cryptobyte/asn1"
"github.com/ProtonMail/go-crypto/cryptobyte"
"github.com/ProtonMail/go-crypto/cryptobyte/asn1"
)

func ExampleString_lengthPrefixed() {
Expand Down
2 changes: 1 addition & 1 deletion cryptobyte/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//
// See the documentation and examples for the Builder and String types to get
// started.
package cryptobyte // import "golang.org/x/crypto/cryptobyte"
package cryptobyte // import "github.com/ProtonMail/go-crypto/cryptobyte"

// String represents a string of bytes. It provides methods for parsing
// fixed-length and length-prefixed values from it.
Expand Down
2 changes: 1 addition & 1 deletion curve25519/curve25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Package curve25519 provides an implementation of the X25519 function, which
// performs scalar multiplication on the elliptic curve known as Curve25519.
// See RFC 7748.
package curve25519 // import "golang.org/x/crypto/curve25519"
package curve25519 // import "github.com/ProtonMail/go-crypto/curve25519"

import (
"crypto/subtle"
Expand Down
2 changes: 1 addition & 1 deletion eax/eax.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"crypto/cipher"
"crypto/subtle"
"errors"
"golang.org/x/crypto/internal/byteutil"
"github.com/ProtonMail/go-crypto/internal/byteutil"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion ed25519/ed25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"io"
"strconv"

"golang.org/x/crypto/ed25519/internal/edwards25519"
"github.com/ProtonMail/go-crypto/ed25519/internal/edwards25519"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions ed25519/ed25519_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"strings"
"testing"

"golang.org/x/crypto/ed25519"
"golang.org/x/crypto/ed25519/internal/edwards25519"
"github.com/ProtonMail/go-crypto/ed25519"
"github.com/ProtonMail/go-crypto/ed25519/internal/edwards25519"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion ed25519/go113_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package ed25519_test

import (
ed25519std "crypto/ed25519"
"golang.org/x/crypto/ed25519"
"github.com/ProtonMail/go-crypto/ed25519"
"testing"
)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module golang.org/x/crypto
module github.com/ProtonMail/go-crypto

go 1.13

Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
github.com/ProtonMail/go-crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand Down
2 changes: 1 addition & 1 deletion hkdf/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"fmt"
"io"

"golang.org/x/crypto/hkdf"
"github.com/ProtonMail/go-crypto/hkdf"
)

// Usage example that expands one master secret into three other
Expand Down
2 changes: 1 addition & 1 deletion hkdf/hkdf.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// HKDF is a cryptographic key derivation function (KDF) with the goal of
// expanding limited input keying material into one or more cryptographically
// strong secret keys.
package hkdf // import "golang.org/x/crypto/hkdf"
package hkdf // import "github.com/ProtonMail/go-crypto/hkdf"

import (
"crypto/hmac"
Expand Down
2 changes: 1 addition & 1 deletion internal/subtle/aliasing.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// Package subtle implements functions that are often useful in cryptographic
// code but require careful thought to use correctly.
package subtle // import "golang.org/x/crypto/internal/subtle"
package subtle // import "github.com/ProtonMail/go-crypto/internal/subtle"

import "unsafe"

Expand Down
2 changes: 1 addition & 1 deletion internal/subtle/aliasing_appengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// Package subtle implements functions that are often useful in cryptographic
// code but require careful thought to use correctly.
package subtle // import "golang.org/x/crypto/internal/subtle"
package subtle // import "github.com/ProtonMail/go-crypto/internal/subtle"

// This is the Google App Engine standard variant based on reflect
// because the unsafe package and cgo are disallowed.
Expand Down
2 changes: 1 addition & 1 deletion internal/subtle/aliasing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package subtle_test
import (
"testing"

"golang.org/x/crypto/internal/subtle"
"github.com/ProtonMail/go-crypto/internal/subtle"
)

var a, b [100]byte
Expand Down
4 changes: 2 additions & 2 deletions internal/wycheproof/aead_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"fmt"
"testing"

"golang.org/x/crypto/eax"
"golang.org/x/crypto/chacha20poly1305"
"github.com/ProtonMail/go-crypto/eax"
"github.com/ProtonMail/go-crypto/chacha20poly1305"
)

func TestAEAD(t *testing.T) {
Expand Down
Loading

0 comments on commit 35941d5

Please sign in to comment.