Commit 7740e9d3 authored by Frank Denis's avatar Frank Denis

Update dep and deps

parent 33bcff7d
......@@ -2,142 +2,185 @@
[[projects]]
digest = "1:b16fbfbcc20645cb419f78325bb2e85ec729b338e996a228124d68931a6f2a37"
name = "github.com/BurntSushi/toml"
packages = ["."]
pruneopts = "UT"
revision = "b26d9c308763d68093482582cea63d69be07a0f0"
version = "v0.3.0"
[[projects]]
digest = "1:e626376fab8608a972d47e91b3c1bbbddaecaf1d42b82be6dcc52d10a7557893"
name = "github.com/VividCortex/ewma"
packages = ["."]
pruneopts = "UT"
revision = "b24eb346a94c3ba12c1da1e564dbac1b498a77ce"
version = "v1.1.1"
[[projects]]
branch = "master"
digest = "1:6d6d9309d10d5dffaaf3a56c4b2570dec62152f978ac3566b13bdfafd63f32fb"
name = "github.com/aead/chacha20"
packages = ["chacha"]
revision = "e2538746bfea853aaa589feb8ec46bd46ee78f86"
pruneopts = "UT"
revision = "8b13a72661dae6e9e5dea04f344f0dc95ea29547"
[[projects]]
branch = "master"
digest = "1:82df2686fe2e0cc2894fbec00098fe2efeacbda08af8087a86d9eeea58699d49"
name = "github.com/aead/poly1305"
packages = ["."]
revision = "969857f48f7ae439b6d2449ed1dcd9aaabc49c67"
pruneopts = "UT"
revision = "3fee0db0b63511234f7230da50b72414f6258f10"
[[projects]]
branch = "master"
digest = "1:47ea4fbe2ab4aeb9808502c51e657041c2e49b36b83fc1c1a349135cdf16342f"
name = "github.com/agl/ed25519"
packages = [
".",
"edwards25519"
"edwards25519",
]
pruneopts = "UT"
revision = "5312a61534124124185d41f09206b9fef1d88403"
[[projects]]
digest = "1:9ddcd6732e302feb09865d8bfbebd55c295d95915ee0a530fd22b51851d852e4"
name = "github.com/coreos/go-systemd"
packages = [
"activation",
"daemon"
"daemon",
]
pruneopts = "UT"
revision = "39ca1b05acc7ad1220e09f133283b8859a8b71ab"
version = "v17"
[[projects]]
branch = "master"
digest = "1:b78a58e00a1b951af4803ddfefbbcae14c7cacce3940ebad359c9d5582bf74a0"
name = "github.com/dchest/safefile"
packages = ["."]
pruneopts = "UT"
revision = "855e8d98f1852d48dde521e0522408d1fe7e836a"
[[projects]]
branch = "master"
digest = "1:c183111eaf02a9e6bb39c213bdfb5472b16f1955dd4c9dab82db83f114c64a63"
name = "github.com/facebookgo/atomicfile"
packages = ["."]
pruneopts = "UT"
revision = "2de1f203e7d5e386a6833233882782932729f27e"
[[projects]]
branch = "master"
digest = "1:b0b75ab0829ae3769f1f221486da0c40c8dc0680fb93d072b5df5a39d56c996c"
name = "github.com/facebookgo/pidfile"
packages = ["."]
pruneopts = "UT"
revision = "f242e2999868dcd267a2b86e49ce1f9cf9e15b16"
[[projects]]
branch = "master"
digest = "1:2394f5a25132b3868eff44599cc28d44bdd0330806e34c495d754dd052df612b"
name = "github.com/hashicorp/go-immutable-radix"
packages = ["."]
pruneopts = "UT"
revision = "7f3cd4390caab3250a57f30efdb2a65dd7649ecf"
[[projects]]
branch = "master"
digest = "1:4d9d876a856ada3b553062ac8e50331a9a539e12893c0c4a50d8ae2af4242685"
name = "github.com/hashicorp/go-syslog"
packages = ["."]
pruneopts = "UT"
revision = "326bf4a7f709d263f964a6a96558676b103f3534"
[[projects]]
branch = "master"
digest = "1:cf296baa185baae04a9a7004efee8511d08e2f5f51d4cbe5375da89722d681db"
name = "github.com/hashicorp/golang-lru"
packages = [
".",
"simplelru"
"simplelru",
]
pruneopts = "UT"
revision = "0fb14efe8c47ae851c0034ed7a448854d3d34cf3"
[[projects]]
branch = "master"
digest = "1:d7b8c19830aedc4fec0c843fd3ada94eeb47f7c4f43149f90e6e9623627480d7"
name = "github.com/jedisct1/dlog"
packages = ["."]
pruneopts = "UT"
revision = "f81e5af176e59fc11674b2777fe465fc506c27fe"
[[projects]]
branch = "master"
digest = "1:6874350bad25169257ca2ccfe929d852d0f866b841908632d3b94b1a100178df"
name = "github.com/jedisct1/go-clocksmith"
packages = ["."]
pruneopts = "UT"
revision = "c35da9bed550558a4797c74e34957071214342e7"
[[projects]]
branch = "master"
digest = "1:2c8c475bb86fe1b4cdb134c3b4649385daafcd37fa56b970957d98814db7b3ea"
name = "github.com/jedisct1/go-dnsstamps"
packages = ["."]
pruneopts = "UT"
revision = "1e4999280f861b465e03e21e4f84d838f2f02b38"
[[projects]]
branch = "master"
digest = "1:d1d9e8794639828c2953fae54ef5f25eb0dbc42032f9a8700ebabbc42d70130d"
name = "github.com/jedisct1/go-minisign"
packages = ["."]
pruneopts = "UT"
revision = "f4dbde220b4f73d450949b9ba27fa941faa05a78"
[[projects]]
branch = "master"
digest = "1:9eb6e583742b094222b15794641e0e5fac69078147b82f4a5c971bb0b8938671"
name = "github.com/jedisct1/xsecretbox"
packages = ["."]
pruneopts = "UT"
revision = "7a679c0bcd9a5bbfe097fb7d48497bc06d17be76"
[[projects]]
digest = "1:9d85ab479918f5d22a449601d35ff4e94115e31db534e22b8431e2c7b152bc4d"
name = "github.com/k-sone/critbitgo"
packages = ["."]
pruneopts = "UT"
revision = "658116ef1e826b72c603cfe2091b12503f9bca43"
version = "v1.2.0"
[[projects]]
branch = "master"
digest = "1:caf6db28595425c0e0f2301a00257d11712f65c1878e12cffc42f6b9a9cf3f23"
name = "github.com/kardianos/osext"
packages = ["."]
pruneopts = "UT"
revision = "ae77be60afb1dcacde03767a8c37337fad28ac14"
[[projects]]
branch = "master"
digest = "1:2c4470d47613daac5ff660ff9b67a6f8dca489845bb867186e3fcda742a3e53f"
name = "github.com/kardianos/service"
packages = ["."]
pruneopts = "UT"
revision = "615a14ed75099c9eaac6949e22ac2341bf9d3197"
[[projects]]
digest = "1:463e4140189f8194f9121ca1c7fe3b8e9e9a2ab3d949b43c835c21034927dc62"
name = "github.com/miekg/dns"
packages = ["."]
pruneopts = "UT"
revision = "5a2b9fab83ff0f8bfc99684bd5f43a37abe560f1"
version = "v1.0.8"
[[projects]]
branch = "master"
digest = "1:fb92a63e4dcf1d88c58efdbc028d0b91bcaeddd8633758056beb376f13531147"
name = "golang.org/x/crypto"
packages = [
"curve25519",
......@@ -147,12 +190,14 @@
"nacl/box",
"nacl/secretbox",
"poly1305",
"salsa20/salsa"
"salsa20/salsa",
]
revision = "a49355c7e3f8fe157a85be2f77e6e269a0f89602"
pruneopts = "UT"
revision = "de0752318171da717af4ce24d0a2e8626afaeb11"
[[projects]]
branch = "master"
digest = "1:b6a4877dbd8d954aebfe3c6e4b8f674f0564aaf7ac2bb99ea1d9e190410f46c4"
name = "golang.org/x/net"
packages = [
"bpf",
......@@ -165,12 +210,14 @@
"internal/socks",
"ipv4",
"ipv6",
"proxy"
"proxy",
]
revision = "32a936f46389aa10549d60bd7833e54b01685d09"
pruneopts = "UT"
revision = "f9ce57c11b242f0f1599cf25c89d8cb02c45295a"
[[projects]]
branch = "master"
digest = "1:86c7b355731b7a7eb6cb38f1af9c7e025412c081ba76bffed9ba5381802d275a"
name = "golang.org/x/sys"
packages = [
"cpu",
......@@ -179,11 +226,13 @@
"windows/registry",
"windows/svc",
"windows/svc/eventlog",
"windows/svc/mgr"
"windows/svc/mgr",
]
revision = "3c6ecd8f22c6f40fbeec94c000a069d7d87c7624"
pruneopts = "UT"
revision = "904bdc257025c7b3f43c19360ad3ab85783fad78"
[[projects]]
digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18"
name = "golang.org/x/text"
packages = [
"collate",
......@@ -199,20 +248,50 @@
"unicode/bidi",
"unicode/cldr",
"unicode/norm",
"unicode/rangetable"
"unicode/rangetable",
]
pruneopts = "UT"
revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0"
version = "v0.3.0"
[[projects]]
digest = "1:c805e517269b0ba4c21ded5836019ed7d16953d4026cb7d00041d039c7906be9"
name = "gopkg.in/natefinch/lumberjack.v2"
packages = ["."]
pruneopts = "UT"
revision = "a96e63847dc3c67d17befa69c303767e2f84e54f"
version = "v2.1"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "2e3662737bdfec3295cf1f397f5584d97fbfd99973ab0351fafe66049bfa79bb"
input-imports = [
"github.com/BurntSushi/toml",
"github.com/VividCortex/ewma",
"github.com/agl/ed25519",
"github.com/coreos/go-systemd/activation",
"github.com/coreos/go-systemd/daemon",
"github.com/dchest/safefile",
"github.com/facebookgo/pidfile",
"github.com/hashicorp/go-immutable-radix",
"github.com/hashicorp/golang-lru",
"github.com/jedisct1/dlog",
"github.com/jedisct1/go-clocksmith",
"github.com/jedisct1/go-dnsstamps",
"github.com/jedisct1/go-minisign",
"github.com/jedisct1/xsecretbox",
"github.com/k-sone/critbitgo",
"github.com/kardianos/service",
"github.com/miekg/dns",
"golang.org/x/crypto/curve25519",
"golang.org/x/crypto/ed25519",
"golang.org/x/crypto/nacl/box",
"golang.org/x/crypto/nacl/secretbox",
"golang.org/x/net/http2",
"golang.org/x/net/proxy",
"golang.org/x/sys/unix",
"golang.org/x/sys/windows/svc/mgr",
"gopkg.in/natefinch/lumberjack.v2",
]
solver-name = "gps-cdcl"
solver-version = 1
[prune]
go-tests = true
unused-packages = true
[[constraint]]
name = "github.com/BurntSushi/toml"
version = "0.3.0"
......
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
This diff is collapsed.
This diff is collapsed.
package ewma
// Copyright (c) 2013 VividCortex, Inc. All rights reserved.
// Please see the LICENSE file for applicable license terms.
import (
"math"
"testing"
)
const testMargin = 0.00000001
var samples = [100]float64{
4599, 5711, 4746, 4621, 5037, 4218, 4925, 4281, 5207, 5203, 5594, 5149,
4948, 4994, 6056, 4417, 4973, 4714, 4964, 5280, 5074, 4913, 4119, 4522,
4631, 4341, 4909, 4750, 4663, 5167, 3683, 4964, 5151, 4892, 4171, 5097,
3546, 4144, 4551, 6557, 4234, 5026, 5220, 4144, 5547, 4747, 4732, 5327,
5442, 4176, 4907, 3570, 4684, 4161, 5206, 4952, 4317, 4819, 4668, 4603,
4885, 4645, 4401, 4362, 5035, 3954, 4738, 4545, 5433, 6326, 5927, 4983,
5364, 4598, 5071, 5231, 5250, 4621, 4269, 3953, 3308, 3623, 5264, 5322,
5395, 4753, 4936, 5315, 5243, 5060, 4989, 4921, 4480, 3426, 3687, 4220,
3197, 5139, 6101, 5279,
}
func withinMargin(a, b float64) bool {
return math.Abs(a-b) <= testMargin
}
func TestSimpleEWMA(t *testing.T) {
var e SimpleEWMA
for _, f := range samples {
e.Add(f)
}
if !withinMargin(e.Value(), 4734.500946466118) {
t.Errorf("e.Value() is %v, wanted %v", e.Value(), 4734.500946466118)
}
e.Set(1.0)
if e.Value() != 1.0 {
t.Errorf("e.Value() is %d", e.Value())
}
}
func TestVariableEWMA(t *testing.T) {
e := NewMovingAverage(30)
for _, f := range samples {
e.Add(f)
}
if !withinMargin(e.Value(), 4734.500946466118) {
t.Errorf("e.Value() is %v, wanted %v", e.Value(), 4734.500946466118)
}
e.Set(1.0)
if e.Value() != 1.0 {
t.Errorf("e.Value() is %d", e.Value())
}
}
func TestVariableEWMA2(t *testing.T) {
e := NewMovingAverage(5)
for _, f := range samples {
e.Add(f)
}
if !withinMargin(e.Value(), 5015.397367486725) {
t.Errorf("e.Value() is %v, wanted %v", e.Value(), 5015.397367486725)
}
}
func TestVariableEWMAWarmup(t *testing.T) {
e := NewMovingAverage(5)
for i, f := range samples {
e.Add(f)
// all values returned during warmup should be 0.0
if uint8(i) < WARMUP_SAMPLES {
if e.Value() != 0.0 {
t.Errorf("e.Value() is %v, expected %v", e.Value(), 0.0)
}
}
}
e = NewMovingAverage(5)
e.Set(5)
e.Add(1)
if e.Value() >= 5 {
t.Errorf("e.Value() is %d, expected it to decay towards 0", e.Value())
}
}
func TestVariableEWMAWarmup2(t *testing.T) {
e := NewMovingAverage(5)
testSamples := [12]float64{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10000, 1}
for i, f := range testSamples {
e.Add(f)
// all values returned during warmup should be 0.0
if uint8(i) < WARMUP_SAMPLES {
if e.Value() != 0.0 {
t.Errorf("e.Value() is %v, expected %v", e.Value(), 0.0)
}
}
}
if val := e.Value(); val == 1.0 {
t.Errorf("e.Value() is expected to be greater than %v", 1.0)
}
}
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
.vscode
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
*.prof
language: go
go:
- "1.8.x"
- "1.9.x"
- "1.10.x"
env:
- TRAVIS_GOARCH=amd64
- TRAVIS_GOARCH=386
before_install:
- export GOARCH=$TRAVIS_GOARCH
branches:
only:
- master
before_script:
- go get -u github.com/klauspost/asmfmt/cmd/asmfmt
script:
- diff -au <(gofmt -d .) <(printf "")
- diff -au <(asmfmt -d .) <(printf "")
- go test -v ./...
[![Godoc Reference](https://godoc.org/github.com/aead/chacha20?status.svg)](https://godoc.org/github.com/aead/chacha20)
[![Build Status](https://travis-ci.org/aead/chacha20.svg?branch=master)](https://travis-ci.org/aead/chacha20)
[![Go Report Card](https://goreportcard.com/badge/aead/chacha20)](https://goreportcard.com/report/aead/chacha20)
## The ChaCha20 stream cipher
ChaCha is a stream cipher family created by Daniel J. Bernstein.
The most common ChaCha variant is ChaCha20 (20 rounds). ChaCha20 is
standardized in [RFC 7539](https://tools.ietf.org/html/rfc7539 "RFC 7539").
This package provides implementations of three ChaCha versions:
- ChaCha20 with a 64 bit nonce (can en/decrypt up to 2^64 * 64 bytes for one key-nonce combination)
- ChaCha20 with a 96 bit nonce (can en/decrypt up to 2^32 * 64 bytes ~ 256 GB for one key-nonce combination)
- XChaCha20 with a 192 bit nonce (can en/decrypt up to 2^64 * 64 bytes for one key-nonce combination)
Furthermore the chacha sub package implements ChaCha20/12 and ChaCha20/8.
These versions use 12 or 8 rounds instead of 20.
But it's recommended to use ChaCha20 (with 20 rounds) - it will be fast enough for almost all purposes.
### Installation
Install in your GOPATH: `go get -u github.com/aead/chacha20`
### Requirements
All go versions >= 1.8.7 are supported.
The code may also work on Go 1.7 but this is not tested.
### Performance
#### AMD64
Hardware: Intel i7-6500U 2.50GHz x 2
System: Linux Ubuntu 16.04 - kernel: 4.4.0-62-generic
Go version: 1.8.0
```
AVX2
name speed cpb
ChaCha20_64-4 573MB/s ± 0% 4.16
ChaCha20_1K-4 2.19GB/s ± 0% 1.06
XChaCha20_64-4 261MB/s ± 0% 9.13
XChaCha20_1K-4 1.69GB/s ± 4% 1.37
XORKeyStream64-4 474MB/s ± 2% 5.02
XORKeyStream1K-4 2.09GB/s ± 1% 1.11
XChaCha20_XORKeyStream64-4 262MB/s ± 0% 9.09
XChaCha20_XORKeyStream1K-4 1.71GB/s ± 1% 1.36
SSSE3
name speed cpb
ChaCha20_64-4 583MB/s ± 0% 4.08
ChaCha20_1K-4 1.15GB/s ± 1% 2.02
XChaCha20_64-4 267MB/s ± 0% 8.92
XChaCha20_1K-4 984MB/s ± 5% 2.42
XORKeyStream64-4 492MB/s ± 1% 4.84
XORKeyStream1K-4 1.10GB/s ± 5% 2.11
XChaCha20_XORKeyStream64-4 266MB/s ± 0% 8.96
XChaCha20_XORKeyStream1K-4 1.00GB/s ± 2% 2.32
```
#### 386
Hardware: Intel i7-6500U 2.50GHz x 2
System: Linux Ubuntu 16.04 - kernel: 4.4.0-62-generic
Go version: 1.8.0
```
SSSE3
name                        speed cpb
ChaCha20_64-4               570MB/s ± 0% 4.18
ChaCha20_1K-4               650MB/s ± 0% 3.66
XChaCha20_64-4              223MB/s ± 0% 10.69
XChaCha20_1K-4              584MB/s ± 1% 4.08
XORKeyStream64-4            392MB/s ± 1% 6.08
XORKeyStream1K-4            629MB/s ± 1% 3.79
XChaCha20_XORKeyStream64-4  222MB/s ± 0% 10.73
XChaCha20_XORKeyStream1K-4  585MB/s ± 0% 4.07
SSE2
name speed cpb
ChaCha20_64-4 509MB/s ± 0% 4.68
ChaCha20_1K-4 553MB/s ± 2% 4.31
XChaCha20_64-4 201MB/s ± 0% 11.86
XChaCha20_1K-4 498MB/s ± 4% 4.78
XORKeyStream64-4 359MB/s ± 1% 6.64
XORKeyStream1K-4 545MB/s ± 0% 4.37
XChaCha20_XORKeyStream64-4 201MB/s ± 1% 11.86
XChaCha20_XORKeyStream1K-4 507MB/s ± 0% 4.70
```
......@@ -9,6 +9,7 @@ package chacha // import "github.com/aead/chacha20/chacha"
import (