From 708f5f977ad61f6729722b221122381b245ab44e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Feb 2023 02:48:44 +0000 Subject: [PATCH] build(deps): bump golang.org/x/text from 0.3.2 to 0.3.8 Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.2 to 0.3.8. - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.3.2...v0.3.8) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 9 +- go.sum | 43 +- .../gopherjs/gopherjs/build/build.go | 875 -- .../gopherjs/compiler/analysis/bool.go | 43 - .../gopherjs/compiler/analysis/break.go | 32 - .../gopherjs/compiler/analysis/escape.go | 70 - .../gopherjs/compiler/analysis/info.go | 254 - .../gopherjs/compiler/analysis/sideeffect.go | 37 - .../gopherjs/compiler/astutil/astutil.go | 48 - .../gopherjs/gopherjs/compiler/compiler.go | 297 - .../gopherjs/gopherjs/compiler/expressions.go | 1373 --- .../gopherjs/compiler/filter/assign.go | 106 - .../gopherjs/compiler/filter/incdecstmt.go | 39 - .../gopherjs/compiler/gopherjspkg/doc.go | 12 - .../gopherjs/compiler/gopherjspkg/fs.go | 31 - .../compiler/gopherjspkg/fs_vfsdata.go | 232 - .../gopherjs/gopherjs/compiler/natives/doc.go | 8 - .../gopherjs/gopherjs/compiler/natives/fs.go | 29 - .../gopherjs/compiler/natives/fs_vfsdata.go | 1056 --- .../gopherjs/gopherjs/compiler/package.go | 809 -- .../gopherjs/compiler/prelude/genmin.go | 63 - .../gopherjs/compiler/prelude/goroutines.go | 358 - .../gopherjs/compiler/prelude/jsmapping.go | 379 - .../gopherjs/compiler/prelude/numeric.go | 196 - .../gopherjs/compiler/prelude/prelude.go | 425 - .../gopherjs/compiler/prelude/prelude_min.go | 6 - .../gopherjs/compiler/prelude/types.go | 747 -- .../compiler/prelude/uglifyjs_options.json | 98 - .../gopherjs/gopherjs/compiler/statements.go | 786 -- .../gopherjs/compiler/typesutil/typesutil.go | 16 - .../gopherjs/gopherjs/compiler/utils.go | 673 -- .../gopherjs/compiler/version_check.go | 9 - .../gopherjs/internal/sysutil/sysutil.go | 13 - .../internal/sysutil/sysutil_windows.go | 7 - .../gopherjs/gopherjs/nosync/map.go | 67 - .../gopherjs/gopherjs/nosync/mutex.go | 85 - .../gopherjs/gopherjs/nosync/once.go | 39 - .../gopherjs/gopherjs/nosync/pool.go | 63 - vendor/github.com/gopherjs/gopherjs/tool.go | 963 -- vendor/github.com/gopherjs/jquery/jquery.go | 16 +- vendor/github.com/gopherjs/jsbuiltin/LICENSE | 24 - .../github.com/gopherjs/jsbuiltin/README.md | 103 - .../gopherjs/jsbuiltin/jsbuiltin.go | 98 - .../gopherjs/jsbuiltin/jsbuiltin.inc.js | 5 - vendor/github.com/lib/pq/oid/gen.go | 93 - vendor/github.com/miekg/dns/msg_generate.go | 340 - vendor/github.com/miekg/dns/types_generate.go | 271 - vendor/github.com/neelance/astrewrite/LICENSE | 24 - .../neelance/astrewrite/simplify.go | 835 -- vendor/golang.org/x/crypto/acme/acme.go | 335 +- .../x/crypto/acme/autocert/autocert.go | 317 +- .../x/crypto/acme/autocert/cache.go | 8 +- .../x/crypto/acme/autocert/listener.go | 2 - vendor/golang.org/x/crypto/acme/http.go | 50 +- vendor/golang.org/x/crypto/acme/jws.go | 131 +- vendor/golang.org/x/crypto/acme/rfc8555.go | 438 + vendor/golang.org/x/crypto/acme/types.go | 387 +- .../golang.org/x/crypto/acme/version_go112.go | 28 + vendor/golang.org/x/crypto/blowfish/block.go | 159 + vendor/golang.org/x/crypto/blowfish/cipher.go | 99 + vendor/golang.org/x/crypto/blowfish/const.go | 199 + .../x/crypto/chacha20/chacha_arm64.go | 17 + .../asm_arm64.s => chacha20/chacha_arm64.s} | 4 +- .../x/crypto/chacha20/chacha_generic.go | 398 + .../x/crypto/chacha20/chacha_noasm.go | 14 + .../x/crypto/chacha20/chacha_ppc64le.go | 17 + .../x/crypto/chacha20/chacha_ppc64le.s | 450 + .../x/crypto/chacha20/chacha_s390x.go | 27 + .../{internal => }/chacha20/chacha_s390x.s | 41 +- .../x/crypto/{internal => }/chacha20/xor.go | 21 +- .../x/crypto/curve25519/const_amd64.h | 8 - .../x/crypto/curve25519/const_amd64.s | 20 - .../x/crypto/curve25519/cswap_amd64.s | 65 - .../x/crypto/curve25519/curve25519.go | 925 +- vendor/golang.org/x/crypto/curve25519/doc.go | 23 - .../x/crypto/curve25519/freeze_amd64.s | 73 - .../x/crypto/curve25519/internal/field/README | 7 + .../x/crypto/curve25519/internal/field/fe.go | 416 + .../curve25519/internal/field/fe_amd64.go | 13 + .../curve25519/internal/field/fe_amd64.s | 379 + .../internal/field/fe_amd64_noasm.go | 12 + .../curve25519/internal/field/fe_arm64.go | 16 + .../curve25519/internal/field/fe_arm64.s | 43 + .../internal/field/fe_arm64_noasm.go | 12 + .../curve25519/internal/field/fe_generic.go | 264 + .../curve25519/internal/field/sync.checkpoint | 1 + .../crypto/curve25519/internal/field/sync.sh | 19 + .../x/crypto/curve25519/ladderstep_amd64.s | 1377 --- .../x/crypto/curve25519/mont25519_amd64.go | 240 - .../x/crypto/curve25519/mul_amd64.s | 169 - .../x/crypto/curve25519/square_amd64.s | 132 - vendor/golang.org/x/crypto/ed25519/ed25519.go | 6 + .../x/crypto/ed25519/ed25519_go113.go | 74 + .../crypto/internal/chacha20/chacha_arm64.go | 31 - .../internal/chacha20/chacha_generic.go | 264 - .../crypto/internal/chacha20/chacha_noasm.go | 16 - .../crypto/internal/chacha20/chacha_s390x.go | 29 - .../x/crypto/internal/poly1305/bits_compat.go | 40 + .../x/crypto/internal/poly1305/bits_go1.13.go | 22 + .../{ => internal}/poly1305/mac_noasm.go | 5 +- .../{ => internal}/poly1305/poly1305.go | 36 +- .../x/crypto/internal/poly1305/sum_amd64.go | 48 + .../{ => internal}/poly1305/sum_amd64.s | 43 +- .../x/crypto/internal/poly1305/sum_generic.go | 310 + .../x/crypto/internal/poly1305/sum_ppc64le.go | 48 + .../x/crypto/internal/poly1305/sum_ppc64le.s | 182 + .../x/crypto/internal/poly1305/sum_s390x.go | 76 + .../x/crypto/internal/poly1305/sum_s390x.s | 504 ++ .../x/crypto/internal/subtle/aliasing.go | 3 +- ...iasing_appengine.go => aliasing_purego.go} | 3 +- .../x/crypto/nacl/secretbox/secretbox.go | 2 +- .../x/crypto/openpgp/armor/armor.go | 27 +- .../x/crypto/openpgp/elgamal/elgamal.go | 10 +- .../x/crypto/openpgp/errors/errors.go | 6 + .../x/crypto/openpgp/packet/encrypted_key.go | 6 +- .../x/crypto/openpgp/packet/packet.go | 73 +- .../x/crypto/openpgp/packet/private_key.go | 2 +- vendor/golang.org/x/crypto/openpgp/read.go | 6 + vendor/golang.org/x/crypto/openpgp/s2k/s2k.go | 6 + .../golang.org/x/crypto/poly1305/sum_amd64.go | 68 - .../golang.org/x/crypto/poly1305/sum_arm.go | 22 - vendor/golang.org/x/crypto/poly1305/sum_arm.s | 427 - .../x/crypto/poly1305/sum_generic.go | 172 - .../golang.org/x/crypto/poly1305/sum_noasm.go | 16 - .../golang.org/x/crypto/poly1305/sum_s390x.go | 42 - .../golang.org/x/crypto/poly1305/sum_s390x.s | 378 - .../x/crypto/poly1305/sum_vmsl_s390x.s | 909 -- .../x/crypto/salsa20/salsa/salsa20_amd64.go | 3 +- .../x/crypto/salsa20/salsa/salsa20_amd64.s | 238 +- .../x/crypto/salsa20/salsa/salsa20_noasm.go | 3 +- vendor/golang.org/x/crypto/scrypt/scrypt.go | 23 +- vendor/golang.org/x/crypto/ssh/certs.go | 39 +- vendor/golang.org/x/crypto/ssh/cipher.go | 55 +- vendor/golang.org/x/crypto/ssh/client.go | 2 +- vendor/golang.org/x/crypto/ssh/client_auth.go | 24 +- vendor/golang.org/x/crypto/ssh/common.go | 17 +- .../ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go | 93 + vendor/golang.org/x/crypto/ssh/kex.go | 244 +- vendor/golang.org/x/crypto/ssh/keys.go | 482 +- vendor/golang.org/x/crypto/ssh/messages.go | 30 + vendor/golang.org/x/crypto/ssh/mux.go | 23 +- vendor/golang.org/x/crypto/ssh/server.go | 14 +- vendor/golang.org/x/image/draw/gen.go | 1404 --- vendor/golang.org/x/net/AUTHORS | 3 - vendor/golang.org/x/net/CONTRIBUTORS | 3 - vendor/golang.org/x/net/context/context.go | 6 +- vendor/golang.org/x/net/context/go17.go | 11 +- vendor/golang.org/x/net/context/go19.go | 1 + vendor/golang.org/x/net/context/pre_go17.go | 11 +- vendor/golang.org/x/net/context/pre_go19.go | 1 + vendor/golang.org/x/net/html/atom/gen.go | 712 -- vendor/golang.org/x/net/html/const.go | 3 +- vendor/golang.org/x/net/html/foreign.go | 120 +- vendor/golang.org/x/net/html/node.go | 5 + vendor/golang.org/x/net/html/parse.go | 337 +- vendor/golang.org/x/net/html/render.go | 34 +- vendor/golang.org/x/net/html/token.go | 9 +- .../golang.org/x/net/http/httpguts/httplex.go | 64 +- vendor/golang.org/x/net/http2/Dockerfile | 2 +- vendor/golang.org/x/net/http2/README | 20 - vendor/golang.org/x/net/http2/ascii.go | 53 + .../x/net/http2/client_conn_pool.go | 129 +- vendor/golang.org/x/net/http2/errors.go | 14 +- vendor/golang.org/x/net/http2/flow.go | 2 + vendor/golang.org/x/net/http2/frame.go | 65 +- vendor/golang.org/x/net/http2/go111.go | 1 + vendor/golang.org/x/net/http2/go115.go | 27 + vendor/golang.org/x/net/http2/go118.go | 17 + vendor/golang.org/x/net/http2/headermap.go | 7 +- vendor/golang.org/x/net/http2/hpack/encode.go | 2 +- .../golang.org/x/net/http2/hpack/huffman.go | 132 +- vendor/golang.org/x/net/http2/http2.go | 27 +- vendor/golang.org/x/net/http2/not_go111.go | 1 + vendor/golang.org/x/net/http2/not_go115.go | 31 + vendor/golang.org/x/net/http2/not_go118.go | 17 + vendor/golang.org/x/net/http2/pipe.go | 18 +- vendor/golang.org/x/net/http2/server.go | 438 +- vendor/golang.org/x/net/http2/transport.go | 1809 ++-- vendor/golang.org/x/net/http2/write.go | 7 +- vendor/golang.org/x/net/http2/writesched.go | 10 +- .../x/net/http2/writesched_priority.go | 11 +- .../x/net/http2/writesched_random.go | 15 +- vendor/golang.org/x/net/idna/go118.go | 14 + vendor/golang.org/x/net/idna/idna10.0.0.go | 118 +- vendor/golang.org/x/net/idna/idna9.0.0.go | 98 +- vendor/golang.org/x/net/idna/pre_go118.go | 12 + vendor/golang.org/x/net/idna/punycode.go | 36 +- vendor/golang.org/x/net/idna/tables10.0.0.go | 1 + vendor/golang.org/x/net/idna/tables11.0.0.go | 3 +- vendor/golang.org/x/net/idna/tables12.0.0.go | 4734 ++++++++++ vendor/golang.org/x/net/idna/tables13.0.0.go | 4840 ++++++++++ vendor/golang.org/x/net/idna/tables9.0.0.go | 1 + vendor/golang.org/x/net/idna/trieval.go | 34 +- .../x/net/internal/timeseries/timeseries.go | 6 +- vendor/golang.org/x/net/xsrftoken/xsrf.go | 17 +- vendor/golang.org/x/sync/AUTHORS | 3 - vendor/golang.org/x/sync/CONTRIBUTORS | 3 - vendor/golang.org/x/sync/errgroup/errgroup.go | 70 +- .../golang.org/x/sync/semaphore/semaphore.go | 11 +- vendor/golang.org/x/sys/AUTHORS | 3 - vendor/golang.org/x/sys/CONTRIBUTORS | 3 - vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s | 18 + vendor/golang.org/x/sys/cpu/byteorder.go | 50 +- vendor/golang.org/x/sys/cpu/cpu.go | 207 +- .../sys/cpu/{cpu_aix_ppc64.go => cpu_aix.go} | 8 +- vendor/golang.org/x/sys/cpu/cpu_arm.go | 66 +- vendor/golang.org/x/sys/cpu/cpu_arm64.go | 172 + vendor/golang.org/x/sys/cpu/cpu_arm64.s | 32 + vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go | 12 + vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go | 3 +- vendor/golang.org/x/sys/cpu/cpu_gc_x86.go | 3 +- .../golang.org/x/sys/cpu/cpu_gccgo_arm64.go | 12 + .../golang.org/x/sys/cpu/cpu_gccgo_s390x.go | 1 + .../sys/cpu/{cpu_gccgo.c => cpu_gccgo_x86.c} | 29 +- .../cpu/{cpu_gccgo.go => cpu_gccgo_x86.go} | 7 + vendor/golang.org/x/sys/cpu/cpu_linux.go | 51 +- vendor/golang.org/x/sys/cpu/cpu_linux_arm.go | 39 + .../golang.org/x/sys/cpu/cpu_linux_arm64.go | 8 +- .../golang.org/x/sys/cpu/cpu_linux_mips64x.go | 24 + .../golang.org/x/sys/cpu/cpu_linux_noinit.go | 10 + .../golang.org/x/sys/cpu/cpu_linux_ppc64x.go | 3 +- .../golang.org/x/sys/cpu/cpu_linux_s390x.go | 123 +- vendor/golang.org/x/sys/cpu/cpu_loong64.go | 13 + vendor/golang.org/x/sys/cpu/cpu_mips64x.go | 7 +- vendor/golang.org/x/sys/cpu/cpu_mipsx.go | 3 +- .../golang.org/x/sys/cpu/cpu_netbsd_arm64.go | 173 + vendor/golang.org/x/sys/cpu/cpu_other_arm.go | 10 + .../golang.org/x/sys/cpu/cpu_other_arm64.go | 5 +- .../golang.org/x/sys/cpu/cpu_other_mips64x.go | 13 + .../golang.org/x/sys/cpu/cpu_other_riscv64.go | 12 + vendor/golang.org/x/sys/cpu/cpu_ppc64x.go | 17 + .../mkerrors.go => cpu/cpu_riscv64.go} | 9 +- vendor/golang.org/x/sys/cpu/cpu_s390x.go | 172 + vendor/golang.org/x/sys/cpu/cpu_s390x.s | 3 +- vendor/golang.org/x/sys/cpu/cpu_wasm.go | 5 +- vendor/golang.org/x/sys/cpu/cpu_x86.go | 92 +- vendor/golang.org/x/sys/cpu/cpu_x86.s | 3 +- vendor/golang.org/x/sys/cpu/cpu_zos.go | 10 + vendor/golang.org/x/sys/cpu/cpu_zos_s390x.go | 25 + vendor/golang.org/x/sys/cpu/hwcap_linux.go | 56 + .../golang.org/x/sys/cpu/syscall_aix_gccgo.go | 27 + .../x/sys/cpu/syscall_aix_ppc64_gc.go | 36 + .../sys/internal/unsafeheader/unsafeheader.go | 30 + vendor/golang.org/x/sys/unix/README.md | 21 +- .../golang.org/x/sys/unix/affinity_linux.go | 42 +- vendor/golang.org/x/sys/unix/aliases.go | 3 +- vendor/golang.org/x/sys/unix/asm_aix_ppc64.s | 3 +- .../unix/{asm_darwin_386.s => asm_bsd_386.s} | 12 +- .../{asm_darwin_amd64.s => asm_bsd_amd64.s} | 10 +- .../unix/{asm_netbsd_arm.s => asm_bsd_arm.s} | 10 +- .../{asm_netbsd_amd64.s => asm_bsd_arm64.s} | 10 +- ...{asm_openbsd_amd64.s => asm_bsd_riscv64.s} | 10 +- vendor/golang.org/x/sys/unix/asm_darwin_arm.s | 30 - .../golang.org/x/sys/unix/asm_darwin_arm64.s | 30 - .../x/sys/unix/asm_dragonfly_amd64.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_386.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_amd64.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_arm.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_arm64.s | 29 - vendor/golang.org/x/sys/unix/asm_linux_386.s | 3 +- .../golang.org/x/sys/unix/asm_linux_amd64.s | 3 +- vendor/golang.org/x/sys/unix/asm_linux_arm.s | 3 +- .../golang.org/x/sys/unix/asm_linux_arm64.s | 3 +- .../golang.org/x/sys/unix/asm_linux_loong64.s | 54 + .../golang.org/x/sys/unix/asm_linux_mips64x.s | 3 +- .../golang.org/x/sys/unix/asm_linux_mipsx.s | 3 +- .../golang.org/x/sys/unix/asm_linux_ppc64x.s | 3 +- .../golang.org/x/sys/unix/asm_linux_riscv64.s | 49 + .../golang.org/x/sys/unix/asm_linux_s390x.s | 5 +- vendor/golang.org/x/sys/unix/asm_netbsd_386.s | 29 - .../golang.org/x/sys/unix/asm_netbsd_arm64.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_386.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_arm.s | 29 - ...m_openbsd_arm64.s => asm_openbsd_mips64.s} | 5 +- .../golang.org/x/sys/unix/asm_solaris_amd64.s | 3 +- vendor/golang.org/x/sys/unix/asm_zos_s390x.s | 426 + .../golang.org/x/sys/unix/bluetooth_linux.go | 1 + vendor/golang.org/x/sys/unix/cap_freebsd.go | 1 + vendor/golang.org/x/sys/unix/constants.go | 3 +- vendor/golang.org/x/sys/unix/dev_aix_ppc.go | 4 +- vendor/golang.org/x/sys/unix/dev_aix_ppc64.go | 4 +- vendor/golang.org/x/sys/unix/dev_zos.go | 29 + vendor/golang.org/x/sys/unix/dirent.go | 92 +- vendor/golang.org/x/sys/unix/endian_big.go | 3 +- vendor/golang.org/x/sys/unix/endian_little.go | 3 +- vendor/golang.org/x/sys/unix/env_unix.go | 3 +- vendor/golang.org/x/sys/unix/epoll_zos.go | 221 + .../x/sys/unix/errors_freebsd_386.go | 227 - .../x/sys/unix/errors_freebsd_amd64.go | 227 - .../x/sys/unix/errors_freebsd_arm.go | 226 - vendor/golang.org/x/sys/unix/fcntl.go | 13 +- vendor/golang.org/x/sys/unix/fcntl_darwin.go | 6 + .../x/sys/unix/fcntl_linux_32bit.go | 5 +- vendor/golang.org/x/sys/unix/fdset.go | 30 + vendor/golang.org/x/sys/unix/fstatfs_zos.go | 164 + vendor/golang.org/x/sys/unix/gccgo.go | 6 +- vendor/golang.org/x/sys/unix/gccgo_c.c | 6 + .../x/sys/unix/gccgo_linux_amd64.go | 1 + vendor/golang.org/x/sys/unix/ifreq_linux.go | 142 + vendor/golang.org/x/sys/unix/ioctl.go | 51 +- vendor/golang.org/x/sys/unix/ioctl_linux.go | 219 + vendor/golang.org/x/sys/unix/ioctl_zos.go | 74 + vendor/golang.org/x/sys/unix/mkall.sh | 57 +- vendor/golang.org/x/sys/unix/mkasm_darwin.go | 61 - vendor/golang.org/x/sys/unix/mkerrors.sh | 170 +- vendor/golang.org/x/sys/unix/mkpost.go | 122 - vendor/golang.org/x/sys/unix/mksyscall.go | 407 - .../x/sys/unix/mksyscall_aix_ppc.go | 415 - .../x/sys/unix/mksyscall_aix_ppc64.go | 614 -- .../x/sys/unix/mksyscall_solaris.go | 335 - .../golang.org/x/sys/unix/mksysctl_openbsd.go | 355 - vendor/golang.org/x/sys/unix/mksysnum.go | 190 - vendor/golang.org/x/sys/unix/pagesize_unix.go | 1 + vendor/golang.org/x/sys/unix/ptrace_darwin.go | 12 + vendor/golang.org/x/sys/unix/ptrace_ios.go | 12 + vendor/golang.org/x/sys/unix/race.go | 1 + vendor/golang.org/x/sys/unix/race0.go | 3 +- .../x/sys/unix/readdirent_getdents.go | 13 + .../x/sys/unix/readdirent_getdirentries.go | 20 + .../x/sys/unix/sockcmsg_dragonfly.go | 16 + .../golang.org/x/sys/unix/sockcmsg_linux.go | 51 +- vendor/golang.org/x/sys/unix/sockcmsg_unix.go | 39 +- .../x/sys/unix/sockcmsg_unix_other.go | 47 + vendor/golang.org/x/sys/unix/str.go | 1 + vendor/golang.org/x/sys/unix/syscall.go | 46 +- vendor/golang.org/x/sys/unix/syscall_aix.go | 136 +- .../golang.org/x/sys/unix/syscall_aix_ppc.go | 8 +- .../x/sys/unix/syscall_aix_ppc64.go | 8 +- vendor/golang.org/x/sys/unix/syscall_bsd.go | 181 +- .../x/sys/unix/syscall_darwin.1_12.go | 32 + .../x/sys/unix/syscall_darwin.1_13.go | 108 + .../golang.org/x/sys/unix/syscall_darwin.go | 368 +- .../x/sys/unix/syscall_darwin_386.go | 63 - .../x/sys/unix/syscall_darwin_amd64.go | 26 +- .../x/sys/unix/syscall_darwin_arm.go | 64 - .../x/sys/unix/syscall_darwin_arm64.go | 29 +- .../x/sys/unix/syscall_darwin_libSystem.go | 12 +- .../x/sys/unix/syscall_dragonfly.go | 133 +- .../x/sys/unix/syscall_dragonfly_amd64.go | 5 + .../golang.org/x/sys/unix/syscall_freebsd.go | 420 +- .../x/sys/unix/syscall_freebsd_386.go | 15 + .../x/sys/unix/syscall_freebsd_amd64.go | 15 + .../x/sys/unix/syscall_freebsd_arm.go | 11 + .../x/sys/unix/syscall_freebsd_arm64.go | 11 + .../x/sys/unix/syscall_freebsd_riscv64.go | 63 + .../golang.org/x/sys/unix/syscall_illumos.go | 185 + vendor/golang.org/x/sys/unix/syscall_linux.go | 1084 ++- .../x/sys/unix/syscall_linux_386.go | 70 +- .../x/sys/unix/syscall_linux_alarm.go | 14 + .../x/sys/unix/syscall_linux_amd64.go | 63 +- .../x/sys/unix/syscall_linux_amd64_gc.go | 4 +- .../x/sys/unix/syscall_linux_arm.go | 69 +- .../x/sys/unix/syscall_linux_arm64.go | 76 +- .../golang.org/x/sys/unix/syscall_linux_gc.go | 3 +- .../x/sys/unix/syscall_linux_gc_386.go | 3 +- .../x/sys/unix/syscall_linux_gc_arm.go | 14 + .../x/sys/unix/syscall_linux_gccgo_386.go | 1 + .../x/sys/unix/syscall_linux_gccgo_arm.go | 1 + .../x/sys/unix/syscall_linux_loong64.go | 226 + .../x/sys/unix/syscall_linux_mips64x.go | 49 +- .../x/sys/unix/syscall_linux_mipsx.go | 57 +- .../x/sys/unix/syscall_linux_ppc.go | 236 + .../x/sys/unix/syscall_linux_ppc64x.go | 52 +- .../x/sys/unix/syscall_linux_riscv64.go | 66 +- .../x/sys/unix/syscall_linux_s390x.go | 64 +- .../x/sys/unix/syscall_linux_sparc64.go | 51 +- .../golang.org/x/sys/unix/syscall_netbsd.go | 139 +- .../x/sys/unix/syscall_netbsd_386.go | 5 + .../x/sys/unix/syscall_netbsd_amd64.go | 5 + .../x/sys/unix/syscall_netbsd_arm.go | 5 + .../x/sys/unix/syscall_netbsd_arm64.go | 5 + .../golang.org/x/sys/unix/syscall_openbsd.go | 131 +- .../x/sys/unix/syscall_openbsd_386.go | 5 + .../x/sys/unix/syscall_openbsd_amd64.go | 5 + .../x/sys/unix/syscall_openbsd_arm.go | 5 + .../x/sys/unix/syscall_openbsd_arm64.go | 5 + .../x/sys/unix/syscall_openbsd_mips64.go | 39 + .../golang.org/x/sys/unix/syscall_solaris.go | 456 +- .../x/sys/unix/syscall_solaris_amd64.go | 5 + vendor/golang.org/x/sys/unix/syscall_unix.go | 145 +- .../golang.org/x/sys/unix/syscall_unix_gc.go | 5 +- .../x/sys/unix/syscall_unix_gc_ppc64x.go | 3 +- .../x/sys/unix/syscall_zos_s390x.go | 1823 ++++ vendor/golang.org/x/sys/unix/sysvshm_linux.go | 21 + vendor/golang.org/x/sys/unix/sysvshm_unix.go | 61 + .../x/sys/unix/sysvshm_unix_other.go | 14 + vendor/golang.org/x/sys/unix/timestruct.go | 29 +- vendor/golang.org/x/sys/unix/types_aix.go | 237 - vendor/golang.org/x/sys/unix/types_darwin.go | 283 - .../golang.org/x/sys/unix/types_dragonfly.go | 263 - vendor/golang.org/x/sys/unix/types_freebsd.go | 356 - vendor/golang.org/x/sys/unix/types_netbsd.go | 289 - vendor/golang.org/x/sys/unix/types_openbsd.go | 282 - vendor/golang.org/x/sys/unix/types_solaris.go | 266 - vendor/golang.org/x/sys/unix/xattr_bsd.go | 1 + .../golang.org/x/sys/unix/zerrors_aix_ppc.go | 13 +- .../x/sys/unix/zerrors_aix_ppc64.go | 13 +- .../x/sys/unix/zerrors_darwin_amd64.go | 3047 +++---- .../x/sys/unix/zerrors_darwin_arm.go | 1783 ---- .../x/sys/unix/zerrors_darwin_arm64.go | 3047 +++---- .../x/sys/unix/zerrors_dragonfly_amd64.go | 140 +- .../x/sys/unix/zerrors_freebsd_386.go | 284 +- .../x/sys/unix/zerrors_freebsd_amd64.go | 280 +- .../x/sys/unix/zerrors_freebsd_arm.go | 260 +- .../x/sys/unix/zerrors_freebsd_arm64.go | 274 +- .../x/sys/unix/zerrors_freebsd_riscv64.go | 2148 +++++ vendor/golang.org/x/sys/unix/zerrors_linux.go | 3457 ++++++++ .../x/sys/unix/zerrors_linux_386.go | 3133 ++----- .../x/sys/unix/zerrors_linux_amd64.go | 3133 ++----- .../x/sys/unix/zerrors_linux_arm.go | 3145 ++----- .../x/sys/unix/zerrors_linux_arm64.go | 3122 ++----- .../x/sys/unix/zerrors_linux_loong64.go | 818 ++ .../x/sys/unix/zerrors_linux_mips.go | 3137 ++----- .../x/sys/unix/zerrors_linux_mips64.go | 3137 ++----- .../x/sys/unix/zerrors_linux_mips64le.go | 3137 ++----- .../x/sys/unix/zerrors_linux_mipsle.go | 3137 ++----- .../x/sys/unix/zerrors_linux_ppc.go | 887 ++ .../x/sys/unix/zerrors_linux_ppc64.go | 3256 ++----- .../x/sys/unix/zerrors_linux_ppc64le.go | 3256 ++----- .../x/sys/unix/zerrors_linux_riscv64.go | 3107 ++----- .../x/sys/unix/zerrors_linux_s390x.go | 3255 ++----- .../x/sys/unix/zerrors_linux_sparc64.go | 3234 ++----- .../x/sys/unix/zerrors_netbsd_386.go | 10 +- .../x/sys/unix/zerrors_netbsd_amd64.go | 10 +- .../x/sys/unix/zerrors_netbsd_arm.go | 10 +- .../x/sys/unix/zerrors_netbsd_arm64.go | 10 +- .../x/sys/unix/zerrors_openbsd_386.go | 28 +- .../x/sys/unix/zerrors_openbsd_amd64.go | 14 +- .../x/sys/unix/zerrors_openbsd_arm.go | 22 +- .../x/sys/unix/zerrors_openbsd_arm64.go | 9 + ...arwin_386.go => zerrors_openbsd_mips64.go} | 1666 ++-- .../x/sys/unix/zerrors_solaris_amd64.go | 29 +- .../x/sys/unix/zerrors_zos_s390x.go | 860 ++ ...acearm_linux.go => zptrace_armnn_linux.go} | 3 +- .../x/sys/unix/zptrace_linux_arm64.go | 17 + ...emips_linux.go => zptrace_mipsnn_linux.go} | 3 +- ...sle_linux.go => zptrace_mipsnnle_linux.go} | 3 +- ...trace386_linux.go => zptrace_x86_linux.go} | 3 +- .../golang.org/x/sys/unix/zsyscall_aix_ppc.go | 27 +- .../x/sys/unix/zsyscall_aix_ppc64.go | 25 +- .../x/sys/unix/zsyscall_aix_ppc64_gc.go | 24 +- .../x/sys/unix/zsyscall_aix_ppc64_gccgo.go | 22 +- .../x/sys/unix/zsyscall_darwin_386.1_11.go | 1810 ---- .../x/sys/unix/zsyscall_darwin_386.go | 2505 ------ .../x/sys/unix/zsyscall_darwin_386.s | 284 - .../x/sys/unix/zsyscall_darwin_amd64.1_13.go | 40 + .../x/sys/unix/zsyscall_darwin_amd64.1_13.s | 25 + .../x/sys/unix/zsyscall_darwin_amd64.go | 1033 ++- .../x/sys/unix/zsyscall_darwin_amd64.s | 897 +- .../x/sys/unix/zsyscall_darwin_arm.1_11.go | 1793 ---- .../x/sys/unix/zsyscall_darwin_arm.go | 2483 ------ .../x/sys/unix/zsyscall_darwin_arm.s | 282 - .../x/sys/unix/zsyscall_darwin_arm64.1_13.go | 40 + .../x/sys/unix/zsyscall_darwin_arm64.1_13.s | 25 + .../x/sys/unix/zsyscall_darwin_arm64.go | 1022 +-- .../x/sys/unix/zsyscall_darwin_arm64.s | 895 +- .../x/sys/unix/zsyscall_dragonfly_amd64.go | 78 +- .../x/sys/unix/zsyscall_freebsd_386.go | 204 +- .../x/sys/unix/zsyscall_freebsd_amd64.go | 202 +- .../x/sys/unix/zsyscall_freebsd_arm.go | 204 +- .../x/sys/unix/zsyscall_freebsd_arm64.go | 204 +- ...64.1_11.go => zsyscall_freebsd_riscv64.go} | 567 +- .../x/sys/unix/zsyscall_illumos_amd64.go | 128 + .../golang.org/x/sys/unix/zsyscall_linux.go | 2153 +++++ .../x/sys/unix/zsyscall_linux_386.go | 1747 +--- .../x/sys/unix/zsyscall_linux_amd64.go | 1787 +--- .../x/sys/unix/zsyscall_linux_arm.go | 1767 +--- .../x/sys/unix/zsyscall_linux_arm64.go | 1723 +--- .../x/sys/unix/zsyscall_linux_loong64.go | 527 ++ .../x/sys/unix/zsyscall_linux_mips.go | 1766 +--- .../x/sys/unix/zsyscall_linux_mips64.go | 1737 +--- .../x/sys/unix/zsyscall_linux_mips64le.go | 1740 +--- .../x/sys/unix/zsyscall_linux_mipsle.go | 1766 +--- .../x/sys/unix/zsyscall_linux_ppc.go | 709 ++ .../x/sys/unix/zsyscall_linux_ppc64.go | 1780 +--- .../x/sys/unix/zsyscall_linux_ppc64le.go | 1780 +--- .../x/sys/unix/zsyscall_linux_riscv64.go | 1719 +--- .../x/sys/unix/zsyscall_linux_s390x.go | 1749 +--- .../x/sys/unix/zsyscall_linux_sparc64.go | 1747 +--- .../x/sys/unix/zsyscall_netbsd_386.go | 96 +- .../x/sys/unix/zsyscall_netbsd_amd64.go | 96 +- .../x/sys/unix/zsyscall_netbsd_arm.go | 96 +- .../x/sys/unix/zsyscall_netbsd_arm64.go | 96 +- .../x/sys/unix/zsyscall_openbsd_386.go | 69 +- .../x/sys/unix/zsyscall_openbsd_amd64.go | 69 +- .../x/sys/unix/zsyscall_openbsd_arm.go | 69 +- .../x/sys/unix/zsyscall_openbsd_arm64.go | 69 +- ...m64.1_11.go => zsyscall_openbsd_mips64.go} | 550 +- .../x/sys/unix/zsyscall_solaris_amd64.go | 140 +- .../x/sys/unix/zsyscall_zos_s390x.go | 1255 +++ .../x/sys/unix/zsysctl_openbsd_386.go | 4 +- .../x/sys/unix/zsysctl_openbsd_amd64.go | 2 + .../x/sys/unix/zsysctl_openbsd_arm.go | 2 + .../x/sys/unix/zsysctl_openbsd_arm64.go | 1 + .../x/sys/unix/zsysctl_openbsd_mips64.go | 280 + .../x/sys/unix/zsysnum_darwin_386.go | 436 - .../x/sys/unix/zsysnum_darwin_amd64.go | 2 + .../x/sys/unix/zsysnum_darwin_arm.go | 436 - .../x/sys/unix/zsysnum_darwin_arm64.go | 2 + .../x/sys/unix/zsysnum_dragonfly_amd64.go | 256 +- .../x/sys/unix/zsysnum_freebsd_386.go | 121 +- .../x/sys/unix/zsysnum_freebsd_amd64.go | 121 +- .../x/sys/unix/zsysnum_freebsd_arm.go | 121 +- .../x/sys/unix/zsysnum_freebsd_arm64.go | 461 +- .../x/sys/unix/zsysnum_freebsd_riscv64.go | 394 + .../x/sys/unix/zsysnum_linux_386.go | 24 + .../x/sys/unix/zsysnum_linux_amd64.go | 702 +- .../x/sys/unix/zsysnum_linux_arm.go | 24 + .../x/sys/unix/zsysnum_linux_arm64.go | 592 +- .../x/sys/unix/zsysnum_linux_loong64.go | 311 + .../x/sys/unix/zsysnum_linux_mips.go | 23 + .../x/sys/unix/zsysnum_linux_mips64.go | 687 +- .../x/sys/unix/zsysnum_linux_mips64le.go | 687 +- .../x/sys/unix/zsysnum_linux_mipsle.go | 23 + .../x/sys/unix/zsysnum_linux_ppc.go | 441 + .../x/sys/unix/zsysnum_linux_ppc64.go | 785 +- .../x/sys/unix/zsysnum_linux_ppc64le.go | 785 +- .../x/sys/unix/zsysnum_linux_riscv64.go | 590 +- .../x/sys/unix/zsysnum_linux_s390x.go | 715 +- .../x/sys/unix/zsysnum_linux_sparc64.go | 744 +- .../x/sys/unix/zsysnum_netbsd_386.go | 1 + .../x/sys/unix/zsysnum_netbsd_amd64.go | 1 + .../x/sys/unix/zsysnum_netbsd_arm.go | 1 + .../x/sys/unix/zsysnum_netbsd_arm64.go | 1 + .../x/sys/unix/zsysnum_openbsd_386.go | 1 + .../x/sys/unix/zsysnum_openbsd_amd64.go | 1 + .../x/sys/unix/zsysnum_openbsd_arm.go | 1 + .../x/sys/unix/zsysnum_openbsd_arm64.go | 1 + .../x/sys/unix/zsysnum_openbsd_mips64.go | 221 + .../x/sys/unix/zsysnum_zos_s390x.go | 2670 ++++++ .../golang.org/x/sys/unix/ztypes_aix_ppc.go | 2 + .../golang.org/x/sys/unix/ztypes_aix_ppc64.go | 2 + .../x/sys/unix/ztypes_darwin_386.go | 499 -- .../x/sys/unix/ztypes_darwin_amd64.go | 346 +- .../x/sys/unix/ztypes_darwin_arm.go | 500 -- .../x/sys/unix/ztypes_darwin_arm64.go | 346 +- .../x/sys/unix/ztypes_dragonfly_amd64.go | 61 +- .../x/sys/unix/ztypes_freebsd_386.go | 167 +- .../x/sys/unix/ztypes_freebsd_amd64.go | 174 +- .../x/sys/unix/ztypes_freebsd_arm.go | 156 +- .../x/sys/unix/ztypes_freebsd_arm64.go | 156 +- .../x/sys/unix/ztypes_freebsd_riscv64.go | 626 ++ .../x/sys/unix/ztypes_illumos_amd64.go | 42 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 5601 ++++++++++++ .../golang.org/x/sys/unix/ztypes_linux_386.go | 2027 +---- .../x/sys/unix/ztypes_linux_amd64.go | 2029 +---- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 2031 +---- .../x/sys/unix/ztypes_linux_arm64.go | 2029 +---- .../x/sys/unix/ztypes_linux_loong64.go | 685 ++ .../x/sys/unix/ztypes_linux_mips.go | 2030 +---- .../x/sys/unix/ztypes_linux_mips64.go | 2030 +---- .../x/sys/unix/ztypes_linux_mips64le.go | 2030 +---- .../x/sys/unix/ztypes_linux_mipsle.go | 2030 +---- .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 698 ++ .../x/sys/unix/ztypes_linux_ppc64.go | 2028 +---- .../x/sys/unix/ztypes_linux_ppc64le.go | 2028 +---- .../x/sys/unix/ztypes_linux_riscv64.go | 2030 +---- .../x/sys/unix/ztypes_linux_s390x.go | 2032 +---- .../x/sys/unix/ztypes_linux_sparc64.go | 2028 +---- .../x/sys/unix/ztypes_netbsd_386.go | 37 + .../x/sys/unix/ztypes_netbsd_amd64.go | 38 + .../x/sys/unix/ztypes_netbsd_arm.go | 37 + .../x/sys/unix/ztypes_netbsd_arm64.go | 38 + .../x/sys/unix/ztypes_openbsd_386.go | 24 +- .../x/sys/unix/ztypes_openbsd_amd64.go | 24 +- .../x/sys/unix/ztypes_openbsd_arm.go | 24 +- .../x/sys/unix/ztypes_openbsd_arm64.go | 24 +- .../x/sys/unix/ztypes_openbsd_mips64.go | 568 ++ .../x/sys/unix/ztypes_solaris_amd64.go | 82 +- .../golang.org/x/sys/unix/ztypes_zos_s390x.go | 406 + vendor/golang.org/x/sys/windows/aliases.go | 4 +- .../x/sys/windows/asm_windows_386.s | 13 - .../x/sys/windows/asm_windows_amd64.s | 13 - .../x/sys/windows/asm_windows_arm.s | 11 - .../golang.org/x/sys/windows/dll_windows.go | 52 +- vendor/golang.org/x/sys/windows/empty.s | 9 + .../golang.org/x/sys/windows/env_windows.go | 11 +- vendor/golang.org/x/sys/windows/eventlog.go | 1 + .../golang.org/x/sys/windows/exec_windows.go | 91 +- .../x/sys/windows/memory_windows.go | 36 +- vendor/golang.org/x/sys/windows/mkerrors.bash | 12 +- .../x/sys/windows/mkknownfolderids.bash | 27 + vendor/golang.org/x/sys/windows/mksyscall.go | 3 +- vendor/golang.org/x/sys/windows/race.go | 1 + vendor/golang.org/x/sys/windows/race0.go | 1 + .../x/sys/windows/security_windows.go | 660 +- vendor/golang.org/x/sys/windows/service.go | 33 +- .../x/sys/windows/setupapi_windows.go | 1425 +++ vendor/golang.org/x/sys/windows/str.go | 1 + vendor/golang.org/x/sys/windows/syscall.go | 47 +- .../x/sys/windows/syscall_windows.go | 622 +- .../golang.org/x/sys/windows/types_windows.go | 1847 +++- .../x/sys/windows/types_windows_386.go | 13 + .../x/sys/windows/types_windows_amd64.go | 12 + .../x/sys/windows/types_windows_arm.go | 13 + .../x/sys/windows/types_windows_arm64.go | 34 + .../x/sys/windows/zerrors_windows.go | 2621 +++++- .../x/sys/windows/zknownfolderids_windows.go | 149 + .../x/sys/windows/zsyscall_windows.go | 5183 ++++++----- vendor/golang.org/x/text/AUTHORS | 3 - vendor/golang.org/x/text/CONTRIBUTORS | 3 - .../x/text/encoding/charmap/maketables.go | 556 -- .../x/text/encoding/htmlindex/gen.go | 173 - .../x/text/encoding/htmlindex/tables.go | 9 + .../text/encoding/internal/identifier/gen.go | 142 - .../text/encoding/internal/identifier/mib.go | 8 + .../x/text/encoding/japanese/maketables.go | 161 - .../x/text/encoding/korean/maketables.go | 143 - .../x/text/encoding/simplifiedchinese/gbk.go | 6 +- .../encoding/simplifiedchinese/hzgb2312.go | 2 +- .../encoding/simplifiedchinese/maketables.go | 161 - .../encoding/traditionalchinese/maketables.go | 140 - .../x/text/encoding/unicode/unicode.go | 94 +- .../x/text/internal/language/compact/gen.go | 64 - .../internal/language/compact/gen_index.go | 113 - .../internal/language/compact/gen_parents.go | 54 - .../text/internal/language/compact/tables.go | 36 +- .../x/text/internal/language/gen.go | 1520 ---- .../x/text/internal/language/gen_common.go | 20 - .../x/text/internal/language/language.go | 133 +- .../x/text/internal/language/lookup.go | 2 +- .../x/text/internal/language/parse.go | 68 +- .../x/text/internal/language/tables.go | 4173 ++++----- .../internal/utf8internal/utf8internal.go | 2 +- vendor/golang.org/x/text/language/doc.go | 44 +- vendor/golang.org/x/text/language/gen.go | 305 - vendor/golang.org/x/text/language/go1_1.go | 1 + vendor/golang.org/x/text/language/go1_2.go | 1 + vendor/golang.org/x/text/language/language.go | 4 + vendor/golang.org/x/text/language/match.go | 2 +- vendor/golang.org/x/text/language/parse.go | 27 + vendor/golang.org/x/text/language/tables.go | 86 +- .../x/text/secure/bidirule/bidirule10.0.0.go | 1 + .../x/text/secure/bidirule/bidirule9.0.0.go | 1 + .../golang.org/x/text/transform/transform.go | 6 +- vendor/golang.org/x/text/unicode/bidi/bidi.go | 221 +- vendor/golang.org/x/text/unicode/bidi/core.go | 95 +- vendor/golang.org/x/text/unicode/bidi/gen.go | 133 - .../x/text/unicode/bidi/gen_ranges.go | 57 - .../x/text/unicode/bidi/gen_trieval.go | 64 - .../x/text/unicode/bidi/tables10.0.0.go | 1 + .../x/text/unicode/bidi/tables11.0.0.go | 3 +- .../x/text/unicode/bidi/tables12.0.0.go | 1924 ++++ .../x/text/unicode/bidi/tables13.0.0.go | 1956 +++++ .../x/text/unicode/bidi/tables9.0.0.go | 1 + .../x/text/unicode/norm/forminfo.go | 9 +- .../x/text/unicode/norm/maketables.go | 986 --- .../x/text/unicode/norm/normalize.go | 11 +- .../x/text/unicode/norm/tables10.0.0.go | 1 + .../x/text/unicode/norm/tables11.0.0.go | 3 +- .../x/text/unicode/norm/tables12.0.0.go | 7711 ++++++++++++++++ .../x/text/unicode/norm/tables13.0.0.go | 7761 +++++++++++++++++ .../x/text/unicode/norm/tables9.0.0.go | 1 + .../golang.org/x/text/unicode/norm/triegen.go | 117 - vendor/golang.org/x/tools/AUTHORS | 3 - vendor/golang.org/x/tools/CONTRIBUTORS | 3 - vendor/golang.org/x/tools/LICENSE | 27 - vendor/golang.org/x/tools/PATENTS | 22 - .../x/tools/go/ast/astutil/enclosing.go | 627 -- .../x/tools/go/ast/astutil/imports.go | 481 - .../x/tools/go/ast/astutil/rewrite.go | 477 - .../golang.org/x/tools/go/ast/astutil/util.go | 14 - .../x/tools/go/gcexportdata/gcexportdata.go | 109 - .../x/tools/go/gcexportdata/importer.go | 73 - .../x/tools/go/gcexportdata/main.go | 99 - .../x/tools/go/internal/gcimporter/bexport.go | 852 -- .../x/tools/go/internal/gcimporter/bimport.go | 1036 --- .../go/internal/gcimporter/exportdata.go | 93 - .../go/internal/gcimporter/gcimporter.go | 1078 --- .../x/tools/go/internal/gcimporter/iexport.go | 723 -- .../x/tools/go/internal/gcimporter/iimport.go | 606 -- .../go/internal/gcimporter/newInterface10.go | 21 - .../go/internal/gcimporter/newInterface11.go | 13 - .../x/tools/go/types/typeutil/callee.go | 46 - .../x/tools/go/types/typeutil/imports.go | 31 - .../x/tools/go/types/typeutil/map.go | 313 - .../tools/go/types/typeutil/methodsetcache.go | 72 - .../x/tools/go/types/typeutil/ui.go | 52 - .../api/internal/service-account.json | 12 + vendor/honnef.co/go/js/dom/LICENSE | 20 - vendor/honnef.co/go/js/dom/README.md | 11 - vendor/honnef.co/go/js/dom/dom.go | 3082 ------- vendor/honnef.co/go/js/dom/events.go | 412 - vendor/modules.txt | 393 +- vendor/myitcv.io/LICENSE | 19 - .../src/github.com/fsnotify/fsnotify/AUTHORS | 52 - .../src/github.com/fsnotify/fsnotify/LICENSE | 28 - .../src/github.com/golang/protobuf/AUTHORS | 3 - .../github.com/golang/protobuf/CONTRIBUTORS | 3 - .../src/github.com/golang/protobuf/LICENSE | 28 - .../src/github.com/gopherjs/gopherjs/LICENSE | 24 - .../src/github.com/gopherjs/jsbuiltin/LICENSE | 24 - .../github.com/jteeuwen/go-bindata/LICENSE | 3 - .../go-bindata/testdata/symlinkFile/file1 | 1 - .../testdata/symlinkParent/symlinkTarget | 1 - .../symlinkRecursiveParent/symlinkTarget | 1 - .../src/github.com/kisielk/gotool/LEGAL | 32 - .../src/github.com/kisielk/gotool/LICENSE | 20 - .../_vendor/src/github.com/kr/fs/LICENSE | 27 - .../_vendor/src/github.com/kr/pretty/License | 21 - .../_vendor/src/github.com/kr/pty/License | 23 - .../_vendor/src/github.com/kr/text/License | 19 - .../src/github.com/neelance/sourcemap/LICENSE | 24 - .../github.com/rogpeppe/rog-go/go9p/AUTHORS | 13 - .../rogpeppe/rog-go/go9p/CONTRIBUTORS | 17 - .../russross/blackfriday/LICENSE.txt | 29 - .../src/github.com/sclevine/agouti/LICENSE | 22 - .../src/github.com/spf13/cobra/LICENSE.txt | 174 - .../spf13/cobra/cobra/cmd/license_agpl.go | 683 -- .../spf13/cobra/cobra/cmd/license_apache_2.go | 238 - .../cobra/cobra/cmd/license_bsd_clause_2.go | 71 - .../cobra/cobra/cmd/license_bsd_clause_3.go | 78 - .../spf13/cobra/cobra/cmd/license_gpl_2.go | 376 - .../spf13/cobra/cobra/cmd/license_gpl_3.go | 711 -- .../spf13/cobra/cobra/cmd/license_lgpl.go | 186 - .../spf13/cobra/cobra/cmd/license_mit.go | 63 - .../spf13/cobra/cobra/cmd/licenses.go | 118 - .../cobra/cobra/cmd/testdata/LICENSE.golden | 202 - .../src/github.com/spf13/pflag/LICENSE | 28 - .../_vendor/src/golang.org/x/crypto/AUTHORS | 3 - .../src/golang.org/x/crypto/CONTRIBUTORS | 3 - .../_vendor/src/golang.org/x/crypto/LICENSE | 27 - .../_vendor/src/golang.org/x/crypto/PATENTS | 22 - .../_vendor/src/golang.org/x/net/AUTHORS | 3 - .../_vendor/src/golang.org/x/net/CONTRIBUTORS | 3 - .../_vendor/src/golang.org/x/net/LICENSE | 27 - .../_vendor/src/golang.org/x/net/PATENTS | 22 - .../_vendor/src/golang.org/x/sys/AUTHORS | 3 - .../_vendor/src/golang.org/x/sys/CONTRIBUTORS | 3 - .../_vendor/src/golang.org/x/sys/LICENSE | 27 - .../_vendor/src/golang.org/x/sys/PATENTS | 22 - .../_vendor/src/golang.org/x/tools/AUTHORS | 3 - .../src/golang.org/x/tools/CONTRIBUTORS | 3 - .../_vendor/src/golang.org/x/tools/LICENSE | 27 - .../_vendor/src/golang.org/x/tools/PATENTS | 22 - .../src/golang.org/x/tools/cmd/getgo/LICENSE | 27 - .../x/tools/third_party/moduleloader/LICENSE | 22 - .../x/tools/third_party/typescript/LICENSE | 55 - .../x/tools/third_party/webcomponents/LICENSE | 27 - .../_vendor/src/gopkg.in/check.v1/LICENSE | 25 - .../src/gopkg.in/fsnotify/fsnotify.v1/AUTHORS | 52 - .../src/gopkg.in/fsnotify/fsnotify.v1/LICENSE | 28 - .../_vendor/src/honnef.co/go/js/dom/LICENSE | 20 - .../_vendor/src/honnef.co/go/js/util/LICENSE | 20 - .../_vendor/src/honnef.co/go/js/xhr/LICENSE | 20 - .../myitcv.io/_vendor/src/mvdan.cc/sh/LICENSE | 27 - vendor/myitcv.io/cmd/gai/LICENSE | 19 - vendor/myitcv.io/cmd/gai/gotype/LICENSE | 27 - vendor/myitcv.io/cmd/gg/LICENSE | 19 - vendor/myitcv.io/cmd/gitgodoc/LICENSE | 19 - vendor/myitcv.io/cmd/modpub/LICENSE | 27 - vendor/myitcv.io/gogenerate/LICENSE | 19 - .../gogenerate/_testFiles/licenseFile.txt | 2 - vendor/myitcv.io/gogenerate/coregogenerate.go | 261 - vendor/myitcv.io/gogenerate/gogenerate.go | 294 - vendor/myitcv.io/gopherize.me/client/artwork | 1 - vendor/myitcv.io/highlightjs/LICENSE | 27 - vendor/myitcv.io/hybridimporter/LICENSE | 19 - vendor/myitcv.io/immutable/LICENSE | 27 - .../internal/coretest/license.txt | 1 - .../immutable/example/license_header.txt | 2 - vendor/myitcv.io/react/.bin_deps | 5 - vendor/myitcv.io/react/.ggconfig.json | 10 - vendor/myitcv.io/react/.gitattributes | 4 - vendor/myitcv.io/react/.vendored_bin_deps | 8 - vendor/myitcv.io/react/LICENSE | 27 - vendor/myitcv.io/react/README.md | 31 - .../myitcv.io/react/cmd/reactGen/comp_gen.go | 399 - .../myitcv.io/react/cmd/reactGen/core_gen.go | 49 - vendor/myitcv.io/react/cmd/reactGen/flag.go | 58 - vendor/myitcv.io/react/cmd/reactGen/gen.go | 231 - vendor/myitcv.io/react/cmd/reactGen/init.go | 179 - .../myitcv.io/react/cmd/reactGen/react_gen.go | 91 - vendor/myitcv.io/react/core.go | 52 - vendor/myitcv.io/react/custom_elements.go | 42 - vendor/myitcv.io/react/gen_react_coreGen.go | 4031 --------- vendor/myitcv.io/react/gen_react_cssGen.go | 57 - vendor/myitcv.io/react/internal/bundle/dev.go | 5 - .../myitcv.io/react/internal/bundle/dummy.go | 1 - .../myitcv.io/react/internal/bundle/preact.go | 5 - .../myitcv.io/react/internal/bundle/prod.go | 5 - vendor/myitcv.io/react/internal/core/core.go | 17 - vendor/myitcv.io/react/internal/dev/dev.go | 1 - .../myitcv.io/react/internal/dev/entry.point | 3 - .../react/internal/dev/package-lock.json | 4230 --------- .../myitcv.io/react/internal/dev/package.json | 14 - .../react/internal/dev/webpack.config.js | 11 - .../myitcv.io/react/internal/preact/preact.go | 1 - .../myitcv.io/react/internal/prod/entry.point | 1 - .../react/internal/prod/node_modules | 1 - vendor/myitcv.io/react/internal/prod/prod.go | 1 - .../react/internal/prod/webpack.config.js | 14 - .../react/internal/testutils/node_modules | 1 - vendor/myitcv.io/react/react.go | 326 - vendor/myitcv.io/react/unsafe.go | 15 - vendor/myitcv.io/react/unsafe_js.go | 17 - vendor/myitcv.io/remarkable/LICENSE | 27 - vendor/myitcv.io/sorter/LICENSE | 19 - .../sorter/example/license_header.txt | 2 - vendor/rsc.io/qr/coding/gen.go | 149 - 800 files changed, 109566 insertions(+), 169368 deletions(-) delete mode 100644 vendor/github.com/gopherjs/gopherjs/build/build.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/analysis/bool.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/analysis/break.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/analysis/escape.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/analysis/info.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/analysis/sideeffect.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/astutil/astutil.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/compiler.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/expressions.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/filter/assign.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/filter/incdecstmt.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/doc.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/fs.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/fs_vfsdata.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/natives/doc.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/natives/fs.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/natives/fs_vfsdata.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/package.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/prelude/genmin.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/prelude/goroutines.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/prelude/jsmapping.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/prelude/numeric.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/prelude/prelude.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/prelude/prelude_min.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/prelude/types.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/prelude/uglifyjs_options.json delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/statements.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/typesutil/typesutil.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/utils.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/compiler/version_check.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/internal/sysutil/sysutil.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/internal/sysutil/sysutil_windows.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/nosync/map.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/nosync/mutex.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/nosync/once.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/nosync/pool.go delete mode 100644 vendor/github.com/gopherjs/gopherjs/tool.go delete mode 100644 vendor/github.com/gopherjs/jsbuiltin/LICENSE delete mode 100644 vendor/github.com/gopherjs/jsbuiltin/README.md delete mode 100755 vendor/github.com/gopherjs/jsbuiltin/jsbuiltin.go delete mode 100755 vendor/github.com/gopherjs/jsbuiltin/jsbuiltin.inc.js delete mode 100644 vendor/github.com/lib/pq/oid/gen.go delete mode 100644 vendor/github.com/miekg/dns/msg_generate.go delete mode 100644 vendor/github.com/miekg/dns/types_generate.go delete mode 100644 vendor/github.com/neelance/astrewrite/LICENSE delete mode 100644 vendor/github.com/neelance/astrewrite/simplify.go create mode 100644 vendor/golang.org/x/crypto/acme/rfc8555.go create mode 100644 vendor/golang.org/x/crypto/acme/version_go112.go create mode 100644 vendor/golang.org/x/crypto/blowfish/block.go create mode 100644 vendor/golang.org/x/crypto/blowfish/cipher.go create mode 100644 vendor/golang.org/x/crypto/blowfish/const.go create mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_arm64.go rename vendor/golang.org/x/crypto/{internal/chacha20/asm_arm64.s => chacha20/chacha_arm64.s} (99%) create mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_generic.go create mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_noasm.go create mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go create mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s create mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_s390x.go rename vendor/golang.org/x/crypto/{internal => }/chacha20/chacha_s390x.s (87%) rename vendor/golang.org/x/crypto/{internal => }/chacha20/xor.go (73%) delete mode 100644 vendor/golang.org/x/crypto/curve25519/const_amd64.h delete mode 100644 vendor/golang.org/x/crypto/curve25519/const_amd64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/cswap_amd64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/doc.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/freeze_amd64.s create mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/README create mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe.go create mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go create mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.s create mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64_noasm.go create mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.go create mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.s create mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64_noasm.go create mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_generic.go create mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/sync.checkpoint create mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh delete mode 100644 vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/mul_amd64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/square_amd64.s create mode 100644 vendor/golang.org/x/crypto/ed25519/ed25519_go113.go delete mode 100644 vendor/golang.org/x/crypto/internal/chacha20/chacha_arm64.go delete mode 100644 vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go delete mode 100644 vendor/golang.org/x/crypto/internal/chacha20/chacha_noasm.go delete mode 100644 vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go create mode 100644 vendor/golang.org/x/crypto/internal/poly1305/bits_compat.go create mode 100644 vendor/golang.org/x/crypto/internal/poly1305/bits_go1.13.go rename vendor/golang.org/x/crypto/{ => internal}/poly1305/mac_noasm.go (66%) rename vendor/golang.org/x/crypto/{ => internal}/poly1305/poly1305.go (75%) create mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.go rename vendor/golang.org/x/crypto/{ => internal}/poly1305/sum_amd64.s (74%) create mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go create mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.go create mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s create mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.go create mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.s rename vendor/golang.org/x/crypto/internal/subtle/{aliasing_appengine.go => aliasing_purego.go} (97%) delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_amd64.go delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_arm.go delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_arm.s delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_generic.go delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_noasm.go delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_s390x.go delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_s390x.s delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s create mode 100644 vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go delete mode 100644 vendor/golang.org/x/image/draw/gen.go delete mode 100644 vendor/golang.org/x/net/AUTHORS delete mode 100644 vendor/golang.org/x/net/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/net/html/atom/gen.go delete mode 100644 vendor/golang.org/x/net/http2/README create mode 100644 vendor/golang.org/x/net/http2/ascii.go create mode 100644 vendor/golang.org/x/net/http2/go115.go create mode 100644 vendor/golang.org/x/net/http2/go118.go create mode 100644 vendor/golang.org/x/net/http2/not_go115.go create mode 100644 vendor/golang.org/x/net/http2/not_go118.go create mode 100644 vendor/golang.org/x/net/idna/go118.go create mode 100644 vendor/golang.org/x/net/idna/pre_go118.go create mode 100644 vendor/golang.org/x/net/idna/tables12.0.0.go create mode 100644 vendor/golang.org/x/net/idna/tables13.0.0.go delete mode 100644 vendor/golang.org/x/sync/AUTHORS delete mode 100644 vendor/golang.org/x/sync/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/sys/AUTHORS delete mode 100644 vendor/golang.org/x/sys/CONTRIBUTORS create mode 100644 vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s rename vendor/golang.org/x/sys/cpu/{cpu_aix_ppc64.go => cpu_aix.go} (88%) create mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm64.s create mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go rename vendor/golang.org/x/sys/cpu/{cpu_gccgo.c => cpu_gccgo_x86.c} (63%) rename vendor/golang.org/x/sys/cpu/{cpu_gccgo.go => cpu_gccgo_x86.go} (74%) create mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_arm.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_loong64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_arm.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_ppc64x.go rename vendor/golang.org/x/sys/{windows/mkerrors.go => cpu/cpu_riscv64.go} (62%) create mode 100644 vendor/golang.org/x/sys/cpu/cpu_s390x.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_zos.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/cpu/hwcap_linux.go create mode 100644 vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go create mode 100644 vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go create mode 100644 vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go rename vendor/golang.org/x/sys/unix/{asm_darwin_386.s => asm_bsd_386.s} (70%) rename vendor/golang.org/x/sys/unix/{asm_darwin_amd64.s => asm_bsd_amd64.s} (71%) rename vendor/golang.org/x/sys/unix/{asm_netbsd_arm.s => asm_bsd_arm.s} (74%) rename vendor/golang.org/x/sys/unix/{asm_netbsd_amd64.s => asm_bsd_arm64.s} (73%) rename vendor/golang.org/x/sys/unix/{asm_openbsd_amd64.s => asm_bsd_riscv64.s} (73%) delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_arm.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_arm64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_arm.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s create mode 100644 vendor/golang.org/x/sys/unix/asm_linux_loong64.s create mode 100644 vendor/golang.org/x/sys/unix/asm_linux_riscv64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_netbsd_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_openbsd_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_openbsd_arm.s rename vendor/golang.org/x/sys/unix/{asm_openbsd_arm64.s => asm_openbsd_mips64.s} (89%) create mode 100644 vendor/golang.org/x/sys/unix/asm_zos_s390x.s create mode 100644 vendor/golang.org/x/sys/unix/dev_zos.go create mode 100644 vendor/golang.org/x/sys/unix/epoll_zos.go delete mode 100644 vendor/golang.org/x/sys/unix/errors_freebsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/errors_freebsd_arm.go create mode 100644 vendor/golang.org/x/sys/unix/fdset.go create mode 100644 vendor/golang.org/x/sys/unix/fstatfs_zos.go create mode 100644 vendor/golang.org/x/sys/unix/ifreq_linux.go create mode 100644 vendor/golang.org/x/sys/unix/ioctl_linux.go create mode 100644 vendor/golang.org/x/sys/unix/ioctl_zos.go delete mode 100644 vendor/golang.org/x/sys/unix/mkasm_darwin.go delete mode 100644 vendor/golang.org/x/sys/unix/mkpost.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall_solaris.go delete mode 100644 vendor/golang.org/x/sys/unix/mksysctl_openbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/mksysnum.go create mode 100644 vendor/golang.org/x/sys/unix/ptrace_darwin.go create mode 100644 vendor/golang.org/x/sys/unix/ptrace_ios.go create mode 100644 vendor/golang.org/x/sys/unix/readdirent_getdents.go create mode 100644 vendor/golang.org/x/sys/unix/readdirent_getdirentries.go create mode 100644 vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go create mode 100644 vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_386.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_arm.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_illumos.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_alarm.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_loong64.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_ppc.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/unix/sysvshm_linux.go create mode 100644 vendor/golang.org/x/sys/unix/sysvshm_unix.go create mode 100644 vendor/golang.org/x/sys/unix/sysvshm_unix_other.go delete mode 100644 vendor/golang.org/x/sys/unix/types_aix.go delete mode 100644 vendor/golang.org/x/sys/unix/types_darwin.go delete mode 100644 vendor/golang.org/x/sys/unix/types_dragonfly.go delete mode 100644 vendor/golang.org/x/sys/unix/types_freebsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_netbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_openbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_solaris.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go create mode 100644 vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go create mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux.go create mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go create mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go rename vendor/golang.org/x/sys/unix/{zerrors_darwin_386.go => zerrors_openbsd_mips64.go} (51%) create mode 100644 vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go rename vendor/golang.org/x/sys/unix/{zptracearm_linux.go => zptrace_armnn_linux.go} (90%) create mode 100644 vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go rename vendor/golang.org/x/sys/unix/{zptracemips_linux.go => zptrace_mipsnn_linux.go} (91%) rename vendor/golang.org/x/sys/unix/{zptracemipsle_linux.go => zptrace_mipsnnle_linux.go} (91%) rename vendor/golang.org/x/sys/unix/{zptrace386_linux.go => zptrace_x86_linux.go} (93%) delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s rename vendor/golang.org/x/sys/unix/{zsyscall_darwin_amd64.1_11.go => zsyscall_freebsd_riscv64.go} (82%) create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go rename vendor/golang.org/x/sys/unix/{zsyscall_darwin_arm64.1_11.go => zsyscall_openbsd_mips64.go} (84%) create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_darwin_386.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go delete mode 100644 vendor/golang.org/x/sys/windows/asm_windows_386.s delete mode 100644 vendor/golang.org/x/sys/windows/asm_windows_amd64.s delete mode 100644 vendor/golang.org/x/sys/windows/asm_windows_arm.s create mode 100644 vendor/golang.org/x/sys/windows/empty.s create mode 100644 vendor/golang.org/x/sys/windows/mkknownfolderids.bash create mode 100644 vendor/golang.org/x/sys/windows/setupapi_windows.go create mode 100644 vendor/golang.org/x/sys/windows/types_windows_arm64.go create mode 100644 vendor/golang.org/x/sys/windows/zknownfolderids_windows.go delete mode 100644 vendor/golang.org/x/text/AUTHORS delete mode 100644 vendor/golang.org/x/text/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/text/encoding/charmap/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/htmlindex/gen.go delete mode 100644 vendor/golang.org/x/text/encoding/internal/identifier/gen.go delete mode 100644 vendor/golang.org/x/text/encoding/japanese/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/korean/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/simplifiedchinese/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/traditionalchinese/maketables.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/gen.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/gen_index.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/gen_parents.go delete mode 100644 vendor/golang.org/x/text/internal/language/gen.go delete mode 100644 vendor/golang.org/x/text/internal/language/gen_common.go delete mode 100644 vendor/golang.org/x/text/language/gen.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/gen.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/gen_ranges.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/gen_trieval.go create mode 100644 vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go create mode 100644 vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/maketables.go create mode 100644 vendor/golang.org/x/text/unicode/norm/tables12.0.0.go create mode 100644 vendor/golang.org/x/text/unicode/norm/tables13.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/triegen.go delete mode 100644 vendor/golang.org/x/tools/AUTHORS delete mode 100644 vendor/golang.org/x/tools/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/tools/LICENSE delete mode 100644 vendor/golang.org/x/tools/PATENTS delete mode 100644 vendor/golang.org/x/tools/go/ast/astutil/enclosing.go delete mode 100644 vendor/golang.org/x/tools/go/ast/astutil/imports.go delete mode 100644 vendor/golang.org/x/tools/go/ast/astutil/rewrite.go delete mode 100644 vendor/golang.org/x/tools/go/ast/astutil/util.go delete mode 100644 vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go delete mode 100644 vendor/golang.org/x/tools/go/gcexportdata/importer.go delete mode 100644 vendor/golang.org/x/tools/go/gcexportdata/main.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go delete mode 100644 vendor/golang.org/x/tools/go/types/typeutil/callee.go delete mode 100644 vendor/golang.org/x/tools/go/types/typeutil/imports.go delete mode 100644 vendor/golang.org/x/tools/go/types/typeutil/map.go delete mode 100644 vendor/golang.org/x/tools/go/types/typeutil/methodsetcache.go delete mode 100644 vendor/golang.org/x/tools/go/types/typeutil/ui.go create mode 100644 vendor/google.golang.org/api/internal/service-account.json delete mode 100644 vendor/honnef.co/go/js/dom/LICENSE delete mode 100644 vendor/honnef.co/go/js/dom/README.md delete mode 100644 vendor/honnef.co/go/js/dom/dom.go delete mode 100644 vendor/honnef.co/go/js/dom/events.go delete mode 100644 vendor/myitcv.io/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/fsnotify/fsnotify/AUTHORS delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/fsnotify/fsnotify/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/golang/protobuf/AUTHORS delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/golang/protobuf/CONTRIBUTORS delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/golang/protobuf/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/gopherjs/gopherjs/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/gopherjs/jsbuiltin/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/jteeuwen/go-bindata/LICENSE delete mode 120000 vendor/myitcv.io/_vendor/src/github.com/jteeuwen/go-bindata/testdata/symlinkFile/file1 delete mode 120000 vendor/myitcv.io/_vendor/src/github.com/jteeuwen/go-bindata/testdata/symlinkParent/symlinkTarget delete mode 120000 vendor/myitcv.io/_vendor/src/github.com/jteeuwen/go-bindata/testdata/symlinkRecursiveParent/symlinkTarget delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/kisielk/gotool/LEGAL delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/kisielk/gotool/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/kr/fs/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/kr/pretty/License delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/kr/pty/License delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/kr/text/License delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/neelance/sourcemap/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/rogpeppe/rog-go/go9p/AUTHORS delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/rogpeppe/rog-go/go9p/CONTRIBUTORS delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/russross/blackfriday/LICENSE.txt delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/sclevine/agouti/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/spf13/cobra/LICENSE.txt delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/spf13/cobra/cobra/cmd/license_agpl.go delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/spf13/cobra/cobra/cmd/license_apache_2.go delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_2.go delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_3.go delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/spf13/cobra/cobra/cmd/license_gpl_2.go delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/spf13/cobra/cobra/cmd/license_gpl_3.go delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/spf13/cobra/cobra/cmd/license_lgpl.go delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/spf13/cobra/cobra/cmd/license_mit.go delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/spf13/cobra/cobra/cmd/licenses.go delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/spf13/cobra/cobra/cmd/testdata/LICENSE.golden delete mode 100644 vendor/myitcv.io/_vendor/src/github.com/spf13/pflag/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/crypto/AUTHORS delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/crypto/CONTRIBUTORS delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/crypto/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/crypto/PATENTS delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/net/AUTHORS delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/net/CONTRIBUTORS delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/net/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/net/PATENTS delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/sys/AUTHORS delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/sys/CONTRIBUTORS delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/sys/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/sys/PATENTS delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/tools/AUTHORS delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/tools/CONTRIBUTORS delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/tools/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/tools/PATENTS delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/tools/cmd/getgo/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/tools/third_party/moduleloader/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/tools/third_party/typescript/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/golang.org/x/tools/third_party/webcomponents/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/gopkg.in/check.v1/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/gopkg.in/fsnotify/fsnotify.v1/AUTHORS delete mode 100644 vendor/myitcv.io/_vendor/src/gopkg.in/fsnotify/fsnotify.v1/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/honnef.co/go/js/dom/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/honnef.co/go/js/util/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/honnef.co/go/js/xhr/LICENSE delete mode 100644 vendor/myitcv.io/_vendor/src/mvdan.cc/sh/LICENSE delete mode 100644 vendor/myitcv.io/cmd/gai/LICENSE delete mode 100644 vendor/myitcv.io/cmd/gai/gotype/LICENSE delete mode 100644 vendor/myitcv.io/cmd/gg/LICENSE delete mode 100644 vendor/myitcv.io/cmd/gitgodoc/LICENSE delete mode 100644 vendor/myitcv.io/cmd/modpub/LICENSE delete mode 100644 vendor/myitcv.io/gogenerate/LICENSE delete mode 100644 vendor/myitcv.io/gogenerate/_testFiles/licenseFile.txt delete mode 100644 vendor/myitcv.io/gogenerate/coregogenerate.go delete mode 100644 vendor/myitcv.io/gogenerate/gogenerate.go delete mode 120000 vendor/myitcv.io/gopherize.me/client/artwork delete mode 100644 vendor/myitcv.io/highlightjs/LICENSE delete mode 100644 vendor/myitcv.io/hybridimporter/LICENSE delete mode 100644 vendor/myitcv.io/immutable/LICENSE delete mode 100644 vendor/myitcv.io/immutable/cmd/immutableGen/internal/coretest/license.txt delete mode 100644 vendor/myitcv.io/immutable/example/license_header.txt delete mode 100644 vendor/myitcv.io/react/.bin_deps delete mode 100644 vendor/myitcv.io/react/.ggconfig.json delete mode 100644 vendor/myitcv.io/react/.gitattributes delete mode 100644 vendor/myitcv.io/react/.vendored_bin_deps delete mode 100644 vendor/myitcv.io/react/LICENSE delete mode 100644 vendor/myitcv.io/react/README.md delete mode 100644 vendor/myitcv.io/react/cmd/reactGen/comp_gen.go delete mode 100644 vendor/myitcv.io/react/cmd/reactGen/core_gen.go delete mode 100644 vendor/myitcv.io/react/cmd/reactGen/flag.go delete mode 100644 vendor/myitcv.io/react/cmd/reactGen/gen.go delete mode 100644 vendor/myitcv.io/react/cmd/reactGen/init.go delete mode 100644 vendor/myitcv.io/react/cmd/reactGen/react_gen.go delete mode 100644 vendor/myitcv.io/react/core.go delete mode 100644 vendor/myitcv.io/react/custom_elements.go delete mode 100644 vendor/myitcv.io/react/gen_react_coreGen.go delete mode 100644 vendor/myitcv.io/react/gen_react_cssGen.go delete mode 100644 vendor/myitcv.io/react/internal/bundle/dev.go delete mode 100644 vendor/myitcv.io/react/internal/bundle/dummy.go delete mode 100644 vendor/myitcv.io/react/internal/bundle/preact.go delete mode 100644 vendor/myitcv.io/react/internal/bundle/prod.go delete mode 100644 vendor/myitcv.io/react/internal/core/core.go delete mode 100644 vendor/myitcv.io/react/internal/dev/dev.go delete mode 100644 vendor/myitcv.io/react/internal/dev/entry.point delete mode 100644 vendor/myitcv.io/react/internal/dev/package-lock.json delete mode 100644 vendor/myitcv.io/react/internal/dev/package.json delete mode 100644 vendor/myitcv.io/react/internal/dev/webpack.config.js delete mode 100644 vendor/myitcv.io/react/internal/preact/preact.go delete mode 120000 vendor/myitcv.io/react/internal/prod/entry.point delete mode 120000 vendor/myitcv.io/react/internal/prod/node_modules delete mode 100644 vendor/myitcv.io/react/internal/prod/prod.go delete mode 100644 vendor/myitcv.io/react/internal/prod/webpack.config.js delete mode 120000 vendor/myitcv.io/react/internal/testutils/node_modules delete mode 100644 vendor/myitcv.io/react/react.go delete mode 100644 vendor/myitcv.io/react/unsafe.go delete mode 100644 vendor/myitcv.io/react/unsafe_js.go delete mode 100644 vendor/myitcv.io/remarkable/LICENSE delete mode 100644 vendor/myitcv.io/sorter/LICENSE delete mode 100644 vendor/myitcv.io/sorter/example/license_header.txt delete mode 100644 vendor/rsc.io/qr/coding/gen.go diff --git a/go.mod b/go.mod index c37b50b0f..ee1df3e31 100644 --- a/go.mod +++ b/go.mod @@ -51,13 +51,12 @@ require ( github.com/syndtr/goleveldb v0.0.0-20180608030153-db3ee9ee8931 github.com/tgulacsi/picago v0.0.0-20171229130838-9e1ac2306c70 go4.org v0.0.0-20190218023631-ce4c26f7be8e - golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f + golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 golang.org/x/image v0.0.0-20190523035834-f03afa92d3ff - golang.org/x/net v0.0.0-20190522155817-f3200d17e092 + golang.org/x/net v0.0.0-20220722155237-a158d28d115b golang.org/x/oauth2 v0.0.0-20190523182746-aaccbc9213b0 - golang.org/x/sync v0.0.0-20190423024810-112230192c58 - golang.org/x/sys v0.0.0-20190528183647-3626398d7749 // indirect - golang.org/x/text v0.3.2 // indirect + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 + golang.org/x/text v0.3.8 // indirect golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 google.golang.org/api v0.5.0 google.golang.org/appengine v1.6.0 // indirect diff --git a/go.sum b/go.sum index aa853bda1..5bc896d30 100644 --- a/go.sum +++ b/go.sum @@ -52,7 +52,6 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekf github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -94,8 +93,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/lib/pq v0.0.0-20130607063955-9afcd9aa7931 h1:iG6qKXF9fh1vkUvi+5NCgWY+4Yms+rYZfXrtZzZt978= -github.com/lib/pq v0.0.0-20130607063955-9afcd9aa7931/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mailgun/mailgun-go v0.0.0-20171127222028-17e8bd11e87c h1:5huPh/MfWW65cx8KWNVD4mCCnwIrNiX4bFJR5OeONg0= @@ -145,13 +142,14 @@ github.com/tgulacsi/picago v0.0.0-20171229130838-9e1ac2306c70/go.mod h1:YOW4MCz1 github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 h1:nrZ3ySNYwJbSpD6ce9duiP+QkD3JuLCcWkdaehUS/3Y= github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80/go.mod h1:iFyPdL66DjUD96XmzVL3ZntbzcflLnznH0fr99w5VqE= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go4.org v0.0.0-20190218023631-ce4c26f7be8e h1:m9LfARr2VIOW0vsV19kEKp/sWQvZnGobA8JHui/XJoY= go4.org v0.0.0-20190218023631-ce4c26f7be8e/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f h1:R423Cnkcp5JABoeemiGEPlt9tHXFfw5kvc0yqlxRPWo= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/image v0.0.0-20190523035834-f03afa92d3ff h1:+2zgJKVDVAz/BWSsuniCmU1kLCjL88Z8/kv39xCI9NQ= golang.org/x/image v0.0.0-20190523035834-f03afa92d3ff/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -159,42 +157,50 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd h1:HuTn7WObtcDo9uEEU7rEqL0jYthdXAmZ6PP+meazmaU= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190509222800-a4d6f7feada5/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190523182746-aaccbc9213b0 h1:xFEXbcD0oa/xhqQmMXztdZ0bWvexAWds+8c1gRN8nu0= golang.org/x/oauth2 v0.0.0-20190523182746-aaccbc9213b0/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190509141414-a5b02f93d862/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190528183647-3626398d7749 h1:oG2HS+e2B9VqK95y67B5MgJIJhOPY27/m5uJKJhHzus= -golang.org/x/sys v0.0.0-20190528183647-3626398d7749/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -203,8 +209,10 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384 h1:TFlARGu6Czu1z7q93HTxcP1P+/ZFC/IKythI5RzrnRg= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.5.0 h1:lj9SyhMzyoa38fgFF0oO2T6pjs5IzkLPKfVtxpyCRMM= google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -230,7 +238,6 @@ gopkg.in/mgo.v2 v2.0.0-20160818020120-3f83fa500528 h1:/saqWwm73dLmuzbNhe92F0QsZ/ gopkg.in/mgo.v2 v2.0.0-20160818020120-3f83fa500528/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/gopherjs/gopherjs/build/build.go b/vendor/github.com/gopherjs/gopherjs/build/build.go deleted file mode 100644 index f2513ba5b..000000000 --- a/vendor/github.com/gopherjs/gopherjs/build/build.go +++ /dev/null @@ -1,875 +0,0 @@ -package build - -import ( - "fmt" - "go/ast" - "go/build" - "go/parser" - "go/scanner" - "go/token" - "go/types" - "io" - "io/ioutil" - "os" - "os/exec" - "path" - "path/filepath" - "runtime" - "strconv" - "strings" - "time" - - "github.com/fsnotify/fsnotify" - "github.com/gopherjs/gopherjs/compiler" - "github.com/gopherjs/gopherjs/compiler/gopherjspkg" - "github.com/gopherjs/gopherjs/compiler/natives" - "github.com/neelance/sourcemap" - "github.com/shurcooL/httpfs/vfsutil" - "golang.org/x/tools/go/buildutil" -) - -type ImportCError struct { - pkgPath string -} - -func (e *ImportCError) Error() string { - return e.pkgPath + `: importing "C" is not supported by GopherJS` -} - -// NewBuildContext creates a build context for building Go packages -// with GopherJS compiler. -// -// Core GopherJS packages (i.e., "github.com/gopherjs/gopherjs/js", "github.com/gopherjs/gopherjs/nosync") -// are loaded from gopherjspkg.FS virtual filesystem rather than GOPATH. -func NewBuildContext(installSuffix string, buildTags []string) *build.Context { - gopherjsRoot := filepath.Join(build.Default.GOROOT, "src", "github.com", "gopherjs", "gopherjs") - return &build.Context{ - GOROOT: build.Default.GOROOT, - GOPATH: build.Default.GOPATH, - GOOS: build.Default.GOOS, - GOARCH: "js", - InstallSuffix: installSuffix, - Compiler: "gc", - BuildTags: append(buildTags, - "netgo", // See https://godoc.org/net#hdr-Name_Resolution. - "purego", // See https://golang.org/issues/23172. - ), - ReleaseTags: build.Default.ReleaseTags, - CgoEnabled: true, // detect `import "C"` to throw proper error - - IsDir: func(path string) bool { - if strings.HasPrefix(path, gopherjsRoot+string(filepath.Separator)) { - path = filepath.ToSlash(path[len(gopherjsRoot):]) - if fi, err := vfsutil.Stat(gopherjspkg.FS, path); err == nil { - return fi.IsDir() - } - } - fi, err := os.Stat(path) - return err == nil && fi.IsDir() - }, - ReadDir: func(path string) ([]os.FileInfo, error) { - if strings.HasPrefix(path, gopherjsRoot+string(filepath.Separator)) { - path = filepath.ToSlash(path[len(gopherjsRoot):]) - if fis, err := vfsutil.ReadDir(gopherjspkg.FS, path); err == nil { - return fis, nil - } - } - return ioutil.ReadDir(path) - }, - OpenFile: func(path string) (io.ReadCloser, error) { - if strings.HasPrefix(path, gopherjsRoot+string(filepath.Separator)) { - path = filepath.ToSlash(path[len(gopherjsRoot):]) - if f, err := gopherjspkg.FS.Open(path); err == nil { - return f, nil - } - } - return os.Open(path) - }, - } -} - -// statFile returns an os.FileInfo describing the named file. -// For files in "$GOROOT/src/github.com/gopherjs/gopherjs" directory, -// gopherjspkg.FS is consulted first. -func statFile(path string) (os.FileInfo, error) { - gopherjsRoot := filepath.Join(build.Default.GOROOT, "src", "github.com", "gopherjs", "gopherjs") - if strings.HasPrefix(path, gopherjsRoot+string(filepath.Separator)) { - path = filepath.ToSlash(path[len(gopherjsRoot):]) - if fi, err := vfsutil.Stat(gopherjspkg.FS, path); err == nil { - return fi, nil - } - } - return os.Stat(path) -} - -// Import returns details about the Go package named by the import path. If the -// path is a local import path naming a package that can be imported using -// a standard import path, the returned package will set p.ImportPath to -// that path. -// -// In the directory containing the package, .go and .inc.js files are -// considered part of the package except for: -// -// - .go files in package documentation -// - files starting with _ or . (likely editor temporary files) -// - files with build constraints not satisfied by the context -// -// If an error occurs, Import returns a non-nil error and a nil -// *PackageData. -func Import(path string, mode build.ImportMode, installSuffix string, buildTags []string) (*PackageData, error) { - wd, err := os.Getwd() - if err != nil { - // Getwd may fail if we're in GOARCH=js mode. That's okay, handle - // it by falling back to empty working directory. It just means - // Import will not be able to resolve relative import paths. - wd = "" - } - bctx := NewBuildContext(installSuffix, buildTags) - return importWithSrcDir(*bctx, path, wd, mode, installSuffix) -} - -func importWithSrcDir(bctx build.Context, path string, srcDir string, mode build.ImportMode, installSuffix string) (*PackageData, error) { - // bctx is passed by value, so it can be modified here. - var isVirtual bool - switch path { - case "syscall": - // syscall needs to use a typical GOARCH like amd64 to pick up definitions for _Socklen, BpfInsn, IFNAMSIZ, Timeval, BpfStat, SYS_FCNTL, Flock_t, etc. - bctx.GOARCH = runtime.GOARCH - bctx.InstallSuffix = "js" - if installSuffix != "" { - bctx.InstallSuffix += "_" + installSuffix - } - case "math/big": - // Use pure Go version of math/big; we don't want non-Go assembly versions. - bctx.BuildTags = append(bctx.BuildTags, "math_big_pure_go") - case "crypto/x509", "os/user": - // These stdlib packages have cgo and non-cgo versions (via build tags); we want the latter. - bctx.CgoEnabled = false - case "github.com/gopherjs/gopherjs/js", "github.com/gopherjs/gopherjs/nosync": - // These packages are already embedded via gopherjspkg.FS virtual filesystem (which can be - // safely vendored). Don't try to use vendor directory to resolve them. - mode |= build.IgnoreVendor - isVirtual = true - } - pkg, err := bctx.Import(path, srcDir, mode) - if err != nil { - return nil, err - } - - switch path { - case "os": - pkg.GoFiles = excludeExecutable(pkg.GoFiles) // Need to exclude executable implementation files, because some of them contain package scope variables that perform (indirectly) syscalls on init. - case "runtime": - pkg.GoFiles = []string{"error.go"} - case "runtime/internal/sys": - pkg.GoFiles = []string{fmt.Sprintf("zgoos_%s.go", bctx.GOOS), "zversion.go"} - case "runtime/pprof": - pkg.GoFiles = nil - case "internal/poll": - pkg.GoFiles = exclude(pkg.GoFiles, "fd_poll_runtime.go") - case "crypto/rand": - pkg.GoFiles = []string{"rand.go", "util.go"} - pkg.TestGoFiles = exclude(pkg.TestGoFiles, "rand_linux_test.go") // Don't want linux-specific tests (since linux-specific package files are excluded too). - } - - if len(pkg.CgoFiles) > 0 { - return nil, &ImportCError{path} - } - - if pkg.IsCommand() { - pkg.PkgObj = filepath.Join(pkg.BinDir, filepath.Base(pkg.ImportPath)+".js") - } - - if _, err := os.Stat(pkg.PkgObj); os.IsNotExist(err) && strings.HasPrefix(pkg.PkgObj, build.Default.GOROOT) { - // fall back to GOPATH - firstGopathWorkspace := filepath.SplitList(build.Default.GOPATH)[0] // TODO: Need to check inside all GOPATH workspaces. - gopathPkgObj := filepath.Join(firstGopathWorkspace, pkg.PkgObj[len(build.Default.GOROOT):]) - if _, err := os.Stat(gopathPkgObj); err == nil { - pkg.PkgObj = gopathPkgObj - } - } - - jsFiles, err := jsFilesFromDir(&bctx, pkg.Dir) - if err != nil { - return nil, err - } - - return &PackageData{Package: pkg, JSFiles: jsFiles, IsVirtual: isVirtual}, nil -} - -// excludeExecutable excludes all executable implementation .go files. -// They have "executable_" prefix. -func excludeExecutable(goFiles []string) []string { - var s []string - for _, f := range goFiles { - if strings.HasPrefix(f, "executable_") { - continue - } - s = append(s, f) - } - return s -} - -// exclude returns files, excluding specified files. -func exclude(files []string, exclude ...string) []string { - var s []string -Outer: - for _, f := range files { - for _, e := range exclude { - if f == e { - continue Outer - } - } - s = append(s, f) - } - return s -} - -// ImportDir is like Import but processes the Go package found in the named -// directory. -func ImportDir(dir string, mode build.ImportMode, installSuffix string, buildTags []string) (*PackageData, error) { - bctx := NewBuildContext(installSuffix, buildTags) - pkg, err := bctx.ImportDir(dir, mode) - if err != nil { - return nil, err - } - - jsFiles, err := jsFilesFromDir(bctx, pkg.Dir) - if err != nil { - return nil, err - } - - return &PackageData{Package: pkg, JSFiles: jsFiles}, nil -} - -// parseAndAugment parses and returns all .go files of given pkg. -// Standard Go library packages are augmented with files in compiler/natives folder. -// If isTest is true and pkg.ImportPath has no _test suffix, package is built for running internal tests. -// If isTest is true and pkg.ImportPath has _test suffix, package is built for running external tests. -// -// The native packages are augmented by the contents of natives.FS in the following way. -// The file names do not matter except the usual `_test` suffix. The files for -// native overrides get added to the package (even if they have the same name -// as an existing file from the standard library). For all identifiers that exist -// in the original AND the overrides, the original identifier in the AST gets -// replaced by `_`. New identifiers that don't exist in original package get added. -func parseAndAugment(bctx *build.Context, pkg *build.Package, isTest bool, fileSet *token.FileSet) ([]*ast.File, error) { - var files []*ast.File - replacedDeclNames := make(map[string]bool) - funcName := func(d *ast.FuncDecl) string { - if d.Recv == nil || len(d.Recv.List) == 0 { - return d.Name.Name - } - recv := d.Recv.List[0].Type - if star, ok := recv.(*ast.StarExpr); ok { - recv = star.X - } - return recv.(*ast.Ident).Name + "." + d.Name.Name - } - isXTest := strings.HasSuffix(pkg.ImportPath, "_test") - importPath := pkg.ImportPath - if isXTest { - importPath = importPath[:len(importPath)-5] - } - - nativesContext := &build.Context{ - GOROOT: "/", - GOOS: build.Default.GOOS, - GOARCH: "js", - Compiler: "gc", - JoinPath: path.Join, - SplitPathList: func(list string) []string { - if list == "" { - return nil - } - return strings.Split(list, "/") - }, - IsAbsPath: path.IsAbs, - IsDir: func(name string) bool { - dir, err := natives.FS.Open(name) - if err != nil { - return false - } - defer dir.Close() - info, err := dir.Stat() - if err != nil { - return false - } - return info.IsDir() - }, - HasSubdir: func(root, name string) (rel string, ok bool) { - panic("not implemented") - }, - ReadDir: func(name string) (fi []os.FileInfo, err error) { - dir, err := natives.FS.Open(name) - if err != nil { - return nil, err - } - defer dir.Close() - return dir.Readdir(0) - }, - OpenFile: func(name string) (r io.ReadCloser, err error) { - return natives.FS.Open(name) - }, - } - - // reflect needs to tell Go 1.11 apart from Go 1.11.1 for https://github.com/gopherjs/gopherjs/issues/862, - // so provide it with the custom go1.11.1 build tag whenever we're on Go 1.11.1 or later. - // TODO: Remove this ad hoc special behavior in GopherJS 1.12. - if runtime.Version() != "go1.11" { - nativesContext.ReleaseTags = append(nativesContext.ReleaseTags, "go1.11.1") - } - - if nativesPkg, err := nativesContext.Import(importPath, "", 0); err == nil { - names := nativesPkg.GoFiles - if isTest { - names = append(names, nativesPkg.TestGoFiles...) - } - if isXTest { - names = nativesPkg.XTestGoFiles - } - for _, name := range names { - fullPath := path.Join(nativesPkg.Dir, name) - r, err := nativesContext.OpenFile(fullPath) - if err != nil { - panic(err) - } - file, err := parser.ParseFile(fileSet, fullPath, r, parser.ParseComments) - if err != nil { - panic(err) - } - r.Close() - for _, decl := range file.Decls { - switch d := decl.(type) { - case *ast.FuncDecl: - replacedDeclNames[funcName(d)] = true - case *ast.GenDecl: - switch d.Tok { - case token.TYPE: - for _, spec := range d.Specs { - replacedDeclNames[spec.(*ast.TypeSpec).Name.Name] = true - } - case token.VAR, token.CONST: - for _, spec := range d.Specs { - for _, name := range spec.(*ast.ValueSpec).Names { - replacedDeclNames[name.Name] = true - } - } - } - } - } - files = append(files, file) - } - } - delete(replacedDeclNames, "init") - - var errList compiler.ErrorList - for _, name := range pkg.GoFiles { - if !filepath.IsAbs(name) { // name might be absolute if specified directly. E.g., `gopherjs build /abs/file.go`. - name = filepath.Join(pkg.Dir, name) - } - r, err := buildutil.OpenFile(bctx, name) - if err != nil { - return nil, err - } - file, err := parser.ParseFile(fileSet, name, r, parser.ParseComments) - r.Close() - if err != nil { - if list, isList := err.(scanner.ErrorList); isList { - if len(list) > 10 { - list = append(list[:10], &scanner.Error{Pos: list[9].Pos, Msg: "too many errors"}) - } - for _, entry := range list { - errList = append(errList, entry) - } - continue - } - errList = append(errList, err) - continue - } - - switch pkg.ImportPath { - case "crypto/rand", "encoding/gob", "encoding/json", "expvar", "go/token", "log", "math/big", "math/rand", "regexp", "testing", "time": - for _, spec := range file.Imports { - path, _ := strconv.Unquote(spec.Path.Value) - if path == "sync" { - if spec.Name == nil { - spec.Name = ast.NewIdent("sync") - } - spec.Path.Value = `"github.com/gopherjs/gopherjs/nosync"` - } - } - } - - for _, decl := range file.Decls { - switch d := decl.(type) { - case *ast.FuncDecl: - if replacedDeclNames[funcName(d)] { - d.Name = ast.NewIdent("_") - } - case *ast.GenDecl: - switch d.Tok { - case token.TYPE: - for _, spec := range d.Specs { - s := spec.(*ast.TypeSpec) - if replacedDeclNames[s.Name.Name] { - s.Name = ast.NewIdent("_") - } - } - case token.VAR, token.CONST: - for _, spec := range d.Specs { - s := spec.(*ast.ValueSpec) - for i, name := range s.Names { - if replacedDeclNames[name.Name] { - s.Names[i] = ast.NewIdent("_") - } - } - } - } - } - } - files = append(files, file) - } - if errList != nil { - return nil, errList - } - return files, nil -} - -type Options struct { - GOROOT string - GOPATH string - Verbose bool - Quiet bool - Watch bool - CreateMapFile bool - MapToLocalDisk bool - Minify bool - Color bool - BuildTags []string -} - -func (o *Options) PrintError(format string, a ...interface{}) { - if o.Color { - format = "\x1B[31m" + format + "\x1B[39m" - } - fmt.Fprintf(os.Stderr, format, a...) -} - -func (o *Options) PrintSuccess(format string, a ...interface{}) { - if o.Color { - format = "\x1B[32m" + format + "\x1B[39m" - } - fmt.Fprintf(os.Stderr, format, a...) -} - -type PackageData struct { - *build.Package - JSFiles []string - IsTest bool // IsTest is true if the package is being built for running tests. - SrcModTime time.Time - UpToDate bool - IsVirtual bool // If true, the package does not have a corresponding physical directory on disk. -} - -type Session struct { - options *Options - bctx *build.Context - Archives map[string]*compiler.Archive - Types map[string]*types.Package - Watcher *fsnotify.Watcher -} - -func NewSession(options *Options) *Session { - if options.GOROOT == "" { - options.GOROOT = build.Default.GOROOT - } - if options.GOPATH == "" { - options.GOPATH = build.Default.GOPATH - } - options.Verbose = options.Verbose || options.Watch - - s := &Session{ - options: options, - Archives: make(map[string]*compiler.Archive), - } - s.bctx = NewBuildContext(s.InstallSuffix(), s.options.BuildTags) - s.Types = make(map[string]*types.Package) - if options.Watch { - if out, err := exec.Command("ulimit", "-n").Output(); err == nil { - if n, err := strconv.Atoi(strings.TrimSpace(string(out))); err == nil && n < 1024 { - fmt.Printf("Warning: The maximum number of open file descriptors is very low (%d). Change it with 'ulimit -n 8192'.\n", n) - } - } - - var err error - s.Watcher, err = fsnotify.NewWatcher() - if err != nil { - panic(err) - } - } - return s -} - -// BuildContext returns the session's build context. -func (s *Session) BuildContext() *build.Context { return s.bctx } - -func (s *Session) InstallSuffix() string { - if s.options.Minify { - return "min" - } - return "" -} - -func (s *Session) BuildDir(packagePath string, importPath string, pkgObj string) error { - if s.Watcher != nil { - s.Watcher.Add(packagePath) - } - buildPkg, err := s.bctx.ImportDir(packagePath, 0) - if err != nil { - return err - } - pkg := &PackageData{Package: buildPkg} - jsFiles, err := jsFilesFromDir(s.bctx, pkg.Dir) - if err != nil { - return err - } - pkg.JSFiles = jsFiles - archive, err := s.BuildPackage(pkg) - if err != nil { - return err - } - if pkgObj == "" { - pkgObj = filepath.Base(packagePath) + ".js" - } - if pkg.IsCommand() && !pkg.UpToDate { - if err := s.WriteCommandPackage(archive, pkgObj); err != nil { - return err - } - } - return nil -} - -func (s *Session) BuildFiles(filenames []string, pkgObj string, packagePath string) error { - pkg := &PackageData{ - Package: &build.Package{ - Name: "main", - ImportPath: "main", - Dir: packagePath, - }, - } - - for _, file := range filenames { - if strings.HasSuffix(file, ".inc.js") { - pkg.JSFiles = append(pkg.JSFiles, file) - continue - } - pkg.GoFiles = append(pkg.GoFiles, file) - } - - archive, err := s.BuildPackage(pkg) - if err != nil { - return err - } - if s.Types["main"].Name() != "main" { - return fmt.Errorf("cannot build/run non-main package") - } - return s.WriteCommandPackage(archive, pkgObj) -} - -func (s *Session) BuildImportPath(path string) (*compiler.Archive, error) { - _, archive, err := s.buildImportPathWithSrcDir(path, "") - return archive, err -} - -func (s *Session) buildImportPathWithSrcDir(path string, srcDir string) (*PackageData, *compiler.Archive, error) { - pkg, err := importWithSrcDir(*s.bctx, path, srcDir, 0, s.InstallSuffix()) - if s.Watcher != nil && pkg != nil { // add watch even on error - s.Watcher.Add(pkg.Dir) - } - if err != nil { - return nil, nil, err - } - - archive, err := s.BuildPackage(pkg) - if err != nil { - return nil, nil, err - } - - return pkg, archive, nil -} - -func (s *Session) BuildPackage(pkg *PackageData) (*compiler.Archive, error) { - if archive, ok := s.Archives[pkg.ImportPath]; ok { - return archive, nil - } - - if pkg.PkgObj != "" { - var fileInfo os.FileInfo - gopherjsBinary, err := os.Executable() - if err == nil { - fileInfo, err = os.Stat(gopherjsBinary) - if err == nil { - pkg.SrcModTime = fileInfo.ModTime() - } - } - if err != nil { - os.Stderr.WriteString("Could not get GopherJS binary's modification timestamp. Please report issue.\n") - pkg.SrcModTime = time.Now() - } - - for _, importedPkgPath := range pkg.Imports { - // Ignore all imports that aren't mentioned in import specs of pkg. - // For example, this ignores imports such as runtime/internal/sys and runtime/internal/atomic. - ignored := true - for _, pos := range pkg.ImportPos[importedPkgPath] { - importFile := filepath.Base(pos.Filename) - for _, file := range pkg.GoFiles { - if importFile == file { - ignored = false - break - } - } - if !ignored { - break - } - } - - if importedPkgPath == "unsafe" || ignored { - continue - } - importedPkg, _, err := s.buildImportPathWithSrcDir(importedPkgPath, pkg.Dir) - if err != nil { - return nil, err - } - impModTime := importedPkg.SrcModTime - if impModTime.After(pkg.SrcModTime) { - pkg.SrcModTime = impModTime - } - } - - for _, name := range append(pkg.GoFiles, pkg.JSFiles...) { - fileInfo, err := statFile(filepath.Join(pkg.Dir, name)) - if err != nil { - return nil, err - } - if fileInfo.ModTime().After(pkg.SrcModTime) { - pkg.SrcModTime = fileInfo.ModTime() - } - } - - pkgObjFileInfo, err := os.Stat(pkg.PkgObj) - if err == nil && !pkg.SrcModTime.After(pkgObjFileInfo.ModTime()) { - // package object is up to date, load from disk if library - pkg.UpToDate = true - if pkg.IsCommand() { - return nil, nil - } - - objFile, err := os.Open(pkg.PkgObj) - if err != nil { - return nil, err - } - defer objFile.Close() - - archive, err := compiler.ReadArchive(pkg.PkgObj, pkg.ImportPath, objFile, s.Types) - if err != nil { - return nil, err - } - - s.Archives[pkg.ImportPath] = archive - return archive, err - } - } - - fileSet := token.NewFileSet() - files, err := parseAndAugment(s.bctx, pkg.Package, pkg.IsTest, fileSet) - if err != nil { - return nil, err - } - - localImportPathCache := make(map[string]*compiler.Archive) - importContext := &compiler.ImportContext{ - Packages: s.Types, - Import: func(path string) (*compiler.Archive, error) { - if archive, ok := localImportPathCache[path]; ok { - return archive, nil - } - _, archive, err := s.buildImportPathWithSrcDir(path, pkg.Dir) - if err != nil { - return nil, err - } - localImportPathCache[path] = archive - return archive, nil - }, - } - archive, err := compiler.Compile(pkg.ImportPath, files, fileSet, importContext, s.options.Minify) - if err != nil { - return nil, err - } - - for _, jsFile := range pkg.JSFiles { - code, err := ioutil.ReadFile(filepath.Join(pkg.Dir, jsFile)) - if err != nil { - return nil, err - } - archive.IncJSCode = append(archive.IncJSCode, []byte("\t(function() {\n")...) - archive.IncJSCode = append(archive.IncJSCode, code...) - archive.IncJSCode = append(archive.IncJSCode, []byte("\n\t}).call($global);\n")...) - } - - if s.options.Verbose { - fmt.Println(pkg.ImportPath) - } - - s.Archives[pkg.ImportPath] = archive - - if pkg.PkgObj == "" || pkg.IsCommand() { - return archive, nil - } - - if err := s.writeLibraryPackage(archive, pkg.PkgObj); err != nil { - if strings.HasPrefix(pkg.PkgObj, s.options.GOROOT) { - // fall back to first GOPATH workspace - firstGopathWorkspace := filepath.SplitList(s.options.GOPATH)[0] - if err := s.writeLibraryPackage(archive, filepath.Join(firstGopathWorkspace, pkg.PkgObj[len(s.options.GOROOT):])); err != nil { - return nil, err - } - return archive, nil - } - return nil, err - } - - return archive, nil -} - -func (s *Session) writeLibraryPackage(archive *compiler.Archive, pkgObj string) error { - if err := os.MkdirAll(filepath.Dir(pkgObj), 0777); err != nil { - return err - } - - objFile, err := os.Create(pkgObj) - if err != nil { - return err - } - defer objFile.Close() - - return compiler.WriteArchive(archive, objFile) -} - -func (s *Session) WriteCommandPackage(archive *compiler.Archive, pkgObj string) error { - if err := os.MkdirAll(filepath.Dir(pkgObj), 0777); err != nil { - return err - } - codeFile, err := os.Create(pkgObj) - if err != nil { - return err - } - defer codeFile.Close() - - sourceMapFilter := &compiler.SourceMapFilter{Writer: codeFile} - if s.options.CreateMapFile { - m := &sourcemap.Map{File: filepath.Base(pkgObj)} - mapFile, err := os.Create(pkgObj + ".map") - if err != nil { - return err - } - - defer func() { - m.WriteTo(mapFile) - mapFile.Close() - fmt.Fprintf(codeFile, "//# sourceMappingURL=%s.map\n", filepath.Base(pkgObj)) - }() - - sourceMapFilter.MappingCallback = NewMappingCallback(m, s.options.GOROOT, s.options.GOPATH, s.options.MapToLocalDisk) - } - - deps, err := compiler.ImportDependencies(archive, func(path string) (*compiler.Archive, error) { - if archive, ok := s.Archives[path]; ok { - return archive, nil - } - _, archive, err := s.buildImportPathWithSrcDir(path, "") - return archive, err - }) - if err != nil { - return err - } - return compiler.WriteProgramCode(deps, sourceMapFilter) -} - -func NewMappingCallback(m *sourcemap.Map, goroot, gopath string, localMap bool) func(generatedLine, generatedColumn int, originalPos token.Position) { - return func(generatedLine, generatedColumn int, originalPos token.Position) { - if !originalPos.IsValid() { - m.AddMapping(&sourcemap.Mapping{GeneratedLine: generatedLine, GeneratedColumn: generatedColumn}) - return - } - - file := originalPos.Filename - - switch hasGopathPrefix, prefixLen := hasGopathPrefix(file, gopath); { - case localMap: - // no-op: keep file as-is - case hasGopathPrefix: - file = filepath.ToSlash(file[prefixLen+4:]) - case strings.HasPrefix(file, goroot): - file = filepath.ToSlash(file[len(goroot)+4:]) - default: - file = filepath.Base(file) - } - - m.AddMapping(&sourcemap.Mapping{GeneratedLine: generatedLine, GeneratedColumn: generatedColumn, OriginalFile: file, OriginalLine: originalPos.Line, OriginalColumn: originalPos.Column}) - } -} - -func jsFilesFromDir(bctx *build.Context, dir string) ([]string, error) { - files, err := buildutil.ReadDir(bctx, dir) - if err != nil { - return nil, err - } - var jsFiles []string - for _, file := range files { - if strings.HasSuffix(file.Name(), ".inc.js") && file.Name()[0] != '_' && file.Name()[0] != '.' { - jsFiles = append(jsFiles, file.Name()) - } - } - return jsFiles, nil -} - -// hasGopathPrefix returns true and the length of the matched GOPATH workspace, -// iff file has a prefix that matches one of the GOPATH workspaces. -func hasGopathPrefix(file, gopath string) (hasGopathPrefix bool, prefixLen int) { - gopathWorkspaces := filepath.SplitList(gopath) - for _, gopathWorkspace := range gopathWorkspaces { - gopathWorkspace = filepath.Clean(gopathWorkspace) - if strings.HasPrefix(file, gopathWorkspace) { - return true, len(gopathWorkspace) - } - } - return false, 0 -} - -func (s *Session) WaitForChange() { - s.options.PrintSuccess("watching for changes...\n") - for { - select { - case ev := <-s.Watcher.Events: - if ev.Op&(fsnotify.Create|fsnotify.Write|fsnotify.Remove|fsnotify.Rename) == 0 || filepath.Base(ev.Name)[0] == '.' { - continue - } - if !strings.HasSuffix(ev.Name, ".go") && !strings.HasSuffix(ev.Name, ".inc.js") { - continue - } - s.options.PrintSuccess("change detected: %s\n", ev.Name) - case err := <-s.Watcher.Errors: - s.options.PrintError("watcher error: %s\n", err.Error()) - } - break - } - - go func() { - for range s.Watcher.Events { - // consume, else Close() may deadlock - } - }() - s.Watcher.Close() -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/analysis/bool.go b/vendor/github.com/gopherjs/gopherjs/compiler/analysis/bool.go deleted file mode 100644 index cba7c1c14..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/analysis/bool.go +++ /dev/null @@ -1,43 +0,0 @@ -package analysis - -import ( - "go/ast" - "go/constant" - "go/token" - "go/types" -) - -func BoolValue(expr ast.Expr, info *types.Info) (bool, bool) { - v := info.Types[expr].Value - if v != nil && v.Kind() == constant.Bool { - return constant.BoolVal(v), true - } - switch e := expr.(type) { - case *ast.BinaryExpr: - switch e.Op { - case token.LAND: - if b, ok := BoolValue(e.X, info); ok { - if !b { - return false, true - } - return BoolValue(e.Y, info) - } - case token.LOR: - if b, ok := BoolValue(e.X, info); ok { - if b { - return true, true - } - return BoolValue(e.Y, info) - } - } - case *ast.UnaryExpr: - if e.Op == token.NOT { - if b, ok := BoolValue(e.X, info); ok { - return !b, true - } - } - case *ast.ParenExpr: - return BoolValue(e.X, info) - } - return false, false -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/analysis/break.go b/vendor/github.com/gopherjs/gopherjs/compiler/analysis/break.go deleted file mode 100644 index 579815d92..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/analysis/break.go +++ /dev/null @@ -1,32 +0,0 @@ -package analysis - -import ( - "go/ast" - "go/token" -) - -func HasBreak(n ast.Node) bool { - v := hasBreakVisitor{} - ast.Walk(&v, n) - return v.hasBreak -} - -type hasBreakVisitor struct { - hasBreak bool -} - -func (v *hasBreakVisitor) Visit(node ast.Node) (w ast.Visitor) { - if v.hasBreak { - return nil - } - switch n := node.(type) { - case *ast.BranchStmt: - if n.Tok == token.BREAK && n.Label == nil { - v.hasBreak = true - return nil - } - case *ast.ForStmt, *ast.RangeStmt, *ast.SwitchStmt, *ast.TypeSwitchStmt, *ast.SelectStmt, ast.Expr: - return nil - } - return v -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/analysis/escape.go b/vendor/github.com/gopherjs/gopherjs/compiler/analysis/escape.go deleted file mode 100644 index 2807ecf64..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/analysis/escape.go +++ /dev/null @@ -1,70 +0,0 @@ -package analysis - -import ( - "go/ast" - "go/token" - "go/types" -) - -func EscapingObjects(n ast.Node, info *types.Info) []*types.Var { - v := escapeAnalysis{ - info: info, - escaping: make(map[*types.Var]bool), - topScope: info.Scopes[n], - bottomScopes: make(map[*types.Scope]bool), - } - ast.Walk(&v, n) - var list []*types.Var - for obj := range v.escaping { - list = append(list, obj) - } - return list -} - -type escapeAnalysis struct { - info *types.Info - escaping map[*types.Var]bool - topScope *types.Scope - bottomScopes map[*types.Scope]bool -} - -func (v *escapeAnalysis) Visit(node ast.Node) (w ast.Visitor) { - // huge overapproximation - switch n := node.(type) { - case *ast.UnaryExpr: - if n.Op == token.AND { - if _, ok := n.X.(*ast.Ident); ok { - return &escapingObjectCollector{v} - } - } - case *ast.FuncLit: - v.bottomScopes[v.info.Scopes[n.Type]] = true - return &escapingObjectCollector{v} - case *ast.ForStmt: - v.bottomScopes[v.info.Scopes[n.Body]] = true - case *ast.RangeStmt: - v.bottomScopes[v.info.Scopes[n.Body]] = true - } - return v -} - -type escapingObjectCollector struct { - analysis *escapeAnalysis -} - -func (v *escapingObjectCollector) Visit(node ast.Node) (w ast.Visitor) { - if id, ok := node.(*ast.Ident); ok { - if obj, ok := v.analysis.info.Uses[id].(*types.Var); ok { - for s := obj.Parent(); s != nil; s = s.Parent() { - if s == v.analysis.topScope { - v.analysis.escaping[obj] = true - break - } - if v.analysis.bottomScopes[s] { - break - } - } - } - } - return v -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/analysis/info.go b/vendor/github.com/gopherjs/gopherjs/compiler/analysis/info.go deleted file mode 100644 index a8181615f..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/analysis/info.go +++ /dev/null @@ -1,254 +0,0 @@ -package analysis - -import ( - "go/ast" - "go/token" - "go/types" - - "github.com/gopherjs/gopherjs/compiler/astutil" - "github.com/gopherjs/gopherjs/compiler/typesutil" -) - -type continueStmt struct { - forStmt *ast.ForStmt - analyzeStack []ast.Node -} - -type Info struct { - *types.Info - Pkg *types.Package - IsBlocking func(*types.Func) bool - HasPointer map[*types.Var]bool - FuncDeclInfos map[*types.Func]*FuncInfo - FuncLitInfos map[*ast.FuncLit]*FuncInfo - InitFuncInfo *FuncInfo - allInfos []*FuncInfo - comments ast.CommentMap -} - -type FuncInfo struct { - HasDefer bool - Flattened map[ast.Node]bool - Blocking map[ast.Node]bool - GotoLabel map[*types.Label]bool - LocalCalls map[*types.Func][][]ast.Node - ContinueStmts []continueStmt - p *Info - analyzeStack []ast.Node -} - -func (info *Info) newFuncInfo() *FuncInfo { - funcInfo := &FuncInfo{ - p: info, - Flattened: make(map[ast.Node]bool), - Blocking: make(map[ast.Node]bool), - GotoLabel: make(map[*types.Label]bool), - LocalCalls: make(map[*types.Func][][]ast.Node), - } - info.allInfos = append(info.allInfos, funcInfo) - return funcInfo -} - -func AnalyzePkg(files []*ast.File, fileSet *token.FileSet, typesInfo *types.Info, typesPkg *types.Package, isBlocking func(*types.Func) bool) *Info { - info := &Info{ - Info: typesInfo, - Pkg: typesPkg, - HasPointer: make(map[*types.Var]bool), - comments: make(ast.CommentMap), - IsBlocking: isBlocking, - FuncDeclInfos: make(map[*types.Func]*FuncInfo), - FuncLitInfos: make(map[*ast.FuncLit]*FuncInfo), - } - info.InitFuncInfo = info.newFuncInfo() - - for _, file := range files { - for k, v := range ast.NewCommentMap(fileSet, file, file.Comments) { - info.comments[k] = v - } - ast.Walk(info.InitFuncInfo, file) - } - - for { - done := true - for _, funcInfo := range info.allInfos { - for obj, calls := range funcInfo.LocalCalls { - if len(info.FuncDeclInfos[obj].Blocking) != 0 { - for _, call := range calls { - funcInfo.markBlocking(call) - } - delete(funcInfo.LocalCalls, obj) - done = false - } - } - } - if done { - break - } - } - - for _, funcInfo := range info.allInfos { - for _, continueStmt := range funcInfo.ContinueStmts { - if funcInfo.Blocking[continueStmt.forStmt.Post] { - funcInfo.markBlocking(continueStmt.analyzeStack) - } - } - } - - return info -} - -func (c *FuncInfo) Visit(node ast.Node) ast.Visitor { - if node == nil { - if len(c.analyzeStack) != 0 { - c.analyzeStack = c.analyzeStack[:len(c.analyzeStack)-1] - } - return nil - } - c.analyzeStack = append(c.analyzeStack, node) - - switch n := node.(type) { - case *ast.FuncDecl: - newInfo := c.p.newFuncInfo() - c.p.FuncDeclInfos[c.p.Defs[n.Name].(*types.Func)] = newInfo - return newInfo - case *ast.FuncLit: - newInfo := c.p.newFuncInfo() - c.p.FuncLitInfos[n] = newInfo - return newInfo - case *ast.BranchStmt: - switch n.Tok { - case token.GOTO: - for _, n2 := range c.analyzeStack { - c.Flattened[n2] = true - } - c.GotoLabel[c.p.Uses[n.Label].(*types.Label)] = true - case token.CONTINUE: - if n.Label != nil { - label := c.p.Uses[n.Label].(*types.Label) - for i := len(c.analyzeStack) - 1; i >= 0; i-- { - if labelStmt, ok := c.analyzeStack[i].(*ast.LabeledStmt); ok && c.p.Defs[labelStmt.Label] == label { - if _, ok := labelStmt.Stmt.(*ast.RangeStmt); ok { - return nil - } - stack := make([]ast.Node, len(c.analyzeStack)) - copy(stack, c.analyzeStack) - c.ContinueStmts = append(c.ContinueStmts, continueStmt{labelStmt.Stmt.(*ast.ForStmt), stack}) - return nil - } - } - return nil - } - for i := len(c.analyzeStack) - 1; i >= 0; i-- { - if _, ok := c.analyzeStack[i].(*ast.RangeStmt); ok { - return nil - } - if forStmt, ok := c.analyzeStack[i].(*ast.ForStmt); ok { - stack := make([]ast.Node, len(c.analyzeStack)) - copy(stack, c.analyzeStack) - c.ContinueStmts = append(c.ContinueStmts, continueStmt{forStmt, stack}) - return nil - } - } - } - case *ast.CallExpr: - callTo := func(obj types.Object) { - switch o := obj.(type) { - case *types.Func: - if recv := o.Type().(*types.Signature).Recv(); recv != nil { - if _, ok := recv.Type().Underlying().(*types.Interface); ok { - c.markBlocking(c.analyzeStack) - return - } - } - if o.Pkg() != c.p.Pkg { - if c.p.IsBlocking(o) { - c.markBlocking(c.analyzeStack) - } - return - } - stack := make([]ast.Node, len(c.analyzeStack)) - copy(stack, c.analyzeStack) - c.LocalCalls[o] = append(c.LocalCalls[o], stack) - case *types.Var: - c.markBlocking(c.analyzeStack) - } - } - switch f := astutil.RemoveParens(n.Fun).(type) { - case *ast.Ident: - callTo(c.p.Uses[f]) - case *ast.SelectorExpr: - if sel := c.p.Selections[f]; sel != nil && typesutil.IsJsObject(sel.Recv()) { - break - } - callTo(c.p.Uses[f.Sel]) - case *ast.FuncLit: - ast.Walk(c, n.Fun) - for _, arg := range n.Args { - ast.Walk(c, arg) - } - if len(c.p.FuncLitInfos[f].Blocking) != 0 { - c.markBlocking(c.analyzeStack) - } - return nil - default: - if !astutil.IsTypeExpr(f, c.p.Info) { - c.markBlocking(c.analyzeStack) - } - } - case *ast.SendStmt: - c.markBlocking(c.analyzeStack) - case *ast.UnaryExpr: - switch n.Op { - case token.AND: - if id, ok := astutil.RemoveParens(n.X).(*ast.Ident); ok { - c.p.HasPointer[c.p.Uses[id].(*types.Var)] = true - } - case token.ARROW: - c.markBlocking(c.analyzeStack) - } - case *ast.RangeStmt: - if _, ok := c.p.TypeOf(n.X).Underlying().(*types.Chan); ok { - c.markBlocking(c.analyzeStack) - } - case *ast.SelectStmt: - for _, s := range n.Body.List { - if s.(*ast.CommClause).Comm == nil { // default clause - return c - } - } - c.markBlocking(c.analyzeStack) - case *ast.CommClause: - switch comm := n.Comm.(type) { - case *ast.SendStmt: - ast.Walk(c, comm.Chan) - ast.Walk(c, comm.Value) - case *ast.ExprStmt: - ast.Walk(c, comm.X.(*ast.UnaryExpr).X) - case *ast.AssignStmt: - ast.Walk(c, comm.Rhs[0].(*ast.UnaryExpr).X) - } - for _, s := range n.Body { - ast.Walk(c, s) - } - return nil - case *ast.GoStmt: - ast.Walk(c, n.Call.Fun) - for _, arg := range n.Call.Args { - ast.Walk(c, arg) - } - return nil - case *ast.DeferStmt: - c.HasDefer = true - if funcLit, ok := n.Call.Fun.(*ast.FuncLit); ok { - ast.Walk(c, funcLit.Body) - } - } - return c -} - -func (c *FuncInfo) markBlocking(stack []ast.Node) { - for _, n := range stack { - c.Blocking[n] = true - c.Flattened[n] = true - } -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/analysis/sideeffect.go b/vendor/github.com/gopherjs/gopherjs/compiler/analysis/sideeffect.go deleted file mode 100644 index a94d92b67..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/analysis/sideeffect.go +++ /dev/null @@ -1,37 +0,0 @@ -package analysis - -import ( - "go/ast" - "go/token" - "go/types" -) - -func HasSideEffect(n ast.Node, info *types.Info) bool { - v := hasSideEffectVisitor{info: info} - ast.Walk(&v, n) - return v.hasSideEffect -} - -type hasSideEffectVisitor struct { - info *types.Info - hasSideEffect bool -} - -func (v *hasSideEffectVisitor) Visit(node ast.Node) (w ast.Visitor) { - if v.hasSideEffect { - return nil - } - switch n := node.(type) { - case *ast.CallExpr: - if _, isSig := v.info.TypeOf(n.Fun).(*types.Signature); isSig { // skip conversions - v.hasSideEffect = true - return nil - } - case *ast.UnaryExpr: - if n.Op == token.ARROW { - v.hasSideEffect = true - return nil - } - } - return v -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/astutil/astutil.go b/vendor/github.com/gopherjs/gopherjs/compiler/astutil/astutil.go deleted file mode 100644 index 7cd93b3dd..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/astutil/astutil.go +++ /dev/null @@ -1,48 +0,0 @@ -package astutil - -import ( - "go/ast" - "go/types" -) - -func RemoveParens(e ast.Expr) ast.Expr { - for { - p, isParen := e.(*ast.ParenExpr) - if !isParen { - return e - } - e = p.X - } -} - -func SetType(info *types.Info, t types.Type, e ast.Expr) ast.Expr { - info.Types[e] = types.TypeAndValue{Type: t} - return e -} - -func NewIdent(name string, t types.Type, info *types.Info, pkg *types.Package) *ast.Ident { - ident := ast.NewIdent(name) - info.Types[ident] = types.TypeAndValue{Type: t} - obj := types.NewVar(0, pkg, name, t) - info.Uses[ident] = obj - return ident -} - -func IsTypeExpr(expr ast.Expr, info *types.Info) bool { - switch e := expr.(type) { - case *ast.ArrayType, *ast.ChanType, *ast.FuncType, *ast.InterfaceType, *ast.MapType, *ast.StructType: - return true - case *ast.StarExpr: - return IsTypeExpr(e.X, info) - case *ast.Ident: - _, ok := info.Uses[e].(*types.TypeName) - return ok - case *ast.SelectorExpr: - _, ok := info.Uses[e.Sel].(*types.TypeName) - return ok - case *ast.ParenExpr: - return IsTypeExpr(e.X, info) - default: - return false - } -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/compiler.go b/vendor/github.com/gopherjs/gopherjs/compiler/compiler.go deleted file mode 100644 index 36ec91a8e..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/compiler.go +++ /dev/null @@ -1,297 +0,0 @@ -package compiler - -import ( - "bytes" - "encoding/binary" - "encoding/gob" - "encoding/json" - "fmt" - "go/token" - "go/types" - "io" - "strings" - - "github.com/gopherjs/gopherjs/compiler/prelude" - "golang.org/x/tools/go/gcexportdata" -) - -var sizes32 = &types.StdSizes{WordSize: 4, MaxAlign: 8} -var reservedKeywords = make(map[string]bool) -var _ = ___GOPHERJS_REQUIRES_GO_VERSION_1_12___ // Compile error on other Go versions, because they're not supported. - -func init() { - for _, keyword := range []string{"abstract", "arguments", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "eval", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "typeof", "undefined", "var", "void", "volatile", "while", "with", "yield"} { - reservedKeywords[keyword] = true - } -} - -type ErrorList []error - -func (err ErrorList) Error() string { - return err[0].Error() -} - -type Archive struct { - ImportPath string - Name string - Imports []string - ExportData []byte - Declarations []*Decl - IncJSCode []byte - FileSet []byte - Minified bool -} - -type Decl struct { - FullName string - Vars []string - DeclCode []byte - MethodListCode []byte - TypeInitCode []byte - InitCode []byte - DceObjectFilter string - DceMethodFilter string - DceDeps []string - Blocking bool -} - -type Dependency struct { - Pkg string - Type string - Method string -} - -func ImportDependencies(archive *Archive, importPkg func(string) (*Archive, error)) ([]*Archive, error) { - var deps []*Archive - paths := make(map[string]bool) - var collectDependencies func(path string) error - collectDependencies = func(path string) error { - if paths[path] { - return nil - } - dep, err := importPkg(path) - if err != nil { - return err - } - for _, imp := range dep.Imports { - if err := collectDependencies(imp); err != nil { - return err - } - } - deps = append(deps, dep) - paths[dep.ImportPath] = true - return nil - } - - if err := collectDependencies("runtime"); err != nil { - return nil, err - } - for _, imp := range archive.Imports { - if err := collectDependencies(imp); err != nil { - return nil, err - } - } - - deps = append(deps, archive) - return deps, nil -} - -type dceInfo struct { - decl *Decl - objectFilter string - methodFilter string -} - -func WriteProgramCode(pkgs []*Archive, w *SourceMapFilter) error { - mainPkg := pkgs[len(pkgs)-1] - minify := mainPkg.Minified - - byFilter := make(map[string][]*dceInfo) - var pendingDecls []*Decl - for _, pkg := range pkgs { - for _, d := range pkg.Declarations { - if d.DceObjectFilter == "" && d.DceMethodFilter == "" { - pendingDecls = append(pendingDecls, d) - continue - } - info := &dceInfo{decl: d} - if d.DceObjectFilter != "" { - info.objectFilter = pkg.ImportPath + "." + d.DceObjectFilter - byFilter[info.objectFilter] = append(byFilter[info.objectFilter], info) - } - if d.DceMethodFilter != "" { - info.methodFilter = pkg.ImportPath + "." + d.DceMethodFilter - byFilter[info.methodFilter] = append(byFilter[info.methodFilter], info) - } - } - } - - dceSelection := make(map[*Decl]struct{}) - for len(pendingDecls) != 0 { - d := pendingDecls[len(pendingDecls)-1] - pendingDecls = pendingDecls[:len(pendingDecls)-1] - - dceSelection[d] = struct{}{} - - for _, dep := range d.DceDeps { - if infos, ok := byFilter[dep]; ok { - delete(byFilter, dep) - for _, info := range infos { - if info.objectFilter == dep { - info.objectFilter = "" - } - if info.methodFilter == dep { - info.methodFilter = "" - } - if info.objectFilter == "" && info.methodFilter == "" { - pendingDecls = append(pendingDecls, info.decl) - } - } - } - } - } - - if _, err := w.Write([]byte("\"use strict\";\n(function() {\n\n")); err != nil { - return err - } - preludeJS := prelude.Prelude - if minify { - preludeJS = prelude.Minified - } - if _, err := io.WriteString(w, preludeJS); err != nil { - return err - } - if _, err := w.Write([]byte("\n")); err != nil { - return err - } - - // write packages - for _, pkg := range pkgs { - if err := WritePkgCode(pkg, dceSelection, minify, w); err != nil { - return err - } - } - - if _, err := w.Write([]byte("$synthesizeMethods();\nvar $mainPkg = $packages[\"" + string(mainPkg.ImportPath) + "\"];\n$packages[\"runtime\"].$init();\n$go($mainPkg.$init, []);\n$flushConsole();\n\n}).call(this);\n")); err != nil { - return err - } - - return nil -} - -func WritePkgCode(pkg *Archive, dceSelection map[*Decl]struct{}, minify bool, w *SourceMapFilter) error { - if w.MappingCallback != nil && pkg.FileSet != nil { - w.fileSet = token.NewFileSet() - if err := w.fileSet.Read(json.NewDecoder(bytes.NewReader(pkg.FileSet)).Decode); err != nil { - panic(err) - } - } - if _, err := w.Write(pkg.IncJSCode); err != nil { - return err - } - if _, err := w.Write(removeWhitespace([]byte(fmt.Sprintf("$packages[\"%s\"] = (function() {\n", pkg.ImportPath)), minify)); err != nil { - return err - } - vars := []string{"$pkg = {}", "$init"} - var filteredDecls []*Decl - for _, d := range pkg.Declarations { - if _, ok := dceSelection[d]; ok { - vars = append(vars, d.Vars...) - filteredDecls = append(filteredDecls, d) - } - } - if _, err := w.Write(removeWhitespace([]byte(fmt.Sprintf("\tvar %s;\n", strings.Join(vars, ", "))), minify)); err != nil { - return err - } - for _, d := range filteredDecls { - if _, err := w.Write(d.DeclCode); err != nil { - return err - } - } - for _, d := range filteredDecls { - if _, err := w.Write(d.MethodListCode); err != nil { - return err - } - } - for _, d := range filteredDecls { - if _, err := w.Write(d.TypeInitCode); err != nil { - return err - } - } - - if _, err := w.Write(removeWhitespace([]byte("\t$init = function() {\n\t\t$pkg.$init = function() {};\n\t\t/* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:\n"), minify)); err != nil { - return err - } - for _, d := range filteredDecls { - if _, err := w.Write(d.InitCode); err != nil { - return err - } - } - if _, err := w.Write(removeWhitespace([]byte("\t\t/* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;\n\t};\n\t$pkg.$init = $init;\n\treturn $pkg;\n})();"), minify)); err != nil { - return err - } - if _, err := w.Write([]byte("\n")); err != nil { // keep this \n even when minified - return err - } - return nil -} - -func ReadArchive(filename, path string, r io.Reader, packages map[string]*types.Package) (*Archive, error) { - var a Archive - if err := gob.NewDecoder(r).Decode(&a); err != nil { - return nil, err - } - - var err error - packages[path], err = gcexportdata.Read(bytes.NewReader(a.ExportData), token.NewFileSet(), packages, path) - if err != nil { - return nil, err - } - - return &a, nil -} - -func WriteArchive(a *Archive, w io.Writer) error { - return gob.NewEncoder(w).Encode(a) -} - -type SourceMapFilter struct { - Writer io.Writer - MappingCallback func(generatedLine, generatedColumn int, originalPos token.Position) - line int - column int - fileSet *token.FileSet -} - -func (f *SourceMapFilter) Write(p []byte) (n int, err error) { - var n2 int - for { - i := bytes.IndexByte(p, '\b') - w := p - if i != -1 { - w = p[:i] - } - - n2, err = f.Writer.Write(w) - n += n2 - for { - i := bytes.IndexByte(w, '\n') - if i == -1 { - f.column += len(w) - break - } - f.line++ - f.column = 0 - w = w[i+1:] - } - - if err != nil || i == -1 { - return - } - if f.MappingCallback != nil { - f.MappingCallback(f.line+1, f.column, f.fileSet.Position(token.Pos(binary.BigEndian.Uint32(p[i+1:i+5])))) - } - p = p[i+5:] - n += 5 - } -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/expressions.go b/vendor/github.com/gopherjs/gopherjs/compiler/expressions.go deleted file mode 100644 index 42fe624b6..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/expressions.go +++ /dev/null @@ -1,1373 +0,0 @@ -package compiler - -import ( - "bytes" - "fmt" - "go/ast" - "go/constant" - "go/token" - "go/types" - "sort" - "strconv" - "strings" - - "github.com/gopherjs/gopherjs/compiler/analysis" - "github.com/gopherjs/gopherjs/compiler/astutil" - "github.com/gopherjs/gopherjs/compiler/typesutil" -) - -type expression struct { - str string - parens bool -} - -func (e *expression) String() string { - return e.str -} - -func (e *expression) StringWithParens() string { - if e.parens { - return "(" + e.str + ")" - } - return e.str -} - -func (c *funcContext) translateExpr(expr ast.Expr) *expression { - exprType := c.p.TypeOf(expr) - if value := c.p.Types[expr].Value; value != nil { - basic := exprType.Underlying().(*types.Basic) - switch { - case isBoolean(basic): - return c.formatExpr("%s", strconv.FormatBool(constant.BoolVal(value))) - case isInteger(basic): - if is64Bit(basic) { - if basic.Kind() == types.Int64 { - d, ok := constant.Int64Val(constant.ToInt(value)) - if !ok { - panic("could not get exact uint") - } - return c.formatExpr("new %s(%s, %s)", c.typeName(exprType), strconv.FormatInt(d>>32, 10), strconv.FormatUint(uint64(d)&(1<<32-1), 10)) - } - d, ok := constant.Uint64Val(constant.ToInt(value)) - if !ok { - panic("could not get exact uint") - } - return c.formatExpr("new %s(%s, %s)", c.typeName(exprType), strconv.FormatUint(d>>32, 10), strconv.FormatUint(d&(1<<32-1), 10)) - } - d, ok := constant.Int64Val(constant.ToInt(value)) - if !ok { - panic("could not get exact int") - } - return c.formatExpr("%s", strconv.FormatInt(d, 10)) - case isFloat(basic): - f, _ := constant.Float64Val(value) - return c.formatExpr("%s", strconv.FormatFloat(f, 'g', -1, 64)) - case isComplex(basic): - r, _ := constant.Float64Val(constant.Real(value)) - i, _ := constant.Float64Val(constant.Imag(value)) - if basic.Kind() == types.UntypedComplex { - exprType = types.Typ[types.Complex128] - } - return c.formatExpr("new %s(%s, %s)", c.typeName(exprType), strconv.FormatFloat(r, 'g', -1, 64), strconv.FormatFloat(i, 'g', -1, 64)) - case isString(basic): - return c.formatExpr("%s", encodeString(constant.StringVal(value))) - default: - panic("Unhandled constant type: " + basic.String()) - } - } - - var obj types.Object - switch e := expr.(type) { - case *ast.SelectorExpr: - obj = c.p.Uses[e.Sel] - case *ast.Ident: - obj = c.p.Defs[e] - if obj == nil { - obj = c.p.Uses[e] - } - } - - if obj != nil && typesutil.IsJsPackage(obj.Pkg()) { - switch obj.Name() { - case "Global": - return c.formatExpr("$global") - case "Module": - return c.formatExpr("$module") - case "Undefined": - return c.formatExpr("undefined") - } - } - - switch e := expr.(type) { - case *ast.CompositeLit: - if ptrType, isPointer := exprType.(*types.Pointer); isPointer { - exprType = ptrType.Elem() - } - - collectIndexedElements := func(elementType types.Type) []string { - var elements []string - i := 0 - zero := c.translateExpr(c.zeroValue(elementType)).String() - for _, element := range e.Elts { - if kve, isKve := element.(*ast.KeyValueExpr); isKve { - key, ok := constant.Int64Val(constant.ToInt(c.p.Types[kve.Key].Value)) - if !ok { - panic("could not get exact int") - } - i = int(key) - element = kve.Value - } - for len(elements) <= i { - elements = append(elements, zero) - } - elements[i] = c.translateImplicitConversionWithCloning(element, elementType).String() - i++ - } - return elements - } - - switch t := exprType.Underlying().(type) { - case *types.Array: - elements := collectIndexedElements(t.Elem()) - if len(elements) == 0 { - return c.formatExpr("%s.zero()", c.typeName(t)) - } - zero := c.translateExpr(c.zeroValue(t.Elem())).String() - for len(elements) < int(t.Len()) { - elements = append(elements, zero) - } - return c.formatExpr(`$toNativeArray(%s, [%s])`, typeKind(t.Elem()), strings.Join(elements, ", ")) - case *types.Slice: - return c.formatExpr("new %s([%s])", c.typeName(exprType), strings.Join(collectIndexedElements(t.Elem()), ", ")) - case *types.Map: - entries := make([]string, len(e.Elts)) - for i, element := range e.Elts { - kve := element.(*ast.KeyValueExpr) - entries[i] = fmt.Sprintf("{ k: %s, v: %s }", c.translateImplicitConversionWithCloning(kve.Key, t.Key()), c.translateImplicitConversionWithCloning(kve.Value, t.Elem())) - } - return c.formatExpr("$makeMap(%s.keyFor, [%s])", c.typeName(t.Key()), strings.Join(entries, ", ")) - case *types.Struct: - elements := make([]string, t.NumFields()) - isKeyValue := true - if len(e.Elts) != 0 { - _, isKeyValue = e.Elts[0].(*ast.KeyValueExpr) - } - if !isKeyValue { - for i, element := range e.Elts { - elements[i] = c.translateImplicitConversionWithCloning(element, t.Field(i).Type()).String() - } - } - if isKeyValue { - for i := range elements { - elements[i] = c.translateExpr(c.zeroValue(t.Field(i).Type())).String() - } - for _, element := range e.Elts { - kve := element.(*ast.KeyValueExpr) - for j := range elements { - if kve.Key.(*ast.Ident).Name == t.Field(j).Name() { - elements[j] = c.translateImplicitConversionWithCloning(kve.Value, t.Field(j).Type()).String() - break - } - } - } - } - return c.formatExpr("new %s.ptr(%s)", c.typeName(exprType), strings.Join(elements, ", ")) - default: - panic(fmt.Sprintf("Unhandled CompositeLit type: %T\n", t)) - } - - case *ast.FuncLit: - _, fun := translateFunction(e.Type, nil, e.Body, c, exprType.(*types.Signature), c.p.FuncLitInfos[e], "") - if len(c.p.escapingVars) != 0 { - names := make([]string, 0, len(c.p.escapingVars)) - for obj := range c.p.escapingVars { - names = append(names, c.p.objectNames[obj]) - } - sort.Strings(names) - list := strings.Join(names, ", ") - return c.formatExpr("(function(%s) { return %s; })(%s)", list, fun, list) - } - return c.formatExpr("(%s)", fun) - - case *ast.UnaryExpr: - t := c.p.TypeOf(e.X) - switch e.Op { - case token.AND: - if typesutil.IsJsObject(exprType) { - return c.formatExpr("%e.object", e.X) - } - - switch t.Underlying().(type) { - case *types.Struct, *types.Array: - return c.translateExpr(e.X) - } - - switch x := astutil.RemoveParens(e.X).(type) { - case *ast.CompositeLit: - return c.formatExpr("$newDataPointer(%e, %s)", x, c.typeName(c.p.TypeOf(e))) - case *ast.Ident: - obj := c.p.Uses[x].(*types.Var) - if c.p.escapingVars[obj] { - return c.formatExpr("(%1s.$ptr || (%1s.$ptr = new %2s(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, %1s)))", c.p.objectNames[obj], c.typeName(exprType)) - } - return c.formatExpr(`(%1s || (%1s = new %2s(function() { return %3s; }, function($v) { %4s })))`, c.varPtrName(obj), c.typeName(exprType), c.objectName(obj), c.translateAssign(x, c.newIdent("$v", exprType), false)) - case *ast.SelectorExpr: - sel, ok := c.p.SelectionOf(x) - if !ok { - // qualified identifier - obj := c.p.Uses[x.Sel].(*types.Var) - return c.formatExpr(`(%1s || (%1s = new %2s(function() { return %3s; }, function($v) { %4s })))`, c.varPtrName(obj), c.typeName(exprType), c.objectName(obj), c.translateAssign(x, c.newIdent("$v", exprType), false)) - } - newSel := &ast.SelectorExpr{X: c.newIdent("this.$target", c.p.TypeOf(x.X)), Sel: x.Sel} - c.setType(newSel, exprType) - c.p.additionalSelections[newSel] = sel - return c.formatExpr("(%1e.$ptr_%2s || (%1e.$ptr_%2s = new %3s(function() { return %4e; }, function($v) { %5s }, %1e)))", x.X, x.Sel.Name, c.typeName(exprType), newSel, c.translateAssign(newSel, c.newIdent("$v", exprType), false)) - case *ast.IndexExpr: - if _, ok := c.p.TypeOf(x.X).Underlying().(*types.Slice); ok { - return c.formatExpr("$indexPtr(%1e.$array, %1e.$offset + %2e, %3s)", x.X, x.Index, c.typeName(exprType)) - } - return c.formatExpr("$indexPtr(%e, %e, %s)", x.X, x.Index, c.typeName(exprType)) - case *ast.StarExpr: - return c.translateExpr(x.X) - default: - panic(fmt.Sprintf("Unhandled: %T\n", x)) - } - - case token.ARROW: - call := &ast.CallExpr{ - Fun: c.newIdent("$recv", types.NewSignature(nil, types.NewTuple(types.NewVar(0, nil, "", t)), types.NewTuple(types.NewVar(0, nil, "", exprType), types.NewVar(0, nil, "", types.Typ[types.Bool])), false)), - Args: []ast.Expr{e.X}, - } - c.Blocking[call] = true - if _, isTuple := exprType.(*types.Tuple); isTuple { - return c.formatExpr("%e", call) - } - return c.formatExpr("%e[0]", call) - } - - basic := t.Underlying().(*types.Basic) - switch e.Op { - case token.ADD: - return c.translateExpr(e.X) - case token.SUB: - switch { - case is64Bit(basic): - return c.formatExpr("new %1s(-%2h, -%2l)", c.typeName(t), e.X) - case isComplex(basic): - return c.formatExpr("new %1s(-%2r, -%2i)", c.typeName(t), e.X) - case isUnsigned(basic): - return c.fixNumber(c.formatExpr("-%e", e.X), basic) - default: - return c.formatExpr("-%e", e.X) - } - case token.XOR: - if is64Bit(basic) { - return c.formatExpr("new %1s(~%2h, ~%2l >>> 0)", c.typeName(t), e.X) - } - return c.fixNumber(c.formatExpr("~%e", e.X), basic) - case token.NOT: - return c.formatExpr("!%e", e.X) - default: - panic(e.Op) - } - - case *ast.BinaryExpr: - if e.Op == token.NEQ { - return c.formatExpr("!(%s)", c.translateExpr(&ast.BinaryExpr{ - X: e.X, - Op: token.EQL, - Y: e.Y, - })) - } - - t := c.p.TypeOf(e.X) - t2 := c.p.TypeOf(e.Y) - _, isInterface := t2.Underlying().(*types.Interface) - if isInterface || types.Identical(t, types.Typ[types.UntypedNil]) { - t = t2 - } - - if basic, isBasic := t.Underlying().(*types.Basic); isBasic && isNumeric(basic) { - if is64Bit(basic) { - switch e.Op { - case token.MUL: - return c.formatExpr("$mul64(%e, %e)", e.X, e.Y) - case token.QUO: - return c.formatExpr("$div64(%e, %e, false)", e.X, e.Y) - case token.REM: - return c.formatExpr("$div64(%e, %e, true)", e.X, e.Y) - case token.SHL: - return c.formatExpr("$shiftLeft64(%e, %f)", e.X, e.Y) - case token.SHR: - return c.formatExpr("$shiftRight%s(%e, %f)", toJavaScriptType(basic), e.X, e.Y) - case token.EQL: - return c.formatExpr("(%1h === %2h && %1l === %2l)", e.X, e.Y) - case token.LSS: - return c.formatExpr("(%1h < %2h || (%1h === %2h && %1l < %2l))", e.X, e.Y) - case token.LEQ: - return c.formatExpr("(%1h < %2h || (%1h === %2h && %1l <= %2l))", e.X, e.Y) - case token.GTR: - return c.formatExpr("(%1h > %2h || (%1h === %2h && %1l > %2l))", e.X, e.Y) - case token.GEQ: - return c.formatExpr("(%1h > %2h || (%1h === %2h && %1l >= %2l))", e.X, e.Y) - case token.ADD, token.SUB: - return c.formatExpr("new %3s(%1h %4t %2h, %1l %4t %2l)", e.X, e.Y, c.typeName(t), e.Op) - case token.AND, token.OR, token.XOR: - return c.formatExpr("new %3s(%1h %4t %2h, (%1l %4t %2l) >>> 0)", e.X, e.Y, c.typeName(t), e.Op) - case token.AND_NOT: - return c.formatExpr("new %3s(%1h & ~%2h, (%1l & ~%2l) >>> 0)", e.X, e.Y, c.typeName(t)) - default: - panic(e.Op) - } - } - - if isComplex(basic) { - switch e.Op { - case token.EQL: - return c.formatExpr("(%1r === %2r && %1i === %2i)", e.X, e.Y) - case token.ADD, token.SUB: - return c.formatExpr("new %3s(%1r %4t %2r, %1i %4t %2i)", e.X, e.Y, c.typeName(t), e.Op) - case token.MUL: - return c.formatExpr("new %3s(%1r * %2r - %1i * %2i, %1r * %2i + %1i * %2r)", e.X, e.Y, c.typeName(t)) - case token.QUO: - return c.formatExpr("$divComplex(%e, %e)", e.X, e.Y) - default: - panic(e.Op) - } - } - - switch e.Op { - case token.EQL: - return c.formatParenExpr("%e === %e", e.X, e.Y) - case token.LSS, token.LEQ, token.GTR, token.GEQ: - return c.formatExpr("%e %t %e", e.X, e.Op, e.Y) - case token.ADD, token.SUB: - return c.fixNumber(c.formatExpr("%e %t %e", e.X, e.Op, e.Y), basic) - case token.MUL: - switch basic.Kind() { - case types.Int32, types.Int: - return c.formatParenExpr("$imul(%e, %e)", e.X, e.Y) - case types.Uint32, types.Uintptr: - return c.formatParenExpr("$imul(%e, %e) >>> 0", e.X, e.Y) - } - return c.fixNumber(c.formatExpr("%e * %e", e.X, e.Y), basic) - case token.QUO: - if isInteger(basic) { - // cut off decimals - shift := ">>" - if isUnsigned(basic) { - shift = ">>>" - } - return c.formatExpr(`(%1s = %2e / %3e, (%1s === %1s && %1s !== 1/0 && %1s !== -1/0) ? %1s %4s 0 : $throwRuntimeError("integer divide by zero"))`, c.newVariable("_q"), e.X, e.Y, shift) - } - if basic.Kind() == types.Float32 { - return c.fixNumber(c.formatExpr("%e / %e", e.X, e.Y), basic) - } - return c.formatExpr("%e / %e", e.X, e.Y) - case token.REM: - return c.formatExpr(`(%1s = %2e %% %3e, %1s === %1s ? %1s : $throwRuntimeError("integer divide by zero"))`, c.newVariable("_r"), e.X, e.Y) - case token.SHL, token.SHR: - op := e.Op.String() - if e.Op == token.SHR && isUnsigned(basic) { - op = ">>>" - } - if v := c.p.Types[e.Y].Value; v != nil { - i, _ := constant.Uint64Val(constant.ToInt(v)) - if i >= 32 { - return c.formatExpr("0") - } - return c.fixNumber(c.formatExpr("%e %s %s", e.X, op, strconv.FormatUint(i, 10)), basic) - } - if e.Op == token.SHR && !isUnsigned(basic) { - return c.fixNumber(c.formatParenExpr("%e >> $min(%f, 31)", e.X, e.Y), basic) - } - y := c.newVariable("y") - return c.fixNumber(c.formatExpr("(%s = %f, %s < 32 ? (%e %s %s) : 0)", y, e.Y, y, e.X, op, y), basic) - case token.AND, token.OR: - if isUnsigned(basic) { - return c.formatParenExpr("(%e %t %e) >>> 0", e.X, e.Op, e.Y) - } - return c.formatParenExpr("%e %t %e", e.X, e.Op, e.Y) - case token.AND_NOT: - return c.fixNumber(c.formatParenExpr("%e & ~%e", e.X, e.Y), basic) - case token.XOR: - return c.fixNumber(c.formatParenExpr("%e ^ %e", e.X, e.Y), basic) - default: - panic(e.Op) - } - } - - switch e.Op { - case token.ADD, token.LSS, token.LEQ, token.GTR, token.GEQ: - return c.formatExpr("%e %t %e", e.X, e.Op, e.Y) - case token.LAND: - if c.Blocking[e.Y] { - skipCase := c.caseCounter - c.caseCounter++ - resultVar := c.newVariable("_v") - c.Printf("if (!(%s)) { %s = false; $s = %d; continue s; }", c.translateExpr(e.X), resultVar, skipCase) - c.Printf("%s = %s; case %d:", resultVar, c.translateExpr(e.Y), skipCase) - return c.formatExpr("%s", resultVar) - } - return c.formatExpr("%e && %e", e.X, e.Y) - case token.LOR: - if c.Blocking[e.Y] { - skipCase := c.caseCounter - c.caseCounter++ - resultVar := c.newVariable("_v") - c.Printf("if (%s) { %s = true; $s = %d; continue s; }", c.translateExpr(e.X), resultVar, skipCase) - c.Printf("%s = %s; case %d:", resultVar, c.translateExpr(e.Y), skipCase) - return c.formatExpr("%s", resultVar) - } - return c.formatExpr("%e || %e", e.X, e.Y) - case token.EQL: - switch u := t.Underlying().(type) { - case *types.Array, *types.Struct: - return c.formatExpr("$equal(%e, %e, %s)", e.X, e.Y, c.typeName(t)) - case *types.Interface: - return c.formatExpr("$interfaceIsEqual(%s, %s)", c.translateImplicitConversion(e.X, t), c.translateImplicitConversion(e.Y, t)) - case *types.Pointer: - if _, ok := u.Elem().Underlying().(*types.Array); ok { - return c.formatExpr("$equal(%s, %s, %s)", c.translateImplicitConversion(e.X, t), c.translateImplicitConversion(e.Y, t), c.typeName(u.Elem())) - } - case *types.Basic: - if isBoolean(u) { - if b, ok := analysis.BoolValue(e.X, c.p.Info.Info); ok && b { - return c.translateExpr(e.Y) - } - if b, ok := analysis.BoolValue(e.Y, c.p.Info.Info); ok && b { - return c.translateExpr(e.X) - } - } - } - return c.formatExpr("%s === %s", c.translateImplicitConversion(e.X, t), c.translateImplicitConversion(e.Y, t)) - default: - panic(e.Op) - } - - case *ast.ParenExpr: - return c.formatParenExpr("%e", e.X) - - case *ast.IndexExpr: - switch t := c.p.TypeOf(e.X).Underlying().(type) { - case *types.Array, *types.Pointer: - pattern := rangeCheck("%1e[%2f]", c.p.Types[e.Index].Value != nil, true) - if _, ok := t.(*types.Pointer); ok { // check pointer for nix (attribute getter causes a panic) - pattern = `(%1e.nilCheck, ` + pattern + `)` - } - return c.formatExpr(pattern, e.X, e.Index) - case *types.Slice: - return c.formatExpr(rangeCheck("%1e.$array[%1e.$offset + %2f]", c.p.Types[e.Index].Value != nil, false), e.X, e.Index) - case *types.Map: - if typesutil.IsJsObject(c.p.TypeOf(e.Index)) { - c.p.errList = append(c.p.errList, types.Error{Fset: c.p.fileSet, Pos: e.Index.Pos(), Msg: "cannot use js.Object as map key"}) - } - key := fmt.Sprintf("%s.keyFor(%s)", c.typeName(t.Key()), c.translateImplicitConversion(e.Index, t.Key())) - if _, isTuple := exprType.(*types.Tuple); isTuple { - return c.formatExpr(`(%1s = %2e[%3s], %1s !== undefined ? [%1s.v, true] : [%4e, false])`, c.newVariable("_entry"), e.X, key, c.zeroValue(t.Elem())) - } - return c.formatExpr(`(%1s = %2e[%3s], %1s !== undefined ? %1s.v : %4e)`, c.newVariable("_entry"), e.X, key, c.zeroValue(t.Elem())) - case *types.Basic: - return c.formatExpr("%e.charCodeAt(%f)", e.X, e.Index) - default: - panic(fmt.Sprintf("Unhandled IndexExpr: %T\n", t)) - } - - case *ast.SliceExpr: - if b, isBasic := c.p.TypeOf(e.X).Underlying().(*types.Basic); isBasic && isString(b) { - switch { - case e.Low == nil && e.High == nil: - return c.translateExpr(e.X) - case e.Low == nil: - return c.formatExpr("$substring(%e, 0, %f)", e.X, e.High) - case e.High == nil: - return c.formatExpr("$substring(%e, %f)", e.X, e.Low) - default: - return c.formatExpr("$substring(%e, %f, %f)", e.X, e.Low, e.High) - } - } - slice := c.translateConversionToSlice(e.X, exprType) - switch { - case e.Low == nil && e.High == nil: - return c.formatExpr("%s", slice) - case e.Low == nil: - if e.Max != nil { - return c.formatExpr("$subslice(%s, 0, %f, %f)", slice, e.High, e.Max) - } - return c.formatExpr("$subslice(%s, 0, %f)", slice, e.High) - case e.High == nil: - return c.formatExpr("$subslice(%s, %f)", slice, e.Low) - default: - if e.Max != nil { - return c.formatExpr("$subslice(%s, %f, %f, %f)", slice, e.Low, e.High, e.Max) - } - return c.formatExpr("$subslice(%s, %f, %f)", slice, e.Low, e.High) - } - - case *ast.SelectorExpr: - sel, ok := c.p.SelectionOf(e) - if !ok { - // qualified identifier - return c.formatExpr("%s", c.objectName(obj)) - } - - switch sel.Kind() { - case types.FieldVal: - fields, jsTag := c.translateSelection(sel, e.Pos()) - if jsTag != "" { - if _, ok := sel.Type().(*types.Signature); ok { - return c.formatExpr("$internalize(%1e.%2s%3s, %4s, %1e.%2s)", e.X, strings.Join(fields, "."), formatJSStructTagVal(jsTag), c.typeName(sel.Type())) - } - return c.internalize(c.formatExpr("%e.%s%s", e.X, strings.Join(fields, "."), formatJSStructTagVal(jsTag)), sel.Type()) - } - return c.formatExpr("%e.%s", e.X, strings.Join(fields, ".")) - case types.MethodVal: - return c.formatExpr(`$methodVal(%s, "%s")`, c.makeReceiver(e), sel.Obj().(*types.Func).Name()) - case types.MethodExpr: - if !sel.Obj().Exported() { - c.p.dependencies[sel.Obj()] = true - } - if _, ok := sel.Recv().Underlying().(*types.Interface); ok { - return c.formatExpr(`$ifaceMethodExpr("%s")`, sel.Obj().(*types.Func).Name()) - } - return c.formatExpr(`$methodExpr(%s, "%s")`, c.typeName(sel.Recv()), sel.Obj().(*types.Func).Name()) - default: - panic(fmt.Sprintf("unexpected sel.Kind(): %T", sel.Kind())) - } - - case *ast.CallExpr: - plainFun := astutil.RemoveParens(e.Fun) - - if astutil.IsTypeExpr(plainFun, c.p.Info.Info) { - return c.formatExpr("(%s)", c.translateConversion(e.Args[0], c.p.TypeOf(plainFun))) - } - - sig := c.p.TypeOf(plainFun).Underlying().(*types.Signature) - - switch f := plainFun.(type) { - case *ast.Ident: - obj := c.p.Uses[f] - if o, ok := obj.(*types.Builtin); ok { - return c.translateBuiltin(o.Name(), sig, e.Args, e.Ellipsis.IsValid()) - } - if typesutil.IsJsPackage(obj.Pkg()) && obj.Name() == "InternalObject" { - return c.translateExpr(e.Args[0]) - } - return c.translateCall(e, sig, c.translateExpr(f)) - - case *ast.SelectorExpr: - sel, ok := c.p.SelectionOf(f) - if !ok { - // qualified identifier - obj := c.p.Uses[f.Sel] - if typesutil.IsJsPackage(obj.Pkg()) { - switch obj.Name() { - case "Debugger": - return c.formatExpr("debugger") - case "InternalObject": - return c.translateExpr(e.Args[0]) - } - } - return c.translateCall(e, sig, c.translateExpr(f)) - } - - externalizeExpr := func(e ast.Expr) string { - t := c.p.TypeOf(e) - if types.Identical(t, types.Typ[types.UntypedNil]) { - return "null" - } - return c.externalize(c.translateExpr(e).String(), t) - } - externalizeArgs := func(args []ast.Expr) string { - s := make([]string, len(args)) - for i, arg := range args { - s[i] = externalizeExpr(arg) - } - return strings.Join(s, ", ") - } - - switch sel.Kind() { - case types.MethodVal: - recv := c.makeReceiver(f) - declaredFuncRecv := sel.Obj().(*types.Func).Type().(*types.Signature).Recv().Type() - if typesutil.IsJsObject(declaredFuncRecv) { - globalRef := func(id string) string { - if recv.String() == "$global" && id[0] == '$' && len(id) > 1 { - return id - } - return recv.String() + "." + id - } - switch sel.Obj().Name() { - case "Get": - if id, ok := c.identifierConstant(e.Args[0]); ok { - return c.formatExpr("%s", globalRef(id)) - } - return c.formatExpr("%s[$externalize(%e, $String)]", recv, e.Args[0]) - case "Set": - if id, ok := c.identifierConstant(e.Args[0]); ok { - return c.formatExpr("%s = %s", globalRef(id), externalizeExpr(e.Args[1])) - } - return c.formatExpr("%s[$externalize(%e, $String)] = %s", recv, e.Args[0], externalizeExpr(e.Args[1])) - case "Delete": - return c.formatExpr("delete %s[$externalize(%e, $String)]", recv, e.Args[0]) - case "Length": - return c.formatExpr("$parseInt(%s.length)", recv) - case "Index": - return c.formatExpr("%s[%e]", recv, e.Args[0]) - case "SetIndex": - return c.formatExpr("%s[%e] = %s", recv, e.Args[0], externalizeExpr(e.Args[1])) - case "Call": - if id, ok := c.identifierConstant(e.Args[0]); ok { - if e.Ellipsis.IsValid() { - objVar := c.newVariable("obj") - return c.formatExpr("(%s = %s, %s.%s.apply(%s, %s))", objVar, recv, objVar, id, objVar, externalizeExpr(e.Args[1])) - } - return c.formatExpr("%s(%s)", globalRef(id), externalizeArgs(e.Args[1:])) - } - if e.Ellipsis.IsValid() { - objVar := c.newVariable("obj") - return c.formatExpr("(%s = %s, %s[$externalize(%e, $String)].apply(%s, %s))", objVar, recv, objVar, e.Args[0], objVar, externalizeExpr(e.Args[1])) - } - return c.formatExpr("%s[$externalize(%e, $String)](%s)", recv, e.Args[0], externalizeArgs(e.Args[1:])) - case "Invoke": - if e.Ellipsis.IsValid() { - return c.formatExpr("%s.apply(undefined, %s)", recv, externalizeExpr(e.Args[0])) - } - return c.formatExpr("%s(%s)", recv, externalizeArgs(e.Args)) - case "New": - if e.Ellipsis.IsValid() { - return c.formatExpr("new ($global.Function.prototype.bind.apply(%s, [undefined].concat(%s)))", recv, externalizeExpr(e.Args[0])) - } - return c.formatExpr("new (%s)(%s)", recv, externalizeArgs(e.Args)) - case "Bool": - return c.internalize(recv, types.Typ[types.Bool]) - case "String": - return c.internalize(recv, types.Typ[types.String]) - case "Int": - return c.internalize(recv, types.Typ[types.Int]) - case "Int64": - return c.internalize(recv, types.Typ[types.Int64]) - case "Uint64": - return c.internalize(recv, types.Typ[types.Uint64]) - case "Float": - return c.internalize(recv, types.Typ[types.Float64]) - case "Interface": - return c.internalize(recv, types.NewInterface(nil, nil)) - case "Unsafe": - return recv - default: - panic("Invalid js package object: " + sel.Obj().Name()) - } - } - - methodName := sel.Obj().Name() - if reservedKeywords[methodName] { - methodName += "$" - } - return c.translateCall(e, sig, c.formatExpr("%s.%s", recv, methodName)) - - case types.FieldVal: - fields, jsTag := c.translateSelection(sel, f.Pos()) - if jsTag != "" { - call := c.formatExpr("%e.%s%s(%s)", f.X, strings.Join(fields, "."), formatJSStructTagVal(jsTag), externalizeArgs(e.Args)) - switch sig.Results().Len() { - case 0: - return call - case 1: - return c.internalize(call, sig.Results().At(0).Type()) - default: - c.p.errList = append(c.p.errList, types.Error{Fset: c.p.fileSet, Pos: f.Pos(), Msg: "field with js tag can not have func type with multiple results"}) - } - } - return c.translateCall(e, sig, c.formatExpr("%e.%s", f.X, strings.Join(fields, "."))) - - case types.MethodExpr: - return c.translateCall(e, sig, c.translateExpr(f)) - - default: - panic(fmt.Sprintf("unexpected sel.Kind(): %T", sel.Kind())) - } - default: - return c.translateCall(e, sig, c.translateExpr(plainFun)) - } - - case *ast.StarExpr: - if typesutil.IsJsObject(c.p.TypeOf(e.X)) { - return c.formatExpr("new $jsObjectPtr(%e)", e.X) - } - if c1, isCall := e.X.(*ast.CallExpr); isCall && len(c1.Args) == 1 { - if c2, isCall := c1.Args[0].(*ast.CallExpr); isCall && len(c2.Args) == 1 && types.Identical(c.p.TypeOf(c2.Fun), types.Typ[types.UnsafePointer]) { - if unary, isUnary := c2.Args[0].(*ast.UnaryExpr); isUnary && unary.Op == token.AND { - return c.translateExpr(unary.X) // unsafe conversion - } - } - } - switch exprType.Underlying().(type) { - case *types.Struct, *types.Array: - return c.translateExpr(e.X) - } - return c.formatExpr("%e.$get()", e.X) - - case *ast.TypeAssertExpr: - if e.Type == nil { - return c.translateExpr(e.X) - } - t := c.p.TypeOf(e.Type) - if _, isTuple := exprType.(*types.Tuple); isTuple { - return c.formatExpr("$assertType(%e, %s, true)", e.X, c.typeName(t)) - } - return c.formatExpr("$assertType(%e, %s)", e.X, c.typeName(t)) - - case *ast.Ident: - if e.Name == "_" { - panic("Tried to translate underscore identifier.") - } - switch o := obj.(type) { - case *types.Var, *types.Const: - return c.formatExpr("%s", c.objectName(o)) - case *types.Func: - return c.formatExpr("%s", c.objectName(o)) - case *types.TypeName: - return c.formatExpr("%s", c.typeName(o.Type())) - case *types.Nil: - if typesutil.IsJsObject(exprType) { - return c.formatExpr("null") - } - switch t := exprType.Underlying().(type) { - case *types.Basic: - if t.Kind() != types.UnsafePointer { - panic("unexpected basic type") - } - return c.formatExpr("0") - case *types.Slice, *types.Pointer: - return c.formatExpr("%s.nil", c.typeName(exprType)) - case *types.Chan: - return c.formatExpr("$chanNil") - case *types.Map: - return c.formatExpr("false") - case *types.Interface: - return c.formatExpr("$ifaceNil") - case *types.Signature: - return c.formatExpr("$throwNilPointerError") - default: - panic(fmt.Sprintf("unexpected type: %T", t)) - } - default: - panic(fmt.Sprintf("Unhandled object: %T\n", o)) - } - - case nil: - return c.formatExpr("") - - default: - panic(fmt.Sprintf("Unhandled expression: %T\n", e)) - - } -} - -func (c *funcContext) translateCall(e *ast.CallExpr, sig *types.Signature, fun *expression) *expression { - args := c.translateArgs(sig, e.Args, e.Ellipsis.IsValid()) - if c.Blocking[e] { - resumeCase := c.caseCounter - c.caseCounter++ - returnVar := "$r" - if sig.Results().Len() != 0 { - returnVar = c.newVariable("_r") - } - c.Printf("%[1]s = %[2]s(%[3]s); /* */ $s = %[4]d; case %[4]d: if($c) { $c = false; %[1]s = %[1]s.$blk(); } if (%[1]s && %[1]s.$blk !== undefined) { break s; }", returnVar, fun, strings.Join(args, ", "), resumeCase) - if sig.Results().Len() != 0 { - return c.formatExpr("%s", returnVar) - } - return c.formatExpr("") - } - return c.formatExpr("%s(%s)", fun, strings.Join(args, ", ")) -} - -func (c *funcContext) makeReceiver(e *ast.SelectorExpr) *expression { - sel, _ := c.p.SelectionOf(e) - if !sel.Obj().Exported() { - c.p.dependencies[sel.Obj()] = true - } - - x := e.X - recvType := sel.Recv() - if len(sel.Index()) > 1 { - for _, index := range sel.Index()[:len(sel.Index())-1] { - if ptr, isPtr := recvType.(*types.Pointer); isPtr { - recvType = ptr.Elem() - } - s := recvType.Underlying().(*types.Struct) - recvType = s.Field(index).Type() - } - - fakeSel := &ast.SelectorExpr{X: x, Sel: ast.NewIdent("o")} - c.p.additionalSelections[fakeSel] = &fakeSelection{ - kind: types.FieldVal, - recv: sel.Recv(), - index: sel.Index()[:len(sel.Index())-1], - typ: recvType, - } - x = c.setType(fakeSel, recvType) - } - - _, isPointer := recvType.Underlying().(*types.Pointer) - methodsRecvType := sel.Obj().Type().(*types.Signature).Recv().Type() - _, pointerExpected := methodsRecvType.(*types.Pointer) - if !isPointer && pointerExpected { - recvType = types.NewPointer(recvType) - x = c.setType(&ast.UnaryExpr{Op: token.AND, X: x}, recvType) - } - if isPointer && !pointerExpected { - x = c.setType(x, methodsRecvType) - } - - recv := c.translateImplicitConversionWithCloning(x, methodsRecvType) - if isWrapped(recvType) { - recv = c.formatExpr("new %s(%s)", c.typeName(methodsRecvType), recv) - } - return recv -} - -func (c *funcContext) translateBuiltin(name string, sig *types.Signature, args []ast.Expr, ellipsis bool) *expression { - switch name { - case "new": - t := sig.Results().At(0).Type().(*types.Pointer) - if c.p.Pkg.Path() == "syscall" && types.Identical(t.Elem().Underlying(), types.Typ[types.Uintptr]) { - return c.formatExpr("new Uint8Array(8)") - } - switch t.Elem().Underlying().(type) { - case *types.Struct, *types.Array: - return c.formatExpr("%e", c.zeroValue(t.Elem())) - default: - return c.formatExpr("$newDataPointer(%e, %s)", c.zeroValue(t.Elem()), c.typeName(t)) - } - case "make": - switch argType := c.p.TypeOf(args[0]).Underlying().(type) { - case *types.Slice: - t := c.typeName(c.p.TypeOf(args[0])) - if len(args) == 3 { - return c.formatExpr("$makeSlice(%s, %f, %f)", t, args[1], args[2]) - } - return c.formatExpr("$makeSlice(%s, %f)", t, args[1]) - case *types.Map: - if len(args) == 2 && c.p.Types[args[1]].Value == nil { - return c.formatExpr(`((%1f < 0 || %1f > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {})`, args[1]) - } - return c.formatExpr("{}") - case *types.Chan: - length := "0" - if len(args) == 2 { - length = c.formatExpr("%f", args[1]).String() - } - return c.formatExpr("new $Chan(%s, %s)", c.typeName(c.p.TypeOf(args[0]).Underlying().(*types.Chan).Elem()), length) - default: - panic(fmt.Sprintf("Unhandled make type: %T\n", argType)) - } - case "len": - switch argType := c.p.TypeOf(args[0]).Underlying().(type) { - case *types.Basic: - return c.formatExpr("%e.length", args[0]) - case *types.Slice: - return c.formatExpr("%e.$length", args[0]) - case *types.Pointer: - return c.formatExpr("(%e, %d)", args[0], argType.Elem().(*types.Array).Len()) - case *types.Map: - return c.formatExpr("$keys(%e).length", args[0]) - case *types.Chan: - return c.formatExpr("%e.$buffer.length", args[0]) - // length of array is constant - default: - panic(fmt.Sprintf("Unhandled len type: %T\n", argType)) - } - case "cap": - switch argType := c.p.TypeOf(args[0]).Underlying().(type) { - case *types.Slice, *types.Chan: - return c.formatExpr("%e.$capacity", args[0]) - case *types.Pointer: - return c.formatExpr("(%e, %d)", args[0], argType.Elem().(*types.Array).Len()) - // capacity of array is constant - default: - panic(fmt.Sprintf("Unhandled cap type: %T\n", argType)) - } - case "panic": - return c.formatExpr("$panic(%s)", c.translateImplicitConversion(args[0], types.NewInterface(nil, nil))) - case "append": - if ellipsis || len(args) == 1 { - argStr := c.translateArgs(sig, args, ellipsis) - return c.formatExpr("$appendSlice(%s, %s)", argStr[0], argStr[1]) - } - sliceType := sig.Results().At(0).Type().Underlying().(*types.Slice) - return c.formatExpr("$append(%e, %s)", args[0], strings.Join(c.translateExprSlice(args[1:], sliceType.Elem()), ", ")) - case "delete": - keyType := c.p.TypeOf(args[0]).Underlying().(*types.Map).Key() - return c.formatExpr(`delete %e[%s.keyFor(%s)]`, args[0], c.typeName(keyType), c.translateImplicitConversion(args[1], keyType)) - case "copy": - if basic, isBasic := c.p.TypeOf(args[1]).Underlying().(*types.Basic); isBasic && isString(basic) { - return c.formatExpr("$copyString(%e, %e)", args[0], args[1]) - } - return c.formatExpr("$copySlice(%e, %e)", args[0], args[1]) - case "print", "println": - return c.formatExpr("console.log(%s)", strings.Join(c.translateExprSlice(args, nil), ", ")) - case "complex": - argStr := c.translateArgs(sig, args, ellipsis) - return c.formatExpr("new %s(%s, %s)", c.typeName(sig.Results().At(0).Type()), argStr[0], argStr[1]) - case "real": - return c.formatExpr("%e.$real", args[0]) - case "imag": - return c.formatExpr("%e.$imag", args[0]) - case "recover": - return c.formatExpr("$recover()") - case "close": - return c.formatExpr(`$close(%e)`, args[0]) - default: - panic(fmt.Sprintf("Unhandled builtin: %s\n", name)) - } -} - -func (c *funcContext) identifierConstant(expr ast.Expr) (string, bool) { - val := c.p.Types[expr].Value - if val == nil { - return "", false - } - s := constant.StringVal(val) - if len(s) == 0 { - return "", false - } - for i, c := range s { - if !((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (i > 0 && c >= '0' && c <= '9') || c == '_' || c == '$') { - return "", false - } - } - return s, true -} - -func (c *funcContext) translateExprSlice(exprs []ast.Expr, desiredType types.Type) []string { - parts := make([]string, len(exprs)) - for i, expr := range exprs { - parts[i] = c.translateImplicitConversion(expr, desiredType).String() - } - return parts -} - -func (c *funcContext) translateConversion(expr ast.Expr, desiredType types.Type) *expression { - exprType := c.p.TypeOf(expr) - if types.Identical(exprType, desiredType) { - return c.translateExpr(expr) - } - - if c.p.Pkg.Path() == "reflect" { - if call, isCall := expr.(*ast.CallExpr); isCall && types.Identical(c.p.TypeOf(call.Fun), types.Typ[types.UnsafePointer]) { - if ptr, isPtr := desiredType.(*types.Pointer); isPtr { - if named, isNamed := ptr.Elem().(*types.Named); isNamed { - switch named.Obj().Name() { - case "arrayType", "chanType", "funcType", "interfaceType", "mapType", "ptrType", "sliceType", "structType": - return c.formatExpr("%e.kindType", call.Args[0]) // unsafe conversion - default: - return c.translateExpr(expr) - } - } - } - } - } - - switch t := desiredType.Underlying().(type) { - case *types.Basic: - switch { - case isInteger(t): - basicExprType := exprType.Underlying().(*types.Basic) - switch { - case is64Bit(t): - if !is64Bit(basicExprType) { - if basicExprType.Kind() == types.Uintptr { // this might be an Object returned from reflect.Value.Pointer() - return c.formatExpr("new %1s(0, %2e.constructor === Number ? %2e : 1)", c.typeName(desiredType), expr) - } - return c.formatExpr("new %s(0, %e)", c.typeName(desiredType), expr) - } - return c.formatExpr("new %1s(%2h, %2l)", c.typeName(desiredType), expr) - case is64Bit(basicExprType): - if !isUnsigned(t) && !isUnsigned(basicExprType) { - return c.fixNumber(c.formatParenExpr("%1l + ((%1h >> 31) * 4294967296)", expr), t) - } - return c.fixNumber(c.formatExpr("%s.$low", c.translateExpr(expr)), t) - case isFloat(basicExprType): - return c.formatParenExpr("%e >> 0", expr) - case types.Identical(exprType, types.Typ[types.UnsafePointer]): - return c.translateExpr(expr) - default: - return c.fixNumber(c.translateExpr(expr), t) - } - case isFloat(t): - if t.Kind() == types.Float32 && exprType.Underlying().(*types.Basic).Kind() == types.Float64 { - return c.formatExpr("$fround(%e)", expr) - } - return c.formatExpr("%f", expr) - case isComplex(t): - return c.formatExpr("new %1s(%2r, %2i)", c.typeName(desiredType), expr) - case isString(t): - value := c.translateExpr(expr) - switch et := exprType.Underlying().(type) { - case *types.Basic: - if is64Bit(et) { - value = c.formatExpr("%s.$low", value) - } - if isNumeric(et) { - return c.formatExpr("$encodeRune(%s)", value) - } - return value - case *types.Slice: - if types.Identical(et.Elem().Underlying(), types.Typ[types.Rune]) { - return c.formatExpr("$runesToString(%s)", value) - } - return c.formatExpr("$bytesToString(%s)", value) - default: - panic(fmt.Sprintf("Unhandled conversion: %v\n", et)) - } - case t.Kind() == types.UnsafePointer: - if unary, isUnary := expr.(*ast.UnaryExpr); isUnary && unary.Op == token.AND { - if indexExpr, isIndexExpr := unary.X.(*ast.IndexExpr); isIndexExpr { - return c.formatExpr("$sliceToArray(%s)", c.translateConversionToSlice(indexExpr.X, types.NewSlice(types.Typ[types.Uint8]))) - } - if ident, isIdent := unary.X.(*ast.Ident); isIdent && ident.Name == "_zero" { - return c.formatExpr("new Uint8Array(0)") - } - } - if ptr, isPtr := c.p.TypeOf(expr).(*types.Pointer); c.p.Pkg.Path() == "syscall" && isPtr { - if s, isStruct := ptr.Elem().Underlying().(*types.Struct); isStruct { - array := c.newVariable("_array") - target := c.newVariable("_struct") - c.Printf("%s = new Uint8Array(%d);", array, sizes32.Sizeof(s)) - c.Delayed(func() { - c.Printf("%s = %s, %s;", target, c.translateExpr(expr), c.loadStruct(array, target, s)) - }) - return c.formatExpr("%s", array) - } - } - if call, ok := expr.(*ast.CallExpr); ok { - if id, ok := call.Fun.(*ast.Ident); ok && id.Name == "new" { - return c.formatExpr("new Uint8Array(%d)", int(sizes32.Sizeof(c.p.TypeOf(call.Args[0])))) - } - } - } - - case *types.Slice: - switch et := exprType.Underlying().(type) { - case *types.Basic: - if isString(et) { - if types.Identical(t.Elem().Underlying(), types.Typ[types.Rune]) { - return c.formatExpr("new %s($stringToRunes(%e))", c.typeName(desiredType), expr) - } - return c.formatExpr("new %s($stringToBytes(%e))", c.typeName(desiredType), expr) - } - case *types.Array, *types.Pointer: - return c.formatExpr("new %s(%e)", c.typeName(desiredType), expr) - } - - case *types.Pointer: - switch u := t.Elem().Underlying().(type) { - case *types.Array: - return c.translateExpr(expr) - case *types.Struct: - if c.p.Pkg.Path() == "syscall" && types.Identical(exprType, types.Typ[types.UnsafePointer]) { - array := c.newVariable("_array") - target := c.newVariable("_struct") - return c.formatExpr("(%s = %e, %s = %e, %s, %s)", array, expr, target, c.zeroValue(t.Elem()), c.loadStruct(array, target, u), target) - } - return c.formatExpr("$pointerOfStructConversion(%e, %s)", expr, c.typeName(t)) - } - - if !types.Identical(exprType, types.Typ[types.UnsafePointer]) { - exprTypeElem := exprType.Underlying().(*types.Pointer).Elem() - ptrVar := c.newVariable("_ptr") - getterConv := c.translateConversion(c.setType(&ast.StarExpr{X: c.newIdent(ptrVar, exprType)}, exprTypeElem), t.Elem()) - setterConv := c.translateConversion(c.newIdent("$v", t.Elem()), exprTypeElem) - return c.formatExpr("(%1s = %2e, new %3s(function() { return %4s; }, function($v) { %1s.$set(%5s); }, %1s.$target))", ptrVar, expr, c.typeName(desiredType), getterConv, setterConv) - } - - case *types.Interface: - if types.Identical(exprType, types.Typ[types.UnsafePointer]) { - return c.translateExpr(expr) - } - } - - return c.translateImplicitConversionWithCloning(expr, desiredType) -} - -func (c *funcContext) translateImplicitConversionWithCloning(expr ast.Expr, desiredType types.Type) *expression { - switch desiredType.Underlying().(type) { - case *types.Struct, *types.Array: - switch expr.(type) { - case nil, *ast.CompositeLit: - // nothing - default: - return c.formatExpr("$clone(%e, %s)", expr, c.typeName(desiredType)) - } - } - - return c.translateImplicitConversion(expr, desiredType) -} - -func (c *funcContext) translateImplicitConversion(expr ast.Expr, desiredType types.Type) *expression { - if desiredType == nil { - return c.translateExpr(expr) - } - - exprType := c.p.TypeOf(expr) - if types.Identical(exprType, desiredType) { - return c.translateExpr(expr) - } - - basicExprType, isBasicExpr := exprType.Underlying().(*types.Basic) - if isBasicExpr && basicExprType.Kind() == types.UntypedNil { - return c.formatExpr("%e", c.zeroValue(desiredType)) - } - - switch desiredType.Underlying().(type) { - case *types.Slice: - return c.formatExpr("$subslice(new %1s(%2e.$array), %2e.$offset, %2e.$offset + %2e.$length)", c.typeName(desiredType), expr) - - case *types.Interface: - if typesutil.IsJsObject(exprType) { - // wrap JS object into js.Object struct when converting to interface - return c.formatExpr("new $jsObjectPtr(%e)", expr) - } - if isWrapped(exprType) { - return c.formatExpr("new %s(%e)", c.typeName(exprType), expr) - } - if _, isStruct := exprType.Underlying().(*types.Struct); isStruct { - return c.formatExpr("new %1e.constructor.elem(%1e)", expr) - } - } - - return c.translateExpr(expr) -} - -func (c *funcContext) translateConversionToSlice(expr ast.Expr, desiredType types.Type) *expression { - switch c.p.TypeOf(expr).Underlying().(type) { - case *types.Array, *types.Pointer: - return c.formatExpr("new %s(%e)", c.typeName(desiredType), expr) - } - return c.translateExpr(expr) -} - -func (c *funcContext) loadStruct(array, target string, s *types.Struct) string { - view := c.newVariable("_view") - code := fmt.Sprintf("%s = new DataView(%s.buffer, %s.byteOffset)", view, array, array) - var fields []*types.Var - var collectFields func(s *types.Struct, path string) - collectFields = func(s *types.Struct, path string) { - for i := 0; i < s.NumFields(); i++ { - field := s.Field(i) - if fs, isStruct := field.Type().Underlying().(*types.Struct); isStruct { - collectFields(fs, path+"."+fieldName(s, i)) - continue - } - fields = append(fields, types.NewVar(0, nil, path+"."+fieldName(s, i), field.Type())) - } - } - collectFields(s, target) - offsets := sizes32.Offsetsof(fields) - for i, field := range fields { - switch t := field.Type().Underlying().(type) { - case *types.Basic: - if isNumeric(t) { - if is64Bit(t) { - code += fmt.Sprintf(", %s = new %s(%s.getUint32(%d, true), %s.getUint32(%d, true))", field.Name(), c.typeName(field.Type()), view, offsets[i]+4, view, offsets[i]) - break - } - code += fmt.Sprintf(", %s = %s.get%s(%d, true)", field.Name(), view, toJavaScriptType(t), offsets[i]) - } - case *types.Array: - code += fmt.Sprintf(`, %s = new ($nativeArray(%s))(%s.buffer, $min(%s.byteOffset + %d, %s.buffer.byteLength))`, field.Name(), typeKind(t.Elem()), array, array, offsets[i], array) - } - } - return code -} - -func (c *funcContext) fixNumber(value *expression, basic *types.Basic) *expression { - switch basic.Kind() { - case types.Int8: - return c.formatParenExpr("%s << 24 >> 24", value) - case types.Uint8: - return c.formatParenExpr("%s << 24 >>> 24", value) - case types.Int16: - return c.formatParenExpr("%s << 16 >> 16", value) - case types.Uint16: - return c.formatParenExpr("%s << 16 >>> 16", value) - case types.Int32, types.Int, types.UntypedInt: - return c.formatParenExpr("%s >> 0", value) - case types.Uint32, types.Uint, types.Uintptr: - return c.formatParenExpr("%s >>> 0", value) - case types.Float32: - return c.formatExpr("$fround(%s)", value) - case types.Float64: - return value - default: - panic(fmt.Sprintf("fixNumber: unhandled basic.Kind(): %s", basic.String())) - } -} - -func (c *funcContext) internalize(s *expression, t types.Type) *expression { - if typesutil.IsJsObject(t) { - return s - } - switch u := t.Underlying().(type) { - case *types.Basic: - switch { - case isBoolean(u): - return c.formatExpr("!!(%s)", s) - case isInteger(u) && !is64Bit(u): - return c.fixNumber(c.formatExpr("$parseInt(%s)", s), u) - case isFloat(u): - return c.formatExpr("$parseFloat(%s)", s) - } - } - return c.formatExpr("$internalize(%s, %s)", s, c.typeName(t)) -} - -func (c *funcContext) formatExpr(format string, a ...interface{}) *expression { - return c.formatExprInternal(format, a, false) -} - -func (c *funcContext) formatParenExpr(format string, a ...interface{}) *expression { - return c.formatExprInternal(format, a, true) -} - -func (c *funcContext) formatExprInternal(format string, a []interface{}, parens bool) *expression { - processFormat := func(f func(uint8, uint8, int)) { - n := 0 - for i := 0; i < len(format); i++ { - b := format[i] - if b == '%' { - i++ - k := format[i] - if k >= '0' && k <= '9' { - n = int(k - '0' - 1) - i++ - k = format[i] - } - f(0, k, n) - n++ - continue - } - f(b, 0, 0) - } - } - - counts := make([]int, len(a)) - processFormat(func(b, k uint8, n int) { - switch k { - case 'e', 'f', 'h', 'l', 'r', 'i': - counts[n]++ - } - }) - - out := bytes.NewBuffer(nil) - vars := make([]string, len(a)) - hasAssignments := false - for i, e := range a { - if counts[i] <= 1 { - continue - } - if _, isIdent := e.(*ast.Ident); isIdent { - continue - } - if val := c.p.Types[e.(ast.Expr)].Value; val != nil { - continue - } - if !hasAssignments { - hasAssignments = true - out.WriteByte('(') - parens = false - } - v := c.newVariable("x") - out.WriteString(v + " = " + c.translateExpr(e.(ast.Expr)).String() + ", ") - vars[i] = v - } - - processFormat(func(b, k uint8, n int) { - writeExpr := func(suffix string) { - if vars[n] != "" { - out.WriteString(vars[n] + suffix) - return - } - out.WriteString(c.translateExpr(a[n].(ast.Expr)).StringWithParens() + suffix) - } - switch k { - case 0: - out.WriteByte(b) - case 's': - if e, ok := a[n].(*expression); ok { - out.WriteString(e.StringWithParens()) - return - } - out.WriteString(a[n].(string)) - case 'd': - out.WriteString(strconv.Itoa(a[n].(int))) - case 't': - out.WriteString(a[n].(token.Token).String()) - case 'e': - e := a[n].(ast.Expr) - if val := c.p.Types[e].Value; val != nil { - out.WriteString(c.translateExpr(e).String()) - return - } - writeExpr("") - case 'f': - e := a[n].(ast.Expr) - if val := c.p.Types[e].Value; val != nil { - d, _ := constant.Int64Val(constant.ToInt(val)) - out.WriteString(strconv.FormatInt(d, 10)) - return - } - if is64Bit(c.p.TypeOf(e).Underlying().(*types.Basic)) { - out.WriteString("$flatten64(") - writeExpr("") - out.WriteString(")") - return - } - writeExpr("") - case 'h': - e := a[n].(ast.Expr) - if val := c.p.Types[e].Value; val != nil { - d, _ := constant.Uint64Val(constant.ToInt(val)) - if c.p.TypeOf(e).Underlying().(*types.Basic).Kind() == types.Int64 { - out.WriteString(strconv.FormatInt(int64(d)>>32, 10)) - return - } - out.WriteString(strconv.FormatUint(d>>32, 10)) - return - } - writeExpr(".$high") - case 'l': - if val := c.p.Types[a[n].(ast.Expr)].Value; val != nil { - d, _ := constant.Uint64Val(constant.ToInt(val)) - out.WriteString(strconv.FormatUint(d&(1<<32-1), 10)) - return - } - writeExpr(".$low") - case 'r': - if val := c.p.Types[a[n].(ast.Expr)].Value; val != nil { - r, _ := constant.Float64Val(constant.Real(val)) - out.WriteString(strconv.FormatFloat(r, 'g', -1, 64)) - return - } - writeExpr(".$real") - case 'i': - if val := c.p.Types[a[n].(ast.Expr)].Value; val != nil { - i, _ := constant.Float64Val(constant.Imag(val)) - out.WriteString(strconv.FormatFloat(i, 'g', -1, 64)) - return - } - writeExpr(".$imag") - case '%': - out.WriteRune('%') - default: - panic(fmt.Sprintf("formatExpr: %%%c%d", k, n)) - } - }) - - if hasAssignments { - out.WriteByte(')') - } - return &expression{str: out.String(), parens: parens} -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/filter/assign.go b/vendor/github.com/gopherjs/gopherjs/compiler/filter/assign.go deleted file mode 100644 index 2681d4c6a..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/filter/assign.go +++ /dev/null @@ -1,106 +0,0 @@ -package filter - -import ( - "go/ast" - "go/token" - "go/types" - - "github.com/gopherjs/gopherjs/compiler/astutil" -) - -func Assign(stmt ast.Stmt, info *types.Info, pkg *types.Package) ast.Stmt { - if s, ok := stmt.(*ast.AssignStmt); ok && s.Tok != token.ASSIGN && s.Tok != token.DEFINE { - var op token.Token - switch s.Tok { - case token.ADD_ASSIGN: - op = token.ADD - case token.SUB_ASSIGN: - op = token.SUB - case token.MUL_ASSIGN: - op = token.MUL - case token.QUO_ASSIGN: - op = token.QUO - case token.REM_ASSIGN: - op = token.REM - case token.AND_ASSIGN: - op = token.AND - case token.OR_ASSIGN: - op = token.OR - case token.XOR_ASSIGN: - op = token.XOR - case token.SHL_ASSIGN: - op = token.SHL - case token.SHR_ASSIGN: - op = token.SHR - case token.AND_NOT_ASSIGN: - op = token.AND_NOT - default: - panic(s.Tok) - } - - var list []ast.Stmt - - var viaTmpVars func(expr ast.Expr, name string) ast.Expr - viaTmpVars = func(expr ast.Expr, name string) ast.Expr { - switch e := astutil.RemoveParens(expr).(type) { - case *ast.IndexExpr: - return astutil.SetType(info, info.TypeOf(e), &ast.IndexExpr{ - X: viaTmpVars(e.X, "_slice"), - Index: viaTmpVars(e.Index, "_index"), - }) - - case *ast.SelectorExpr: - sel, ok := info.Selections[e] - if !ok { - // qualified identifier - return e - } - newSel := &ast.SelectorExpr{ - X: viaTmpVars(e.X, "_struct"), - Sel: e.Sel, - } - info.Selections[newSel] = sel - return astutil.SetType(info, info.TypeOf(e), newSel) - - case *ast.StarExpr: - return astutil.SetType(info, info.TypeOf(e), &ast.StarExpr{ - X: viaTmpVars(e.X, "_ptr"), - }) - - case *ast.Ident, *ast.BasicLit: - return e - - default: - tmpVar := astutil.NewIdent(name, info.TypeOf(e), info, pkg) - list = append(list, &ast.AssignStmt{ - Lhs: []ast.Expr{tmpVar}, - Tok: token.DEFINE, - Rhs: []ast.Expr{e}, - }) - return tmpVar - - } - } - - lhs := viaTmpVars(s.Lhs[0], "_val") - - list = append(list, &ast.AssignStmt{ - Lhs: []ast.Expr{lhs}, - Tok: token.ASSIGN, - Rhs: []ast.Expr{ - astutil.SetType(info, info.TypeOf(s.Lhs[0]), &ast.BinaryExpr{ - X: lhs, - Op: op, - Y: astutil.SetType(info, info.TypeOf(s.Rhs[0]), &ast.ParenExpr{ - X: s.Rhs[0], - }), - }), - }, - }) - - return &ast.BlockStmt{ - List: list, - } - } - return stmt -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/filter/incdecstmt.go b/vendor/github.com/gopherjs/gopherjs/compiler/filter/incdecstmt.go deleted file mode 100644 index c4899ba1d..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/filter/incdecstmt.go +++ /dev/null @@ -1,39 +0,0 @@ -package filter - -import ( - "go/ast" - "go/constant" - "go/token" - "go/types" -) - -func IncDecStmt(stmt ast.Stmt, info *types.Info) ast.Stmt { - if s, ok := stmt.(*ast.IncDecStmt); ok { - t := info.TypeOf(s.X) - if iExpr, isIExpr := s.X.(*ast.IndexExpr); isIExpr { - switch u := info.TypeOf(iExpr.X).Underlying().(type) { - case *types.Array: - t = u.Elem() - case *types.Slice: - t = u.Elem() - case *types.Map: - t = u.Elem() - } - } - - tok := token.ADD_ASSIGN - if s.Tok == token.DEC { - tok = token.SUB_ASSIGN - } - - one := &ast.BasicLit{Kind: token.INT} - info.Types[one] = types.TypeAndValue{Type: t, Value: constant.MakeInt64(1)} - - return &ast.AssignStmt{ - Lhs: []ast.Expr{s.X}, - Tok: tok, - Rhs: []ast.Expr{one}, - } - } - return stmt -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/doc.go b/vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/doc.go deleted file mode 100644 index f57e84f74..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/doc.go +++ /dev/null @@ -1,12 +0,0 @@ -// Package gopherjspkg provides core GopherJS packages via a virtual filesystem. -// -// Core GopherJS packages are packages that are critical for GopherJS compiler -// operation. They are needed to build the Go standard library with GopherJS. -// Currently, they include: -// -// github.com/gopherjs/gopherjs/js -// github.com/gopherjs/gopherjs/nosync -// -package gopherjspkg - -//go:generate vfsgendev -source="github.com/gopherjs/gopherjs/compiler/gopherjspkg".FS -tag=gopherjsdev diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/fs.go b/vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/fs.go deleted file mode 100644 index f6fb2622d..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/fs.go +++ /dev/null @@ -1,31 +0,0 @@ -// +build gopherjsdev - -package gopherjspkg - -import ( - "go/build" - "log" - "net/http" - "os" - pathpkg "path" - - "github.com/shurcooL/httpfs/filter" -) - -// FS is a virtual filesystem that contains core GopherJS packages. -var FS = filter.Keep( - http.Dir(importPathToDir("github.com/gopherjs/gopherjs")), - func(path string, fi os.FileInfo) bool { - return path == "/" || - path == "/js" || (pathpkg.Dir(path) == "/js" && !fi.IsDir()) || - path == "/nosync" || (pathpkg.Dir(path) == "/nosync" && !fi.IsDir()) - }, -) - -func importPathToDir(importPath string) string { - p, err := build.Import(importPath, "", build.FindOnly) - if err != nil { - log.Fatalln(err) - } - return p.Dir -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/fs_vfsdata.go b/vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/fs_vfsdata.go deleted file mode 100644 index 8931d724b..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/fs_vfsdata.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by vfsgen; DO NOT EDIT. - -// +build !gopherjsdev - -package gopherjspkg - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "net/http" - "os" - pathpkg "path" - "time" -) - -// FS is a virtual filesystem that contains core GopherJS packages. -var FS = func() http.FileSystem { - fs := vfsgen۰FS{ - "/": &vfsgen۰DirInfo{ - name: "/", - modTime: time.Date(2019, 4, 6, 11, 9, 42, 660657937, time.UTC), - }, - "/js": &vfsgen۰DirInfo{ - name: "js", - modTime: time.Date(2019, 3, 10, 16, 38, 53, 764271817, time.UTC), - }, - "/js/js.go": &vfsgen۰CompressedFileInfo{ - name: "js.go", - modTime: time.Date(2019, 3, 10, 16, 38, 53, 764987009, time.UTC), - uncompressedSize: 8002, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x59\x5f\x6f\xdc\x36\x12\x7f\x5e\x7d\x8a\x39\xa1\x40\x56\xcd\x56\xbe\xb6\x86\x51\x38\xe7\x87\xa4\xb9\xfa\xdc\x4b\xdc\x00\x6e\xd0\x07\x23\x30\xb8\xd2\x68\x97\xb1\x44\xea\x48\x6a\x37\x7b\xb6\xbf\xfb\x61\xf8\x47\x2b\xad\xa4\xc4\xbe\x24\x2f\x75\xc5\xe1\x6f\x7e\x9c\x19\xce\x1f\xee\xd1\x11\xbc\x63\xd9\x2d\x5b\x21\x7c\xd4\x50\x2b\xb9\xe1\x39\x6a\x28\x1a\x91\x19\x2e\x85\x86\x42\x2a\xe0\xc2\xa0\x62\x99\xe1\x62\x05\x5b\x6e\xd6\x20\x98\xe1\x1b\x84\xdf\xd9\x86\x5d\x65\x8a\xd7\x06\x5e\xbe\xbb\xd0\x29\xfc\xca\xca\x52\x83\x91\x60\xd6\xa8\xb1\x83\xc2\x14\x82\x51\xc8\x0c\xe6\xa0\x6b\xcc\x38\x2b\xcb\x1d\x2c\x77\x70\x2e\xeb\x35\xaa\xdf\xaf\x80\x89\x1c\x8c\x62\x42\x97\x56\x28\xe7\x0a\x33\x53\xee\x3c\x18\x57\x90\x49\xa5\x50\xd7\x52\xe4\x44\xa3\xa3\x5a\xef\x84\x61\x9f\xd2\xe8\xe8\x28\x3a\x3a\x82\xf7\x1a\xe1\x2d\xbb\xc5\xbf\x14\xab\x6b\x54\xb4\x1f\x3f\xd5\x52\x23\x54\x68\xd6\x32\xb7\xf4\xf6\xbb\x53\xf8\x6b\x8d\x02\x6a\xa6\x35\xc1\x6e\x58\xd9\xa0\x6e\xb5\x2f\x48\x37\x14\xb2\x2c\xe5\x96\x96\xcd\xae\x46\xc8\xa4\xd8\xa0\xd2\xed\xb9\x6a\x54\x85\x54\x15\xe6\xa7\x9e\x02\xdc\xc3\xb9\x74\xb2\xfd\x7f\xf7\x5d\xda\x9d\xf5\x7b\xf8\xb5\x83\xb9\x64\xd9\x2d\x91\xb4\x56\x2f\x58\x86\x77\x0f\x70\xef\x71\x7f\x18\xfb\xf7\xd4\xef\x5d\x09\x8f\xbb\x94\xb2\x84\xc1\xbf\x7b\x78\x25\x65\x89\x4c\x0c\xbe\x8f\xcb\x77\x24\x3c\x2e\x9d\x61\x85\x4a\x5b\xf7\x16\xa5\x64\x46\xdb\xfd\x97\x4d\xb5\x44\x35\xd4\x67\x45\x4e\x8e\xbf\x88\xab\x8d\x22\x7f\x0c\xf6\x5f\x4d\x7c\x1f\x97\x1f\xe2\x5e\x7f\xe0\xc2\xfc\x32\xdc\x7f\x21\xcc\x2f\x2f\x95\x62\xbb\x83\xef\xe3\xf2\x13\xb8\x3f\x9e\x8c\xe1\xfe\x78\x32\x00\x9e\x92\x9f\xc0\xfd\xf9\xa7\x85\xfb\xa3\x87\xfb\xf3\x4f\x53\xb8\xd3\x74\x3b\xb8\xcd\xc8\xc1\xee\xe1\x3d\x1f\x33\xc4\x94\xfc\x14\xee\xe1\xc1\x1c\xee\xd0\x10\x53\xf2\x53\xb8\xce\x10\x4d\x7b\x44\x87\x3b\x34\xc4\x7d\x4f\xea\xf3\xb8\x36\x22\x7f\xfe\xe9\x80\xef\x6f\xee\xeb\x01\xf0\x94\xfc\x24\xee\x41\xa4\x7b\xdc\x93\xe3\x29\xdc\xc9\x9b\x11\x70\x59\x59\x82\x34\x6b\x54\xa0\x4b\x9e\xa1\x0e\xfb\x87\xb1\x0b\xfb\x78\x68\xb3\xcc\x67\x70\x69\xbf\x1e\xee\xd7\x88\x4e\x53\x2f\xdd\x4d\x7d\x1f\xe2\xee\x2b\xc4\x81\x1d\xfc\xf7\x43\x7d\x24\x3f\x4f\xd3\xb4\xc3\x3a\x81\xef\x3f\xea\xf4\x8f\xe5\x47\xcc\x4c\x8b\x6b\x78\x85\xe9\x9f\xbc\xc2\x83\xfd\xaf\x99\x19\x63\x33\x21\x3f\xe4\xfb\xc3\xf8\x2a\x70\xa1\x0d\x13\x19\xca\x02\x2e\x65\xbe\xcf\xeb\x1d\x6a\x9f\xc5\xad\x58\xad\x17\x94\xa5\x9a\xcc\xe8\x71\xdc\x0e\x8c\x95\xbf\x76\x39\x6d\xdc\x81\xf7\xbe\x14\xbd\xcc\x73\x4e\x76\xa4\x72\xbb\xb0\xb5\x9c\x79\x2d\x54\xc6\x0c\xe3\x82\xd2\x22\xeb\xf2\x2c\x38\x96\xf9\x02\xa4\xa0\xe2\xbb\xb6\xe5\xce\xa0\x30\x20\x0b\x57\x0c\x69\x19\xb6\xbc\x2c\x61\x89\xb6\x6e\x62\xde\x2f\xa9\x36\xd7\x6f\xc8\xf7\x54\xd2\x58\x1a\xd5\x6d\x83\x11\x11\x27\xaf\x87\x6b\x60\x81\x04\x2a\xcf\x6d\xd8\x58\x48\x2b\xdd\x69\x2d\xb8\xd1\x6d\x29\xff\x06\x6d\xc5\xb0\x91\x80\x97\x20\x78\x09\xb5\xb4\x96\x25\xc9\x3d\x63\xfc\x4f\xc3\xca\xfe\x71\x9f\x69\x88\x45\x53\x96\x71\x1a\xe4\x32\x26\x40\x48\x43\xf6\x69\xc8\x3a\x8c\x4e\x5a\xb1\x1a\x6e\x71\x97\x46\xf6\x42\x78\x49\xe7\x8a\x3b\x7f\x48\xf8\xde\x7f\x7e\xb0\x76\x3a\x47\x03\x0a\x4d\xa3\x84\xb6\x96\x77\x42\xcf\x6c\x97\x56\xa3\x32\x3b\xd7\x8b\xd1\xd2\x8a\x6f\x50\x38\x78\xba\x21\x30\x97\x01\x2b\x21\x98\xf9\x2d\xee\x7c\x09\x4c\x5a\x25\x77\x1e\x1c\x64\xea\x6d\xec\x25\x13\xaf\xff\x0a\x0d\x50\x5b\xb4\xf2\xfa\x6d\x6f\xe4\x0d\xf7\xff\x92\xb9\xea\x91\x59\x78\xcc\xde\x6d\xbe\xdb\x13\xf2\xd2\x5e\x2c\xf0\x7a\x8d\x25\x1a\x04\x85\x95\xdc\xe0\x57\x99\xc6\x21\xf5\xac\xd3\xd1\xbe\x5f\x0d\x9a\xdf\xa0\x58\x99\xf5\xb8\x53\xe2\xd2\x2e\xc6\x2d\x85\x85\x6f\x14\x8d\xbb\x1f\x5c\x98\x11\x06\x0e\x71\x9e\xd0\xf2\x88\x47\xda\x65\xa7\xff\x42\xe4\xf8\xa9\xa7\x9e\x3f\x33\x6b\xc0\x12\x2b\x7f\x43\x99\x70\xa9\x7a\x44\x95\xdd\x3c\xe7\xa4\xe9\x73\x41\xe0\xc5\x3a\x41\xe0\xb4\x6a\x34\x4f\x56\x19\x36\x3b\xad\x8f\xf0\xb6\x97\x3e\x70\x38\x5d\x7d\xc8\xdc\xfd\xef\x9a\xdc\x65\x81\x43\x57\x0b\x56\xe1\x08\x17\x02\x99\xd3\x5a\x1b\x7b\x4c\xad\x34\x0c\x6a\xc9\xa4\x61\x5a\x00\xb7\x33\x4d\xd3\xbd\x5b\x36\xf2\x16\x07\x0c\x29\x53\x61\x59\xa4\xf0\xe7\x9a\x6b\x97\x31\x0b\xc6\x4b\xe0\x05\x70\x9b\x4c\x28\x47\xb0\xb6\x04\x8e\xba\x8c\x80\xe7\x4f\x24\xda\xd9\xd5\x21\x79\x89\x5b\xc8\x6c\xaa\xa4\x6c\x24\x70\xdb\xd6\x16\x97\xd9\xb9\x76\xa5\x3a\xe4\xdb\x51\xd2\x7d\xc6\x30\xcf\xa4\x70\x29\x4c\xaa\x64\x84\xff\x25\x6e\x9f\x4a\x3e\x6c\xe9\x30\xa7\x19\x64\xe4\xce\xf5\xaf\x97\x1d\x48\x58\x96\x49\x65\xc7\xc3\x7e\x41\x3a\x1c\xdb\x46\xa8\x92\x92\x79\xe2\x60\x86\xac\xfc\xaa\xbf\x12\x6e\x96\xf8\x12\x23\x3f\x72\x7c\x05\x27\xa7\x68\x9e\x04\xa8\x21\xaf\x56\x22\x04\xe2\x58\xc5\x18\xe4\xa1\x47\x73\x82\x79\xcd\x94\xc6\x0b\x61\xc6\xbc\x7b\x21\xcc\x64\xe2\x72\x6b\x2d\xab\x93\xe3\xc7\xf0\x3a\x39\xfe\x76\xcc\x4e\x8e\x1d\xb7\x93\xe3\x71\x76\x76\xdd\xf1\x7b\xcf\x1f\x45\xb0\xf9\x96\x0c\x9d\xce\x79\x12\x50\x87\x1c\x5b\x09\x47\xd2\x0e\x06\x5f\xe4\x18\x86\x84\x27\x92\xb4\xe0\x63\x34\xed\xc2\x3c\x69\x71\x87\x34\x83\x44\xeb\x6a\x77\xc9\x1f\xe3\xee\x90\x0e\x52\xb8\x42\x04\xc3\x96\x25\xd5\x06\x08\xdd\x62\x26\x2b\x5b\x62\xa8\x31\xcc\xd1\x30\x5e\x8e\xdd\x91\x56\xa3\x73\x77\xdb\x09\x8f\x3a\xbd\x95\xf4\x8e\x17\x9a\x15\xa3\x54\xa9\x63\x13\xd6\x37\xb5\x51\x0b\xd8\xae\x79\xb6\xb6\x6d\xdd\x12\x3b\xc7\xd8\x70\x06\x8d\xc5\x48\xdf\xb9\x66\x31\x85\x4b\x69\x2c\x0f\x91\x63\x6e\xa9\xd7\xcd\xb2\xe4\x19\x35\x82\x63\x61\x60\x77\xfb\x30\xa8\x8d\x1a\x8b\x83\x20\xe2\x38\xff\x53\x29\xa9\x00\x45\xc6\x6a\xdd\x94\x36\x9b\x77\xfc\x8b\xb4\xaa\x29\x79\x4b\x8d\xae\x3b\x6e\x94\xc0\x9c\x28\x49\x60\x70\x2e\xa1\x66\x82\x67\xb6\x2d\xae\xd8\x8e\xce\xa3\x30\x93\x1b\x54\x98\x2f\xa8\x80\xda\x94\x25\xe0\x7b\xa7\xc7\xac\x99\x81\xb5\x2c\x73\x67\x9d\x43\x4d\xa1\x58\xb8\x9e\xd6\x6d\xf1\xd3\xc5\x5d\x34\xf3\xa7\x8c\xba\xc4\xbb\xb6\xae\x50\x6b\x72\xb4\x1f\x2c\x3a\x67\xca\xa7\x35\x39\x13\xa2\x52\x9e\x62\xe2\x80\x3b\x49\x32\x9a\x79\x13\xc6\x87\x20\xa7\x10\xc3\x73\xfa\xd3\x76\xba\xb1\xd7\x1f\x27\x6d\x1a\x8d\x42\x82\x67\xd9\x6d\x8f\xaa\xb6\x5f\xda\xe6\xf2\x2b\x19\x5b\xfc\x31\xc6\x2d\x35\xab\x6f\x48\xec\xbc\x94\x4b\x56\xda\x3e\x47\xf7\x27\x90\x95\x5b\xf1\xe1\x3b\x8f\xb7\x5c\xe4\x72\x1b\xdb\x08\x5c\x2a\xb9\xd5\xe1\x0d\x2e\x3e\x7f\xf3\xc7\xab\x97\x6f\xdc\x0a\x8d\xaa\xe9\x47\x9d\xa4\xd1\x86\xa9\x80\x1e\xdc\x46\x0a\xdf\xca\xbc\x29\xd1\x2b\xdc\xcf\x00\xfe\xfc\x71\x65\x97\x63\xd8\x30\xc5\xed\xf5\xd5\x68\x68\xfa\xf2\xb8\x29\xfc\x8b\x0b\x73\xea\x06\x09\x70\xc2\xf6\x31\x56\x19\xd7\xb4\x3d\xfb\xa8\x53\xa7\xc2\x1d\xdb\xad\x69\x3a\xf8\xfe\x7f\x2f\x59\x85\xf1\x82\x5a\x88\xe4\x99\x23\xea\x59\x75\x89\xbe\x17\x39\x16\x9c\x22\x7d\xcf\xb5\xe3\x11\x47\x3b\x6e\x82\x54\xec\x80\xf6\xbb\xba\x58\xaf\x71\xd9\xac\x56\xa8\x60\x45\x2d\x6f\x26\xab\x9a\x97\x87\x33\x2e\x35\xfc\xb9\x97\x7b\x11\x53\x7c\x18\xdb\x10\x7b\x77\x07\x88\x79\x02\x77\x9d\xcc\x28\x58\xe9\x1b\x9f\x5e\x0f\xef\x97\x86\x53\xaf\xbb\x7f\x0a\x6b\x85\x1a\x85\xd1\xc0\x1f\x93\x60\xfa\xaa\x5c\xef\x3d\xd2\x7a\xb5\x51\x27\x78\xe9\xe3\xeb\x2d\xbb\xc5\xdf\x08\x62\xab\x58\xad\xbb\x9d\x1e\x85\x8e\xb3\x2c\xcb\x32\xd4\xe1\x8d\x3f\xbc\x97\xcb\xe2\xc0\x36\xd4\x4f\xc6\x2e\xe0\x98\x5a\x35\x64\x1a\x1d\xd3\x14\xb6\x95\x2a\x0f\x79\x3c\xa8\x9b\x17\xc2\x3d\xec\xd8\x2e\xd4\x13\xb4\x5d\xb6\xdb\x08\xd7\x1f\xda\x8c\xf9\x85\xb3\xb8\x18\x76\xbd\x7a\xfc\x5d\xe5\x15\xc4\x8b\x43\xa3\x14\x22\x09\x97\xea\xdf\xb8\xd3\x3d\x7f\xdc\xd2\x07\x1f\xe2\x6e\xa4\x18\x3e\x47\xb8\x03\xd0\xd6\x6e\x3a\xbf\xfe\xb0\xbf\xd2\xbc\x00\x09\x67\x67\xf6\x29\xe1\xfe\xde\xfd\xbd\x8f\xb7\xbb\x68\xd6\x35\xff\xec\x21\x9a\x31\x38\x3d\x0b\xfc\xed\x6d\x70\xa8\x71\xe2\x4f\x43\xb4\xe2\x05\xc8\x24\x9a\x69\x12\xa5\xc3\xcd\x83\xc6\x05\xb0\x76\x58\x4c\xa2\x99\xfd\xd1\x86\x84\xfe\xfe\x02\x38\xfc\xa3\xb3\xf8\x02\xf8\xf3\xe7\x56\xbd\xbe\xe6\x1f\xe0\x0c\x58\x3b\xf1\xed\xb3\x0d\xd1\xf1\xec\x74\x27\x34\xc2\x4f\x2a\xfb\x31\x62\x18\xb1\xae\x54\xae\x99\xb6\x31\x54\x53\xda\x29\x6c\x21\x09\x37\x1f\xf3\xf6\xf5\x46\x16\x14\xd0\xef\xb5\x5d\x2a\x79\xc6\x0d\x5d\x39\x83\xca\x06\x8e\x76\x7f\x76\x7e\xb5\xf1\xbf\xe3\xf8\x0a\x63\x1f\xa2\x0e\x7f\xcd\xd9\x07\x96\x27\xfb\x99\xf0\xdf\x90\x81\x0e\x2f\x4b\x12\xcd\xe4\xa4\x23\x68\x38\x21\x01\x97\x9e\x6e\x6e\xc2\xcd\xbd\x71\x87\xbf\xb9\x89\x17\xb0\x49\xa2\x59\xe0\x7c\x7a\x06\x1b\x07\xd1\x19\x94\xe2\x24\x94\x1f\x2b\x14\x8f\xb8\xcb\x2f\x8d\x38\xad\xb2\x9e\xf7\xcb\xc1\x71\xd1\x8c\xa2\xad\x72\xb0\xf5\xed\xaa\x53\x38\xe0\x6f\x67\x10\xc7\x70\x07\x47\x47\x76\x78\x0b\x3e\x88\x66\xb3\x59\x26\x85\xe1\xa2\xc1\x68\x46\xfe\xf6\xa7\xf2\x28\x34\xe7\x76\x60\x16\xee\x7e\x86\x59\xae\x0d\xf8\x8e\x35\x67\xe3\x57\x10\x3f\x39\x13\xf1\xff\x62\x78\xd3\x25\x23\x59\x2d\x81\xb1\x92\x75\x47\x57\xb2\x08\x47\x31\xbb\x3a\x4e\x16\x60\x54\x83\xe1\x12\xb0\xba\x2e\x77\x04\xe0\x86\x70\x3a\xfa\x43\x2f\x5e\x65\xd4\x8e\xbb\xf6\xcd\xfb\x55\x53\x14\x53\x21\xdb\x15\x28\x94\xac\x80\xc1\x72\x67\xfc\xc3\xb5\x0f\xa5\x3e\xce\x7c\x09\xd7\x1f\x48\xa6\x77\x74\xf7\xd0\x3d\x0c\xa6\x25\xc5\x4a\x51\x50\x51\x3c\x3d\xf3\xa8\xf6\x60\xdf\xb9\xaf\x71\xe2\xe6\xa4\x68\xe6\xde\x8e\x0e\xa5\xfc\x8b\x52\x2b\x15\xae\x64\x47\xc4\xbe\xbc\x84\x88\x5a\x5a\x8e\x6d\xc2\xb0\x72\x94\x31\xac\xb2\xf0\xdf\xe7\x0e\x35\x64\xbf\xb7\xee\x1d\x56\xf3\xaa\x2e\xd1\x3e\x52\x52\x2f\x97\xc2\x85\x7d\xa1\x68\x0b\x8d\x7d\xc2\xd4\x6b\xa9\xcc\xda\xfe\x92\x27\xd5\xf0\xee\x6b\x98\x2f\xb1\x90\xaa\x3b\x61\x24\xbe\x37\x7c\x3b\xf1\x62\xed\xfa\xad\x1e\x87\xfd\xcf\x06\x4f\x64\xe1\x7f\xa3\x98\x26\x71\xd5\xff\xb9\x23\x72\x1e\xe6\x82\xd3\x00\x73\x17\xcd\x8e\x8e\x80\x6d\x24\xcf\x21\x47\x96\x43\x26\x73\x04\x2c\x79\xc5\x05\xa3\xb0\x8d\x66\xd6\xc7\xb6\x87\xbb\x7b\x88\x66\x37\x70\x06\x18\x3d\x44\xff\x0b\x00\x00\xff\xff\x72\x0d\xcb\x80\x42\x1f\x00\x00"), - }, - "/nosync": &vfsgen۰DirInfo{ - name: "nosync", - modTime: time.Date(2019, 3, 5, 13, 38, 20, 257702305, time.UTC), - }, - "/nosync/map.go": &vfsgen۰CompressedFileInfo{ - name: "map.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 233338323, time.UTC), - uncompressedSize: 1958, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x55\x4d\x8f\xdb\x46\x0c\x3d\x5b\xbf\x82\x3d\x55\x2e\x14\xe7\x9e\x62\x0f\x05\x7a\x29\xd0\x34\x40\xdb\x5b\x90\x03\x2d\x71\xac\x81\xe7\x43\x1d\x52\xeb\x2a\x8b\xfd\xef\x05\x39\xb2\x57\xde\x24\x45\x0f\xbd\xd9\x23\x0e\xf9\xf8\xde\x23\x67\xc2\xfe\x8c\x27\x82\x94\x79\x49\x7d\xd3\xbc\x7d\x0b\xef\x71\x02\xcf\x80\xd0\xe7\xd4\xcf\xa5\x50\x12\x88\x38\xc1\xc5\xcb\x08\x18\x73\x11\xff\x99\x86\x37\x7d\x4e\x2c\x98\xe4\x8d\xf8\x48\x10\x32\x0e\xdc\x01\x4b\x2e\xc4\x1d\x60\x1a\x60\xa0\x40\x42\x7c\xd0\x9c\xbf\x88\xa6\x64\x74\x04\x2e\x17\x88\x73\x10\x3f\x05\x82\x53\x2e\x79\x16\x9f\x88\x41\x32\xf4\x18\x02\xa0\x02\xf8\x9e\x21\x92\x8c\x79\xe0\x0d\x8a\xb0\x68\x2e\x4d\xf7\xe7\x48\xf0\x99\x4a\xbe\x62\x7d\xc4\xe0\x07\x2b\x4a\x71\x92\x5b\xd8\x4f\xf6\x3d\xce\x2c\x90\xb2\xc0\x91\xa0\xcf\x93\xa7\x01\xd0\x09\x15\x70\xbe\xb0\xc0\xcc\x74\x68\x64\x99\xc8\x82\x59\xca\xdc\x0b\x3c\x35\xbb\xa8\x4d\x7f\xf4\x49\xa8\x38\xec\xe9\xe9\xf9\xd3\xe6\x77\xf3\x6c\x54\xfd\x9a\x71\x80\x42\x32\x97\xc4\x20\x23\x29\x90\x99\x2a\x0b\x03\xf8\x64\x67\xca\x9d\x36\x8d\x70\xa6\xa5\x83\x5c\x20\xf9\x00\xde\x41\xca\x9a\xa3\x5e\xf1\x0c\x53\x21\xa6\x24\x87\x6b\x83\xf9\x0c\x85\x78\x0e\x02\x3e\x0d\xbe\x47\x21\x86\xcb\x48\x32\x52\x59\x2f\x5d\x90\xc1\xe5\x39\x6d\x4b\x1d\x1a\x37\xa7\x1e\xda\x08\x3f\xbc\xc7\x69\x6f\x10\xdb\x33\x2d\xb0\x41\xbf\x87\x76\xad\xfa\x72\xd6\x69\xbd\x63\xce\x61\xaf\xcd\xdb\x67\x3b\x7a\x80\x78\x88\x1f\xcf\xb4\x7c\x6a\x76\xb5\x53\xb8\x7d\x5c\x59\xf8\x43\xdb\x05\x26\xd9\x72\x70\xeb\xf8\x35\x20\x8b\x6e\x8d\x8a\x2f\x40\x58\x6d\xef\xb4\x24\x3c\x3c\x18\x4f\x4f\xcd\x6e\x67\x7f\x21\xe2\x99\xda\x7f\xd1\x64\xdf\xec\x9e\x9b\xdd\x15\x2d\x3c\xd4\xf4\x1b\xa5\x3e\x94\x8a\x74\x2b\x18\xfd\xed\x59\x7c\x3a\x6d\x50\xeb\xb1\x11\xe6\xee\x24\xf9\xa0\xc4\x5f\x3c\x53\x07\x5e\x56\xa3\x9b\xe5\xb6\xe9\x4e\xfe\x91\x56\x82\x6e\x3a\xea\x68\xd0\x70\xd3\x92\x41\x8a\x76\xed\x36\x64\xa9\x90\x35\xac\x03\x87\x81\xed\x73\x75\xd1\xd7\xf4\x5c\x1b\xf9\x26\x89\x2d\xf6\x32\x63\xb8\x97\x77\x85\x71\x93\xd8\xbb\x17\x21\xe1\xdd\x8b\xcc\x3f\xea\x7f\x65\xfd\x5e\x6d\x05\x6d\x04\xff\xcf\xf2\xbc\x2a\x63\xdd\xaf\x9a\xfd\x6c\x0b\xe4\xba\x47\xfe\x8b\xb7\xea\x8d\x2f\xed\xfe\x55\x57\xd5\xc2\x86\xaa\x96\x68\xe3\x21\x76\x9a\x76\xbf\x02\xf8\x1d\xd3\x89\x6c\x2b\x31\x38\x60\xfa\x6b\xa6\x24\x1e\x43\x58\x0c\x02\x61\x3f\x9a\x53\xd4\x05\x15\xd9\x6a\x98\xbb\x79\xd4\xf5\xe7\xc0\xdd\x7c\x62\x2d\x76\x50\x2c\x39\x4b\x9e\x6a\x6b\x5e\xa8\xa0\xf8\x9c\xae\xdb\xab\x56\x1f\x32\xb1\x6d\xaf\x44\x3d\x31\x63\xf1\x61\x81\x3e\x97\x42\x3c\xe5\x34\xe8\xda\xc4\xa4\x27\x89\x3d\x8b\xd6\xe6\x84\x13\x8f\x59\x20\x57\x8b\xd9\x3a\xd5\x84\x7d\x4e\x1a\xc0\xef\x20\x65\xc3\x7d\xf1\x21\xe8\x56\x7c\xf4\xec\x85\x06\x88\x3a\x1d\x32\x62\x82\x9c\x7a\xea\xe0\x38\xcb\xbd\x4f\x8d\xf8\xb4\xe8\x65\x4d\xa8\x2b\xbd\xae\xba\x5c\x56\x99\x86\xbb\x7d\xdd\xad\x4d\x44\x5c\xa0\x90\x0b\xd4\x8b\xdd\x8f\x38\x4d\x3a\x74\x75\xdc\x50\xae\x09\x5d\xc9\xd1\x02\xa6\xec\x93\xc0\x30\x17\x8d\xd2\xfa\x2f\x52\xdc\xd3\xa3\x99\x8f\x04\x1f\xda\xdf\xf6\xf5\x81\xd2\xe0\x34\xc7\x23\x15\xed\x9f\x02\x45\x6d\x79\xbb\x8b\x49\x47\xd4\x6f\x14\xb1\xca\x36\x75\xf5\x5d\xb0\x97\xcf\xde\xb6\x4d\x26\x73\xc1\x6b\xbf\x19\x86\xd6\x81\x9e\x7e\x73\x1a\x6f\x13\xa7\xdd\x9e\x3b\x78\xd4\x69\xab\xea\xab\x23\xd5\x8a\xde\xc1\x77\xae\xd5\x6f\x16\xb8\xdb\x1d\x0b\xe1\xb9\xd9\xa9\x37\xf5\xad\xf9\x27\x00\x00\xff\xff\xe8\x19\x65\x16\xa6\x07\x00\x00"), - }, - "/nosync/mutex.go": &vfsgen۰CompressedFileInfo{ - name: "mutex.go", - modTime: time.Date(2019, 3, 5, 13, 38, 20, 257752198, time.UTC), - uncompressedSize: 2073, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x54\xcb\x6e\xdb\x30\x10\x3c\x4b\x5f\xb1\xc9\xc9\x4e\x62\xa5\xbd\xb6\xf5\xa1\x68\x81\x22\x40\x7a\x09\x50\xe4\x4c\x53\x2b\x99\xb0\x44\x1a\x24\x55\xd5\x4d\xf2\xef\xc5\xf2\x21\xcb\x92\xec\xc4\x2d\xaa\x93\xb0\xe4\xce\xce\xec\x0c\xb8\x65\x7c\xc3\x4a\x04\xa9\xcc\x4e\xf2\x34\xbd\xbd\x85\xef\x8d\xc5\x5f\x20\x0c\x30\xc8\x9b\xba\xde\x41\xbb\x16\x7c\x4d\x05\xa9\xe4\x62\x55\x29\xbe\x11\xb2\xcc\x52\xbb\xdb\x62\xb8\x6c\xac\x6e\xb8\x85\xa7\x34\xa1\x53\xcc\x61\xa5\x54\x95\xbe\x38\xb8\x7b\xc5\x37\x40\x65\x03\x75\x06\x77\xd6\x23\xeb\x46\x2e\xac\xa8\x11\x50\x6b\xa5\x41\x14\x50\xbb\x83\x4a\x23\xcb\x77\xe0\x61\xb2\xb4\x68\x24\x87\x59\x0d\x57\x6e\xce\xdc\x81\xcd\xe6\x34\x88\x3a\xb2\x30\xed\x29\x4d\x92\x2d\x93\x82\xcf\x2e\xbd\x8e\x0f\x50\x77\x22\x0e\x10\x2f\xe7\x69\xf2\x92\x26\x5d\xe7\x12\xac\x6e\x30\x30\xfd\x21\xa9\x0a\x8d\x7c\x2b\x5b\xa9\xec\x51\xa6\x1e\xac\xe3\x7a\x71\x8a\xac\x9f\x08\xaa\x08\x7f\x98\x7b\xfe\x63\xb6\x05\xab\x4c\xa4\xfb\xf0\x78\x96\x53\xf1\xfa\xde\xab\x56\x0b\x8b\xf7\x1e\x9a\x3e\x67\x5a\x42\xeb\xa2\xe2\x17\xd5\x48\x8b\x1a\x84\xb4\x13\x4e\x42\xa1\x34\x10\x00\x0d\x38\xb1\x27\xdd\x8e\x4d\x70\xbd\x54\x10\xb2\x84\x1e\x4c\xd8\xa1\x6e\xe1\x2a\x90\x1d\x18\xae\xdb\x6c\xc8\xee\x62\x09\xef\xe0\xf9\x99\x8e\xfa\x72\xce\x4e\xc4\xa0\xff\x54\x2e\x74\x7b\x9e\xf8\x7d\x4a\x0e\xfa\xa6\xd4\x0e\x43\xf3\xba\xaa\x57\xa2\x33\x92\x75\x10\xa0\x91\xa1\xc1\x94\xff\x69\xe8\xc3\xd0\xd1\x7f\xb5\x6d\x90\x88\xeb\xeb\xa8\xae\xb3\x2d\x57\x48\x5a\x8c\x90\x65\x85\x41\x35\x67\x55\xf5\x11\x84\x05\x77\x48\x16\xb1\xa2\x40\x6e\x41\xd9\x35\x6a\x30\xa2\x6e\x2a\xcb\x24\xaa\xc6\x38\x65\xa8\xcd\xd9\x4e\xc7\x6d\x4e\xae\x61\x60\xf5\x44\xb4\x97\x14\xed\xbf\xb2\x7c\x80\xb4\x58\x84\x95\x3c\x32\x61\xbf\x69\xd5\x6c\xdf\xfa\x66\xec\x1b\xf6\xaf\x06\x1f\xbd\x0b\x9f\xf3\x1c\x58\x9e\x1b\xc8\xb1\xb2\xec\x26\x20\xd6\x6c\x07\x2b\x04\x89\x25\xb3\xe2\x27\xde\x80\x55\x60\xd7\x7d\xcc\xbb\xc2\x15\x22\x60\xe9\x9c\xe8\xae\x13\xaa\x53\x6e\xe2\x02\xdb\x12\xae\xba\xee\x39\x5d\x98\xb9\x89\x44\xc5\xed\xb1\x2d\xb3\x08\x76\xbd\xf4\x6c\xdc\x72\x7b\xf5\x4f\x87\x3b\xf5\x1b\x8d\x43\x7b\xdc\xc2\x7d\xbf\x53\x2f\xf3\xab\x92\x08\x39\x72\x8d\x35\x4a\x6b\x06\x62\x42\xc3\x11\xae\xd4\x3b\x8b\x1c\x89\xf8\xe2\xfd\xbc\x67\x4a\x10\x4a\x49\x9a\x44\x8d\xe1\xfa\x8d\x5a\x1d\x99\x40\xbf\x5d\x9a\x7a\x82\x2f\x96\x53\x8a\xc7\x13\x22\x7c\x54\xfc\x27\x00\x00\xff\xff\xec\x95\x29\x83\x19\x08\x00\x00"), - }, - "/nosync/once.go": &vfsgen۰CompressedFileInfo{ - name: "once.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 233609287, time.UTC), - uncompressedSize: 1072, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\x53\xcb\x92\xda\x40\x0c\x3c\xdb\x5f\xd1\xb5\x27\x9c\xa2\xe0\xbe\xa9\x1c\x52\xc5\x65\x4f\x39\xe4\x0b\xc4\x58\x03\xca\x0e\x1a\x32\x0f\x58\x67\x8b\x7f\x4f\x69\x6c\x08\xb9\xd9\x92\xba\xd5\x6a\x69\xce\xe4\xde\xe9\xc0\xd0\x98\x27\x75\x7d\xbf\xdd\xe2\x87\x3a\x86\x64\x90\x22\xee\x7f\xb1\x2b\x28\x47\x2a\xb8\x4a\x08\x38\x73\xf2\x31\x9d\xc0\x1f\xe4\x4a\x98\x10\x95\x41\xae\x48\xd4\x4d\x5f\xa6\x33\xcf\xe0\x5c\x52\x75\x05\x9f\x7d\x37\x46\xd1\x03\xf6\x31\x06\xfb\x56\xc6\xfc\x7d\x6b\x8d\x76\x11\x8e\x42\xc8\x28\x47\x86\xaf\xda\x78\xe0\x21\x1e\xa4\x23\xa2\x86\xc9\xbe\x77\xd1\xd4\xec\xd9\x98\xac\x9e\x47\xf8\x98\x0c\x64\x24\x5e\x52\x2e\x28\x72\xe2\x25\x2a\x19\xa2\xb9\x90\x09\x89\xbe\x09\xda\xe0\x4d\x11\xcb\x91\x13\xae\x31\x8d\x79\x8d\x83\x5c\x58\x0d\xde\x5d\x28\x21\x5a\xad\x15\x5a\x44\x7c\xfb\xdf\xec\xe2\xca\x0f\xd6\x79\xe9\x79\xaa\xa1\xc8\x39\x70\xeb\x95\xd7\xb3\xbc\xa6\xbc\x29\xb0\xaa\xd9\x23\xd1\x4b\x7c\x67\xf8\xb5\xb1\xf1\x85\xd5\x28\x3d\x8e\x94\x41\x18\xc5\x7b\x4e\xac\x05\x17\x0a\x95\x21\x0a\x26\x77\x6c\x20\x47\xcd\x48\xe0\x3b\x94\xaf\xcf\x53\x3c\xaf\x25\xf1\xef\x2a\x69\x31\xa1\x61\x1f\xd6\x95\x08\xfe\x60\x57\x0b\x6f\xfa\xed\x76\xb1\xb8\xf9\x51\x58\xc7\x05\x22\x2a\x45\x28\xc8\x1f\x9a\x31\xb6\xdb\x53\xcd\x05\x7b\x46\xaa\xfa\xb4\x5a\x33\x0e\x3f\xc5\xfa\x36\x05\x92\xa1\x12\x68\x14\xb7\x86\x14\x9c\x68\x32\x8c\xb2\xe3\x9c\x29\x4d\xd6\xbe\x66\x06\xfd\x13\x14\xa4\x70\xa2\x60\x19\x47\xe7\x52\x13\xdf\xd7\x46\xe9\x50\x4f\xac\x25\x5b\x8e\xfe\x1b\x61\xcf\x8b\x85\x23\xf6\x13\x76\xf1\xb5\xed\xc9\x45\xf5\x72\xd8\x3c\x56\x53\xd5\xad\x06\x7c\x62\x89\xdb\x54\x2b\x2f\x81\x95\x4e\x3c\xe0\x36\x2c\x06\xbc\x99\xf5\x8e\x6a\xe6\x6c\x66\xcc\xf4\xf3\x46\xdb\x10\xf3\x55\x93\x8a\xdb\x3c\x23\x5a\x24\xaf\xdb\x89\x46\xcd\x32\x72\xca\x56\x5e\x22\x8e\x74\x61\x24\x2e\x35\x29\x8f\x5f\xe1\x6b\x1b\x6b\x3e\xe4\xd8\xae\x75\x4e\x1a\xd7\x55\xca\x31\xd6\xf9\x38\xec\x7c\x7d\x6b\x62\xda\xb1\x8a\xf8\x62\x2b\x1d\x60\xd3\x60\x9e\x67\xb0\x37\x63\x07\xb8\x69\x8f\xe5\xb3\xef\xba\x85\xac\xbb\x3d\x12\x46\x64\x99\xa6\x71\xf5\x32\xbf\xdc\xd7\xfb\x6b\xe2\xb1\x75\x15\x85\x7f\x19\x1a\xec\x8e\xf9\x86\x92\x2a\xf7\xdd\xc8\x9e\x13\xee\x06\xf6\xdd\x53\x81\xa7\x90\x79\x89\x28\x3f\x10\xb7\xd5\xd0\x77\x7e\x35\xf4\xb7\xfe\x6f\x00\x00\x00\xff\xff\xf9\x72\xbe\xa9\x30\x04\x00\x00"), - }, - "/nosync/pool.go": &vfsgen۰CompressedFileInfo{ - name: "pool.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 233714234, time.UTC), - uncompressedSize: 2130, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x55\x3f\x93\xdb\xc6\x0f\xad\x4f\x9f\x02\xbf\xea\x77\xca\xe8\x74\x49\xeb\x99\x2b\x32\x29\x1c\x37\x89\x8b\x74\x1e\x17\x10\x09\x8a\x88\x97\x0b\x06\xc0\x4a\xa2\x3d\xf7\xdd\x33\x58\xfe\x39\x39\xee\x44\xee\xf2\xe1\xe1\xbd\x07\x68\xc4\xe6\x0b\x9e\x09\xb2\xd8\x94\x9b\xdd\xee\xf9\x19\x7e\x85\x8f\x22\x09\xd8\x00\xc1\xc8\x41\x3a\x70\x1a\x46\x51\xd4\x09\xe4\xf4\x37\x35\x6e\xe0\x3d\x3a\x0c\x38\xc1\x89\x80\x73\xcb\x17\x6e\x0b\xa6\x34\x81\xe1\x85\x5a\xc0\xdc\x06\x94\x92\x2b\xd3\x85\xda\xe3\xee\xf9\xb9\x62\xe7\x09\xd8\x69\x00\x73\x51\x6a\x81\x33\x78\x4f\x73\xc1\x05\x4d\x69\x90\x0a\x51\x5c\x06\x74\x6e\x2a\x2c\x3a\x60\x9e\xc0\x79\x20\xb8\xb2\xf7\x52\x3c\xf0\xb2\x38\x77\xdc\xa0\xb3\xe4\x23\x7c\xe8\xde\xd0\x7a\x49\xad\xd5\x47\xc9\x69\x02\xa5\x8e\x94\x72\x43\x70\xed\x29\x8a\xb2\x41\x8f\xe3\x48\xd9\x0e\x71\x2b\xc0\x2a\xb1\x81\xcf\xbd\x07\x8f\x96\x30\x25\x69\xd0\xef\xd8\x6f\xca\x18\x76\x04\x9d\x28\x14\x23\x38\x4d\x30\x94\xe4\x3c\x26\x82\xb3\xa8\x14\xe7\x4c\x06\xc6\xf1\x16\x33\x49\xb1\x34\xad\x18\x81\xf0\x7f\x83\xb1\xe8\x28\x46\x81\xe5\x02\x0d\x36\x3d\xc1\x56\x0f\x4e\xc5\xa1\xe4\x62\xa1\x90\xd3\x60\xb5\x54\x42\x27\x05\xa5\x62\x74\x98\xc5\x4d\x4c\x17\xce\x67\x18\x95\xcc\x8a\x46\xab\xb5\xe3\x33\xea\x29\x4c\x6d\x24\x25\x6a\x5c\xf4\x08\x7f\x85\x5f\x6c\x07\xe0\xb0\xed\x0b\x59\xfc\x20\xb4\x09\x5c\x02\xec\x54\x38\xb5\x40\x5d\xc7\x0d\x53\xf6\xd0\x44\x09\xdb\xa7\xb9\x51\x25\x82\xc4\xe6\x76\x84\xdf\xe5\x4a\x17\xd2\x0a\xc4\x16\x06\x80\x15\x76\x3c\xa5\x59\x10\x4c\x29\xf0\xee\x3e\xd9\xac\x07\x1c\x47\x95\x51\x19\x9d\xaa\x70\xd2\x01\x6e\x92\xba\xc0\x80\x39\x68\x23\x9c\x55\xca\xf8\x7d\xf0\xaa\x0e\x81\x63\x9c\x28\x7b\x24\xad\xc7\x88\x10\x0e\x92\xcf\x11\x38\x18\xc5\x29\x3b\xd7\xbc\x54\x99\xda\xb0\xa6\x91\xdc\x14\x55\xca\x1e\x41\xa5\x91\x72\x4b\xb9\x86\xa7\x49\xd1\xaa\xcd\x34\x96\x41\x38\xce\x7c\x46\x95\x0b\xb7\x14\x23\x70\xc5\xd0\x28\xca\xa8\xf3\xd7\xcd\x25\x96\x0c\x72\x21\xed\x09\x6b\xd4\xb1\x51\x31\x8b\x16\xa6\x15\xf8\xae\x73\xba\xe1\x10\xf1\x90\x0e\xce\x22\xed\x8f\xdd\x2f\x83\xd0\x0d\xbe\x32\x39\xc0\xb5\xe7\xa6\x87\x01\x39\x3b\x72\x36\xc0\x00\x6b\xa7\x8c\xc3\x3c\x14\x4f\xc6\x5f\xa9\x9d\x47\xe9\x3f\x53\x5a\x7c\x2c\x0e\xa7\xd2\x75\xa4\x16\xee\xd3\x72\xcd\x1a\x4c\x64\x50\x72\x4b\x1a\x70\x49\xb0\x85\xc7\x3a\x13\x95\xfa\x5d\x7e\x51\x09\xb0\x71\xbe\x50\x9a\x60\x54\xce\xce\xf9\xbc\xaf\x4a\x5b\xaf\x9c\xbf\x58\x9d\xa5\x40\xf9\xa7\x30\x59\x43\xd9\xd7\x96\xff\x9c\xdb\x11\xef\x49\xa1\xc7\xdc\x1e\x00\xdf\x32\xb1\xf5\x14\xf6\x19\x8c\xa8\x3e\xab\x61\xbd\xa8\x3f\x25\x8e\xf9\x9f\x37\x0d\xb0\x2d\x73\x1e\xc7\x6b\xd0\x42\xbe\x1a\xb6\xaa\xdf\x01\x8c\x63\xb2\x6b\xc5\xc5\x12\x68\x85\xe6\x74\x6e\xc6\x5d\x29\x25\xe0\xca\xb7\x6e\xaf\x20\x8c\xca\x72\x84\x0f\x35\xca\x43\xe8\xb3\x4d\x40\x78\xde\xe3\x85\xc0\x4a\xd3\x6f\x6b\x8f\xc3\xc5\xa1\x1e\xf7\xc4\x0a\x72\xcd\xdf\xa5\xbd\xf6\xef\xd3\xb8\x2c\x21\x73\x2d\x8d\xc3\xb7\xdd\xc3\xac\xfe\xa7\xcf\x9c\x9d\xb4\xc3\x86\xbe\xbd\xee\x1e\xfe\xa0\x2b\x00\x74\x25\x37\x8f\x7b\xb8\x3f\x79\xad\x8b\xf8\x3d\x39\x18\xa5\x5a\x18\x33\xa0\x9e\xd8\xb7\x59\x80\x4e\x65\xd8\xd6\xdd\x61\x59\x9b\x75\xac\xd7\x93\x75\xdd\x1c\xaa\x67\x4a\x5e\x34\xd7\x0b\x2e\xf5\xc3\x08\x11\xe9\x71\x2d\x15\xfb\xb7\xe9\x25\xb6\x92\x0b\xf0\x39\x07\xe3\xb8\x37\x46\x2b\x01\xe1\x4a\xb1\x45\x3c\x4c\xa3\x61\xf4\xba\xd4\xe0\xb7\x0a\x63\x61\x5e\x49\xed\xac\xb9\x59\x19\xa8\x6e\x6c\xa5\x34\x0f\xcb\x89\xfc\x4a\x94\xe1\x82\xa9\x50\x98\x6e\x31\xa0\x2e\xf0\xb1\xf8\xfa\x7f\x11\xd5\x96\xf3\x99\xee\x3c\xc2\xef\x69\x0b\xd6\x87\xae\x72\xbd\xd6\x52\x35\x5e\x57\x36\x5a\x6e\x43\xe6\x99\xe8\x78\x0c\x69\xeb\x7a\xca\x4f\x99\xd3\xa1\x7e\xb4\x28\xb0\x16\x52\xb2\x92\x6a\xf0\x42\x88\xba\x47\xe3\xb3\xe3\x2e\x0c\x81\xc7\x11\x7e\x0a\xf1\xf6\xf1\xe9\xf7\xf6\x84\x9f\xdc\x41\xa2\xfc\x38\x1e\xab\xb1\x7b\x78\x79\x81\x9f\xe3\x7d\x1c\xcc\xd5\xff\xf7\x52\xe9\xc4\xbb\x87\x85\x5e\x3d\x78\xdc\xef\x1e\x1e\x5e\x77\xdb\xcb\xcc\x69\x17\xcf\x37\x78\xf7\x02\x0b\xde\xa7\x7b\xec\xa7\x5f\x3e\xef\x1e\x96\x07\x78\xbb\xf2\xee\x87\x3b\x0b\xe0\x6d\x89\x4f\xd5\xb5\x6d\x0d\x6e\xab\xe1\x61\xe4\x0f\xed\x7d\x2c\xfe\x78\xbb\x6f\x6f\xbf\xf4\x77\x8b\xa6\xd6\x16\x66\xec\x4a\xf4\x8d\x4a\xfd\xff\x6c\x57\x12\x07\xb8\xed\x77\xaf\xbb\x7f\x03\x00\x00\xff\xff\x07\xba\x3e\x57\x52\x08\x00\x00"), - }, - } - fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/js"].(os.FileInfo), - fs["/nosync"].(os.FileInfo), - } - fs["/js"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/js/js.go"].(os.FileInfo), - } - fs["/nosync"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/nosync/map.go"].(os.FileInfo), - fs["/nosync/mutex.go"].(os.FileInfo), - fs["/nosync/once.go"].(os.FileInfo), - fs["/nosync/pool.go"].(os.FileInfo), - } - - return fs -}() - -type vfsgen۰FS map[string]interface{} - -func (fs vfsgen۰FS) Open(path string) (http.File, error) { - path = pathpkg.Clean("/" + path) - f, ok := fs[path] - if !ok { - return nil, &os.PathError{Op: "open", Path: path, Err: os.ErrNotExist} - } - - switch f := f.(type) { - case *vfsgen۰CompressedFileInfo: - gr, err := gzip.NewReader(bytes.NewReader(f.compressedContent)) - if err != nil { - // This should never happen because we generate the gzip bytes such that they are always valid. - panic("unexpected error reading own gzip compressed bytes: " + err.Error()) - } - return &vfsgen۰CompressedFile{ - vfsgen۰CompressedFileInfo: f, - gr: gr, - }, nil - case *vfsgen۰DirInfo: - return &vfsgen۰Dir{ - vfsgen۰DirInfo: f, - }, nil - default: - // This should never happen because we generate only the above types. - panic(fmt.Sprintf("unexpected type %T", f)) - } -} - -// vfsgen۰CompressedFileInfo is a static definition of a gzip compressed file. -type vfsgen۰CompressedFileInfo struct { - name string - modTime time.Time - compressedContent []byte - uncompressedSize int64 -} - -func (f *vfsgen۰CompressedFileInfo) Readdir(count int) ([]os.FileInfo, error) { - return nil, fmt.Errorf("cannot Readdir from file %s", f.name) -} -func (f *vfsgen۰CompressedFileInfo) Stat() (os.FileInfo, error) { return f, nil } - -func (f *vfsgen۰CompressedFileInfo) GzipBytes() []byte { - return f.compressedContent -} - -func (f *vfsgen۰CompressedFileInfo) Name() string { return f.name } -func (f *vfsgen۰CompressedFileInfo) Size() int64 { return f.uncompressedSize } -func (f *vfsgen۰CompressedFileInfo) Mode() os.FileMode { return 0444 } -func (f *vfsgen۰CompressedFileInfo) ModTime() time.Time { return f.modTime } -func (f *vfsgen۰CompressedFileInfo) IsDir() bool { return false } -func (f *vfsgen۰CompressedFileInfo) Sys() interface{} { return nil } - -// vfsgen۰CompressedFile is an opened compressedFile instance. -type vfsgen۰CompressedFile struct { - *vfsgen۰CompressedFileInfo - gr *gzip.Reader - grPos int64 // Actual gr uncompressed position. - seekPos int64 // Seek uncompressed position. -} - -func (f *vfsgen۰CompressedFile) Read(p []byte) (n int, err error) { - if f.grPos > f.seekPos { - // Rewind to beginning. - err = f.gr.Reset(bytes.NewReader(f.compressedContent)) - if err != nil { - return 0, err - } - f.grPos = 0 - } - if f.grPos < f.seekPos { - // Fast-forward. - _, err = io.CopyN(ioutil.Discard, f.gr, f.seekPos-f.grPos) - if err != nil { - return 0, err - } - f.grPos = f.seekPos - } - n, err = f.gr.Read(p) - f.grPos += int64(n) - f.seekPos = f.grPos - return n, err -} -func (f *vfsgen۰CompressedFile) Seek(offset int64, whence int) (int64, error) { - switch whence { - case io.SeekStart: - f.seekPos = 0 + offset - case io.SeekCurrent: - f.seekPos += offset - case io.SeekEnd: - f.seekPos = f.uncompressedSize + offset - default: - panic(fmt.Errorf("invalid whence value: %v", whence)) - } - return f.seekPos, nil -} -func (f *vfsgen۰CompressedFile) Close() error { - return f.gr.Close() -} - -// vfsgen۰DirInfo is a static definition of a directory. -type vfsgen۰DirInfo struct { - name string - modTime time.Time - entries []os.FileInfo -} - -func (d *vfsgen۰DirInfo) Read([]byte) (int, error) { - return 0, fmt.Errorf("cannot Read from directory %s", d.name) -} -func (d *vfsgen۰DirInfo) Close() error { return nil } -func (d *vfsgen۰DirInfo) Stat() (os.FileInfo, error) { return d, nil } - -func (d *vfsgen۰DirInfo) Name() string { return d.name } -func (d *vfsgen۰DirInfo) Size() int64 { return 0 } -func (d *vfsgen۰DirInfo) Mode() os.FileMode { return 0755 | os.ModeDir } -func (d *vfsgen۰DirInfo) ModTime() time.Time { return d.modTime } -func (d *vfsgen۰DirInfo) IsDir() bool { return true } -func (d *vfsgen۰DirInfo) Sys() interface{} { return nil } - -// vfsgen۰Dir is an opened dir instance. -type vfsgen۰Dir struct { - *vfsgen۰DirInfo - pos int // Position within entries for Seek and Readdir. -} - -func (d *vfsgen۰Dir) Seek(offset int64, whence int) (int64, error) { - if offset == 0 && whence == io.SeekStart { - d.pos = 0 - return 0, nil - } - return 0, fmt.Errorf("unsupported Seek in directory %s", d.name) -} - -func (d *vfsgen۰Dir) Readdir(count int) ([]os.FileInfo, error) { - if d.pos >= len(d.entries) && count > 0 { - return nil, io.EOF - } - if count <= 0 || count > len(d.entries)-d.pos { - count = len(d.entries) - d.pos - } - e := d.entries[d.pos : d.pos+count] - d.pos += count - return e, nil -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/natives/doc.go b/vendor/github.com/gopherjs/gopherjs/compiler/natives/doc.go deleted file mode 100644 index c176d5b33..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/natives/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// Package natives provides native packages via a virtual filesystem. -// -// See documentation of parseAndAugment in github.com/gopherjs/gopherjs/build -// for explanation of behavior used to augment the native packages using the files -// in src subfolder. -package natives - -//go:generate vfsgendev -source="github.com/gopherjs/gopherjs/compiler/natives".FS -tag=gopherjsdev diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/natives/fs.go b/vendor/github.com/gopherjs/gopherjs/compiler/natives/fs.go deleted file mode 100644 index 13bbd3b53..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/natives/fs.go +++ /dev/null @@ -1,29 +0,0 @@ -// +build gopherjsdev - -package natives - -import ( - "go/build" - "log" - "net/http" - "os" - "strings" - - "github.com/shurcooL/httpfs/filter" -) - -// FS is a virtual filesystem that contains native packages. -var FS = filter.Keep( - http.Dir(importPathToDir("github.com/gopherjs/gopherjs/compiler/natives")), - func(path string, fi os.FileInfo) bool { - return path == "/" || path == "/src" || strings.HasPrefix(path, "/src/") - }, -) - -func importPathToDir(importPath string) string { - p, err := build.Import(importPath, "", build.FindOnly) - if err != nil { - log.Fatalln(err) - } - return p.Dir -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/natives/fs_vfsdata.go b/vendor/github.com/gopherjs/gopherjs/compiler/natives/fs_vfsdata.go deleted file mode 100644 index 749606e01..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/natives/fs_vfsdata.go +++ /dev/null @@ -1,1056 +0,0 @@ -// Code generated by vfsgen; DO NOT EDIT. - -// +build !gopherjsdev - -package natives - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "net/http" - "os" - pathpkg "path" - "time" -) - -// FS is a virtual filesystem that contains native packages. -var FS = func() http.FileSystem { - fs := vfsgen۰FS{ - "/": &vfsgen۰DirInfo{ - name: "/", - modTime: time.Date(2019, 4, 10, 21, 27, 44, 478007813, time.UTC), - }, - "/src": &vfsgen۰DirInfo{ - name: "src", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 225440940, time.UTC), - }, - "/src/bytes": &vfsgen۰DirInfo{ - name: "bytes", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 212650386, time.UTC), - }, - "/src/bytes/bytes.go": &vfsgen۰CompressedFileInfo{ - name: "bytes.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 212511031, time.UTC), - uncompressedSize: 508, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x90\xcd\x4e\xc3\x30\x10\x84\xcf\xde\xa7\x18\x6e\x8d\x68\x55\x72\x45\x4d\x0f\x20\x0e\x3c\x43\xd5\xc3\xda\xdd\x54\x86\xe0\x14\x27\x91\xa8\x50\xde\x1d\xd9\x71\x1a\x19\x55\xca\x21\xde\x9f\x99\x6f\x67\xbb\xc5\xa3\x1e\x6c\x73\xc2\x47\x47\x74\x61\xf3\xc9\x67\x81\xbe\xf6\xd2\x11\xd5\x83\x33\x78\x77\x27\xf9\x79\xb9\xf6\xb2\xea\x70\x38\x86\xce\x1a\x26\x4e\x14\xb0\xae\xc7\x2f\xa9\xba\xf5\xb0\x6b\x68\x3c\x57\xf0\xec\xce\x82\x2e\x94\x95\xad\xa1\x51\x55\x30\xf1\xa5\xbc\xf4\x83\x77\xb0\xa4\xd4\x48\xe1\x4b\x85\x4d\x49\x63\x32\x7b\xfb\x1e\xb8\x59\x71\xd0\x9a\xbc\x0a\xe8\xb6\x6d\xc2\xbe\xad\xd1\x88\x5b\x71\x81\x87\x2a\xfe\xe9\x22\xca\x26\x91\x9a\x9b\x4e\xa2\x6a\xa2\x31\x0b\x0d\xcf\x34\x26\xec\xea\x83\x3d\x66\x40\x69\x35\x87\xea\xfd\x20\x37\xac\xd7\xf6\xeb\xc2\x5e\x72\xb0\xfc\x78\xc3\x77\xfc\x2c\xf6\x19\xeb\x2c\x5e\x4e\x6e\xca\xc4\xc8\x02\x50\xe2\x63\xec\x60\x74\x36\xbb\x99\x87\xa7\xfe\xfe\x7f\xbf\xbc\x91\x2f\x09\xed\xee\x04\x14\x74\x96\xf3\x9e\x68\xa4\xbf\x00\x00\x00\xff\xff\x23\x2d\xfc\x5d\xfc\x01\x00\x00"), - }, - "/src/bytes/bytes_test.go": &vfsgen۰CompressedFileInfo{ - name: "bytes_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 212684307, time.UTC), - uncompressedSize: 215, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\xcc\xc1\x4a\xc4\x30\x10\x87\xf1\x73\xe7\x29\x86\x5c\x6c\x55\xba\x8f\xb1\xe0\xb5\xde\x44\x24\x4d\xff\xb6\xe3\xa6\x93\x90\x99\x22\xab\xf8\xee\xb2\xe0\xc5\xeb\xc7\x8f\xef\x74\xe2\x87\xf9\x90\xbc\xf0\x87\x11\xd5\x98\x2e\x71\x05\xcf\x57\x87\xbd\x39\xcc\x89\x64\xaf\xa5\x39\xf7\xd4\x85\x5b\x10\x5d\x03\x0d\x44\xef\x87\x26\x5e\xa2\xae\x68\xe5\xb0\x29\x4b\x42\xef\x7c\xff\x47\xc6\xe7\x81\x5f\x5e\x6f\x1b\xfe\xa6\xce\xc7\xe9\x22\xb5\x0f\xff\x39\x37\x64\x81\x71\x51\xb6\xab\xa5\x98\xf3\x78\x86\xd7\xb8\xc2\xe4\x0b\x8f\xfc\xb9\x49\xda\xf8\x5c\xea\x86\xf6\x34\xf1\x52\x60\x7a\xe7\x2c\x7b\xcd\xd8\xa1\x1e\x06\xa2\xae\x46\x95\xd4\x87\x43\x1b\x62\xda\xe2\x9c\x11\x06\xfa\xa1\xdf\x00\x00\x00\xff\xff\x25\x40\x6e\x83\xd7\x00\x00\x00"), - }, - "/src/crypto": &vfsgen۰DirInfo{ - name: "crypto", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 213341455, time.UTC), - }, - "/src/crypto/internal": &vfsgen۰DirInfo{ - name: "internal", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 212840574, time.UTC), - }, - "/src/crypto/internal/subtle": &vfsgen۰DirInfo{ - name: "subtle", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 212919879, time.UTC), - }, - "/src/crypto/internal/subtle/aliasing.go": &vfsgen۰CompressedFileInfo{ - name: "aliasing.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 212967731, time.UTC), - uncompressedSize: 654, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x90\x4d\x6f\xd4\x3c\x14\x85\xd7\xe3\x5f\x71\x14\xbd\xea\x9b\x68\xda\x84\x6e\x11\x45\x62\x55\xc1\xa6\x0b\x90\x58\x20\x16\x8e\x73\x27\x76\x70\xae\xa3\xeb\x1b\x88\x85\xf8\xef\x68\xa6\xa5\x7c\x0e\xec\x72\xa5\xe7\x39\xe7\xc4\x5d\x87\x7d\xbf\x86\x38\x60\xca\xc6\x2c\xd6\x7d\xb0\x23\x21\xaf\xbd\x46\x32\x26\xcc\x4b\x12\x45\x35\x06\xf5\x6b\xdf\xba\x34\x77\x63\x5a\x3c\xc9\x94\xbf\x7f\x4c\xb9\x32\xa6\xeb\xf0\x82\xcb\xdd\x47\x92\x68\x17\x08\x1d\xbd\x8c\x4f\x9e\xd4\x93\x60\x83\xe5\x01\x05\xd9\x5b\x21\xcc\x34\x27\x29\xb0\x0a\xcb\x05\x35\x27\x05\x93\xa3\x9c\xad\x84\x58\x8e\x51\x2e\x89\x50\x5e\x12\x0f\x81\xc7\x06\x81\x07\xda\x5a\xbc\xf1\x8f\x6e\x4f\x25\xf1\x00\xf5\x84\x1c\x83\x23\x44\xe2\x51\x3d\x42\x46\x18\x39\x09\x0d\xad\x39\xac\xec\x7e\x18\x55\x6f\x97\x28\x78\xf7\xbe\x2f\x4a\x0d\xfa\x94\x22\x3e\x9b\x5d\xd7\xe1\xf6\xf4\x23\xaf\x5e\x3f\xc5\x5b\x82\xb3\xfc\xbf\x42\x28\x16\x24\xc6\x92\x02\x2b\x09\xac\x04\xf5\x33\x69\x70\x97\xc8\x09\x6b\xa6\x47\xeb\xa1\xff\xc4\xb1\x8d\xb9\x35\x3b\x21\x5d\x85\x8f\x93\xea\xad\xc1\x73\x3c\xc1\xc5\xc5\xe9\x2a\xdf\x2e\xb3\xdb\x4d\xb9\x7d\xf9\xe0\xdc\xf5\x13\x39\xad\xb7\xa6\xbd\x25\xad\xab\xff\xac\x88\x2d\x55\x83\x9b\x1b\xfc\x4e\x95\x5f\xa9\x7f\xa5\xa5\xc3\x21\x93\x56\xcd\x11\xa8\x1b\x3c\xfb\x6b\xe8\xcf\xf0\xfe\x7e\xf4\xd5\xf5\xb9\x92\x33\xde\x9f\x4b\xce\x2c\xda\xdf\xbf\xd3\xd5\xb5\xf9\x62\xbe\x06\x00\x00\xff\xff\xb2\x4c\x59\x2e\x8e\x02\x00\x00"), - }, - "/src/crypto/rand": &vfsgen۰DirInfo{ - name: "rand", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 527715943, time.UTC), - }, - "/src/crypto/rand/rand.go": &vfsgen۰CompressedFileInfo{ - name: "rand.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 528084886, time.UTC), - uncompressedSize: 1415, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x54\x41\x4f\xeb\x38\x10\x3e\xc7\xbf\x62\xc8\xae\x56\xf1\x12\x12\x24\x04\x87\xae\x8a\xc4\x22\x84\x38\x2c\xbb\x8b\x76\xdf\x3b\x20\x0e\x76\x32\x69\x5c\x52\xbb\x6f\xec\x34\x54\xa5\xff\xfd\xc9\x71\x52\x0a\xf4\xe9\x5d\xda\x38\xdf\x37\xdf\x37\x33\x9e\x49\x9e\xc3\xb1\x6c\x55\x53\xc2\xdc\x32\xb6\x14\xc5\xb3\x98\x21\x90\xd0\x25\x63\x6a\xb1\x34\xe4\x20\x61\x51\x8c\x44\x86\x6c\xcc\x58\x14\xcf\x94\xab\x5b\x99\x15\x66\x91\xcf\xcc\xb2\x46\x9a\xdb\xb7\x87\xb9\x8d\x19\x67\xac\x6a\x75\x01\x4a\x2b\x97\x70\xd8\xb0\xe8\x01\x45\x89\x04\x53\xf8\x8d\xf4\x2c\x1c\x36\x5b\xb6\x65\xcc\xad\x97\x08\xbb\x77\x60\x1d\xb5\x85\xdb\x6c\x07\x81\x84\xe0\xf7\x1d\xc8\xc1\xff\x27\x12\x1e\x9f\xe4\xda\x21\x87\x44\x83\xd2\x2e\x05\x24\x82\x3e\xbd\xde\x4a\x10\x89\x35\x4c\xa6\x30\xb7\xd9\x9d\x76\x48\x5a\x34\x7f\xcb\x39\x16\x2e\x91\x3c\xbb\x45\x97\xc4\xbf\xf6\x9c\x98\xb3\xc8\x54\x95\x45\xf7\x13\x76\x20\xc5\xdc\x13\x12\xce\x58\x94\xe7\x20\xc9\x74\x16\x89\x45\x05\xad\x97\xce\x0c\x0a\xb7\x8d\x91\xa2\x09\x61\x01\xf0\x26\xaa\x82\x81\x35\xed\x59\xff\xeb\x12\x2b\xa5\xb1\xf4\xe9\x8e\x02\x9f\xe2\x17\xf6\x7a\xa7\xb0\xdd\x17\x39\x3a\x20\xb2\x43\x43\xec\x0c\xdd\x83\xd0\xa5\x59\x7c\x11\x4d\x8b\x36\xe6\x07\x83\x22\x0d\x53\x68\x50\x27\x92\xfb\x93\xaa\x40\xc3\x25\x5c\x9c\x9f\x9f\x5d\x04\xdc\x17\x7a\xb5\x32\xaa\x84\x7f\x5b\xe3\xc4\xcd\x4b\x81\x58\x62\x79\xe3\x7b\x0d\xae\x26\xd3\x69\x90\x6b\xf8\xe0\x36\x46\x76\x35\x6a\x2f\x3f\x73\x35\x28\x0b\x0b\x43\x08\xae\x16\x3a\x38\xa4\x20\x2c\xd8\x25\x16\xaa\x52\x58\x82\xd2\x63\x58\xed\xdc\x72\x92\xe7\x5d\xd7\x65\xdd\x59\x66\x68\x96\xff\xf7\x90\x7f\x45\x19\xba\x71\xf5\xcf\x5d\xfe\x4b\x78\x3c\x59\xa0\xab\x4d\x79\x72\xc8\xde\x57\xd6\xdb\xf8\xd3\xd6\xff\x0c\xed\xb9\x16\x4d\xf3\xb9\x3f\x29\xf4\x13\x31\xa0\xb6\x95\x61\x40\x52\x08\x57\x3f\xfe\x1f\x6b\xde\x77\x8a\xd0\xb5\xa4\x41\xa7\xa0\x55\xc3\x7a\x83\x6d\x18\x8b\x7b\x53\x62\x36\xb7\xfd\x75\x11\x7e\x6b\x15\xe1\x81\xd1\x18\x90\x98\xff\xb1\x23\xfd\xe0\x52\xa9\xcf\xf2\xcf\xb5\x43\xeb\x75\x06\x76\x76\xa7\x57\xe6\x19\xdf\x66\x6c\x90\x7d\x23\xf7\xd2\x7b\xb1\x07\xaf\xff\x5d\xcd\xe8\xe2\x74\x3f\x64\xf4\x08\xf3\xc1\xc7\x16\xec\xd7\x1f\xa0\x0f\x4d\x18\xb0\xd3\x34\xac\xa4\xcd\xee\xb1\x1b\x13\xcd\xbd\x3e\x68\xe3\x40\xac\x84\x6a\x84\x6c\x10\x94\x06\x57\x2b\x0b\xa8\x57\x8a\x8c\x5e\xa0\x76\x31\x67\xe3\x07\x40\x0a\x57\xd4\x58\x26\x15\xf8\x63\x32\x6e\xbe\x34\xa6\x49\x81\x50\x94\x7f\x89\x17\xff\x11\xe0\x9f\x71\x5f\xe3\x90\x4c\x8f\xc9\xb6\x82\x8f\x78\x54\x19\x0a\x65\xb4\x15\x87\xcb\x9d\xe2\x66\xd8\x87\xa3\xca\x23\x8f\x93\xe1\xfd\x13\x1f\xf6\x62\xd4\x15\x8d\xc5\xdd\x84\x79\x83\x29\x78\xfe\x40\x9f\x3c\x85\xb6\xbc\xeb\x97\x37\x9a\x4e\xe1\x14\x5e\x5f\xa1\x57\xef\xd7\x7b\xcb\xbe\x07\x00\x00\xff\xff\x4b\xf2\x65\x42\x87\x05\x00\x00"), - }, - "/src/crypto/x509": &vfsgen۰DirInfo{ - name: "x509", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 213551650, time.UTC), - }, - "/src/crypto/x509/x509.go": &vfsgen۰CompressedFileInfo{ - name: "x509.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 213460911, time.UTC), - uncompressedSize: 177, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x34\x8d\xb1\x6e\xc2\x40\x10\x05\xeb\xec\x57\x3c\x5d\x65\x27\x51\x9c\x26\x45\xd2\xa6\x88\x94\x02\x21\xfc\x05\x67\x7b\x81\x83\xf3\xed\x69\x6f\x0d\x58\x88\x7f\x47\x58\xa2\x1d\x8d\x66\x9a\x06\x6f\xdd\x14\xe2\x80\x43\x21\xca\xbe\x3f\xfa\x1d\xe3\xf2\xf5\xf9\x4d\x14\xc6\x2c\x6a\x70\xac\x2a\x5a\x1c\xd1\x76\x4a\x3d\xa2\xf8\xa1\x9d\x8b\xf1\xb8\x11\xb1\x52\xd5\xa8\x5e\x7f\x59\x6d\x2d\x12\xdf\xb1\xb8\x35\xae\xf4\xa2\x6c\x93\x26\xa4\xf0\xa4\xe5\x63\xc5\xe7\xca\xf5\x3a\x67\x93\xe6\xb1\xf8\x41\x59\x42\x50\x11\x43\x16\x89\x08\x05\x49\x0c\xfe\xe4\x43\xf4\x5d\x64\x84\x84\x3f\xc9\x7b\xd6\xff\xd6\xd5\x74\xa3\x7b\x00\x00\x00\xff\xff\xa1\x8b\x91\x39\xb1\x00\x00\x00"), - }, - "/src/crypto/x509/x509_test.go": &vfsgen۰CompressedFileInfo{ - name: "x509_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 213620762, time.UTC), - uncompressedSize: 364, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x90\xb1\x0e\x82\x40\x0c\x40\x67\xfb\x15\xcd\x4d\xa0\x09\xb8\x38\x38\x1b\x07\x37\x23\x84\x1d\xb1\x90\x13\xb8\x92\x6b\x31\x12\xe3\xbf\x1b\xd1\x49\x17\xc2\xdc\xf7\x5e\x9b\xc6\x31\xae\xce\xbd\x6d\x2e\x78\x15\x80\x2e\x2f\xea\xbc\x22\xbc\x6f\xd6\x5b\x00\xdb\x76\xec\x15\x8d\x92\xa8\x75\x95\x01\x28\x7b\x57\x60\x4a\xa2\xc9\x20\x4a\xed\x8e\xbc\x1e\x99\x9b\x40\x71\xf9\x85\xa2\x34\xc4\x07\x2c\x34\x4a\x6a\xdb\x05\xc6\x31\xca\x88\xa2\x67\x56\x31\x21\x3c\xff\x2a\xa7\xf7\x64\x6e\x62\xef\x6e\x59\xee\x67\xeb\x9f\x0b\x32\xf2\xb6\x1c\x26\x34\x7e\xec\xc3\xf8\xa0\x29\xcb\x47\xf1\x15\x00\x00\xff\xff\xa4\x46\xbd\x49\x6c\x01\x00\x00"), - }, - "/src/database": &vfsgen۰DirInfo{ - name: "database", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 213773794, time.UTC), - }, - "/src/database/sql": &vfsgen۰DirInfo{ - name: "sql", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 213829998, time.UTC), - }, - "/src/database/sql/driver": &vfsgen۰DirInfo{ - name: "driver", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 213911889, time.UTC), - }, - "/src/database/sql/driver/driver_test.go": &vfsgen۰CompressedFileInfo{ - name: "driver_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 213971471, time.UTC), - uncompressedSize: 1185, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x53\x4d\x8f\xd3\x30\x10\x3d\x93\x5f\x31\x9a\x03\x38\x60\x35\xc9\x0a\xad\x44\x24\x2e\xb0\xe2\xba\x1c\x7a\xdb\xf6\xe0\x24\x0e\x32\x18\x3b\xf8\x23\xa5\xaa\xfa\xdf\x91\xe3\x06\xa4\xd6\x6d\xc3\x25\x9e\xcc\x9b\x79\xf3\xe4\x79\x2e\x0a\x78\xd7\x78\x21\x3b\xf8\x6e\xb3\x6c\x60\xed\x0f\xf6\x8d\x43\x67\xc4\xc8\x4d\x96\x8d\xcc\xc0\xc8\xa4\xe7\x9f\xb5\x1a\xb9\x71\xdc\xac\xb9\x75\x16\x3e\xc2\xcb\xf6\x32\x7f\xc8\x5e\x1d\x3e\x69\x2d\x29\xa0\x33\x9e\x23\x85\x70\x50\x40\x3c\xd2\x7f\xd0\xfa\x2a\xf4\xb2\x6d\xf6\x8e\x13\x74\x98\x27\xf1\x98\x4a\x71\x56\x69\xc2\x2a\x99\x15\xca\x3d\xbe\x27\x55\x7a\x86\x17\xca\x55\x8f\xd7\x50\xec\x99\xb4\x41\xfd\x74\x9e\x81\xa7\x5c\x0a\xc2\xf2\x4a\x4f\x99\x4e\x47\x89\x65\x9e\x46\x4f\x1a\x2f\xe1\xb6\x86\xb9\xbf\x06\xec\xb5\x46\x0a\xdc\x98\x1a\xd0\xfe\x92\x45\x5c\x6a\x0d\xad\xf6\xb2\x53\x6f\x1c\xb4\x71\x79\xb0\x09\xa5\x1b\x0c\x53\x35\xb8\xfd\xc0\xa1\xd1\x5a\x26\x28\x1f\x16\xd1\x3d\x24\x89\x9e\x78\xcf\xbc\x74\x5f\x99\x61\x3f\xb9\xe3\xe6\xaf\x73\x28\x28\xbd\x3b\x7d\xf0\x6e\x2d\x79\x3b\xdd\x4d\x4e\x94\x90\x39\x05\x25\xe4\x92\xae\xd7\x4c\xd9\x5d\x08\xe6\x73\x41\xcb\xb9\xaa\xa2\xb8\x55\x2e\xc8\x87\x7c\xde\x5b\x88\x42\x0f\x14\x05\xac\x9f\x9f\x9e\x6b\xf8\x22\x7e\xaf\x6e\x8f\xeb\x49\xb9\x0a\xa6\xeb\xa5\x66\xd3\xee\xa7\xbf\xfb\x32\x1b\x12\x6c\x7a\xe6\xd6\xdb\x52\x1b\x7b\xa8\x8e\xf3\x6b\x9b\xc2\xff\x15\x6b\x09\xb2\xf0\x46\x91\xe1\x12\x8d\x22\x0e\x8c\xbb\xf2\xca\xfa\x61\xd0\xc6\xf1\x2e\x5a\x24\xfa\x68\x25\x2c\x05\x06\x56\x8a\x96\x83\xee\xc3\x4d\x06\xde\x63\xf6\x27\x00\x00\xff\xff\x8d\xf2\x41\x9a\xa1\x04\x00\x00"), - }, - "/src/debug": &vfsgen۰DirInfo{ - name: "debug", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 214115075, time.UTC), - }, - "/src/debug/elf": &vfsgen۰DirInfo{ - name: "elf", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 214185958, time.UTC), - }, - "/src/debug/elf/elf_test.go": &vfsgen۰FileInfo{ - name: "elf_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 214239008, time.UTC), - content: []byte("\x2f\x2f\x20\x2b\x62\x75\x69\x6c\x64\x20\x6a\x73\x0a\x0a\x70\x61\x63\x6b\x61\x67\x65\x20\x65\x6c\x66\x0a\x0a\x69\x6d\x70\x6f\x72\x74\x20\x22\x74\x65\x73\x74\x69\x6e\x67\x22\x0a\x0a\x66\x75\x6e\x63\x20\x54\x65\x73\x74\x4e\x6f\x53\x65\x63\x74\x69\x6f\x6e\x4f\x76\x65\x72\x6c\x61\x70\x73\x28\x74\x20\x2a\x74\x65\x73\x74\x69\x6e\x67\x2e\x54\x29\x20\x7b\x0a\x09\x74\x2e\x53\x6b\x69\x70\x28\x22\x6e\x6f\x74\x20\x36\x6c\x22\x29\x0a\x7d\x0a"), - }, - "/src/encoding": &vfsgen۰DirInfo{ - name: "encoding", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 215208874, time.UTC), - }, - "/src/encoding/gob": &vfsgen۰DirInfo{ - name: "gob", - modTime: time.Date(2019, 4, 6, 11, 3, 15, 126398833, time.UTC), - }, - "/src/encoding/gob/gob_test.go": &vfsgen۰CompressedFileInfo{ - name: "gob_test.go", - modTime: time.Date(2019, 4, 6, 11, 3, 15, 126473498, time.UTC), - uncompressedSize: 2598, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x56\x51\x6f\xdb\x3e\x0e\x7f\xb6\x3e\x05\x67\xdc\x0a\xa7\xe7\x39\x95\x93\xae\x9d\x81\x3e\xac\x5b\x77\xd8\x43\x3b\x60\x33\x70\xdb\x8a\x62\x70\x6c\x26\xd1\xea\x48\x3e\x49\x6e\x1a\x04\xf9\xee\x07\x4a\x76\x9c\xae\xff\x0d\x2b\xd0\x56\xa4\x7e\xfc\x91\xa2\x48\xca\xe3\x31\xfc\x7b\xd6\x8a\xba\x82\x9f\x86\xb1\xa6\x28\xef\x8b\x05\xc2\x42\xcd\x18\x13\xab\x46\x69\x0b\x11\x0b\xc2\xd9\xc6\xa2\x09\x59\x10\x6a\x9c\xd7\x58\x5a\x5a\x5a\x34\x56\xc8\x45\xc8\x46\x8c\x8d\xc7\x90\x7f\x7a\xff\x29\x83\x1c\x8d\xbd\x92\x55\xae\xae\x64\x05\xea\x01\xb5\x16\x15\x42\x59\x48\x98\x21\x68\x5c\xa9\x07\xac\x40\xc9\x12\xc1\x2e\x11\x66\xed\x02\xd6\xc2\x2e\xe1\xba\xd0\x1a\xe6\x02\xeb\x0a\x84\x81\xb9\x78\xc4\x2a\x61\xf3\x56\x96\x4f\x08\x23\x0b\xc7\x9d\xd7\x24\x1f\xc1\x96\x05\x76\xd3\x20\xe4\x29\x18\xab\xdb\xd2\x92\x26\xc8\x49\x10\x72\xc1\x82\x5d\xbf\x3f\x39\xdc\xff\x0a\xf3\x5a\x15\xf6\xf5\x94\x05\xc1\x77\x38\x16\xd2\x1e\x20\xf9\x21\xf2\x6d\x0c\x97\x31\xbc\x03\x70\x98\xe0\x1a\xba\x9f\x55\xd1\xdc\x7a\x1f\x77\xc7\x03\xd7\x75\x7a\xb0\x2d\xa4\xbd\xcb\x27\xa4\xf5\xc0\x27\x46\x7d\x7c\xc1\xb5\x90\xb6\xb1\x7a\x30\x39\xee\x3c\x95\x6a\xd5\xf4\x54\xb4\xae\xf1\x91\xa7\xe7\x77\xc3\x92\x40\x94\xb2\x1e\x74\x9b\x76\xac\x77\xb7\xe9\x61\x50\x57\xab\xc6\x6e\xae\x8b\xe6\xd0\xbd\x90\x16\xc6\x63\xb0\x0a\xca\x25\x96\xf7\x60\x97\x85\x85\x35\xdd\x4e\x89\xe2\x01\xa1\x00\xa9\xe4\x2b\x29\x6a\x32\x4a\x58\x10\xdc\xf4\x07\x3f\xbe\x9d\xdc\x0d\xdc\x5f\xac\x36\x9d\x3a\x1d\xce\xf4\x51\xda\xd7\x53\xe3\xb4\xe4\xc9\x21\x3f\x7f\xec\x08\xba\x03\x78\xf3\x9e\x75\x6f\xfa\xad\xd7\xdc\xde\x51\xbd\xb9\xbb\xec\x3d\xe7\xa9\xbb\xa5\x46\x40\x76\x01\x93\x84\x4f\xf9\xe9\x1b\x16\x20\x49\x69\x72\xc6\xcf\x29\x25\x76\xad\xbc\x7c\xc2\x82\x15\x16\x92\xf2\x9e\x5d\xc0\x34\x65\xc1\x5c\xc8\x05\x6a\x43\xe2\x29\x0b\x0c\xa7\x45\xe8\x1d\xf3\x90\x05\x26\x3d\x50\xa4\x21\x0b\x1e\x0a\xed\x82\xe5\x30\xe4\x1c\x2e\x7a\x21\xe2\xc9\x49\x0c\x3c\x39\x19\x0d\xc8\xf4\xaf\x90\x85\xd6\x1c\x0e\xd2\x45\xf2\xed\xc9\x1d\x5c\x80\xe1\x9d\xc4\x9d\x94\xee\xf1\xe9\x2f\xf8\xb4\xc3\xa7\x9d\xc4\x7b\x6b\xc2\xbb\xdb\x79\xdb\x39\x19\xea\x60\xaf\xf6\xb6\x47\x8d\x38\xd4\x39\x86\x23\x7c\xca\x90\xfe\x33\x43\xe7\x9d\xd0\x83\xca\x13\xd8\xb5\x62\x81\x75\xa9\x3d\xca\xb9\x6b\xa0\xac\xbb\x3e\x7e\x16\xb3\x20\xb8\xdc\x8b\xe7\x24\xbe\xeb\xc5\x57\xa7\x24\x5e\x67\xbf\x6f\xaf\x6d\xd8\x88\x30\xa3\xb8\x63\x08\x91\x56\xb8\x73\x36\x69\xf6\x6b\xcf\x6d\xa7\x19\xe4\x93\xed\xd7\x0c\x08\xfc\x3d\x83\xa3\xae\x14\x76\x31\xf0\x93\x7e\x0f\xfd\x56\x57\x16\x3b\x4f\xe6\x9d\x66\xcf\x5b\xb5\x73\x1f\x52\xdd\x85\x5d\x04\x21\x95\x5d\xe8\x0d\x7d\x1b\x67\x4f\xda\x78\xdb\xb9\x1d\xbc\xc4\xd0\x2d\x0e\x63\xea\xbb\x3d\xfb\x53\xb7\x6f\x5d\x29\x66\xbe\xce\x62\xff\xcf\x4b\xdc\x31\xec\xa7\xef\x07\xf1\x08\x76\x29\x0c\x34\x5a\xcd\x6a\x5c\x65\x7e\x33\xc8\x37\x0d\x5e\x69\xad\x74\x06\x95\xb1\xc9\xbf\x0c\x5a\x9a\xb3\x52\x59\x28\x80\xc6\xac\x15\x4a\x76\x58\x4a\x67\x61\x81\xe6\x61\xb5\xc2\x15\x4d\x6c\x88\xc6\x0b\x61\x97\xed\x2c\x29\xd5\x6a\xbc\x50\xcd\x12\xf5\x4f\x33\x2c\xba\x47\x21\x59\xa8\x6c\x7a\x7e\x96\x4d\x46\x8e\x8a\x06\x54\xf6\xe7\x09\xb5\xa5\x8a\xcf\x86\xaa\x8d\x5d\xc1\x0f\x8a\xd4\x1d\xaf\x1f\x62\x94\xe0\x7b\x8c\x9e\x8e\xb2\x11\x21\x6e\xfa\xda\x81\xa3\x61\x44\x6d\x79\x72\x1a\x43\x4a\x7f\x26\xc9\xa9\x63\xa2\x91\x95\x75\xb8\x3e\x9e\xad\xe1\x31\x18\xef\xc9\x0f\xaf\xcc\xed\xfb\xe9\xb5\x3d\x3b\x8b\xe1\xfc\x4d\x0c\x3c\x9d\x4c\xe9\x37\xe5\x93\xa9\xc3\x7e\xfe\x38\x54\x37\xbc\x82\x74\x22\x9c\x87\x7d\x24\xe1\x8d\x5a\x53\x92\xe9\x9d\xb3\x62\x85\x21\x6d\x7f\xcb\x9e\xce\xb8\x28\x5c\x62\x5d\xab\x18\x4c\x21\x6a\xa5\x43\x77\x9a\x7c\x38\x4d\x9e\x6e\x43\x77\xa1\xc2\x40\x9e\xba\x72\xdb\xb1\x60\x46\x3d\x26\x71\x1d\xb9\x67\x39\xb9\x6c\xe7\x73\xd4\x23\x16\xa0\xd6\xb4\x73\x83\xeb\x2b\x59\xaa\x0a\x75\x34\x1b\x25\x7e\x19\x59\x3e\x62\x81\x98\x03\x61\x5e\x5c\x00\x8d\x77\x6a\x51\x9b\xb8\xba\x88\x42\x74\xb0\x2c\x8c\x09\x31\x72\x6e\x68\x1c\xfc\xb0\x1c\x72\xee\xa9\x1d\xf3\x7b\xdc\x33\xfb\x65\x74\xf4\xe3\xb7\xdc\x1f\x0a\x5b\xd4\x51\x58\xe1\x33\x6e\x31\x87\x17\x7d\xd9\xbc\x47\x6c\xae\xfe\xd7\x16\x75\x64\x79\x0c\x8e\xee\x30\xb6\x79\x1f\x1c\xe0\x63\x83\xa5\xc5\x0a\x5e\x3e\xc0\x42\x59\x78\xf9\x10\xc6\x70\x4c\x46\x3e\x84\x1d\xa3\x0a\xbe\x44\x28\x66\x46\xd5\xad\xc5\x7a\x03\xa6\xd5\xfe\x5b\xa3\x7b\xde\x2a\xaa\x46\x5f\xfc\xee\x91\x4b\x5c\x2c\x96\x27\xfb\xa7\xf2\xe2\x59\x76\xe6\x51\xd8\x3d\x87\x60\x50\xda\x70\x7f\x84\x1f\x7f\x6d\xd7\x7b\xf7\xb6\x3b\x36\x7c\xdc\x50\x6f\x7e\x2e\x4a\x7c\xfe\x71\x33\x1e\x83\x3b\xb8\x90\x8b\xf1\x42\xcd\xa0\x6c\xb5\x46\x69\xeb\x0d\xb4\x06\xe9\x00\x66\x23\xcb\x04\x72\xaa\x0f\xb2\xf4\x6a\xa7\xfc\x6f\x21\xec\x7f\xb4\x6a\x1b\x28\x64\xe5\x98\xca\x42\x52\xbb\x9b\xb6\x2c\x11\x2b\x58\x2f\x51\x76\x0c\x94\x8c\xd6\xd0\x07\x57\x60\x93\x2f\xf7\xa2\x89\xc2\xd6\xd0\xdb\xe9\xb7\xc3\x11\xdb\xb1\xff\x07\x00\x00\xff\xff\x9b\x7c\x41\xd0\x26\x0a\x00\x00"), - }, - "/src/encoding/json": &vfsgen۰DirInfo{ - name: "json", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 215280298, time.UTC), - }, - "/src/encoding/json/stream_test.go": &vfsgen۰FileInfo{ - name: "stream_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 215335211, time.UTC), - content: []byte("\x2f\x2f\x20\x2b\x62\x75\x69\x6c\x64\x20\x6a\x73\x0a\x0a\x70\x61\x63\x6b\x61\x67\x65\x20\x6a\x73\x6f\x6e\x0a\x0a\x69\x6d\x70\x6f\x72\x74\x20\x22\x74\x65\x73\x74\x69\x6e\x67\x22\x0a\x0a\x66\x75\x6e\x63\x20\x54\x65\x73\x74\x48\x54\x54\x50\x44\x65\x63\x6f\x64\x69\x6e\x67\x28\x74\x20\x2a\x74\x65\x73\x74\x69\x6e\x67\x2e\x54\x29\x20\x7b\x0a\x09\x74\x2e\x53\x6b\x69\x70\x28\x22\x6e\x65\x74\x77\x6f\x72\x6b\x20\x61\x63\x63\x65\x73\x73\x20\x69\x73\x20\x6e\x6f\x74\x20\x73\x75\x70\x70\x6f\x72\x74\x65\x64\x20\x62\x79\x20\x47\x6f\x70\x68\x65\x72\x4a\x53\x22\x29\x0a\x7d\x0a"), - }, - "/src/fmt": &vfsgen۰DirInfo{ - name: "fmt", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 215487136, time.UTC), - }, - "/src/fmt/fmt_test.go": &vfsgen۰FileInfo{ - name: "fmt_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 215520167, time.UTC), - content: []byte("\x2f\x2f\x20\x2b\x62\x75\x69\x6c\x64\x20\x6a\x73\x0a\x0a\x70\x61\x63\x6b\x61\x67\x65\x20\x66\x6d\x74\x5f\x74\x65\x73\x74\x0a\x0a\x63\x6f\x6e\x73\x74\x20\x69\x6e\x74\x43\x6f\x75\x6e\x74\x20\x3d\x20\x31\x30\x30\x0a"), - }, - "/src/go": &vfsgen۰DirInfo{ - name: "go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 215644444, time.UTC), - }, - "/src/go/token": &vfsgen۰DirInfo{ - name: "token", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 215700085, time.UTC), - }, - "/src/go/token/token_test.go": &vfsgen۰FileInfo{ - name: "token_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 215741006, time.UTC), - content: []byte("\x2f\x2f\x20\x2b\x62\x75\x69\x6c\x64\x20\x6a\x73\x0a\x0a\x70\x61\x63\x6b\x61\x67\x65\x20\x74\x6f\x6b\x65\x6e\x0a\x0a\x69\x6d\x70\x6f\x72\x74\x20\x28\x0a\x09\x22\x74\x65\x73\x74\x69\x6e\x67\x22\x0a\x29\x0a\x0a\x66\x75\x6e\x63\x20\x54\x65\x73\x74\x46\x69\x6c\x65\x53\x65\x74\x52\x61\x63\x65\x28\x74\x20\x2a\x74\x65\x73\x74\x69\x6e\x67\x2e\x54\x29\x20\x7b\x0a\x09\x74\x2e\x53\x6b\x69\x70\x28\x29\x0a\x7d\x0a"), - }, - "/src/internal": &vfsgen۰DirInfo{ - name: "internal", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 529838293, time.UTC), - }, - "/src/internal/bytealg": &vfsgen۰DirInfo{ - name: "bytealg", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 528247352, time.UTC), - }, - "/src/internal/bytealg/bytealg.go": &vfsgen۰CompressedFileInfo{ - name: "bytealg.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 528670257, time.UTC), - uncompressedSize: 181, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x5c\xcb\xb1\x0a\xc2\x30\x10\xc6\xf1\x39\xf7\x14\x9f\x5b\x8b\x85\xee\x42\x47\x9f\xa2\x74\xb8\x8b\x97\x12\x3d\x52\x4d\x9b\x41\xa4\xef\x2e\x29\xb8\xb8\x1d\xff\xfb\x7e\x7d\x8f\xb3\x94\x68\x37\xdc\x57\xa2\x27\xfb\x07\xcf\x0a\x79\x6f\xca\x36\x13\x85\x92\x3c\xae\xaf\xc2\xd6\x70\x07\xc1\x38\xd5\x57\x0b\x59\x16\xc3\x87\x5c\x0c\x30\x4d\x0d\xb7\x38\x0d\xc7\x25\x6d\xcd\x2e\xeb\x56\x72\x42\x60\x5b\x95\xdc\x4e\x2e\x2c\x19\xb1\x83\xc7\x65\x40\xe6\x34\x2b\xf8\x18\xc6\x00\x5f\xad\x8c\x71\x3a\xc2\x1f\xad\x76\xa7\x5f\xdc\x72\x51\xda\xe9\x1b\x00\x00\xff\xff\x11\x57\xe4\x4d\xb5\x00\x00\x00"), - }, - "/src/internal/cpu": &vfsgen۰DirInfo{ - name: "cpu", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 528796048, time.UTC), - }, - "/src/internal/cpu/cpu.go": &vfsgen۰FileInfo{ - name: "cpu.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 529123771, time.UTC), - content: []byte("\x2f\x2f\x20\x2b\x62\x75\x69\x6c\x64\x20\x6a\x73\x0a\x0a\x70\x61\x63\x6b\x61\x67\x65\x20\x63\x70\x75\x0a\x0a\x63\x6f\x6e\x73\x74\x20\x28\x0a\x09\x43\x61\x63\x68\x65\x4c\x69\x6e\x65\x53\x69\x7a\x65\x20\x20\x20\x20\x3d\x20\x30\x0a\x09\x43\x61\x63\x68\x65\x4c\x69\x6e\x65\x50\x61\x64\x53\x69\x7a\x65\x20\x3d\x20\x30\x0a\x29\x0a"), - }, - "/src/internal/fmtsort": &vfsgen۰DirInfo{ - name: "fmtsort", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 529240051, time.UTC), - }, - "/src/internal/fmtsort/fmtsort_test.go": &vfsgen۰CompressedFileInfo{ - name: "fmtsort_test.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 529575759, time.UTC), - uncompressedSize: 1103, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x53\x41\x8f\xd3\x3c\x10\x3d\xc7\xbf\x62\xbe\x48\xdd\x2f\x81\x90\xb6\x80\x38\x74\x29\x97\x15\x20\x40\x2a\x48\xbb\xf7\x95\xd7\x99\x34\x6e\x52\x3b\xb2\xa7\x29\x15\xdb\xff\x8e\xc6\x75\xb7\x5d\x15\xc1\xa5\xb5\x3d\x6f\x66\xde\x7b\x33\x19\x8f\xe1\xe5\xc3\x46\x77\x15\xac\xbc\x10\xbd\x54\xad\x5c\x22\xd4\x6b\xf2\xd6\xd1\x3d\xa1\x27\x21\xf4\xba\xb7\x8e\x20\x13\x49\xba\x96\xd4\xa4\x22\x49\x1d\xd6\x1d\x2a\xe2\x23\x63\xb4\x59\xa6\x42\x24\xa9\x36\x84\xce\xc8\x6e\x1c\x0b\xa4\x22\x17\x62\x3c\x06\x83\x58\xf9\xdb\x56\xf7\xe0\x90\x6b\x79\xd8\x36\x48\x0d\x3a\xa0\x06\xa1\xd5\xa6\x82\xca\xa2\x37\xff\x13\x6c\xad\x6b\xa1\xb6\x0e\x38\x5f\x9b\x25\x58\x03\x9f\x6d\xdf\xa0\xfb\x7a\x5b\x8a\x7a\x63\xd4\xa9\x5a\xd6\x42\x24\x52\x7e\xd3\xa6\xca\xe1\xc1\xda\x0e\x7e\x89\xc4\x6f\x35\xa9\x06\x5a\x3e\x2b\xe9\xf1\x09\xf6\x83\x5c\xf1\x74\xb9\x69\xa4\x99\x89\x24\x71\x48\x1b\x67\x80\xdc\x06\x45\xb2\x17\xc7\x7b\x2d\x3b\x8f\x62\x1f\x04\x2c\x2c\xe1\x0c\xfc\xce\x28\xd8\x6a\x6a\x02\x6d\xeb\xf4\x52\x1b\xd9\xc1\x1d\x7a\xba\xb1\xeb\x5e\x3a\x8c\x0c\xcf\x5e\x32\x82\x17\xd1\xa2\xf2\x2e\x67\x42\x2c\xee\xbe\x00\x7e\x84\xd9\x1c\x9c\x34\x4b\x04\x75\x40\x73\xa2\x67\x50\x40\xe9\x02\x86\xc9\x09\x13\x32\x38\x16\x82\xab\x02\x86\xe9\x9f\x82\x89\xae\xcf\x2c\x1a\x26\xc1\x9b\x2c\xcf\x63\x34\x51\xd6\x90\x36\xac\x35\x49\x58\xee\x45\xc6\xf4\x1f\x19\xe1\x4f\x71\xeb\x38\xe6\xf2\xa8\x75\x98\x30\xa9\x3c\x00\x06\xe9\x00\x7f\xf6\xa8\x08\xb4\xa1\xf0\x14\xc7\x72\xa8\x1a\xe6\xa2\x61\x3e\x87\xd5\xec\xd0\x26\xa2\xe7\x30\x39\xdc\xd9\x77\xb9\xf0\x20\x1d\x02\x39\xad\xda\x5d\x79\x08\xe8\x1a\x68\xd7\x33\x81\x61\x52\xde\xed\x7a\xcc\xf2\x6b\xc8\x68\xd7\x47\xe2\x5c\xf4\x38\xe4\x4f\x9d\x95\xf4\xe6\x35\x3c\x3e\xc2\x5f\x00\xef\xde\xe6\x70\x75\x05\xbc\xde\xe5\x17\xbf\x90\x0b\xf6\x2d\x44\xce\x6c\x38\x11\x7c\x35\x3d\xbc\xec\xcf\x95\xbc\xbf\x14\x12\x71\x11\xf0\xe1\x12\x30\x7d\x3e\x04\x05\xff\xcd\x8f\xa6\xc5\xa6\x54\x7e\x74\xce\xba\x3a\x4b\x47\x7e\x76\x5c\x93\x6c\x34\x14\xa3\x21\x9f\x8f\xaa\xeb\x23\x7c\x54\xa5\xc5\xc9\x0e\x3e\xf2\x28\x0a\x50\x45\x44\xe4\xa7\x56\xfc\xb3\xe7\x55\xdf\x8b\xd3\xbe\x7e\x77\x15\xba\xcb\x6d\xa5\x32\x2c\x45\xda\x1a\xbb\x35\xa0\xbd\xdf\xe0\x0c\x8c\xee\xa0\xc5\xdd\xb3\x8f\x36\xcd\xc5\x5e\xfc\x0e\x00\x00\xff\xff\xd0\xa4\x01\x39\x4f\x04\x00\x00"), - }, - "/src/internal/poll": &vfsgen۰DirInfo{ - name: "poll", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 529702349, time.UTC), - }, - "/src/internal/poll/fd_poll.go": &vfsgen۰CompressedFileInfo{ - name: "fd_poll.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 529772376, time.UTC), - uncompressedSize: 1931, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x54\x41\x6f\x2a\x37\x10\x3e\xaf\x7f\xc5\x28\x97\xec\x12\xd8\x4d\xdb\x5b\x14\x0e\x15\x69\xd2\x48\x55\xa9\x92\x48\x39\x20\x1a\x19\x7b\x80\x49\xbc\xb6\x6b\x7b\x83\x10\xca\x7f\xaf\xbc\xbb\x04\x48\xe0\x85\xf7\xa4\x77\x02\x79\x66\xbe\xf9\xbe\x6f\x67\xa6\x28\xe0\x6c\x52\x91\x92\xf0\xec\x19\xb3\x5c\xbc\xf0\x19\x82\x35\x4a\x31\x46\xa5\x35\x2e\xc0\x49\xa0\x12\x4f\x18\x2b\x8a\xfa\xfd\x0a\xbd\x00\xf2\xc0\x41\x9b\x9e\xb1\x40\xa5\x55\x58\xa2\x0e\x3c\x90\xd1\x60\xa6\xc0\x35\xdc\x16\xc3\x3a\x19\x1d\x4c\x8d\x83\x9b\xe1\xef\x77\x83\x3f\xfb\xcf\x3e\x67\x45\x11\x81\x6e\x83\xff\x58\x48\x1e\x26\xdc\xa3\x04\xa3\xe1\x6f\x3e\xf8\x0b\x48\xc3\x4c\x80\x30\xa5\xa5\x88\x93\x7a\x44\xb8\x19\xde\x0d\x87\x0f\x85\x77\xa2\x20\x1d\xd0\x69\xae\x8a\xd8\xa7\x98\xca\xa7\xf8\xfb\xa4\xb9\x50\xf9\xcc\x64\xdd\xd8\x65\x52\x05\xa0\x00\xd2\xa0\x07\x7c\x45\x0d\x0a\xbd\xcf\x59\x58\x5a\xdc\x48\xf1\xc1\x55\x22\xc0\x8a\x25\x42\x19\x4f\x7a\x06\x13\x63\x14\x7b\x63\x6c\x5a\x69\x01\xa9\x95\xd0\x59\x27\x67\x40\x9a\x42\x3a\x95\xd0\xb9\xbe\xca\x00\x9d\x33\x0e\x56\xe0\x30\x54\x4e\x83\x26\x05\x07\xca\x22\x34\xa6\x19\xac\x0e\xc4\xf1\x95\x44\x88\x71\xb0\x32\x5f\xf3\xe8\x43\x70\x15\x1e\x82\xb4\x0e\x2d\x77\x98\x96\x46\x22\x90\x0e\x5d\x20\x7f\x4d\x0a\x6b\xfa\xef\xdc\x58\x42\xd3\x6d\xcc\x15\x4b\x92\x96\x2e\x3a\x37\x68\x5e\xd3\xa6\x32\x63\xc9\x1b\x4b\x36\x62\x0e\x79\xd0\x76\xbe\x43\x2e\xd3\x7d\x3d\xd7\x7e\x58\x99\xaf\x49\x9e\xba\xd3\x35\xbf\xec\x0b\x41\x8f\x8e\x02\x1e\x8d\xbb\xf8\x1a\x77\xc1\x29\xfc\x2c\x97\xfe\x70\xee\x81\x4a\x34\x55\x38\x64\x56\xec\x7e\x8c\x53\x35\xcb\x63\x6c\x8a\x89\x47\x79\xd4\x20\xee\x35\xe8\x03\xdc\x80\x6b\x81\x0a\xe5\xbb\x4b\xdb\x83\xba\xfd\x85\x8c\x52\x7c\xa2\xe2\x20\xc7\xa6\x9b\x6e\xbb\x73\x5a\xef\xc6\x3d\x86\x2b\xe4\x52\x91\xc6\x34\x40\x3c\x21\x79\x74\xea\xdb\x4b\xb3\xae\x8c\x86\xfd\x78\x75\xed\xce\xf7\x94\x17\x05\xfc\xd3\x8a\x74\x64\x83\x71\x6d\xdc\x43\x98\x23\xc8\xcd\xf3\x04\xe3\x74\x54\xf1\x4a\x4d\x96\x75\xb0\x39\x72\xf5\xb5\x31\x0e\xfe\xad\x48\x07\x1b\x5c\x7a\x9e\x01\x4d\x63\x82\x43\x20\xaf\x4f\x03\x18\x8d\x39\x3c\xcc\xc9\xc7\x43\x67\xb4\x5a\x36\x30\xf1\x3a\x06\xf4\x81\xf4\x2c\x6f\x64\xec\x32\x49\x33\x68\x31\xe3\x50\xb6\xb4\xb7\xda\xb0\x86\xfe\xc0\xd8\x65\x3c\xbd\x7e\xa9\x45\xee\x2a\x1d\x25\x3f\xdd\x63\xc9\xc5\x7f\x15\x39\x6c\xa1\x3f\x07\x52\x0f\x9d\x08\xf6\xdb\xaf\x59\xbb\x05\x1d\x0f\xfd\x3e\x9c\xd7\x2b\x20\xe6\x70\xd1\x87\x92\xbf\x60\x2a\xe6\x5c\x37\x93\xc6\x92\xc4\x63\xf9\xc8\x29\xa0\xf3\x23\x3f\x86\x3e\x70\x6b\x51\xcb\x74\xe7\xb9\x0b\x62\x1e\x73\x2f\x7b\x62\x5e\x6f\x4c\xc7\xf7\x7a\x5f\xb0\x75\xa8\x90\xfb\x3d\x6c\xdb\xc0\x07\xb6\x1d\x7f\x76\xc6\x58\xb2\x88\x24\x77\x7a\xd7\x42\x14\xea\x74\x91\x6d\xc4\x34\xde\x45\x2a\xac\x15\xb6\x18\x9d\x8f\x63\x79\xfc\xf7\xcb\xc5\x98\x7d\xd2\xb5\xd8\x0b\x24\x51\x61\xc0\x2d\xb5\x5d\xf0\xd9\x3b\xee\x65\xaf\xde\x86\xa8\xf4\x95\xbb\x2d\x5e\xd0\x3a\x59\x72\x3b\x6a\x55\x8c\x47\xe3\x2d\x5f\xff\x0f\x00\x00\xff\xff\x9e\x79\xbb\x91\x8b\x07\x00\x00"), - }, - "/src/internal/syscall": &vfsgen۰DirInfo{ - name: "syscall", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 529879090, time.UTC), - }, - "/src/internal/syscall/unix": &vfsgen۰DirInfo{ - name: "unix", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 529929191, time.UTC), - }, - "/src/internal/syscall/unix/unix.go": &vfsgen۰CompressedFileInfo{ - name: "unix.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 530273886, time.UTC), - uncompressedSize: 149, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x3c\xc8\x3f\xaa\xc2\x40\x10\x07\xe0\xfa\xcd\x29\x7e\x65\xc2\x0b\xc4\x0b\x78\x00\x1b\x2b\x2f\x30\xd9\x3f\x61\xcd\x3a\x13\x66\x67\x41\x10\xef\x2e\x42\xb0\xf8\x9a\x6f\x9e\xf1\xbf\xf4\x52\x23\xee\x8d\x68\xe7\xb0\xf1\x9a\xd0\xa5\x3c\x89\x82\x4a\x73\x18\x4b\xd4\xc7\xcd\x78\xc7\x19\xa7\x23\x73\x73\x76\xf6\xdf\x52\xee\x12\x70\x69\x57\x95\xa5\x6a\xd8\x86\x1c\x51\xc4\x47\x0c\x72\x4c\x91\x15\x8b\x6a\x9d\x90\xcc\xbe\xd4\x46\xbc\xe8\xcf\x92\x77\x13\x64\xae\x2d\x4d\x90\x52\xe9\x4d\x9f\x00\x00\x00\xff\xff\x38\x6c\xdd\x48\x95\x00\x00\x00"), - }, - "/src/internal/testenv": &vfsgen۰DirInfo{ - name: "testenv", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 216787484, time.UTC), - }, - "/src/internal/testenv/testenv.go": &vfsgen۰CompressedFileInfo{ - name: "testenv.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 216853257, time.UTC), - uncompressedSize: 424, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x8f\xc1\x6a\xc3\x30\x0c\x86\xcf\xd1\x53\x08\x9f\x12\x36\x92\xfb\x6e\xa3\x8c\xf5\xd6\xb2\x3e\x81\xeb\x2a\x8d\xbb\x58\x2e\x92\xb2\xb4\x8c\xbe\xfb\xf0\xd6\x52\xd8\x06\x3e\xfd\x9f\xfd\xf1\xb9\xeb\xf0\x61\x3b\xc5\x71\x87\x07\x05\x38\xfa\xf0\xee\xf7\x84\x46\x6a\xc4\x1f\x00\x31\x1d\xb3\x18\xd6\x50\x39\x99\xd8\x62\x22\x07\x95\x53\x93\xc8\x7b\x75\xd0\x00\x74\x1d\x2e\xbd\xbe\x9c\x28\xa0\x50\xb9\xac\x38\x0f\x64\x03\x09\xda\x40\x18\x26\x11\x62\x43\x3d\xab\x51\xc2\xe0\x19\xd5\xbc\x18\x32\xcd\x78\x94\x1c\x48\x95\xb4\x58\x26\x8d\xbc\xc7\xac\xed\xa6\xf0\xf5\x0f\xc2\x2c\x58\xa7\x2c\x84\x21\xa7\x94\x79\x3c\x37\x48\x27\x0a\xed\x22\xa7\xe4\x79\xd7\x42\x3f\x71\xb8\x15\xd4\x0d\x6e\x73\x1e\xf1\x13\x2a\x9d\xa3\x85\x01\xaf\xd1\xed\xeb\x6a\xb5\x29\x73\xf0\x4a\xe8\xd8\x87\xd1\x3d\x41\x55\x09\xd9\x24\x8c\xbd\x1f\x95\x6e\x70\xe7\x65\x8e\xfc\x8d\x63\x8f\xd7\xaf\xb6\x4b\xaf\x6b\xa1\x3e\x9e\xea\xbb\xf2\xf9\x6d\xb1\x7c\x44\xe7\x25\xb9\xa6\xc8\x7f\xfb\xaa\x0b\x94\xf3\x27\xa5\xbc\xbb\xc7\x1c\xf4\x9f\x94\x0b\xdc\x06\x93\x89\xe0\x02\x5f\x01\x00\x00\xff\xff\xdc\xf8\xeb\x9e\xa8\x01\x00\x00"), - }, - "/src/io": &vfsgen۰DirInfo{ - name: "io", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 217482019, time.UTC), - }, - "/src/io/io_test.go": &vfsgen۰CompressedFileInfo{ - name: "io_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 217540394, time.UTC), - uncompressedSize: 574, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\xd0\x41\x4b\xfb\x40\x10\x05\xf0\x73\xf7\x53\x0c\xbd\xfc\x9b\xbf\x92\x7e\x06\x29\x46\x10\xbc\x98\x82\xc7\xb2\x26\xcf\x64\xec\x66\x76\x99\x9d\x45\x51\xfc\xee\xd2\xa6\xa7\x52\x0f\xde\x3c\x2d\x3c\x78\xcb\xef\xcd\x7a\x4d\x57\xcf\x85\x43\x4f\xaf\xd9\xb9\xe4\xbb\xbd\x1f\x40\x1c\x77\x86\x6c\xce\xf1\x94\xa2\x1a\xad\xdc\x62\x79\x08\x58\x86\xa5\xab\x9c\x7b\x29\xd2\xd1\x16\xd9\x1e\x4a\x30\x7e\x52\x36\xe8\xee\xf8\xb4\xa6\x2c\x43\xcb\x32\x04\xdc\x84\x10\xbb\x95\xd1\xff\x53\xb5\xde\x56\xf4\xe9\x16\x56\xb7\x7b\x4e\xab\xca\x7d\x9d\x7f\xf4\x08\xdf\x43\x9b\xe0\xcd\x20\x3f\x16\x8f\x12\x52\x04\x46\xa6\x28\xa4\x45\x8c\x27\xd4\x1b\x1f\x02\x34\x93\x97\xfe\x3c\x6b\xd4\x4f\xc8\xd7\xf4\x36\x72\x37\xd2\x5d\x4c\x23\xf4\xbe\xa5\x3e\x22\xcb\x3f\xa3\x5c\xd2\x61\xe6\xf2\x02\x69\xde\x36\xef\xd9\x8c\x9e\xe5\x4f\xe9\x4e\x07\x53\x20\xdf\xbe\x8f\xbe\x64\x43\x3f\x67\xf9\xd7\xc0\x16\xd6\xb0\xf8\xc0\x1f\xd0\x8b\x16\x92\x68\xc4\x53\x0a\x98\x20\x33\xe7\x3b\x00\x00\xff\xff\x75\x6f\xe1\xab\x3e\x02\x00\x00"), - }, - "/src/math": &vfsgen۰DirInfo{ - name: "math", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 531261141, time.UTC), - }, - "/src/math/big": &vfsgen۰DirInfo{ - name: "big", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 217805546, time.UTC), - }, - "/src/math/big/big.go": &vfsgen۰CompressedFileInfo{ - name: "big.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 217740972, time.UTC), - uncompressedSize: 174, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x44\x8d\xbd\xaa\xc3\x30\x0c\x46\x77\x3f\x85\xf6\x0b\x11\x5c\x68\x87\xcc\xdd\x03\x25\xd0\xd9\x89\x15\xdb\xf9\x93\x91\xe4\x94\xbe\x7d\x49\x3b\xf4\x9b\xbe\xe1\x70\x0e\x22\xfc\x0d\x35\xaf\x01\x66\x75\xae\xf8\x71\xf1\x91\x60\xc8\xd1\x39\x44\xe8\xbb\x5b\xd7\x42\x9f\xb2\x42\x56\xf0\xf0\x64\x59\xbc\x70\xdd\x03\x4c\x2c\x90\xcc\x8a\xb6\x88\x31\x5b\xaa\x43\x33\xf2\x86\x91\x4b\x22\x99\xf5\x77\xb2\x6a\x25\xc5\xeb\xe5\xbf\x39\x95\xdf\xdd\x69\xe3\x83\xc0\x4f\x46\x02\x96\xbc\xc1\x07\x3b\x2b\x42\xca\xeb\x41\xa1\x71\xf6\x2a\x04\x0f\x96\x00\x35\xef\x56\x4c\xdc\x3b\x00\x00\xff\xff\x55\xc0\x14\x01\xae\x00\x00\x00"), - }, - "/src/math/big/big_test.go": &vfsgen۰CompressedFileInfo{ - name: "big_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 217834611, time.UTC), - uncompressedSize: 148, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd2\xd7\x57\xd0\x4e\x2a\xcd\xcc\x49\x51\xc8\x2a\xe6\xe2\x2a\x48\x4c\xce\x4e\x4c\x4f\x55\x48\xca\x4c\xe7\xe2\xca\xcc\x2d\xc8\x2f\x2a\x51\x50\x2a\x49\x2d\x2e\xc9\xcc\x4b\x57\xe2\xe2\x4a\x2b\xcd\x4b\x56\x08\x49\x2d\x2e\x71\xaa\x2c\x49\x2d\xd6\x28\x51\xd0\x82\xca\xe9\x85\x68\x2a\x54\x73\x71\x96\xe8\x05\x67\x67\x16\x68\x28\x25\x15\xe5\x67\xa7\xe6\x29\x69\x72\xd5\x22\xe9\xf1\xcd\x4f\x09\x2e\x2c\x2a\xc1\xad\xab\x38\x27\xbf\x1c\xac\x07\x10\x00\x00\xff\xff\x9b\x59\x2d\xf0\x94\x00\x00\x00"), - }, - "/src/math/bits": &vfsgen۰DirInfo{ - name: "bits", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 530550273, time.UTC), - }, - "/src/math/bits/bits.go": &vfsgen۰CompressedFileInfo{ - name: "bits.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 530755801, time.UTC), - uncompressedSize: 314, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x8e\xc1\x4a\xc5\x30\x10\x45\xd7\x9d\xaf\xb8\x74\x95\x20\xbc\xec\x05\x97\xfe\x80\x3f\x20\xed\xeb\xbc\x32\xda\x26\x65\x92\x54\x6a\xf1\xdf\xc5\x24\x82\xb8\x7a\x9b\x2c\xce\xcd\x39\x8c\x73\x78\x18\xb3\x2c\x13\xde\x22\xd1\x36\x5c\xdf\x87\x99\x31\x4a\x8a\x44\xe9\xd8\x18\xaf\xac\x8a\x98\x54\xfc\x4c\x74\xcb\xfe\x0a\x53\xa1\xc5\xb3\x6a\x50\x63\xdb\x8a\x93\x3a\xe5\x94\xd5\x37\x60\xd8\xd2\x17\x91\x73\x78\xc9\x3e\xc9\xca\xe5\x3f\x64\xdd\x16\x5e\xd9\xa7\x08\xad\xfc\x52\x86\xcb\xbf\xfa\x5f\xc9\x58\x9c\x3f\xad\x7d\x50\x18\xea\xc2\xce\x7a\x5b\xc2\x47\x0d\x72\x79\x9f\x8a\x66\xfa\xd6\xac\xf4\x11\xe2\x13\xcf\xac\xf8\x55\x7a\x4b\xdd\x24\xbb\x4c\xed\x1a\xdc\xa7\x57\x05\xe3\x81\x4f\xd6\xd0\x5b\xb2\xf4\x1d\x00\x00\xff\xff\x76\x78\x13\x86\x3a\x01\x00\x00"), - }, - "/src/math/math.go": &vfsgen۰CompressedFileInfo{ - name: "math.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 531123377, time.UTC), - uncompressedSize: 4581, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x57\xdd\x6e\xdb\x38\x13\xbd\xb6\x9e\x62\x3e\xe3\x43\x57\xda\x2a\xb2\xe5\x04\x41\x51\xc4\x05\xba\xc1\xa6\x5b\xa0\xed\x2e\x36\xed\xde\x04\xbe\xa0\x64\xd2\xa6\x2b\x91\x2a\x49\xc5\x72\x9b\xbe\xfb\x82\xd4\x1f\x25\x5b\xb1\xbd\x57\xb6\xc8\x33\x67\xce\x8c\x66\xc8\xd1\x64\x02\x2f\xa3\x9c\x26\x4b\xd8\x48\xc7\xc9\x50\xfc\x15\xad\x30\xa4\x48\xad\x1d\x87\xa6\x19\x17\x0a\x5c\x67\x34\x5e\x51\xb5\xce\xa3\x20\xe6\xe9\x64\xc5\xb3\x35\x16\x1b\xd9\xfe\xd9\xc8\xb1\xe3\x39\xce\x23\x12\xc6\x10\xe6\xb0\x91\xc1\xbb\x84\x47\x28\x09\xde\x61\xe5\x8e\x3f\x22\xb5\x1e\x7b\x06\xf0\x1d\x0b\x0e\x24\xe1\x48\x5d\x5f\xc1\x1c\xa6\x66\x31\xe3\xf2\x3d\x23\x30\x87\x10\x26\x06\x61\x56\x19\x5e\x95\xab\x17\xdd\x65\xc4\xb4\x61\xbd\xe4\x90\x9c\xc5\xf0\x36\xe6\xd2\x2d\x6a\x62\xaf\xf1\xf0\xc3\x19\x09\xac\x72\xc1\x8c\xb2\xe0\x16\x25\x89\x3b\x46\x31\x97\x63\x1f\x0a\x2f\xb8\xd3\x30\xd7\x73\x7e\x5a\x34\xeb\xb3\x78\xd6\x03\x44\x92\xb2\xd3\x79\x24\x65\xc3\x34\x67\xe8\xd1\xe8\x01\x22\x85\xce\xd0\xa3\xd0\x90\x1e\x85\xce\xd1\xa3\xd1\xc3\x44\x33\x77\xe7\xc3\x39\x5c\xb3\xb1\x0f\xbb\x83\x74\xb7\x91\x50\x27\xcb\x8a\x23\xa1\x0e\xab\xba\xc5\x34\x39\x9d\x06\xd3\x64\x80\x86\x67\x3b\x49\x57\xcc\x2d\x7c\xd8\x1d\x64\xa3\x04\xdc\x02\x6e\x60\x0a\x4f\x4f\x10\x4e\x0a\x98\xcf\xab\x72\xf7\xe0\x7f\x73\x70\x77\xed\xde\xce\xde\xfb\xe1\x8c\x6a\x25\x17\x85\x33\xfa\xd9\xe8\x2a\x2c\xe7\xa7\x37\xc2\x60\x1f\xdc\x9e\xd3\x06\xc3\x5d\xf0\xbb\x20\xcf\xb3\x60\x0d\xe8\xe0\xe3\xa3\x06\x71\xc7\xa2\xc8\x4e\xd6\x89\x8b\x6c\x40\x66\x91\xcd\x4e\x66\xc9\xf8\x76\xec\xc3\x6c\x88\x28\x0d\x8f\x04\x50\x42\x5a\x9b\xbb\x84\x73\x71\xb2\x77\xa2\xd1\x87\xa3\xb8\x13\xb8\xc8\x5c\xd2\x12\xb9\x44\xa0\xb8\x7e\xf4\xb5\x67\xa0\x4c\x79\x16\x31\x29\x4d\x5a\x8e\x3f\x76\x19\x57\x6e\xe6\xc3\xb7\xe7\xf4\xac\x1b\x54\x6b\xf9\x9e\x11\x57\xd7\x7c\xe9\xc2\xb2\x91\x5b\xaa\xe2\xb5\xfe\x17\x23\x89\xc1\x60\xde\xcc\x61\xfa\xba\x2d\xe5\xf2\xf8\x77\x46\x4b\x4c\x50\x9e\x28\x6b\xa7\xac\x7b\x5d\xe8\x8d\x1f\x0d\x6d\xa3\xf4\xa1\x75\x1a\x71\x9e\x54\xcd\x45\x74\xd3\x54\xb7\x8a\xd5\x33\x8d\x73\xd3\x3a\x35\xae\xba\x67\xfa\xb8\x9b\x1a\x57\x27\x0b\x25\x12\x5b\x3a\x3e\xa1\x4f\x9d\x6c\x53\x69\x14\x74\xf2\xab\x9b\x99\x34\x36\x1f\x96\x26\xdd\x87\xdf\x4a\xf7\x74\xb8\x08\xa7\xb3\x2b\xb8\x31\xdb\x2f\x5e\x98\x9f\x1b\x30\x6b\x3f\x60\x32\x81\x2f\x12\x83\xbe\x54\x83\x8c\x6f\x81\x70\x01\x32\x45\x49\x62\x60\x8f\x28\xc9\xb1\x84\xed\x1a\x0b\x0c\x54\xfd\x22\xe1\x91\xa2\x28\xc1\x01\xdc\x71\x01\x19\x16\x84\x8b\x14\xb1\x18\x07\xce\xc8\xa4\x40\xcb\x99\xeb\x0b\x55\x27\xa0\xad\x0c\x14\x3b\x23\x1d\xbd\xbd\x02\xbf\x1e\xec\x04\x5c\x64\x6d\x39\x5a\x19\x4b\x9a\x78\x4b\x4c\x9b\x08\xbe\x1a\xa8\x78\x4a\xa0\xd0\x49\x2b\xca\x38\xb7\x5c\x7c\x45\x82\xe7\x6c\x69\xa2\xe4\x99\xa2\x29\xfd\x8e\x05\x44\xf9\x0a\x28\x83\x7f\x5e\xf9\x20\x70\xca\x1f\x31\x20\x05\x92\xa7\x18\x32\x4e\x99\xb2\x2a\x08\x31\x5b\x92\x25\x3f\xe1\xab\xc3\x8d\xf4\x81\xaf\xc2\xe9\xf3\x1d\x99\x94\x90\xae\xcd\x91\x93\x28\x29\x21\x1d\x9b\x23\xc7\x4e\x62\x10\xad\xc5\x47\x54\x0c\xdf\x29\x4d\x84\x25\xc6\xb2\xa2\xcf\xdc\x44\xb5\x55\x85\xb1\xac\xf8\xf2\xa8\x55\x3b\xe6\x95\x29\xfd\x7f\xca\x97\x3a\xa7\x9a\x68\x2f\xad\x1f\xf9\x92\x74\x8f\xa7\xba\x07\x9a\xa5\xfd\xe6\x7d\x7a\x1a\xea\x51\xe2\x37\xef\x96\x12\x08\x27\xc3\x30\x73\x7e\x8c\x4c\xfd\xbe\x9e\x9b\xb8\x88\x0f\xa1\x67\x75\xe9\x05\x94\x45\x6a\xaa\xbe\xd6\xab\xfb\xfb\x50\xd0\xda\x6b\x8d\xf9\x8b\x6f\x9f\xbd\xe4\xcd\xc5\x1e\xea\x28\x5c\xf3\xf7\x22\xd4\xdd\xec\xee\xba\x11\xda\x57\x7c\xe7\x8e\x0f\x07\x4a\xb7\xec\xbc\xc3\x69\xfe\x1b\xa7\x88\xb2\x25\x16\x47\xdf\x9e\xe8\x20\x5b\x86\x7b\xba\x62\x11\xed\xcc\x53\xf5\xd1\x5a\x4f\x1b\x07\x47\x17\x8b\xe0\xf4\x59\x73\x70\xf4\xbd\x3f\x67\xf2\x1d\x1e\x7c\xef\x29\xeb\x7d\x1a\xb8\x92\x32\x1f\x62\x2e\x3b\x75\x57\x71\x1a\xe9\x9e\x5f\x4e\x51\x16\xcb\xb7\x33\xe6\x4b\xf9\x6d\x68\xbe\xfc\x7c\xc6\x10\x3e\x38\x83\x7f\x3e\x67\x04\x1f\x9e\xc0\x3f\x8b\x9c\x0d\x0d\x5b\x75\xe5\xb6\x25\x6a\xbd\xe6\xf2\xd1\x9c\xd1\xfd\x0a\xb0\x6b\xb7\x33\x9e\x36\x13\x71\xe5\xc4\xa5\x4c\xb9\x85\xe7\x69\x65\x5a\x91\xfe\xae\x8b\x72\x02\x52\x89\x3c\x56\x9a\x26\xa7\x4c\x5d\xce\x90\x10\x68\x07\xf0\x30\x5b\x94\xcf\xce\xc8\x10\xd4\x1b\x0f\xb3\x45\xf5\x5c\x6d\x5c\x5f\x55\x1b\xe1\xa2\x7a\x6e\xe2\xa5\x8c\x2a\xd7\xbc\x6a\x14\xe9\x73\xa0\xf7\x89\xfa\x56\xdb\xfd\x96\x13\x82\xc5\xd8\x0b\x3e\xe1\xad\xfb\xca\x73\x46\x1b\x19\xbc\x67\x0a\x0b\x86\x92\x3f\xa3\x0d\x8e\x95\x1b\xe5\xc4\x0b\xee\xb5\x85\xa5\x70\xec\xf7\xe9\xbe\x98\x4d\x43\x5a\xd1\xa1\xc8\x3b\x42\x68\x87\xb6\xcf\x78\x57\xee\xfe\x07\xca\x2a\x29\x03\x94\xd7\x57\x7b\x94\xd6\x68\xaa\x5d\x46\x54\xc9\xfa\xe0\xbe\x9c\x79\x50\x06\xae\x33\x19\xe5\x24\xb0\x55\x3f\x4c\x17\xa0\x07\x9e\xfa\xb5\xeb\x7d\x2b\x4d\x0f\xd3\x45\x9f\x9b\x08\x9e\x1a\xfe\xa8\xa2\xf5\x6a\x3f\x35\x7f\xd7\x1e\xe6\x10\x75\xe8\x7b\xee\xbb\xfc\xd7\x57\xb6\x76\x5d\xe4\x9a\xad\xac\xf1\xc6\xb8\x4a\x4f\x5f\x7b\x89\x74\xfb\x12\xc2\x85\x77\x73\x73\x39\x83\x97\x43\x80\xe9\xc2\xeb\x8b\xe8\x05\xd9\x6b\xb6\x83\x41\x96\x0b\x6e\xe4\xed\xef\x87\xf6\x3e\xbc\x79\x03\x97\x33\x6f\x3f\x25\x6d\x54\xce\x4f\xe7\xdf\x00\x00\x00\xff\xff\x85\x20\xa4\x35\xe5\x11\x00\x00"), - }, - "/src/math/math_test.go": &vfsgen۰CompressedFileInfo{ - name: "math_test.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 531663209, time.UTC), - uncompressedSize: 704, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x92\x3f\x6f\xdb\x30\x10\xc5\xe7\xf0\x53\x3c\x78\x89\xdd\xca\x16\x02\xb8\x19\xba\x78\x69\x50\x64\x28\x5c\x20\xde\x8b\x93\x7c\x92\xae\xa1\x48\x95\x77\x8a\x2c\x04\xf9\xee\x85\x6c\xb7\xca\x12\x4e\xfc\x73\xf7\x7b\xef\x1e\x98\xe7\xf8\x5c\xf4\xe2\x8f\xf8\xad\xce\x75\x54\x3e\x53\xcd\x68\xc9\x9a\x5f\xc6\x6a\xce\x49\xdb\xc5\x64\x58\xba\x9b\xc5\x74\x21\xa1\x5e\xb8\x95\x73\x79\x8e\x27\x2f\x75\xe3\x47\x34\x52\x37\x9c\x60\xd1\x73\xa2\x50\xb2\xc2\x1a\x0a\xe8\x3b\xb5\xc4\xd4\x66\x88\xd6\x70\x1a\x44\x19\x07\x56\xfb\x4e\x6d\x4b\xa8\x48\xbc\x6e\x26\xcc\x61\xff\x6d\xff\x15\x8f\x53\x17\x27\x06\xa1\x60\x33\x4e\x18\x68\x84\x45\x54\x72\x9a\xdb\x76\x78\xb4\x5b\xc5\xc0\x92\x8e\x93\x8a\x21\x06\x3f\x22\x06\xc6\xd9\x6d\x9e\xe3\xb2\x12\xff\xe9\x25\xb1\x42\x42\x99\x98\x54\x42\xfd\xce\xe0\x06\x3f\x39\x35\xd4\x5d\x35\x6f\x75\x56\xad\xe4\xb4\xc3\x0f\x1a\x0b\xc6\xc0\x33\x4f\x9b\xd8\xfb\x23\xe2\x0b\xa7\x24\xc7\xf7\x83\x68\xc7\xa5\x54\x52\x92\xf7\x23\x28\x1c\x11\xa2\x4d\x58\x5c\xb3\x5c\x0f\x53\xfd\xac\x9d\xcd\xd0\x82\x4b\xea\x95\x61\x8d\x28\x06\xf1\x1e\x97\x73\x4b\x61\xbc\x84\x76\x9e\x4a\xa7\x18\x0a\x86\x67\x55\x50\x59\xf6\x89\x8c\x37\xd8\x27\xb4\x67\x9f\x53\xfb\x0c\x15\x45\x25\x81\x77\xae\xea\x43\x89\xd2\x47\xe5\x25\x65\x28\x50\xf9\x48\x76\xbf\x5d\xa1\x88\xd1\x9f\x4b\x5f\x91\xd8\xfa\x14\x66\x77\xe7\xca\x0c\x5b\x5e\xdf\x6d\x57\x78\xbb\x30\x5e\x38\x8d\x1f\x72\x3e\x64\xdc\xf3\xfa\xee\xcb\xc4\xb8\x40\xa6\x41\x1e\x4e\xdd\xd2\xf0\xe9\xfa\x8d\x36\x87\x0c\x0f\xa7\x0e\xd3\xf3\xf2\x3f\xf4\xba\xc9\x10\xa8\x65\xa8\x25\x09\xf5\x0a\xaf\xee\xc6\x36\x4f\xcf\xd2\x2d\x17\x12\xfe\x45\xb0\x58\xb9\x37\xf7\x37\x00\x00\xff\xff\x4e\x32\x53\x1a\xc0\x02\x00\x00"), - }, - "/src/math/rand": &vfsgen۰DirInfo{ - name: "rand", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 218308925, time.UTC), - }, - "/src/math/rand/rand_test.go": &vfsgen۰CompressedFileInfo{ - name: "rand_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 218341129, time.UTC), - uncompressedSize: 160, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\xcb\x51\x0a\xc2\x30\x0c\x00\xd0\x6f\x73\x8a\xd0\xaf\x4d\x61\x03\x3d\x82\xe0\x05\xdc\x05\x6a\x57\x4b\x5c\x4d\x4a\x93\x22\x22\xde\x5d\x10\x3f\xfc\xd9\xf7\xe3\x8d\x23\xee\x2e\x8d\xf2\x8c\x37\x05\x28\x3e\x2c\x3e\x45\xac\x9e\x67\x00\xba\x17\xa9\x86\xce\xa2\x1a\x71\x72\x00\xd7\xc6\x01\xa7\xa8\x76\xca\xe2\xed\xb0\xef\x0c\xb7\x3f\x1d\xa6\x1e\x5f\xb0\xb1\xe1\xbc\x50\xe9\x9c\x66\x79\xb8\x1e\xde\x7f\xe7\x28\x1c\x5a\xad\x91\x6d\xbd\x35\x25\x4e\xc8\xa2\x4f\x0e\xdf\xfe\x09\x00\x00\xff\xff\x3d\xb4\x3b\xb8\xa0\x00\x00\x00"), - }, - "/src/net": &vfsgen۰DirInfo{ - name: "net", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 218893255, time.UTC), - }, - "/src/net/http": &vfsgen۰DirInfo{ - name: "http", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 218761034, time.UTC), - }, - "/src/net/http/cookiejar": &vfsgen۰DirInfo{ - name: "cookiejar", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 218529933, time.UTC), - }, - "/src/net/http/cookiejar/example_test.go": &vfsgen۰CompressedFileInfo{ - name: "example_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 218568509, time.UTC), - uncompressedSize: 269, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\xcc\x41\x4e\xc3\x30\x10\x85\xe1\x75\xe7\x14\x4f\x5d\xb5\x02\x35\x82\x65\x77\xa8\x02\x24\x16\x05\xd1\x03\xd0\xa9\x3d\x21\x6e\x1c\xdb\x78\x26\x0d\x08\x71\x77\x14\xb1\x65\xfb\xf4\xbd\xbf\x69\x70\x75\x1a\x43\xf4\x38\x2b\x51\x61\xd7\xf3\xbb\xc0\xe5\xdc\x07\x39\x73\x7d\x33\x51\x23\x0a\x43\xc9\xd5\xb0\x6c\x07\x5b\x12\xb5\x63\x72\xb8\xff\xe4\xa1\x44\xd9\xcb\xb4\x5a\xe3\x9b\x16\x4d\x83\x24\x36\xe5\xda\x83\x9d\x13\x55\xa4\x6c\xd0\xb1\xcc\x4f\xf1\x38\x7d\xe1\x31\x97\x4e\xea\xd3\xe1\x1a\x9c\x3c\xac\x0b\x8a\x39\x0f\x2f\x45\x92\x57\xe4\x84\xce\xac\xcc\xdb\x66\x2f\xd3\x41\xea\x45\x2a\xd1\xa2\x1d\x6c\xf3\x52\x43\xb2\x98\x56\xc7\xbb\xd6\xa4\xe2\x46\x0d\x55\x3e\x46\x51\xdb\x12\xf0\x10\xf9\x92\xeb\x16\xbb\x2e\xbb\x1c\xd9\x04\xbb\x2e\x14\xfa\xb3\xb7\xc9\xff\x67\x9f\xd9\x06\xe1\x88\x57\x0e\x1a\xd2\x71\x4d\x3f\xf4\x1b\x00\x00\xff\xff\x4a\xaa\xb1\x5a\x0d\x01\x00\x00"), - }, - "/src/net/http/fetch.go": &vfsgen۰CompressedFileInfo{ - name: "fetch.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 218698588, time.UTC), - uncompressedSize: 3551, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x56\x5f\x6f\xdb\x36\x10\x7f\x16\x3f\xc5\x4d\xc3\x3a\x29\xb5\xa5\x16\x28\xfa\xe0\xc5\x0f\xa9\x9b\x76\xc1\xda\xa5\x48\xb2\xa7\x20\x18\x68\xe9\x24\x31\x91\x48\x85\xa4\x92\x18\x81\xbf\xfb\x70\xa4\x24\xcb\x49\xda\x62\x01\xea\x4a\xe2\xf1\xee\x77\x77\xbf\xfb\x93\xa6\xf0\x7a\xdd\x89\x3a\x87\x6b\xc3\x58\xcb\xb3\x1b\x5e\x22\x54\xd6\xb6\x8c\x89\xa6\x55\xda\x42\xc4\x82\x10\xb5\x56\xda\x84\x2c\x08\x8b\xc6\xd2\x7f\x42\xf9\xdf\x54\xa8\xce\x8a\x9a\x5e\x8c\xd5\x99\x92\x77\x21\x63\x41\x58\x0a\x5b\x75\xeb\x24\x53\x4d\x5a\xaa\xb6\x42\x7d\x6d\x76\x0f\xd7\x26\x64\x31\x63\x69\x0a\xc6\x6a\xe4\xcd\x19\xf2\x1c\x35\x88\xa6\xad\xb1\x41\x69\x0d\x70\x09\x42\x25\xf4\x7d\x55\x2b\x83\x1a\xee\x35\x6f\x5b\xd4\x50\x28\x0d\xf4\x99\xaf\x6b\x3c\x77\x97\x41\x15\x0e\xae\x59\xa4\x69\x81\x36\xab\x12\xd3\x62\x96\xdc\x57\xdc\xde\x97\x89\xd2\x65\x9a\x30\xbb\x69\x71\xdf\x96\xb1\xba\xcb\x2c\x3c\xb2\xa0\x45\x99\x0b\x59\xc2\xe5\xd5\x7a\x63\x91\x05\x5e\x0c\xe0\xe0\xda\x24\xa7\xeb\x6b\xcc\x2c\xdb\x32\x56\x74\x32\x83\x48\xc3\xc1\x54\x4b\xec\xa0\x44\x6d\x7f\x37\x86\x48\x82\x90\x76\x06\xa8\x35\xb8\x88\xc5\x64\x41\x14\x50\xa3\x8c\x74\xd2\x9b\x8a\x61\xb9\x84\x37\x74\x12\xdc\x71\x4d\xe1\x0d\x82\xf5\xaa\x02\x80\x25\x34\xfc\x06\xa3\xac\xe2\x72\xd0\x49\x87\xa8\xf5\xaa\xda\x3b\xf4\xca\x59\x10\xd0\x3f\x9d\x78\x50\xc9\x8a\xd7\x75\x14\x6a\xe4\x79\x18\xf7\x2f\xb6\x42\x19\xce\x48\x09\x79\x10\x69\x34\x5d\x6d\x27\xbe\x39\x80\x41\x40\x18\xfd\x59\xf2\x19\x6d\x14\xe6\x4a\x62\x18\x27\x1f\x94\xaa\xa3\x41\xa4\x87\x71\x38\xa7\xd4\x1c\x9f\x7e\xf2\x1f\x35\xda\x4e\x4b\xf7\xbc\x75\xbf\x6b\x2f\x33\xd5\x76\xc7\xeb\x8e\xd4\x9d\x48\x8b\xba\xe0\x19\x46\x71\x12\x4d\xfc\xdb\x4e\x01\x72\xa3\xe4\x0b\x00\xd3\x14\x8e\x8c\xe9\x1a\x34\x20\xec\xef\x06\x38\x7c\x3c\xfd\x7a\xfc\x90\x61\x6b\x85\x92\x09\xdb\x03\xe8\xd9\x9a\xfc\x8d\xf7\xbd\x42\x8f\xa3\x41\x63\x78\x49\x48\xce\xad\x16\xb2\x8c\xe2\x9d\x79\x7a\x32\x58\xa3\x27\x45\x90\x71\x83\xb0\x86\xc5\x12\x0e\xe7\xeb\x55\xb5\x20\xb9\x31\x81\xb0\x84\xf5\x20\x43\xa9\x76\x52\xce\xb8\x97\x73\x21\x81\x37\x8e\x07\xcc\xc5\x65\xcb\x02\x09\x4b\xc8\x54\xbb\x89\xda\x19\xec\xa8\xc0\xf6\xb4\x8e\xcf\x97\x72\x71\xc5\x06\x45\x72\x06\x52\xd4\x3f\x60\xa1\xab\x91\x28\xf6\x6e\x13\xfc\x34\x85\x8b\x4a\x18\x10\xa5\x54\x1a\xa9\x9c\x36\xfd\xa1\x57\x89\x39\x14\x5a\x35\x90\x71\x99\x61\x0d\x0d\xda\x4a\xe5\x09\x9c\x2b\x28\xb8\x9e\xc1\x09\xe4\x22\x07\xa9\x2c\xa0\xcc\x54\x47\x59\x73\x2a\x32\x25\x33\x8d\x54\x24\x54\xba\xc2\x76\x9c\x62\x0f\xf7\x15\x6a\x04\x8d\xd4\x2c\xc8\x0f\x5b\x61\x6f\x4d\x18\x68\x90\x4b\x21\xcb\xa2\xab\x13\xf8\xaa\x8c\x85\xce\xa0\x1e\x90\xf5\x62\x0e\x8b\x46\xd3\x26\x1f\x54\xbe\x49\x7a\x77\x12\x67\xe6\xa4\x20\x7d\x1a\x5d\xca\x25\x62\x0e\x56\xf5\xb6\xfa\xdb\x74\x3a\x03\x61\xc9\x1b\x58\xe3\xae\x8d\x60\x0e\x5c\xe6\x60\xd1\xd0\xe3\x7d\x85\x12\x6c\xc5\xad\xd7\x92\x29\xa2\x52\xd7\x26\xec\x69\xfd\xf8\xa0\x84\xf1\x2e\xfe\x3e\xf8\x69\x0a\xae\xbf\x5c\x68\x2e\x8d\xb3\x2f\x08\xd3\x99\xea\x64\x7e\xa1\x85\x6b\x4f\x4e\x3f\x05\x7e\x82\xa1\x33\x14\x94\x4f\x74\x15\x8e\xbe\x9d\x24\x70\x62\xc1\x74\x2d\x69\x30\x7d\x53\x12\xb2\x24\xf5\x14\x02\x25\x89\x78\x2a\x17\x68\xfa\xbe\xf5\xc4\xa8\xef\x5c\x8f\x23\x1b\x2c\x1c\xec\x4b\xc4\x3b\x48\x91\xc6\x5b\x38\x38\xc3\xdb\x0e\x8d\x8d\x21\x3a\x38\xeb\x2d\xcc\x26\xed\xa9\x72\x2c\x32\xc4\xe2\x6b\x93\x7c\xae\xd5\x9a\xd7\xbe\x5e\xfe\xf4\x27\x61\xec\x2a\x29\x66\x01\x75\xdf\x1b\xdc\xcc\xc0\x55\xb4\xbb\xa2\xb9\x2c\x29\xf9\xb7\x89\x97\x76\xd5\x43\x72\xff\xf6\x52\x3b\xa1\xfe\x92\xab\xe7\xde\x68\x1f\x72\xea\xed\x32\x0f\x67\x13\xe5\xf1\x58\x38\xaa\xb5\xa4\xa3\xe1\xed\xa5\x71\x65\x7b\x25\x86\x3e\xf2\xb8\x25\x65\xa1\xe7\x6f\xb8\x00\xf7\x47\x58\xbe\xba\x2f\x54\xd7\x61\x6f\xa9\x3f\xed\xdf\xdc\x49\xa6\x31\x47\x69\x05\xaf\xe9\x34\x34\xbc\xc1\xb9\xd2\xa2\x14\xae\x63\x6e\x99\x6f\x8a\xb7\x8e\x94\xf0\xcb\x92\x78\xe0\xc0\x53\x75\x9d\x7e\x3c\x5d\xc0\x27\x21\x73\x50\x9d\x05\x2f\x48\x41\xa6\xd4\x6d\x06\x26\xfa\xe4\x62\x4e\x43\x41\xb9\xb2\x70\x99\x1a\x65\x35\x27\x6a\x13\x69\x68\x6e\x00\xcf\xef\x88\x7a\x8e\xd0\x89\xb7\xe3\xff\xce\x11\xe1\x43\x57\x14\xa8\xcf\x55\xa7\x33\x04\x6e\x7f\x32\xf2\x7e\x25\x18\xf3\x46\x3c\x08\xd7\x1a\xe9\x6d\x36\xb4\x2a\x3f\xb0\xdd\x70\x3d\xaa\xeb\x68\xf0\x90\x02\x2e\x0a\x27\x34\xf1\x35\x18\x8e\x87\xaa\x84\x34\xdd\xf1\x0b\x9a\xce\x58\xe0\xf5\x3d\xdf\x18\xc8\x48\xc0\x79\xe9\xcd\x09\x99\xd5\x9d\x6b\x6c\x4a\x0e\x1d\x79\xd2\x1e\xa5\xa8\x27\x0d\xf2\x99\x1d\x16\x50\xe2\x2f\x43\xd2\x15\x5e\x51\xc7\x55\xf9\xc6\x65\x85\xaa\xe4\x9b\x56\x8d\x30\xb8\xcf\x59\xcf\x25\x17\x90\x70\xe6\x32\xf7\xcf\xd9\x97\xb1\xd5\xcf\x40\xb5\x36\x66\x6c\x9c\xb9\xa4\xe7\xc9\x58\x1d\xeb\x83\xcc\xfb\x69\xf2\xe2\xd8\x8d\xf7\x50\x3c\x1d\xb5\x3f\x9c\xb4\x9e\x80\x04\xdc\xd7\xcb\xe3\xd6\xc7\x64\x37\x2d\xab\xb1\xea\x7a\x87\x94\x3e\xe6\xce\x25\xa7\xd8\x55\x87\xab\x94\x17\xa6\x64\x76\x43\x9a\x57\x5c\x2a\x29\x32\x5e\x7b\x13\x7f\xe1\x26\xba\xc1\xcd\xfe\xd0\xeb\x81\x5c\x66\x37\x14\x5c\x5f\x80\xd1\xee\x5b\x5f\x85\x4f\x06\x25\x85\x2f\x08\x32\x25\x2d\x4a\xfb\x05\x65\x69\x2b\xc7\x28\x69\xdf\xbf\x8b\xe6\x6f\x9d\x90\x28\x20\xab\x47\xb2\xf5\x3b\x61\xf2\x8d\x6b\x83\x27\xd2\xf6\x26\xbc\xa7\x2b\xaf\x68\xee\x35\x85\xf1\x0c\xde\xbe\x99\xc1\xfb\x77\xf1\x1f\xee\xfa\x72\x42\xc3\x27\x46\x97\x90\xd5\x0e\x91\x03\x34\x99\xdb\x7e\x28\xf7\xa9\x3d\x9c\xc3\xab\x21\xa3\x5e\xcb\xb9\xe5\xb6\x33\x7d\xa3\x80\xbd\x25\xc5\xb8\xa3\xc9\x6e\x00\xaf\x21\x84\x10\x5e\x83\xbf\x74\x81\x0f\x36\x7a\xf1\x02\xb9\x15\xc7\xb3\x89\x81\x95\xca\x71\xf1\x5d\x03\x4e\xde\x8b\xfb\x04\x8d\x78\x7c\x70\xfc\xd1\x6a\xea\xf0\x02\xf6\xfc\xf7\x12\x54\x2e\xe3\x55\x80\x57\xd3\xa5\xe0\xd1\xbf\x2c\xf6\x10\xb8\x5a\x1a\x68\x55\xa2\xf5\xa2\x61\xec\xf7\xaf\xa0\x9f\x13\x8b\x31\x38\xb7\xee\xfb\x76\x31\xc6\xf5\x70\x4e\x55\xe5\x90\x3d\xd8\x28\x4e\x3e\x2a\x89\x51\xbc\x60\xfd\xf2\xb7\x9d\xb0\xff\xe5\x35\xee\x59\xa6\xc6\x95\xad\x68\x6c\x72\x4c\xe5\x55\x44\xa1\x44\x9b\x52\x7f\x5b\xf8\x7e\x19\xc5\x50\x70\x51\x63\xbe\x80\xdf\x8c\xab\x6c\xb7\xd2\x8d\xd4\xfc\x5f\xf8\x62\x36\x01\xf1\x93\x4b\x63\xa3\x3f\x5a\xd3\xe4\x1d\xda\xb6\x28\xa0\x55\xc6\x88\x75\x8d\xcf\x86\x3b\x7b\xd6\xdf\x86\x45\x74\xe2\xd5\xa0\xc8\x6f\x1a\x98\xd3\xae\x31\xf2\xd6\x6f\x93\x9e\xc1\x8b\x9d\x3a\xfa\xe0\xf7\xc0\xef\xed\x9d\xcf\xfa\xea\x96\x6d\xd9\x7f\x01\x00\x00\xff\xff\xcd\xea\xf8\xb6\xdf\x0d\x00\x00"), - }, - "/src/net/http/http.go": &vfsgen۰CompressedFileInfo{ - name: "http.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 218832233, time.UTC), - uncompressedSize: 2998, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x56\x61\x6f\xdb\x36\x10\xfd\x2c\xfe\x8a\xab\x06\x04\x52\xaa\xc8\x0d\x50\x74\x43\x1a\x63\xc8\xd2\xae\x09\xd0\x74\x85\x93\x02\x05\xba\xa2\xa0\xa5\x93\xc4\x84\x26\x15\x92\x8a\xe3\x15\xfe\xef\xc3\x91\xb2\x22\x3b\xe9\x86\x2d\x5f\x42\x93\xc7\xbb\x7b\x8f\xef\xee\x34\x99\xc0\xf3\x79\x27\x64\x09\xd7\x96\xb1\x96\x17\x37\xbc\x46\x68\x9c\x6b\x19\x13\x8b\x56\x1b\x07\x09\x8b\xe2\x79\x57\x09\x1d\xd3\x62\xe5\xd0\xd2\x02\x8d\xd1\xc6\xaf\x84\x9e\x08\xdd\x39\x21\xe9\x87\x42\x37\x71\x78\xef\x5a\xa3\x9d\xbf\x60\x9d\x29\xb4\xba\x8b\x19\x8b\xe2\x5a\xb8\xa6\x9b\xe7\x85\x5e\x4c\x6a\xdd\x36\x68\xae\xed\xc3\xe2\xda\xc6\x2c\x65\xec\x8e\x1b\x78\x83\x15\xef\xa4\xbb\x32\x5c\x59\x9f\xc2\x14\xaa\x4e\x15\x49\x0a\x33\xdd\xa9\xf2\xca\x88\xb6\x45\x03\xdf\x59\x64\x97\xc2\x15\x0d\xad\x0a\x6e\x11\xae\x6d\xfe\x4e\xea\x39\x97\xf9\x3b\x74\x49\x5c\xa1\x2b\x9a\x38\x85\x67\x53\x3a\xf9\xa4\x4a\xac\x84\xc2\x12\xf6\xf6\x76\x2d\x67\xc8\x4b\x3e\x97\x78\xe9\x0c\xf2\xc5\xe3\x2b\x47\x30\x99\xc0\xb6\x11\x08\x0b\x9d\xc5\x12\xb8\x05\x0e\x45\x83\xc5\x0d\x54\xda\x80\xed\x5a\x9f\xb3\xae\xc0\x7a\x43\xa1\x6a\x30\x68\x5b\xad\x2c\xc2\x5c\x97\x02\x6d\x06\x16\x03\xcb\xf6\x68\x32\xf1\x69\xe6\xb6\xc5\x22\x5f\x36\xdc\x2d\xeb\x5c\x9b\x7a\xf2\x53\xb8\x6d\x73\x16\x45\x06\x5d\x67\x14\xec\x79\xcb\x81\x96\xef\xeb\xa7\x61\x7f\xbe\x78\x7f\xe6\x5c\x3b\xc3\xdb\x0e\xad\x7b\x02\xcc\xc8\xe3\xe7\xb3\xd9\x96\xbf\x32\x50\x3f\x32\x51\x7a\xcb\x60\xcd\xd6\x49\xca\xd8\x64\x32\x3e\x18\xb8\x58\x36\xa8\x40\xa1\x70\x0d\x1a\xf8\x9d\xb2\x85\x93\x8f\xe7\xa0\xb4\x81\xed\xac\xfc\x36\x37\x08\xfc\x8e\x0b\x49\xac\xe6\x70\xee\x80\xcb\x25\x5f\x59\xa8\xb8\x90\x36\x67\x6e\xd5\xe2\x56\x18\xeb\x4c\x57\x50\x1a\x8c\xf4\x00\xc9\xe8\x6c\xa4\x8d\xc4\xe0\x2d\xec\xf7\x81\x52\x48\xf6\x67\x3d\xfb\x19\x78\xd5\xa6\xa4\x97\x0d\x3a\x21\xfb\x5d\x9b\x7f\xc0\x65\xe2\x05\x4c\x0f\x73\x34\xc0\xd0\x55\x8f\xe4\x69\x14\x96\xc0\x0f\x28\xe2\x94\xad\x59\x48\x7c\x4c\x6d\x9f\x39\x05\x16\xaa\x92\xa2\x6e\x1c\x2c\x78\xfb\x65\x93\xe5\xd7\xfd\x6b\x9b\xff\x31\xbf\xc6\xc2\xb1\x01\x9d\x83\xfd\xb1\x8f\xff\x8a\xf0\xbe\x31\x70\x34\xfd\x37\x71\x78\xd4\x29\x63\x91\xa8\xc0\xe5\x43\x72\xd3\x29\x51\x43\x6e\xa2\xf1\xee\x8f\x92\x0e\xca\x18\x99\x7e\x31\x78\xfb\x15\xa6\x70\xdf\x18\x2f\x2a\x34\x50\xa2\x44\x87\xc9\x83\x4d\x06\x06\x6f\x29\x34\x55\xc7\x69\x43\xc9\x2e\xf8\x0d\x26\x45\xc3\x15\x0c\x90\x52\x16\xa1\x31\xbb\xc7\x01\x26\xf3\x28\xf3\x4b\x02\xa6\x95\xd4\xbc\x8c\xb3\x4d\xab\xa0\xd4\x1b\xe4\x25\x9a\x0c\xbe\xd1\xe5\xa1\x2d\x11\xe4\x99\x3f\x49\x7c\x5f\x1b\xff\xa6\xf6\x36\xfa\xfd\xe5\x2b\xed\x24\x14\xe4\x94\x4b\x99\xc4\x35\xba\x13\x29\x37\xb9\x9d\x79\x2b\x1b\xa7\xf9\xa5\x33\x42\xd5\x49\x0a\xcf\x21\xfe\x53\xc5\x69\x9a\xa6\x39\xf9\xb8\x38\xbf\x78\x1b\xac\x92\x94\x45\xd1\x5c\x97\xab\x27\x1e\xe5\x93\x50\xee\x97\x13\x63\xf8\xaa\x7f\x10\x0a\xe8\x4f\x36\x8d\x23\x4e\xd3\xfc\x5c\x39\x34\x15\x2f\x30\x49\xf3\x3e\x33\x62\x20\x2a\xb4\x72\xa8\xdc\x7b\x54\xb5\xf3\x34\x09\xe5\x5e\xbd\x4c\x0e\x0e\x29\x62\xdf\x21\x0d\xde\xe6\x17\xe8\x1a\x5d\x7a\x62\x7c\xdb\x88\xcf\xde\x9e\xbc\x89\xa9\xd4\xe9\xf1\x43\x1d\xd0\xf5\xbe\x65\xe7\x1f\xb9\xb1\x78\xae\x5c\x12\x68\x0c\x09\x9d\x86\x60\x07\x21\x5a\x9c\x66\x70\xf8\x22\x83\x57\x2f\xd3\xd7\xfe\xfa\x48\x37\xbb\x89\x4d\x41\xd2\xee\x9a\x45\xe3\x2e\xf3\xc8\x28\x24\x2f\x51\x25\x44\x56\x4a\x18\xd6\xcc\xb7\x23\x2f\x92\xe3\x03\xd8\xdb\xd0\xef\xa3\x5c\x3a\xee\x3a\x7b\x04\xfd\xdf\xc0\x9c\xf5\xfb\x3b\x4f\x03\x31\x3c\xdf\x35\xb9\xc2\x7b\x37\x32\xcb\x1e\x9c\x9e\xea\x12\x8f\x9e\x76\x4a\xb4\x04\xd3\xf0\xba\x43\xfc\xfe\xb1\x03\x65\xc1\xe2\x74\x8c\xf0\x08\xb6\x00\x7b\x83\xdf\x74\xb9\x1a\x1c\x00\x84\x69\x9a\x7f\xd0\xed\xa9\xd4\xf6\x09\x55\x06\x62\xfc\xd5\xbe\x14\x37\xb7\x0d\xde\x66\x9e\xb0\x68\xbd\x53\x1c\xbe\x60\x36\xd5\x81\xf0\x50\xba\xa1\x52\x42\x89\x1d\x1f\xfc\xa0\x17\xee\xb4\x3d\xea\xcf\x58\xc6\xe9\xe3\x30\x7c\xae\x8d\xfb\xdf\x61\x4c\xef\xbf\xe0\xaa\xc0\xdd\x08\xa1\x00\x75\x8b\x2a\xce\x46\x7a\x0e\xeb\x4f\xb3\xf7\xc3\x0b\xa6\xa3\x8c\x36\xf5\x73\xb5\x6a\x31\xce\x20\xe6\x54\x64\xf3\xae\xaa\xd0\xc4\x29\x0d\xf5\x86\x5b\x70\x1a\xe6\x08\xbc\x72\x68\x20\x04\x80\x4e\x39\x21\x87\x09\x3d\xef\xea\xbf\x84\x94\x3c\x5f\xe8\xf0\x9f\x06\xb4\x6d\xf4\xf2\xdb\xbc\xab\xf3\xa2\x16\xbf\x8a\x72\x7a\x78\x78\xf8\xe2\xe7\x57\x87\x34\x0e\x0c\x5a\x2d\xef\xb0\x64\x11\x7d\x11\xdc\xe0\x2a\x83\x3b\x2e\x3b\xb4\x54\x5e\x86\xab\x1a\x7d\xd2\x41\x2b\x9e\x18\xb2\xfb\xd6\x5b\x3d\x18\xf5\x97\xbc\xce\x1f\x28\xb0\xe8\xfa\x87\x08\x0e\xe2\x6c\x14\x22\xed\x9f\xdf\x37\x74\x0a\x42\xe2\x1a\x97\xe5\xd8\x8f\x0a\x0c\x03\x4a\x8b\xfe\x90\x94\x35\xf4\x81\x5e\x87\x24\xba\x13\x29\x93\x8d\x33\x8a\x20\x2a\x6f\xf4\x6c\x54\xed\x9b\xe3\xdc\x8b\x36\xf1\xe4\x0e\x03\x0b\x16\x9d\x1d\xa6\x7b\x41\x06\xe0\x1a\xff\x35\xb4\xca\x40\xa8\x42\x76\x25\x7d\x26\x69\xb5\x11\x46\xf0\xb8\x35\xa2\x03\xb0\x47\x71\x1e\x43\xca\xbc\x5f\x02\xc6\x58\x64\x51\x62\x18\xbc\xbe\xe7\x91\x1e\x08\xdb\xf1\x41\xe8\x27\xa3\x0f\x1d\xda\xc8\x28\x5a\x6f\xda\xb3\x70\x7c\xe0\x45\x3b\xfe\x22\x1a\x12\x5a\xff\xc3\xb0\x3e\xf5\x1a\xee\x1f\x6a\x67\x60\x7f\xf7\xaf\x73\xdf\x98\x0c\xf4\x8d\x9f\x4d\xdb\x83\xf3\x35\x6d\x6f\x3f\x56\x28\xac\x34\xc4\xfc\x3b\x00\x00\xff\xff\x05\x0b\xbb\x60\xb6\x0b\x00\x00"), - }, - "/src/net/net.go": &vfsgen۰CompressedFileInfo{ - name: "net.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 218947293, time.UTC), - uncompressedSize: 1122, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x92\x41\x6f\x1a\x3d\x10\x86\xcf\xf8\x57\xcc\xe7\x93\xfd\x75\xbb\xa8\x52\xd4\x43\x25\x0e\x0d\xad\x22\xaa\x36\x44\x42\x6a\x2b\x45\x39\x78\xbd\xb3\x1b\x83\xb1\xb7\x1e\x6f\xc3\xaa\xe2\xbf\x57\x5e\x76\x49\x02\x5c\x7b\xc2\x0c\x33\xcf\xfb\x68\x86\xe9\x14\xde\x14\xad\xb1\x25\xac\x89\xb1\x46\xe9\x8d\xaa\x11\x1c\x46\xc6\xcc\xb6\xf1\x21\x82\x60\x13\x8e\x21\xf8\x40\x9c\x4d\x38\x75\xa4\x95\xb5\x9c\xb1\x09\xaf\x4d\x7c\x6c\x8b\x5c\xfb\xed\xb4\xf6\xcd\x23\x86\x35\x3d\x3f\xd6\xc4\x99\x64\xac\x6a\x9d\x86\xaf\x86\x22\x3a\xe1\x30\x66\x60\x55\x59\x06\xa0\x18\x8c\xab\x25\x88\xc3\x4f\x18\x32\xe8\x33\x24\xfc\x61\x93\x46\x39\xa3\xc5\x21\x33\xbf\xc5\x27\xc1\x1d\xc6\x27\x1f\x36\xa0\xb4\x46\x22\x30\x04\xce\x47\xa0\xb6\x49\x86\x58\x42\xd1\xc1\x4d\x1f\xfc\x65\xc5\xa5\x64\xfb\x21\x57\x94\xf0\xff\x27\xa3\x2c\x06\x09\xe9\x53\x0c\x9c\x0c\x92\x44\x22\x1d\x3d\xe6\xde\xb9\x7f\xe2\x40\x1d\x2d\x9c\x89\x22\x51\xc7\x5a\x13\x7c\x81\x8b\xbb\xdf\x57\xab\xa8\xf4\x46\x48\x28\xbc\xb7\x29\x35\x60\x6c\x83\x83\x4a\x59\xc2\xb3\xee\xf7\x63\xb7\x18\x42\x29\x15\x33\x78\xf1\xed\x6a\xab\x9a\x1e\x26\x4f\x69\xd9\x25\xe8\x0f\xe3\x4a\xff\x44\x8b\xbb\x33\xf2\x77\x43\x51\x2d\xee\x2e\xb3\x8e\x90\xad\xda\x8d\xf7\xbb\x56\x7a\x63\x7d\x2d\x24\x18\x17\x5f\x0c\x0c\xff\x97\x7c\xb5\xfc\xf6\xf1\xe7\x7c\x79\x7b\x9b\x86\xa7\x53\x98\xfb\xa6\x03\x5f\x0d\x07\xa0\x7c\xe1\x4a\xdc\x5d\x77\x11\xf3\x03\xba\xe8\x22\xf6\x35\x31\x1e\x29\x83\x43\xf5\x34\x61\x9d\x86\x23\x06\xa7\xec\xb2\x58\xa3\x8e\x82\x64\x3e\x57\xd6\x0a\x6e\x12\x60\x59\xf1\x2c\x35\xdd\x58\x5f\x28\x9b\xdf\x60\x14\x7c\xd5\x13\xf9\xd8\x57\x05\xbf\x9d\x3f\xaa\x30\xf7\x25\xf2\x0c\xb4\x94\x09\x29\xe4\x89\x6b\x4a\xa7\xfc\xf3\xaf\x56\xd9\x17\x96\xd4\x17\xc4\x2e\x83\x0e\xee\x1f\x0e\x86\xe3\x3d\x4d\x05\x16\x9d\xd8\x49\xf8\x6f\xd6\xbf\xba\x7e\x99\xaf\xb7\x39\xd9\xb3\x49\xe5\x03\x98\x0c\x0a\xf8\x30\x83\xa0\x5c\x8d\xb0\xeb\x1b\x4d\x05\x45\x9a\xed\xee\xcd\x43\x5f\x38\x19\x4d\xb3\xfb\xe3\x2a\x62\x68\xf1\xa2\xf3\xa5\xed\xd2\xb1\x28\x68\x10\x3f\x5b\xf1\xb9\x16\x3d\x6b\xcd\x66\xa0\x5f\x39\x99\x53\x9f\xb7\xef\xd8\x9e\xfd\x0d\x00\x00\xff\xff\x93\x28\xa9\x7f\x62\x04\x00\x00"), - }, - "/src/os": &vfsgen۰DirInfo{ - name: "os", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 219255573, time.UTC), - }, - "/src/os/os.go": &vfsgen۰CompressedFileInfo{ - name: "os.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 219150959, time.UTC), - uncompressedSize: 581, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x5c\x91\x4f\x6b\xdc\x30\x10\xc5\xcf\x9e\x4f\x31\xd5\x49\x62\x5b\x3b\xb9\x76\x6b\x4a\x28\x61\x5b\x28\x2d\xb4\x94\x1e\x42\x28\xfe\x33\xd6\x8e\x23\x4b\x46\x92\x9b\x85\x65\xbf\x7b\x91\xd6\x4e\x21\xe0\x83\xd1\xfc\xde\x9b\x99\x37\x55\x85\xbb\x76\x61\xd3\xe3\x18\x00\xe6\xa6\x7b\x6a\x34\xa1\x0b\x00\x3c\xcd\xce\x47\x94\x50\x08\xf2\xde\xf9\x20\x00\x0a\xa1\x39\x1e\x97\xb6\xec\xdc\x54\x69\x37\x1f\xc9\x8f\xe1\xff\xcf\x18\x04\x28\x80\x61\xb1\x1d\xfa\xc5\x46\x9e\xe8\x4f\xe3\x75\x90\x0a\x1f\x1e\x43\xf4\x6c\x35\x9e\xb1\xaa\xd0\xba\x88\x5d\x63\x0c\xf5\xe8\x2c\xfe\x66\xdb\xbb\xe7\x00\x85\xa7\xb8\x78\x8b\x77\x5e\x07\xb8\xac\x3e\x6c\x39\x4a\x85\x67\x28\x78\xc0\xd9\xbb\x8e\x42\xc0\xf7\x35\x8e\xa1\x3c\x18\xd7\x36\xa6\x3c\x50\x94\x62\xad\x08\xb5\x7f\x81\xde\x64\xe8\x97\xed\x69\x60\x4b\x7d\xb2\x28\x1a\xaf\xff\x26\xf5\xca\x5c\xb5\xe9\x51\x28\x28\x8a\xd4\x18\x6b\x9c\x9a\x27\x92\xdb\xc0\x6f\x31\x95\xcb\xaf\x64\x75\x3c\x4a\xf5\xee\x36\x81\x83\xf3\xc8\xc9\xe7\x66\x8f\x8c\x1f\x5e\x23\x7b\xe4\xdd\x2e\xf7\xcb\x96\x0f\xfc\x88\xf5\x95\xf9\x62\x7b\x3a\x49\xc6\x1d\xde\xaa\xf2\x67\x6e\x20\x93\xe1\x05\xd2\xc7\x03\x1a\xb2\x32\x69\x14\xd6\x35\xde\x64\x8f\x75\xaa\x6d\xa0\xb3\xf8\x28\x32\x7e\x79\x95\x74\x4b\x83\xf3\x74\x7f\xba\xe6\xb5\x55\xe9\x44\xdd\x12\x9b\xd6\x90\x54\x28\xb7\x9d\xf2\x45\x73\xaa\x6b\xe6\x42\xac\x8f\xa1\xfc\x46\xcf\x52\xdc\xbf\xc8\xf2\xb1\x78\x9a\x0d\x4d\x64\x23\xf5\x98\x96\x3f\x7c\xbf\xfb\xf1\xe9\x73\x3d\x06\xa1\xe0\x02\xff\x02\x00\x00\xff\xff\x55\xfc\x3a\xb3\x45\x02\x00\x00"), - }, - "/src/os/signal": &vfsgen۰DirInfo{ - name: "signal", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 219336861, time.UTC), - }, - "/src/os/signal/signal.go": &vfsgen۰CompressedFileInfo{ - name: "signal.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 219392149, time.UTC), - uncompressedSize: 233, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\xce\xbf\xca\xc2\x40\x10\x04\xf0\x7e\x9f\x62\xca\x84\x0f\xbe\x13\xad\x2d\xc4\x42\x3b\xc5\x17\x90\x4b\xb2\x09\x1b\x2f\x7b\xe1\xfe\xd8\x84\xbc\xbb\xa0\x69\x22\xd8\xce\x6f\x60\xc6\x18\xfc\x55\x59\x5c\x83\x3e\x12\x8d\xb6\x7e\xd8\x8e\x11\xa5\x53\xeb\x88\x8c\xc1\x75\x15\x41\x22\xd4\x27\xc8\x30\x3a\x1e\x58\x13\x37\x68\x7d\xc0\xe9\x72\xb8\x1d\xcf\xfb\x3e\xfe\x13\xb5\x59\xeb\xa5\x7e\x6f\x24\xda\xca\x71\x91\x45\xd3\x6e\x5b\x62\x9a\x57\xcc\xba\xd2\x6f\x96\x4e\x7d\xf8\xcd\x81\xeb\x67\x51\xe2\xc3\x00\x26\x04\x4e\x39\x28\x36\x98\x97\x1b\xce\xfb\xb1\x78\xcf\xbe\x02\x00\x00\xff\xff\x29\x0b\xd3\x08\xe9\x00\x00\x00"), - }, - "/src/reflect": &vfsgen۰DirInfo{ - name: "reflect", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 532694606, time.UTC), - }, - "/src/reflect/example_test.go": &vfsgen۰CompressedFileInfo{ - name: "example_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 219601139, time.UTC), - uncompressedSize: 311, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x5c\x8d\xcf\x4a\x33\x31\x14\xc5\xd7\xbd\x4f\x71\xc9\xe2\xa3\xe5\x93\xa4\x95\xba\xe8\xec\x5c\x88\xe2\xa6\x62\x1f\xc0\xa6\x93\x9b\x3f\x75\x92\x0c\xc9\x8d\x08\xa5\xef\x2e\x33\x22\x82\xbb\x03\xbf\x73\xce\x4f\x29\xfc\x7f\x6a\x61\x30\x78\xae\x00\xa3\xee\xdf\xb5\x23\x2c\x64\x07\xea\xf9\x8d\xa9\x32\x40\x88\x63\x2e\x8c\xc2\x46\x16\x00\xb6\xa5\x1e\x1f\x3e\x75\x1c\x07\x3a\x70\x69\x3d\xef\xed\x72\x85\x17\x58\x28\x85\x8f\x79\xf4\x54\x9e\x0f\x68\x32\x55\x4c\x99\x31\x4c\xbd\x48\x89\x7f\x4e\xa5\x36\xe6\xf5\x3b\xee\xad\xc5\x44\x64\xc8\xa0\xcd\x05\xd9\x87\x8a\x93\x52\xce\x5f\x07\x22\xf4\xcc\x63\xed\x94\x72\x81\x7d\x3b\xc9\x3e\x47\xe5\x66\xc5\xb9\xfe\x86\x50\x6b\xa3\xaa\xb6\xbb\x1d\xc0\xc2\x46\x96\x2f\x25\x24\x1e\xd2\xf2\xf8\xa1\x87\x46\x1d\xfe\xbb\x3c\x51\x70\x9e\xbb\xb5\xdc\xe2\xbd\xa3\xee\xf6\x0a\xe7\x9a\x53\x87\x78\x11\x7e\x46\x62\x62\x37\x42\x3b\x12\x13\xfd\x3b\xdc\xc8\xbb\x79\xb8\x59\x5f\x8f\x2b\xb8\xc2\x57\x00\x00\x00\xff\xff\x0d\x48\xa9\x1a\x37\x01\x00\x00"), - }, - "/src/reflect/reflect.go": &vfsgen۰CompressedFileInfo{ - name: "reflect.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 532464528, time.UTC), - uncompressedSize: 36239, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x7f\x73\xe3\x36\xb2\xe0\xdf\xd2\xa7\xc0\xa8\xb6\xfc\xc8\x19\x2e\x3d\x72\xf6\x52\x29\x67\x9c\x57\x9b\x49\xb2\xe7\xdd\xcc\x38\x15\xef\xe4\xae\xce\xcf\x95\x85\x49\x50\x82\x45\x81\x5c\x12\xd2\x58\xf1\xf8\xbb\x5f\xa1\x1b\xbf\x49\xc9\x9e\x49\x72\xb7\xf5\x6a\xe7\x8f\xb1\x44\x02\x8d\x46\x77\xa3\xd1\xbf\x00\x1d\x1f\x93\x17\x37\x1b\x5e\x97\xe4\xb6\x9f\x4e\x5b\x5a\xac\xe8\x82\x91\x8e\x55\x35\x2b\xe4\x74\xca\xd7\x6d\xd3\x49\x92\x4c\x27\x33\xd6\x75\x4d\xd7\xcf\xa6\x93\x59\x2f\xbb\xa2\x11\x5b\xf5\x71\x23\x7a\x5a\xb1\xd9\x74\x3a\x99\x2d\xb8\x5c\x6e\x6e\xf2\xa2\x59\x1f\x2f\x9a\x76\xc9\xba\xdb\xde\x7d\xb8\xed\x67\xd3\x74\x3a\xdd\xd2\x8e\x70\xc1\x25\xa7\x35\xff\x85\x95\xe4\x8c\x54\xb4\xee\xd9\x74\x5a\x6d\x44\x01\x6f\x92\x94\xdc\x4f\x27\xc7\xc7\x84\x6e\x1b\x5e\x92\x92\xd1\x92\x14\x4d\xc9\x08\xab\xf9\x9a\x0b\x2a\x79\x23\xa6\x93\x4d\xcf\x4a\x72\x7a\x46\x54\xb7\x84\x13\x2e\x24\xeb\x2a\x5a\xb0\xfb\x87\x94\xdc\x3f\xe0\xfb\xa4\x93\xbb\x56\x3d\xd1\x5f\x37\xa2\x68\xd6\xeb\x46\xfc\x3d\x78\xba\x66\x72\xd9\x94\xee\x3b\xed\x3a\xba\x0b\x9b\x14\x4b\x1a\x75\x52\xc3\x86\x4f\x2c\x06\x11\x74\xda\x86\x0f\x5a\xd9\x85\x0f\xfa\x9a\xc7\x9d\x7a\xd9\x6d\x0a\x19\xc1\x8f\xf1\xc4\x46\xdf\x71\x56\xc3\xc3\xe9\x24\x24\xab\xec\x36\x6c\x3a\xd9\x70\x21\xbf\x50\x80\xc8\x19\x51\x7f\x2e\xaa\x04\x1e\x25\x2f\xd3\x34\x4f\x9e\x03\x81\x52\x72\x7c\x4c\x7a\x26\x49\xd5\x74\xa4\x63\xb4\x9e\x3e\x68\x76\xdc\xf6\xaa\x4f\x22\x77\x2d\x74\x4e\xc9\xf3\xdb\x3e\xbf\xb8\xb9\x65\x85\x54\x3c\xea\x98\xdc\x74\x82\xdc\xf6\xf9\xb9\x9a\xbc\xa0\x35\xbe\x53\x1d\xd2\xfc\x2f\x4c\x26\x33\x84\x30\x4b\x2d\x48\x2d\x57\x16\xae\x83\x98\x12\x44\x47\x41\xe6\x15\x91\xbb\x16\x41\x78\x3d\x66\x29\x39\x3b\x53\xe3\xbd\x13\x25\xab\xb8\x60\xa5\x6a\x3c\xe9\xa4\x92\x84\x23\xe4\xf6\x74\x32\x99\xf4\xfc\x17\x76\x4a\xd4\x44\x5b\xd9\x25\x16\x92\x7a\x3c\x4b\x15\xb2\x49\x9a\x66\xaa\xe1\x8a\x8b\x12\x1b\x7e\xe1\x9a\xa9\x87\x61\xb3\x5e\x76\xa7\x84\x08\xf6\xfe\x2d\x5d\xb3\x8b\xaa\x4a\xf4\x47\x64\xba\xa0\xf5\x65\x30\x8c\xec\xb8\x58\xcc\xd2\x34\x23\xb3\x59\xe6\x26\xc2\xee\xd4\x4a\x62\x0a\xf6\xd7\x4d\x53\x27\x29\x42\x7f\x98\x4e\x26\x43\x12\x76\x32\xcd\x2f\x3d\x0a\x02\x9c\x74\x3a\x99\x28\x70\x97\x31\x5d\xb2\x11\x26\x74\x32\x55\x52\x31\x41\xb9\xb9\x64\x40\xa4\xdb\x3e\xff\x4b\xdd\xdc\xd0\x3a\x7f\x4d\xeb\x3a\x99\xfd\xc1\xbe\x75\x23\xf0\x8a\xd8\xa7\xf9\xf7\x4c\x2c\xe4\x32\x49\xc9\xb3\x33\xf2\x92\x7c\xf8\xe0\xa6\x23\xe8\xda\x9b\x0b\x30\x62\xd2\xc9\x5c\x56\x35\x5d\x90\x0f\x67\x04\x3e\xbc\xd3\x4b\x4e\xbd\xf4\x99\x3a\xd6\x79\xd8\x5b\xd1\xb8\x54\xaf\x14\x8d\x26\x4a\x75\xe8\x49\xbf\x01\xfc\x7a\x72\x75\x8d\x98\xaa\xd7\x4a\x7a\xb9\x9a\xe3\xcb\x2f\x09\x27\xaf\x46\xe6\xf0\x25\xe1\x2f\x5e\x90\x7b\x25\xee\xdf\x6a\x5e\xe8\x56\x3d\xa9\x78\xd7\xcb\x1c\xd0\x58\x2b\x20\xae\xf7\xb9\x28\xd9\x5d\xc2\x53\x78\x67\x78\xa8\x9a\xf8\xcc\x5f\xe3\xb4\xda\x95\xe2\xbb\x12\xd2\xd9\x0c\xda\xf3\x8a\x3c\xb3\x7d\x70\x96\x93\xa2\x11\x92\x0b\xb5\x3a\xcd\xcc\x26\xd1\xb4\xce\x08\x6d\x5b\x26\xca\x24\x7c\x9e\x69\xac\x34\x1c\x45\xc3\xd3\xc7\xa4\x72\xed\xe8\x6d\x25\xd2\x20\xa4\xa5\x7b\x32\x59\xcb\x5d\x0b\x90\x50\x45\x54\x89\xbf\x4a\x35\x04\xb9\x6b\x67\xa9\xe9\xf1\x90\x5a\xae\xdc\x15\xcd\x46\x80\x6c\xa9\x65\x34\xff\x3c\xa9\x99\x88\xf0\x4e\xd3\x8f\xe6\xcf\x3b\xc1\x62\x0e\xf5\xac\x68\x44\xf9\xbb\xb0\xe8\xbf\x37\x87\x36\xa8\x1e\x83\xdd\x0f\xda\xb4\xab\xc5\x0f\x54\x2e\x3f\x42\xb5\x21\xf1\x10\x47\xd8\xb7\xcd\x70\x6b\x90\x82\x53\x42\x8c\x14\x0c\xb9\xab\x5b\xde\xd9\x96\xf8\x09\x9f\xfe\xac\xb9\x7c\x1a\xad\xf0\xcc\xcd\xc2\x43\xff\x0d\x6d\xaf\x3a\x79\x4d\xce\xc8\x46\xaa\x77\x43\xe5\xb7\xd9\xa7\x3e\x1f\x94\x4a\xec\xdf\x73\x59\x2c\x49\x27\xf3\xbf\x71\x51\x6a\xfd\x53\xd0\x9e\x91\x3f\xab\xcd\xff\x14\x74\x3e\x93\xea\x25\x10\xb8\x93\x19\x39\x72\x76\x01\x8a\x59\xcd\xd6\xa7\xf1\x76\xa6\x15\x7d\xcd\xd6\x33\x33\xdf\x9a\x89\x53\x32\xdc\x8b\x6a\x26\xc2\x3d\x06\x18\x06\x38\xbc\x5e\x52\x01\x28\x94\xbc\x53\x9c\xfb\xba\x91\xcb\x6f\x78\x17\xab\xd0\x9e\x89\xf2\x42\xd4\xbb\x58\x8b\xaa\x5e\x67\xe4\x92\x89\x52\x77\x7a\x88\x7b\x76\xac\xd8\xee\xef\xf9\x23\x2b\xb6\x7e\xcf\x01\x21\xac\x35\xf4\x51\x74\x28\x79\xe7\xd1\xa1\xe4\x5d\x3c\xed\xef\x36\xa2\x80\x69\xb7\xb4\xa3\xeb\x5e\xcd\xdc\xc9\x1d\x3c\x9a\x81\x4c\x73\x01\x8b\x9f\xae\x58\x72\x75\x8d\x26\x43\x46\xb0\x81\x93\xb5\x40\xe1\x74\x54\x2c\x18\xe1\x42\x4f\x93\x8b\x2b\xae\x64\xc7\xc7\x59\xf7\x37\x8a\xc4\x2d\x9e\x8e\xf5\x9b\x5a\x86\xd8\xe8\x67\x88\x4e\x83\xcb\x2b\xc2\x47\x37\x39\x88\x90\xea\x89\x18\x35\x1b\x39\x44\xc9\x80\x18\xe2\xd4\x6c\xe4\xeb\x48\xe9\x8e\x8e\xe7\xf3\x7c\x4b\x3b\x4e\x4b\x5e\xc4\x3c\xb7\xb0\x3e\x9c\x91\x39\x79\xf5\x8a\xcc\xff\xc7\x7e\xce\x5b\xab\x57\x6f\xd7\xbb\x96\xa9\x85\xac\x0c\xb7\x4c\x93\xf6\xb5\x5e\xdd\x1a\xaf\x98\x2f\x59\x30\xe8\x29\x31\x9f\xb4\x16\xe0\x02\xe0\x11\xc2\x85\x7e\xd2\x6c\x24\x3e\x6a\x36\x32\x12\x98\x73\x63\x71\x83\xd4\x98\x6d\xc2\x67\x94\x7e\xa6\xe5\xc6\x6b\xa1\xb9\xa5\x1f\x19\xad\xfd\x88\xfc\x98\xfe\xf7\xf1\x16\xd4\x87\x1b\x90\x69\x88\x2c\xe5\xbf\xcd\x8e\xf0\xc8\x4e\x66\x37\x0a\xd8\x27\x3e\x6a\xa3\xd8\xcf\xee\xd0\xa5\x09\x79\x6e\x59\x6e\x37\x91\x8f\xdc\x38\xf4\xbe\x61\xd4\xbe\x21\x5a\xc4\xe3\x37\xb4\x1d\xd7\xc6\xc6\xaf\x02\x28\x2b\xb6\x3b\x25\xe3\x3a\x68\xc5\x76\x96\x38\x4f\x54\x55\x6e\xf4\x1f\x64\x37\x3e\xba\x71\xe2\x3e\x0d\xec\xa5\xf2\xf8\xc6\x01\x3b\x67\xf0\x13\x41\x83\x53\x08\xb0\x2b\xe5\x19\x86\xeb\x01\x1f\xe1\x72\xd0\x40\xbf\xb3\xad\xf4\x9a\xf0\xdc\xca\x8c\x60\x87\x83\xcb\x22\x84\x83\x68\x57\xe0\x99\x63\xdf\x60\x69\x34\x55\xd5\x33\xf9\xed\xfa\x06\xcd\x33\xb3\x1b\xf0\x14\x34\x8f\x31\xc7\x2a\x3d\x43\xd5\xac\x1c\xba\x09\x01\x14\xa5\xb6\x86\x66\x1a\x62\x83\x0b\xd0\xf7\x93\xfd\x45\xa8\xff\x8d\x89\x6d\x15\x2d\xc0\x91\x77\x92\xa2\x40\x57\xfb\x7c\xbb\x60\x3d\xea\x7f\x3e\x23\x2b\x7f\x2d\x66\x83\x89\x9d\x12\xef\xcb\xa3\x2b\xd5\x0b\x18\xfc\xda\x65\xaa\x5a\x8d\x2e\x55\xe4\xa7\x5b\x67\x48\x63\x27\x7f\x0f\x53\x30\xae\x74\x50\xc0\xc4\x16\x12\x8c\x0f\xe5\x3f\x34\x30\x60\x32\xee\xd6\xe7\xef\xa0\x95\x72\x89\x6d\xa4\x20\x9c\x24\x31\x3b\xeb\x4a\x3f\x8b\x42\x3e\xd3\x43\x3e\xb4\xe9\x33\xea\x27\x9b\x97\x4a\xba\x0f\xbc\xd5\x4e\xb7\x3c\xe8\x6e\x3f\x4c\xa7\x10\xc2\xf0\x8d\x55\x2d\x80\x0a\x45\x4d\x5e\x22\x50\xf9\x4f\xb5\xd9\x6c\x76\xcb\xa9\x71\xa6\xec\xf7\x75\x53\x55\x44\x1b\xd5\x9f\x9d\x4c\xa7\xd6\x4e\x76\x9e\xaf\x21\x57\x22\xc9\x73\x7f\xd8\xd4\x6c\x4e\x49\x6a\x1b\x7b\x41\x1b\x99\x1b\x50\x07\x20\x18\xa9\x7e\xf3\x34\x48\x57\xa7\x32\xd7\xe6\xbd\xf9\x70\xad\xa0\x2b\xc7\x3d\x32\xdf\x89\xd6\x37\x6b\xda\x5e\x21\x67\xaf\xc3\xb1\x3d\x9c\x74\x90\xca\xbc\x4e\xd2\x10\x4d\x0f\x95\xd8\x47\xc0\xe1\x81\x23\xc6\x74\xf1\xb8\x81\xd1\x26\x42\xc8\x3f\xb4\x2c\x9e\xce\x54\xab\xd9\x3f\xa6\xc6\x8e\x71\x8c\xb0\x66\x92\x7e\x30\x55\xb6\x0a\x21\xc6\xe0\x9b\x82\xa1\xe2\xbe\xfa\x24\x35\x23\xa7\x84\x0b\xa0\xa0\x0b\x73\x39\x0a\x72\xb1\xa7\x4f\xb3\x91\x7b\x3b\x35\x1b\x69\xe7\xa7\x44\xca\x9b\xdb\xcd\x4e\xb2\x9e\x3c\x57\x7f\x82\x26\xdf\x50\x49\xbd\x66\xd0\x4b\xfd\xc3\x98\xd5\x74\x22\xe9\x82\x04\x0f\xac\x6b\x7c\xd3\x34\xb5\x61\xa6\xea\x16\x33\x51\x0d\x75\xfd\xdc\x8c\x61\xf9\x27\xa0\x71\x0a\xff\x27\x29\x49\x7a\x0d\x39\x25\xf7\x44\xcf\x44\x43\xbb\x12\x39\x60\x7d\x9d\x03\x56\x0f\x11\x00\x49\x17\x61\xff\x03\x00\xd4\x2c\xe2\xfe\x7a\xed\x25\xa9\x06\xe0\xf5\x9f\xcd\x06\xad\x79\x6f\x22\x44\x49\x0a\x53\x3f\x30\x9a\x25\x91\xe1\xa0\x51\xb1\x22\x53\x58\xeb\xf1\x9c\x53\x0f\xf0\x90\x22\xc0\x2a\xb5\x13\x0a\xf6\x3e\x51\xe0\x52\xe4\x89\x82\x7f\xa3\x36\xaf\x23\x43\x50\xa5\xd7\xdd\xbe\x05\xd6\xb1\xa4\x0b\xbd\xb5\x48\xba\x50\x0f\xcc\x00\xa7\x76\xa8\x4c\xe9\xe4\x89\x87\xb8\x02\x03\x68\x9f\x92\x1b\x78\xe9\x71\xf4\xa2\xaa\xbe\xe7\xbd\x92\x62\xf5\x6d\xb8\x00\x75\x9b\x44\xe9\x24\xfd\xd9\xcd\xc2\x1b\x43\xc3\xb9\xe2\x42\xaa\xb6\xe9\xf5\x34\x22\x0c\xd8\xbd\x9e\x5c\x5c\x54\x15\x04\x7d\x15\x21\x6a\x26\x12\x0f\x88\xa6\x87\x41\xcd\x86\x5d\xbc\x87\x19\x11\x69\x3c\xbe\xb2\x37\xf4\xcc\x24\xda\xc1\x7a\x66\x7a\x7d\x0e\xe6\xa6\x5b\xc1\xdc\xf4\x67\x3f\x1e\x6d\xd6\x9c\x83\x35\x3e\x3b\x63\x74\x0f\x00\x07\xf3\xf3\xc0\xa4\xd3\x89\x8f\xa0\x9d\x9f\xf7\x30\x23\x32\x8d\x31\xd0\xf3\xd3\x39\x13\xb7\x91\xf7\xb2\xbb\xb8\xb9\x0d\x82\xea\x5a\xda\xef\xa7\x10\x3f\x2d\xf4\xe2\xbf\x57\x7f\xcd\xbb\x87\xb1\x8d\xaf\xd0\x3b\x5e\x2f\xbb\x59\x46\x10\x30\x64\x0a\x16\x4c\x9a\x8e\xef\xb9\x5c\x2a\xbd\x67\x50\xe0\xbf\x80\xce\xd0\xb8\x16\x79\x2f\x3b\x87\x66\xff\xbf\x3a\x35\xb9\xd2\x4b\x27\xe0\xc2\xf2\x12\x09\xc6\xc4\xd5\xd9\x83\xf7\xd8\xc3\x1a\x55\x16\x58\xd1\xb4\x3b\x34\x75\x93\x52\x51\xa8\xef\x0a\x6f\xd2\x10\xec\xd1\x43\xdc\x4f\x3d\x43\x78\x30\x80\x33\x88\xe3\xe8\x64\x64\xf9\xea\xd0\xe4\x74\x32\x69\xbb\xa6\x1d\x31\x6f\xb5\xfd\xd4\x35\xed\x2c\xcd\x2f\x81\x3c\x89\xb2\x8a\xca\x5e\x02\x1d\xd5\x1b\xc0\x13\x1a\xaa\x6f\xca\xde\x78\xb0\x33\x52\x8a\xf4\x27\x5a\x6f\x58\x22\x01\xf3\x8c\x6c\x83\x19\x55\x35\xa9\x6a\xba\x48\x09\x34\xc2\xed\x0b\x6c\xfb\xdc\xec\x8a\x98\x35\x31\x11\xad\xb3\x33\x8c\x65\x41\xc8\xde\x7b\x88\x54\x8b\x9f\xfe\x20\x3b\xcc\xa4\x20\x23\x60\x8c\x7b\x65\x59\x46\xd6\xdb\xd6\x19\x6a\x80\xd2\x07\x40\x2a\x31\xa0\xd2\x07\x5f\xdf\xec\x85\x32\x48\x42\x08\xf6\x5e\xe9\x38\xfd\x7e\x96\x91\x6d\x66\x78\xd5\xc9\x5c\x39\x5b\x8d\x32\x0d\x1f\x19\x5c\x3f\x38\x17\x25\xef\x1c\x61\xdf\xd0\x15\x03\x87\xcb\xca\x5d\xa6\x16\x61\x46\x0a\xda\x2a\xc1\xf5\x28\xaa\xe3\x25\x9a\x2c\xcf\xce\xd0\x51\x43\xae\x53\xc1\x0b\x6b\xb4\xe6\x16\x28\x69\x2a\x22\x1a\xf1\x47\xf0\xdb\x60\x75\xce\x80\xad\x0a\x56\xcd\x04\x79\x45\x5e\x1e\xec\xaf\xec\xf1\x05\x95\x7c\xcb\x08\x44\x04\x4d\x5f\x85\xdc\x47\xf4\x2d\x68\x1b\x8e\xfb\x15\x40\x38\xdc\xdb\xb6\xc3\xae\x96\x6f\x9e\x28\xee\xda\x6c\x24\x65\x64\x40\xcc\x32\x7f\x45\x39\xb2\x8e\x99\xc7\x90\xa7\x0d\x13\x88\x64\xb0\xec\xf3\x6f\x6b\xb6\x4e\xd2\x54\x8f\xf4\x0b\xeb\x9a\x59\x4a\x1e\x14\xbf\x5f\xba\xc5\xaf\xf3\x98\x51\xd2\xf7\xef\x2e\x75\xf8\xcc\xcf\x84\x42\x3a\x01\x53\xc9\x90\xbf\x56\x1c\xb3\x59\x51\x27\xf2\x3a\x7b\xf8\x60\x88\xc8\xd5\xb2\x10\xbc\xf6\x97\x85\xe0\xb5\x2f\xdf\xbe\x37\x37\x9c\xb0\x51\x09\x45\x23\x50\xe5\x36\xdd\xcc\xf3\x6e\x80\xc0\xc3\x59\xf8\xb2\x38\x86\x02\xae\xa9\x60\x99\x39\x76\x7d\x0a\x42\x63\xbc\x32\x2d\xff\xb0\xa5\xf5\x2c\xa4\x3d\xe8\x94\x8b\x2a\x41\x3f\x85\x0b\x99\x11\x56\xb3\xb5\x56\xb6\x91\x39\x1e\xe1\x13\x4a\x91\x0d\xa7\x3b\x29\x52\x90\xd2\x8c\x00\x6c\x8f\x54\xaf\x97\x54\x5c\x54\x49\xc9\x3b\xf8\xf8\x0d\xef\x32\x22\x3f\x61\x44\x13\xb7\xf6\xc4\x36\xcd\x08\x04\xbd\x6d\xbc\xdc\x7e\xd7\x51\x70\x0f\x8d\xef\x36\xa2\x50\x0c\x13\x19\x41\x5b\x5f\xab\x69\x1d\x58\xd5\x56\x9d\x27\x86\xf6\xcd\xd1\x11\x81\xac\x18\x17\xa0\x6c\x21\x8d\xca\xc5\x95\x7e\xf4\xc7\xf9\x75\xac\x72\xd2\xb1\x95\x8b\xe3\x9f\x92\x9a\xf6\x92\xd0\x6e\xa1\x04\xd9\x0e\x81\x7b\xc8\xa6\x97\xe4\x86\x11\x50\x46\x66\x51\xdf\xf6\xe7\x41\xc0\xdc\xdb\x53\x34\x02\x66\xf7\x53\x5b\x4e\x1c\x2d\x57\xbd\x31\x8c\xa2\x49\xb6\x45\x35\x73\xdb\x5f\x84\x71\xef\x08\x6c\xb3\x91\xe3\x70\x4d\xd0\x1b\x00\x8c\x41\x7e\x0a\x27\x8d\x7b\x04\x9c\x3c\x17\xea\xff\x8b\x8d\x74\xbc\xf0\xb8\xf6\x86\xb6\x17\x55\xb2\x62\xbb\x51\x41\xd5\x89\xa0\x15\xdb\x79\x99\x20\x9b\x8d\xc8\x54\xef\xcc\x85\xeb\x06\xaa\xb4\x55\xfc\xe0\x62\x4b\x6b\x5e\x2a\x20\xb0\x01\x90\x19\x79\x01\x10\x8d\x15\x10\x6a\xd7\x83\x13\xd3\x51\x4d\x27\xa1\x2b\xb6\x4b\xc3\xf5\xe1\xcd\xcd\x33\x33\xf5\x1e\x39\x34\x59\x0f\x0e\xa7\xc3\x98\xfe\x82\xf0\xc0\xc3\xbc\x2f\xaa\xe4\x53\xd6\x9a\x8d\x63\x0e\x61\x1f\x1f\xa3\xb4\xa2\x25\x72\x51\x25\xda\x3e\xbb\xba\xbe\x74\x91\x3a\x3b\xda\xf1\x31\x99\xdc\xf6\x83\x28\x65\x2c\x6f\x08\x23\x4d\xa1\x7d\xd5\x33\x2d\x9b\xed\x15\x5a\xaa\x3a\xaa\x79\xff\x70\xff\x80\x2d\x50\x2e\x2b\x27\x97\x95\x89\x5f\xaa\xd7\x18\x84\xc4\xb2\x19\xa3\x82\xe1\x79\x2c\x02\x66\x0e\xa7\xd8\x1f\x58\xaf\x6b\xa3\xf2\x73\xd9\xd0\x84\xa7\xe4\x05\x99\x91\x25\xed\x89\x68\x8c\x7d\x00\xa0\x90\x12\xe8\xd4\x81\x3d\x99\x2b\xd7\xc8\x0e\x0f\x8f\x21\xb4\x6f\xc7\x3e\x3e\x26\xdf\xea\x90\x28\x0e\xa7\x9f\x5b\x64\x07\x06\x1d\xbe\x0f\x3a\x3e\x7f\x4e\xa8\x28\xc9\x73\x6f\xd7\x21\xb4\x63\x84\xd7\x35\x5b\xd0\xda\x74\x81\xb5\x02\x58\x01\x60\xdc\x97\xcd\x4b\x5e\x91\x95\x7a\xa9\x1a\xe9\x31\xbf\x24\x2b\x33\xec\x87\x0f\xf8\xd9\xa6\x67\x1c\x22\xfb\xc9\xa7\x87\x27\x54\x34\x62\xb7\x6e\x36\xbd\x26\xa8\x5d\x50\x1a\x11\xb7\xa6\x34\xc8\x07\xf3\x01\x09\x86\x38\x59\xfb\x1b\xdf\x3d\x10\x56\xf7\x1e\x1a\xba\x69\x04\xd2\x34\x0e\xd9\xc3\x2b\xf2\x73\x46\xca\x0d\xda\xfc\x3d\x93\x57\xaa\xf7\xf5\x97\xf0\xe8\x51\xa9\x28\x37\x6d\xcd\x0b\x2a\x99\x27\x1f\xe0\xf7\x9a\x41\xe0\x8f\x03\x6b\xc3\xd5\x20\xa9\xf8\xf6\xb6\xaf\xc2\xca\x1d\xd8\x9b\x51\xf8\x67\x69\xfe\x96\xbd\x37\xb8\xdf\xf6\x15\xfa\x6c\xe0\x86\x64\xfe\x48\xf6\x15\xc4\xb4\xc7\x5f\xd9\x18\x76\x06\xc5\x63\xf1\x6b\xb9\x6b\xdd\x62\x46\xda\xa5\x83\x36\x74\x31\xcb\x14\x61\xe9\xc2\xbe\xf2\x63\xf1\xb7\x7d\x05\x8f\x71\xe2\x4f\x52\x24\x36\xb2\x3d\xc3\x90\xb4\x01\x88\x63\x1b\x5d\xf5\x7f\x58\xd7\x78\x8e\xa5\x73\x92\xf6\x98\xb4\xce\x0f\xf4\x4d\xcd\xc0\xd4\x41\xa7\xe5\x67\x45\x5f\x28\x54\xb3\x61\x48\xdf\x97\xf1\x36\x11\xcf\x75\x30\x9b\x88\xcb\xc6\xd8\x00\x65\xe4\x08\x45\xfe\x68\x2b\x3b\xc3\x52\xe7\xec\x4c\xa3\xd2\x84\xc7\x61\xf9\x73\xf2\xe1\x94\xac\xa2\x9b\xfa\x20\x42\x8f\x79\x66\xfb\x49\xe7\x99\xf1\x23\x1e\x5b\xec\xeb\x9e\x0b\x99\x54\xe0\xaf\x65\xe4\x86\xcb\x1e\x6c\xf2\xcf\xff\xe4\x2c\x3b\xcb\x42\x45\xfc\xc8\xd1\x6d\x25\x14\x46\x84\x1c\x4a\x0f\x71\xe2\x5c\xc8\x2f\xd4\xb4\x9f\x27\x4a\xf3\x7d\x91\x26\xad\xec\x52\x02\x05\x42\x5f\x24\x6a\xfc\xd4\x35\x9c\x7f\xee\x5a\xce\x3f\xf7\x9b\xce\x3f\x8f\xdb\x66\xea\xbf\xcf\x4e\x5c\x87\xcf\x4e\xfc\x0e\x9f\x9d\xc4\x1d\x3e\xff\x93\x6b\xfb\xf9\x9f\xfc\xb6\x9f\xff\x29\x68\xfb\x8e\x3b\x94\x37\x01\xce\x9b\x01\xd2\xef\xb8\x87\xf5\x26\x44\x7b\x33\xc4\xfb\x1d\xd8\xed\xef\x00\x3f\xfc\xdb\x62\xa2\x53\xf7\xf6\xe6\xb0\x19\x4e\xe2\x1d\xf7\x66\xb1\x09\xa7\xb1\x09\xe6\x11\x87\x02\x60\xed\xb5\xb2\x53\x1b\xaf\xe7\xab\x5b\x47\xde\xb2\x2d\x0d\xdd\x77\x65\x8b\x79\xde\x7b\x25\xb0\xea\x97\x76\x0b\x65\x35\x00\xec\x94\x98\x12\x08\xfb\xe4\x90\x63\xaf\x20\x8e\xd8\xd8\xa7\xa4\xa0\x75\xad\x0c\x6b\x33\x2c\x84\xb8\xc0\xc3\x87\x6f\xce\xc1\x9f\x4e\xa4\x49\xad\x3a\xb9\xac\xb4\xac\x26\x2e\x80\x3f\xc8\x7f\x41\x51\x66\xb5\xd5\x2a\xdd\x4e\x0f\x66\x24\x97\xbc\x0f\xa2\x3e\xb4\x5b\x6c\xd6\x4c\xc0\xac\xfc\xa0\x9e\xbf\x7b\xab\x69\x00\x29\x9c\x75\x04\x13\xcf\x88\x42\x27\x7f\xbb\x59\x9f\x0b\x4c\xdd\x46\x99\x5b\xe8\x04\xf9\x42\xda\x2d\xc0\xd8\x51\x5b\x9c\xea\x73\x2e\x94\x0f\xe8\xe6\x85\x03\xa0\x0a\x77\xaa\x54\xf7\xf2\xb0\xbc\xe2\xd7\xa0\x42\x31\x4d\xa9\x19\x82\x71\x12\x05\x5a\x00\xcb\x52\x57\x80\x65\x10\xbc\xd8\x48\xbf\x08\xeb\xe5\x29\x26\xa8\x9d\xd3\x8d\xcf\xe7\xfe\x73\x1f\xfa\xd5\xcb\xeb\xbc\x41\xdf\x15\x62\x6e\x4e\xcd\xf9\xf5\x3b\xd1\x0e\x0a\xfa\x54\x6b\xdb\x00\x11\x97\xe5\xce\x48\xe7\x27\xba\xbd\xe9\xe8\x34\xab\xae\xba\xb9\x64\x52\xc7\x01\x33\xd2\x59\x4c\xfc\x22\x22\x1f\x65\x9d\x2b\x4d\xa7\xf1\xf2\x18\x04\xca\xaa\x28\xde\x46\x17\x89\x12\x16\x6f\x79\x28\x81\x2c\xd7\x6c\xbd\x6e\xb6\x2c\x71\x49\x52\x1b\x14\x0d\x01\xee\xc9\x93\x96\xbd\x4c\xed\x7e\x0b\x95\xc0\xc3\x36\x7d\x57\xd8\x36\x0b\x26\xfd\x50\x46\xdd\xd0\xf2\xb2\xa0\x35\xed\x92\x36\x1a\x30\x23\xc2\x24\xf9\x53\xf3\xe1\x60\xe5\x78\x1b\x0e\x62\xa7\x1f\xec\x1d\xca\x91\xf7\xf6\xe4\x8c\xf4\xfc\x17\x86\xb1\xbc\xa4\x58\x8e\xcd\xb9\xb0\x0b\xd3\x04\x01\xc6\x12\xd3\x69\x3a\x7d\x74\x5f\xc4\xc0\xc8\xeb\x25\x15\x5a\x74\xf4\xb6\xa7\x46\xc8\x75\x00\x43\xa1\xe3\x6f\x7d\x3e\xee\x6b\xda\x7a\x7c\xb2\x31\xc8\x64\x3d\x86\xf6\x93\x90\x09\x2d\xc1\x91\x61\x57\x6c\xf7\x5d\xd3\x79\xa3\x2a\x4f\x35\x1e\x2d\xf1\xd5\x8e\x4d\xd1\x4d\x27\x2b\xa3\xa9\xe2\xbc\x38\xdb\x61\xc4\x79\xb5\xd5\x34\x01\x86\x29\xe5\x3a\xa8\xcf\x5f\x6d\xc9\x99\x6a\xe7\x73\x16\x76\x87\x95\x1f\x94\xcf\xff\xc6\x76\x2e\xf6\x87\x48\xcf\x32\xb2\xda\xfa\xf1\x74\x4d\x91\xd5\x36\x23\x2b\x8f\xae\x2d\x2d\x0a\xd6\xf7\xde\x1c\xd7\xe3\xd3\x1c\x5a\x6f\x3f\x67\xe8\xcc\x18\x2a\x41\xbf\x74\x3a\x61\x42\x76\xbb\xf1\xb9\xaf\xd1\x5a\x5b\x21\x01\xb0\xe1\xe8\xb9\x84\xd1\xb0\xe1\x47\x9b\x5c\x30\x80\xae\xe2\xf3\x0c\xad\x1f\xc0\xc8\x92\x26\x66\x9a\x8e\x4b\x5c\x4b\xfb\x9e\x2f\xc4\x80\x32\x19\xd9\xd2\x7a\x4c\xe6\x80\xb4\x63\x04\xb9\xed\x7f\xa2\xf5\x38\x41\xb6\xb4\x4e\x23\xee\x32\x9d\x9d\xd0\x9e\x23\x10\x6a\x24\x0f\x01\x69\x4d\xf6\xde\x42\xc6\x38\x87\x0c\x6d\x4b\xa5\xff\x5d\xc2\x07\x9b\x2b\x32\xc0\x1f\x26\x53\x08\x27\x29\x10\x90\x47\xfd\x89\x22\xb9\x7d\x06\x1e\xf0\x9c\xb0\x9d\xae\x13\x41\x79\x0b\x9e\x6d\x67\x7a\xa8\xd1\xf2\x90\x35\x66\xc9\x56\x9a\x4b\x01\xe5\x4b\x56\x33\xe9\x6b\xe5\x78\x8d\x8f\x8b\xe8\x01\x99\x1c\x1d\xff\x1b\x1c\x66\xe5\xaa\x4f\xd6\xb4\x3d\x57\xd2\xed\xf2\xfc\x92\x10\x42\x30\xe0\xbd\x86\x82\x4d\xbb\xd8\xa7\x93\x15\xdb\xf5\xc1\x03\x8e\x05\x98\x72\x0a\xa7\xb0\x20\xdc\xc8\x7b\x22\x97\x0c\x3f\xe3\xf6\x06\xdf\xb9\x64\x1d\x95\x6a\xa7\x14\x25\xb8\xb9\x7d\x4e\xce\x2b\x02\x66\x8c\x6e\xc6\xee\x78\x2f\xfb\x0c\x9a\x2b\xc2\x48\xde\x08\x05\x8c\x4a\x13\xfe\x97\x4b\x06\x03\x15\x9b\xae\x63\x42\x02\x4d\x9a\x4e\x89\xe7\x86\xe9\x36\xbd\x0f\x32\x23\x1d\x5b\xd0\xae\xac\x59\xdf\x2b\x53\x4d\x41\x36\x7d\x0d\x42\x39\x39\x07\xa4\x6f\x58\x41\x37\x3d\xf3\xdb\xc0\x58\x16\xf1\x35\x5f\x2c\x31\x66\x2a\x69\xcd\x48\xb9\x61\x44\x36\x80\x02\x70\x8f\x37\x82\x70\x41\x28\xa9\x9b\xa6\xcd\xa7\x13\x20\x80\x47\x2b\x1b\x89\x53\x00\xc9\x73\x4d\xf8\x94\xf4\x2b\xde\xbe\x13\x92\xd7\x3f\xd1\x9a\x97\xa0\xd8\x20\x13\xa9\x48\x25\x59\x97\x73\xf2\x0a\x3f\x28\xe2\xbb\x33\x36\xa0\x2c\xe1\xdc\x82\x7d\xa7\xed\x0a\xe8\xa4\x0f\xe7\xc0\x17\x2c\xe5\x5c\xb9\x80\xc8\xa8\xe6\x9d\xdc\x74\x8c\xae\xb4\x3d\x76\x7c\x4c\xfe\xbe\x64\x30\x39\xde\x13\x5a\x77\x8c\x96\x7a\x9e\xac\xcc\xc9\x9b\x66\xcb\x48\x03\xfc\x20\x82\xdd\x01\x31\xd7\xb9\x1a\x12\x06\x7f\xf1\x22\x74\xe1\x5a\xf5\x18\xce\xeb\xed\x17\xf0\x31\x7d\x3b\xae\x05\x8f\x34\xe9\x94\x11\x34\x26\xe5\x23\x69\x28\x45\x9e\x51\x53\x65\x0d\xf9\xa2\x4c\xe9\xdd\x87\x34\xc6\x78\xc5\x76\x09\x97\x4f\xc0\x13\x38\x0a\x26\x83\xe1\x6a\xc2\x95\xaa\xd9\xd2\x8e\xac\xb6\xe1\x82\xd1\x3c\x01\xe9\x78\xe6\x72\x36\xb0\xef\xd9\x37\x53\x17\x87\xd2\x34\x1d\x91\x12\x8f\xc3\x90\xfe\xd9\x23\x24\xa1\x71\xfc\xf0\xb8\xd8\x38\x54\x06\x82\x33\x45\xd1\xf8\x91\x15\x4d\x57\x02\xf7\x57\x6c\xf7\x47\x5c\x7e\x2d\xe5\x1d\x1c\x0b\xac\xa9\x22\x07\xee\xb2\xac\xb7\x52\x01\x33\x56\x7b\xfb\xaf\xda\xe0\x8c\x09\xb1\x1a\xec\x6e\x30\x88\xb1\x0c\xf6\xed\x70\xaa\x11\xa0\xfb\x6f\xc6\x86\x8c\xfd\x5d\x98\x34\x34\x41\x34\x93\x1e\xb1\x43\x54\x2b\xa5\x56\xc6\x98\x74\x80\x2b\xfe\x0c\x80\x28\x56\x1b\x79\xb0\x6b\x26\x46\x0c\x68\x2e\xa2\x53\xaa\x4f\xd7\x1f\x96\x29\xae\xe2\x64\x2b\xbf\xe1\x1d\x18\x3b\x44\xbb\xd7\x23\xe1\x46\x25\x43\x7d\x57\xa0\x2d\xb2\xf5\x7c\x52\x5e\xd9\xe7\x2e\xe1\x95\xbb\xc0\x9f\xe0\xf5\x2c\xf5\x8d\xc6\x03\x11\x4b\xd7\x21\x23\xdb\x1c\xaa\x42\x30\x22\xa1\x46\x57\x56\x9d\x2f\xc2\x26\xc3\x65\x82\x15\x2e\x5c\x6f\x83\x94\x26\xbd\xd5\x1b\x47\xdd\x1f\x4c\x19\x49\x88\xb9\x36\xf3\x29\xba\xcd\xa9\xe9\x80\x56\xd2\x1f\xb0\x5a\x79\x96\x91\xa0\xb1\x7e\x3a\x68\x5d\x03\x79\xe3\xd6\xfa\xe9\xa0\x75\xa1\xec\x7b\x2e\x77\x71\x7b\xfb\x1c\x7a\x6c\x81\xe8\x8f\x0b\x32\x40\x8e\xad\x68\xe5\xfc\x99\x00\x97\xae\xfa\xd7\x41\x23\x14\xeb\x71\xcb\x35\x6c\xa3\x5e\x02\x4f\xcd\x77\x0c\x12\x20\x5e\x88\x38\x3c\x30\x7b\xb2\x39\xd5\x5a\x93\x21\xc9\x21\x76\xe0\x19\xbd\x5b\x65\xea\x22\x8c\xcc\x1b\x32\x8d\xf7\xf8\x71\x68\x01\xd5\xc0\x40\x8f\x28\x69\x98\x14\x45\xad\x87\xd0\xe2\x28\xf5\xf4\x20\x96\x41\xe8\x3a\x23\x5f\x37\x4d\x9d\x41\x0e\x3f\xd3\xf9\x55\x9b\x23\x32\xa9\x56\xd0\x5d\xfe\xd0\x03\x57\x23\x6f\x65\x17\x86\xb2\x31\x86\x77\x04\xab\xe5\xdb\xae\x6b\xba\x7b\x9b\x89\x79\xdd\x88\x2d\xeb\x94\x58\xae\x1e\xc6\x03\x92\x36\xca\x35\xac\x75\xa2\xb5\x1f\x7d\xc1\x95\x96\x77\x4d\x92\x92\x0f\xfa\xdb\xd1\xd3\x62\x98\xaf\x9b\x76\xe7\xea\xd4\x74\xbc\x52\x6b\xa7\x12\x56\x66\xd9\xcb\x7c\x05\xdd\x40\x55\x94\x2b\xb5\xdb\x60\xfd\xd6\xd1\x91\xfe\x1a\x17\x23\xed\x99\x70\xab\x96\x49\x69\xa6\x8b\xc0\x6c\x31\xd8\xbd\xae\x48\x5b\x6f\x7a\xf9\x35\xfb\x33\xb8\x86\xf4\xa6\x66\x09\xb6\x76\xaf\x5c\xf5\xeb\x74\x3a\xe9\x01\xc7\xbe\x2b\x2c\x8e\xa0\xe7\x80\x57\x6a\x40\xac\x0d\x06\x1d\x17\x22\xde\x47\x88\x7b\x5d\xce\xd4\x4b\x5c\x4d\x5c\x2c\x60\x96\xbd\xcc\x47\x17\x1c\x44\xc2\x71\x41\x3e\xf3\x20\xdc\x4f\x27\x4f\x21\x45\xbf\x72\xa7\x13\x26\x6a\x0e\x23\x13\x1c\x81\xac\x0c\xda\xfe\xcd\xa6\x97\x6f\xa8\x2c\x96\xc9\x80\xc0\x01\xb2\x58\xd8\x17\x2c\x4b\xa5\x8f\xcb\x5e\x6a\xc7\x56\x35\x0f\x36\x83\x11\xa6\xfc\xe4\x2f\x36\x93\x7b\x0f\xc7\x49\x71\xd5\x61\x63\x3d\x88\xde\x56\x34\x83\xc2\x1d\x27\x1a\xc4\xee\x4c\xd1\x20\x11\xf2\xbe\xce\xd0\x83\x28\x60\x21\x7d\xf6\xed\xaa\x5a\x1b\x70\xb1\x40\x2a\xfd\xe4\x54\x82\x3e\xee\xea\x2f\xc3\xf1\xee\xba\xb6\x6c\xbc\xb7\x59\x54\x60\xf1\x59\xfd\xe1\x76\x65\xb5\x60\x75\x2d\x4e\x14\x25\xe7\x95\x5e\xb6\x58\x84\xf3\xc8\x4a\x82\x67\xb9\x1d\x60\x96\x91\x97\x6e\x4d\xc1\x20\x47\x47\xbe\x1a\xf8\xf1\x02\xaf\x48\x18\xa9\xdc\x89\x40\x9d\x92\x82\x0a\xd1\x58\x07\x18\x4d\xed\xe6\x46\x52\xf0\xdb\xaa\xae\x51\xb6\x8c\xad\x16\xc7\xcc\xb1\xf2\x55\xe1\x94\x85\xab\xf3\xf3\x06\xc7\x03\x1a\x0e\x81\xad\x0e\xd4\xe3\x73\xb4\x23\x66\xfe\x5c\xb6\x8e\xb1\xae\x30\x17\x0d\x12\x9f\xbd\x1e\x05\xe3\x78\x69\x68\xc4\x28\x89\x71\xf6\x4e\x70\x9e\xc7\x63\xf7\x01\x70\xae\xf3\xd8\x59\x20\xae\x3a\x7d\x7b\x72\xee\xf9\x9a\x4a\x95\x7a\xf0\x40\x5c\x7e\xdb\x70\xb7\x67\xbe\x02\x19\xdf\xe2\x11\x06\x57\x50\x6d\x8e\x0f\xfc\xe7\x77\xe7\xff\xfb\xcd\xb7\xff\x39\x0b\x02\xbd\x3e\xe9\x9b\xd6\x1e\x02\xd8\x1a\xfd\xef\x27\xa7\x86\x9c\x3c\x1b\x17\xa5\x53\x5b\x6a\x8d\xc5\x8c\xae\xfa\x68\xd3\x43\x2d\xaa\x1a\xf9\x07\xda\x49\x4e\x6b\xb5\xc3\x9a\x5c\xd5\xcf\x19\xf9\x19\x12\x67\xf6\xcc\xea\x8f\xac\x60\x7c\xcb\xba\xa4\x69\xa1\xdc\x96\x0b\xb5\xb7\x82\x31\xf9\xd5\x57\x0e\x91\xcb\x25\xaf\xa0\xfc\xbc\xd8\x82\x79\x1e\xd9\xb4\xe3\xb2\xa3\xda\xc6\x56\xae\x12\x10\xf5\x02\xe5\xe1\xb7\xce\x7f\xed\xcd\x27\x54\xc2\xb0\x9a\xb6\x6d\xad\x34\xb7\x42\xc2\x03\x9c\x42\x26\x26\x34\x0b\xb6\x50\xdc\x90\xa4\xfb\x6d\x83\x30\x31\x13\x9a\x06\x63\x69\x1a\xbf\x52\x0b\x41\xf4\x89\x2b\x7f\x37\x69\xeb\x38\x69\xfd\x83\xec\xb4\x5d\xe4\xdb\x4c\x68\x6b\x65\x83\x7a\x00\xbc\xf0\x67\x98\xe2\xc7\xfb\x95\x26\xa3\xc8\xbc\x6e\xd6\x2d\xed\xd0\x02\x78\x14\x1d\x3d\x3c\x9a\xcf\xfa\x60\x6e\x38\xc6\x68\x9d\x82\xf1\x0c\x73\x7f\xb0\x81\xa9\x19\xd7\xdf\xcb\xfc\xed\x66\x0d\x95\x1e\x7e\xf1\x3d\xec\xd4\x32\xc7\xe7\x3c\xc5\x02\x9e\x60\x12\x26\x31\xe7\xa3\x85\xa6\x71\x50\x34\x0b\xc4\x1a\x21\x08\x4a\x3d\x56\xe5\x42\x56\x06\x1f\xa4\x26\x8b\xec\x99\x25\x7e\x7d\xd3\x64\x22\x25\x7a\xaf\xc1\x99\xe9\xd1\xec\xaf\x23\x8c\xcc\xcd\x70\xb8\x2a\xfc\x23\xec\xf9\xe0\xec\x9d\xae\x09\x7e\xa5\xeb\x47\xc9\x57\x78\x98\x44\x77\x1a\x2b\x19\x3d\xd5\xd8\x13\x2e\x4a\x76\x07\xa5\x97\x4d\x85\xd9\x4c\xbd\x8b\xb4\xde\x21\xf6\x2b\x7e\x3d\x9d\xb4\xa6\x1c\x4d\xe6\xe6\x28\x4d\x9b\x63\xb1\xd0\x64\x0d\x15\x6a\xe4\x8c\x40\xa3\x1c\x4f\x74\x4d\x27\x15\x18\x1f\x4e\xea\xa7\x70\x59\x09\xc2\x30\xc7\x55\xda\x7c\x8d\xee\x40\x25\x1f\xc9\x8f\xaf\x75\x1e\x2e\xb8\xe5\x01\xd3\xcc\x2f\x33\x32\x7f\x01\xc5\x7e\x32\xe7\x02\xf7\x16\x2e\xdc\x99\x19\x2e\xf0\xa8\x8c\x12\xa5\x9f\x61\x89\x7b\xe5\x7d\xd8\x05\x43\x34\x51\x1f\xda\xa1\x03\x1d\x5d\xe5\x60\x07\xd5\x43\xc2\x49\xbc\xd4\xc1\xef\x30\xc5\x61\xe1\x37\x36\x89\xad\xe0\xd8\x11\x9a\x0d\x44\xac\xa5\x66\x31\xf4\x09\x4b\x89\x33\xd5\xfb\xbc\xff\x49\x17\xaf\x82\xf9\xb8\xd6\xd5\x87\x64\x2d\xa7\xf6\xc8\xc9\xc1\xcb\x9b\x46\x6e\xe1\x8a\xee\xe0\x4a\x1f\x3b\xac\x82\xfb\xc3\x6f\xa8\x95\xf5\xa6\xe1\xea\x03\x5e\x5e\x3b\xf1\x57\x6f\xdd\x61\x98\xc3\x5a\xfa\x6a\x7e\x7a\xad\x35\xf5\x1a\x0a\xa1\xc9\x99\xd6\xd5\x6b\x69\xaf\x31\x1b\x6a\x69\x11\xa6\xcf\xd5\x4e\xb8\x46\x22\x90\x33\xc2\x5d\x75\x98\xd3\x04\x76\x7b\x36\xdb\x5c\x74\xe5\x19\x6c\xd6\x5e\x2d\x89\x7f\xcc\x26\x7e\xe1\x05\x0a\xf6\xee\x4f\xc6\x9d\x1d\x58\x74\xe8\x55\x3a\x83\x6e\x6f\xea\x0d\x00\x44\xc9\x37\xac\x3e\xaf\x75\x4a\x20\xc8\x5c\x83\x25\xf5\x16\xa2\x4d\xca\x7e\x35\xcf\x83\x43\x01\xd8\xcf\xdb\xbd\x51\xab\xea\x7d\x21\x98\x26\xbc\xf0\xca\x82\x32\x57\xe3\x14\x85\x0f\x7c\x43\xd1\x62\xb3\xe4\x8b\x25\x84\xb1\x5c\x0c\xa8\x79\x8f\xe1\x1c\x7d\x17\x4e\xb3\x6e\x6b\x76\xa7\x00\xeb\x8f\xf3\x93\x2f\x9e\x0a\xbd\x63\x78\x7e\xc1\x3d\xe1\x6b\x38\xb6\x6f\xc1\xbb\x9b\x18\x0c\xc9\xce\xce\xf6\x10\x25\x8e\xd3\xed\xc1\xc0\xb5\xc2\x36\x36\xd8\xa3\x2f\x28\x18\x24\x3b\x47\x31\xf7\x82\x6c\xa6\x4b\x1c\x67\xdb\x8e\x06\xd9\xa2\xd6\x36\xce\xb6\x1d\x0d\xb2\x45\xad\xbd\x38\xdb\x76\x4f\x90\xcd\x4c\xda\xe4\x59\xed\xd6\x7a\x40\xc4\xfd\x38\x4a\xe4\xfc\x8d\xaf\x86\xe1\x6a\xc4\x24\xf6\xdf\x9b\xa4\x68\x84\x64\x77\xd2\x9a\xd3\xca\xe8\x37\x1e\x81\xa4\xdd\x82\x0d\x7d\x80\xc3\x86\xf6\x41\x97\x49\x8f\xe6\xdc\x25\xbd\x04\x8c\x45\x54\x42\x44\xb8\xde\x79\x81\x14\x08\xf3\x20\x4f\x4f\x31\xb1\x72\xb1\x65\xdd\xfb\x8e\x4b\x3c\x1e\x46\xfa\x06\xb3\x9f\x72\xc9\x76\x64\x4d\x65\xb1\xcc\xb1\xdd\xa5\xda\x5c\xd7\x6c\xdd\x74\x3b\x52\xd3\x1d\x6c\x0c\x7d\x43\x44\x43\x96\xb4\x5b\x93\xb2\x11\x4c\xb5\xc4\xed\x56\x4f\x24\x51\xff\xff\xb9\x2c\xbb\x0f\x56\x67\xb8\xe8\x14\x18\xa4\xd8\xe3\x83\xde\xa0\xcb\xde\x9e\x96\x8b\xcf\x14\x69\xc4\xb1\x3c\x0f\x54\x25\x4c\x91\xab\x45\x07\x3a\x38\x9e\x9a\x32\x87\x90\xe2\xde\x31\xa5\x89\x79\xe4\x17\x67\x96\x70\xce\xd5\xe4\x20\xff\x02\x37\x82\xfe\xf5\xf2\x94\x5c\xae\x78\x0b\x09\xa7\xed\xa8\x59\x05\xfe\xf5\x79\xff\x96\xd7\x49\x4a\x20\x02\x41\x25\xa0\x82\x70\xdc\x3f\xf4\x98\xdb\x5e\x76\x8c\xae\x73\xeb\x2c\x92\x1b\x56\x37\xef\x49\xd9\xb0\x9e\x28\x77\x1b\x8c\xa3\x0c\xca\xdf\xb9\x24\x82\xb1\xb2\x8f\x21\xc9\x86\x74\x1b\x91\x91\x05\xdf\x32\x41\xb8\xec\x49\xb1\xe9\x65\xb3\x76\x64\x80\xeb\x47\x15\x1f\xee\x80\x0d\x51\x10\xc2\xdc\x98\x81\xe4\x51\xd4\x7e\xbb\x59\x6b\x23\x2f\x75\x4e\x9d\xae\xff\xb4\xc7\xbe\x12\xa4\x5a\x4a\xce\xc8\xdd\x74\xe2\xa7\x93\x26\xd6\xf3\x05\xea\xdf\x19\x29\x4f\xc3\x55\xe7\xb1\x10\xdf\x67\xc3\xf2\x4a\x8b\x66\xaa\x6f\xea\x38\x3e\x26\xdf\x51\x5e\xb3\x32\x9f\x6a\xc3\xd1\xac\xae\x17\x64\x76\x6a\xc2\x12\x95\xab\xc1\x47\xcd\x6f\xec\x05\x38\xd8\xc0\x91\xb4\xd4\x2e\x00\x45\x42\xdb\x01\x0e\xbf\xda\x74\x94\x3e\x90\x5d\xd0\xba\xfe\x9f\xac\x6e\x59\x47\x86\xdb\x93\x7a\x89\xf7\xa2\x69\x92\xa6\x39\x1a\x21\x79\x9e\x07\x07\xe5\x3c\xbb\x63\xa0\x2d\x5e\xd3\x36\xb1\x01\xd6\x15\x2e\x17\x13\xb9\xb4\xf9\x90\xfb\x3d\xee\x0a\x4e\xf2\x7b\x26\xac\x93\x82\xce\x97\xdd\x2a\x6c\x3b\x1b\xb0\x88\x15\xa5\x17\xe7\x7a\x34\xc0\xf4\x9a\xb6\x3a\x3a\xad\xc9\x73\xdb\xe3\xb4\x7e\x90\x5d\x74\x21\x58\x4c\x2b\xaf\xa5\x52\xce\x48\x85\xf7\x1d\x6d\xff\xda\xbb\x7b\x58\xcd\x61\xe2\x20\x2d\x34\x62\xd5\xa8\xa6\x90\x9a\x72\xa3\x07\x86\x8b\xc6\xc0\xbe\xb5\x3b\x56\xa0\xd2\xb7\xde\xe5\xb1\x1b\xf1\xfb\xe0\x62\xb7\xa6\x46\x17\xf2\xec\x43\xc0\x09\x84\xce\xc7\xd8\x9d\xc0\x4f\x8a\x19\xd1\xf0\x53\x62\xc1\xcd\x62\xda\xf4\xf2\x23\x1f\x9e\xb1\x70\xc0\xbe\xf2\xf3\xb9\xf6\xdc\x26\xac\x5a\xed\x1f\xf9\xcc\x1d\x37\x3a\xd2\xbd\x09\x41\xb7\x41\xeb\x43\x9a\x9e\xce\x4f\xa7\x83\x4c\x96\x53\xa4\xfb\xb1\x1a\x9b\xa8\x71\x6b\xf5\x49\xb1\x81\xbb\x86\xdb\x41\x1a\xef\x4b\x3a\x20\x3a\x2c\xf2\x56\x7b\x55\xb8\x25\x49\x99\x7b\xe7\x88\x06\xdb\x92\x7e\x3d\xb0\xed\x43\xd9\x32\x8d\xa0\x10\x6d\x60\xf3\x3f\x2d\x57\x84\xeb\x51\x89\x8a\x4b\x17\x0d\x45\x49\x87\x1e\x86\x27\xc7\x8d\x1c\x41\xc6\xc3\x59\xfe\x8f\x0e\x08\x00\x95\xc5\xa5\xfb\xeb\x20\xb3\x21\xbc\x3b\xff\xb2\x9f\xf6\x1c\x4f\x34\x27\x3c\x25\x5f\x61\x0d\x3e\x1c\x37\x95\x32\x37\xc7\xe2\x46\x83\x03\x30\xf2\xde\xd8\x80\xef\x76\x0e\x0c\x5c\x73\x6f\xc2\xa3\x1e\x25\x0c\x71\x7a\x46\x8e\x2c\x32\x10\x66\xd0\x0b\x00\x9e\x28\xb0\xd3\xe9\x88\x5d\x73\x29\x79\xb1\xda\xfd\x78\xe1\x6c\x9b\x0f\x46\x84\xd2\x91\x7c\x1b\xa6\x71\x10\x24\x04\x28\x82\x3b\x5c\xee\x71\x1d\xe0\x6b\x73\xb3\x98\x59\x0e\x4e\x1c\xe1\x9c\xdc\x8f\x17\xd1\x26\xec\xde\x1b\x9c\xdc\x7d\x57\x60\x06\x41\xa4\xc1\x9f\x22\x62\x00\x77\xd6\x7c\x09\xef\x9f\xc1\x51\xbe\xa3\x23\xc2\x9d\xc9\xc9\x2b\x45\x5b\xec\xbc\x60\xf2\xaf\xea\x73\x22\xe9\x22\xfd\x52\x3f\x7f\xa6\xcf\xff\xe9\x7a\x74\x9d\x4f\x86\xd2\x02\x94\xc3\x97\xa9\xf5\x5d\xf2\x3d\x5a\x73\x32\x99\x34\xe1\xb2\x8e\xb5\xe7\x24\x56\x08\xa0\x60\xc6\xc3\xfd\x5e\xba\x1c\x36\x00\xec\x3d\x12\x64\x3f\x78\xde\x3f\x0a\x63\xb8\xeb\x43\xd8\x2c\x23\x0d\xe0\x07\x04\x08\x4e\x15\xa5\x29\x79\x30\x17\xa5\xed\x1b\xf0\x2e\xd8\x58\xee\x49\x03\x9e\x0d\xc0\x1a\xa9\x20\x63\x77\xfe\xb8\x77\xe1\x60\xde\x68\x03\x95\xe2\xdc\xb9\x91\x78\x80\x47\x78\x64\x95\x29\x81\xf5\xaf\x70\xd3\xc2\xd3\x1f\x72\xea\x41\xb6\xaa\x3a\x0e\x07\x1c\x1d\x45\x87\x59\x6c\xba\x35\xba\xbc\x62\x10\x7e\xf8\x24\xee\x7e\x14\x6b\xe3\x1d\x3f\x23\xbd\x77\xdf\x89\xa1\xe8\x13\x99\xd7\x7b\x17\xa7\x0c\x8d\x89\x8c\xdc\x59\x88\x43\x06\x8d\x5d\x8f\x00\x9d\x0e\x63\xa8\x7a\x3b\xff\xd3\x5f\x93\xb6\x26\xde\xa5\x7f\xd4\x92\x94\xc1\x2a\x3d\x3e\x86\xca\x4f\x52\x33\x5a\xaa\x46\x7d\x4b\x0b\xa6\x16\x3a\x04\xb6\x6d\x94\xfb\x15\xde\x02\x44\x17\x10\x83\x91\x74\x01\x27\x6b\xce\xc8\x7f\x90\xff\xd0\x46\xff\x8b\x17\xc6\x52\xa0\x0b\x72\x86\x4d\x4e\xaf\x8d\xd3\xb5\xb0\x07\x83\x83\xea\x0f\x8d\x40\x41\x85\x32\xc2\x8b\xa6\x46\x47\xe5\xf8\x98\x50\xc4\x84\x34\x1d\xa1\xe4\x9f\x9b\x46\x32\xa8\x00\x25\xfd\x4e\x48\x7a\x87\xa9\x24\x40\xf3\x51\x2c\x9f\x21\x96\xe1\x83\xd3\xf8\xc1\x6c\x30\x0f\x5e\x11\xfe\x62\x6e\x62\xd6\x00\xf4\xc3\x87\x08\x86\x79\xf0\x62\x1e\x42\xf1\xeb\x5b\x4c\x78\x1a\xb9\xa0\x00\x5d\x9d\xf2\xeb\x34\xa4\xd4\x8b\xf9\xe9\xb5\x4f\x0d\x98\x71\x69\x38\x27\x1b\x52\x71\x51\xa2\x7f\xa3\x67\x3d\x7f\x7c\xd6\x76\x4e\x95\xcf\xb1\xff\xfa\x2f\xfd\x58\xcf\x55\x5f\xb6\x1c\xcc\x3b\x98\xf5\x60\x46\xff\x44\x3f\x2b\x9e\xd3\x8b\xf9\xbe\x59\xf9\x87\xc3\x6f\x7b\x2d\x05\x5b\x4c\x7e\xff\xac\xe1\xc0\x01\xf4\x77\x02\x26\x9e\xe0\x08\xa9\x67\xf7\x99\xa9\x07\x0b\x65\x36\x1b\x31\x77\xf4\xfe\x1e\x99\x3b\x8f\xd9\xcf\xd6\xa7\x32\x56\x8c\xbd\xec\xe3\x80\x01\x19\x65\x37\x20\x23\x29\x65\x5e\x33\x91\xfa\xb5\x1e\xce\x7e\x01\xa0\x7b\xec\x17\xdf\xcc\xd6\xd6\xe1\x68\xec\x64\x68\x56\x8c\x24\xf3\x7c\x23\x63\x3a\x99\xd0\xc3\x4a\xfb\x37\xd3\xda\xbf\x6e\x53\xfe\x95\x7a\x9b\xba\x7b\xa7\xed\x46\xf8\x44\xbd\x4d\x83\xf3\x70\x87\x35\xf7\xd8\xde\xfa\xb0\xd7\xe9\x39\x88\x26\xea\xee\x41\x51\xe3\x98\xef\x16\x66\xd1\xfa\x28\x32\x8a\xee\xfb\xb8\xcc\x61\x8d\xe4\x21\x99\x33\x76\xbb\xb9\x00\xe3\x80\xc4\xef\x91\x4f\x23\x8d\x91\xfb\xf4\xb8\x60\x72\xf2\xc2\xcd\xc6\x44\x85\x4d\x30\x02\xc5\xb6\x0f\x03\xcc\xff\x96\xd6\x7f\x0d\x69\xb5\x65\x8f\x3d\x9e\x6c\x7f\x0e\x8e\x9f\xb2\x37\x02\xb5\x32\xcc\xfe\xf6\xb2\xdb\x27\xa9\xb8\xdb\x1d\x10\x55\x5f\x1b\x06\x62\x05\x05\x77\xc1\x75\x6a\xd3\xc9\xa4\xd0\x5b\x0b\xf8\x6f\x21\xb3\xed\x75\x5a\x03\x96\x1f\x15\x9f\xe4\x84\x03\x95\x0e\x79\xe1\x36\x40\xf3\x0d\x95\x34\x49\xc9\xd5\xc9\xb5\x77\xba\x14\xe1\xe3\xaf\x55\x81\x88\xcd\x82\xf6\x26\x68\xd9\x6f\x5a\x73\x21\xe7\xce\x46\xa5\xfd\x83\xad\xde\x78\x3a\x78\x12\x95\x48\xec\xdd\x00\xa1\x72\x63\x7f\xc4\xf0\x50\x11\xf8\x34\xfc\x11\x88\x3d\x7d\xa3\xa8\xe9\x92\x8a\xb7\x5e\x67\xf3\x53\x0a\x4f\xea\x2c\x97\x5d\xf3\xfe\x2d\xaf\x35\xcf\x80\x21\x16\x52\x58\xe6\x31\x00\x14\x2f\x30\x1d\xfc\x1e\x06\xd1\x9e\x84\x89\x8b\x9d\x99\xab\x06\x40\x9a\x34\x62\xe3\xb1\x57\xb3\x1e\x21\xb8\xfe\x91\x52\xa6\x98\x7a\x48\xca\x20\x08\x6c\xe2\xc8\x4f\xb2\x79\xfc\x0a\xe6\x21\xae\xf6\x50\x41\xb4\x47\xed\x8b\x28\x87\x1b\xd2\x63\x82\xa1\x3b\xdd\x6c\xaa\x8a\xd9\x7c\xe5\x28\x88\x90\xa9\xfb\x0e\x46\xf8\xe5\x7c\x0e\xf3\x8f\x21\xf0\xf7\x4c\x1c\x22\xaf\x51\x12\xc1\xc9\xf0\xc7\xc8\x8c\xc1\x78\x28\x8a\x82\x45\x36\x10\x91\xbd\xc1\xce\x97\xa1\xb2\x1e\x91\xa1\x68\xf5\x3c\x15\xd2\x3c\xe6\xe7\x27\xa0\x10\xec\xca\x1e\x42\x1f\x43\x6e\xef\xac\xce\x3e\x92\x2b\x87\xfa\xce\x7c\xb9\x9f\x4e\xb6\xa3\x95\xe0\x77\xc3\x1a\xe9\xc9\x1d\x39\x23\x77\xb9\xcd\xc3\xba\xbb\x8e\x30\x19\x9d\xc3\xfe\x26\x78\x9d\x3e\x52\xc8\xb0\xaf\x88\x20\xfa\xf5\x9d\x50\x3b\xa2\x60\x16\x58\x7a\xbd\xcf\xf2\x1e\x7b\x73\x07\x6f\xf6\xfc\x62\xc8\x63\xc5\x14\xfb\x6a\x43\xa3\xa4\xdf\x9d\xfd\x29\xa4\xb1\x5f\x61\xf0\x4e\x47\x7c\x3c\xe2\x26\xdd\x1a\xdd\x69\xf1\x34\xc4\xef\x82\x8b\x28\x9c\xd8\x81\xcf\x07\x1d\x80\xa5\xad\x77\x47\x6f\x20\x28\x5f\xef\x24\xeb\x93\x3b\x72\x75\x0d\x17\x53\xef\x17\x17\xf3\x14\xeb\xc9\x53\xaf\x48\x26\x2c\xe5\x7f\xa6\x4b\xf9\xf7\x97\x48\x9b\x51\xcd\xad\xaa\x6a\x60\xff\x36\x43\xff\x88\xd2\x80\x62\xfe\xc0\xba\x54\x17\x23\x33\xb6\x34\x47\xa3\x13\xbc\x34\xb5\xfe\xe5\x65\x74\xfa\xc9\xab\xcb\xc0\xb3\x48\x83\xca\x0c\xd7\x6d\x70\x06\xca\xeb\xe0\x57\x67\x0c\x7a\xb8\x73\x50\x5e\x0f\xbf\x42\x63\xd0\xc3\x3f\x0b\xe5\xf5\x09\xab\x34\x90\x4c\x67\xc4\xf5\xd6\x97\x36\x3e\x45\x6e\x7a\xe4\xe2\xa8\x4c\xbc\xa6\x6d\x22\x30\x18\xf0\x74\x71\x38\x18\xe4\x8c\x2a\x97\x78\x45\x04\x79\xb5\xcf\x25\xfb\xf0\x81\x08\xf2\x95\x7d\x1b\x67\x5c\x47\xb3\x1c\x48\x0b\xd3\x34\xb0\x84\x09\x17\x7a\x52\x5a\xbc\x04\x7b\x7f\x48\x0c\x06\x22\x60\xda\x0f\xf8\x3f\xe4\x7d\xd4\xd4\x31\x7e\xc8\xf4\xa8\xa9\xc7\x71\x31\x7a\x07\xc0\x18\x13\x0d\x8c\x3d\x7c\x54\x96\xcd\xff\x0b\x3e\xbe\xfc\x15\x2c\x43\x8a\x8c\x31\xec\x7b\x7b\x53\xf2\xff\x07\x86\x89\x83\x1c\x1a\xce\xf3\xb7\x61\x19\x5c\x60\xcd\x33\x72\x1b\x45\xe2\xb6\xb4\x23\x09\x6c\x3b\x70\x91\x8c\x0e\x2a\xe8\xab\x8d\xfb\xe8\xa6\x07\xaf\xfc\x81\x8b\x32\xb2\xb0\xd4\x93\x41\xfc\x2e\xdc\xca\x21\x28\xe1\x8a\x58\xc6\x55\x38\xde\x2d\xdd\x9b\xcb\xb1\x37\x82\x96\x65\xc7\xfa\x1e\x8a\x43\x5c\xd8\xe1\xe1\x23\xa3\x83\x05\xfc\xdc\x84\x17\x13\xd4\x53\x3d\x73\xd7\x94\x62\x18\x05\xf4\xdf\xc8\x19\x48\xcf\x9c\x1d\x04\x89\x10\x10\x0c\xa6\x7b\x07\x11\x23\x1c\x7b\x9f\x08\x7f\xb2\x13\x7f\x4b\x5e\x11\x8e\x1f\xbe\x3a\xe8\xcc\x47\xa4\x45\xc7\x7e\x24\x12\x75\xd3\x6c\x84\xfe\x79\xa7\xb8\x36\xe8\xa2\x4a\xc0\x77\x3f\xbd\xbd\x4e\x3f\xd2\x19\x37\xc7\xb1\x94\x84\x3c\x78\xc7\x86\x46\xa7\xb1\xe7\xd6\xf1\x11\xd9\xd8\x83\xf9\x47\xdc\x43\xde\x6f\x6e\x7a\x8d\x5b\x9f\x11\xb5\x38\xe2\x32\x88\x3d\x0b\xe9\x33\x58\x49\x19\x59\xfd\x7b\x31\xfd\x0b\x2e\xa6\x8f\x96\xcd\xcf\x9e\x22\x9c\x2b\xf2\x8a\xdc\xe2\x87\xa7\x48\xe9\x67\xbf\xa7\x98\x66\x64\xf5\xb8\xa4\xbe\xae\x9b\x5e\x1f\x68\xb1\x3b\xb1\x72\x7e\xbd\x9d\xd9\xf7\xcf\x86\x27\x29\x55\xff\xd0\x8d\x37\x25\x66\x3d\x53\xd3\xdd\x5b\x83\x87\xaf\x3f\xb1\x0a\xaf\x58\x52\xd1\xb1\x62\x3b\xbc\x88\x2d\x23\xe2\x06\x02\x68\xe3\x57\x4f\x25\x38\x2c\x2b\x33\xd2\xe1\xd9\x34\xf3\x43\x39\x6a\x21\x35\x6b\xfc\x45\xd0\xab\x6b\xff\xc8\xc1\xfd\xfd\xc8\xef\x96\x2c\xd3\x07\xac\xa6\x17\x37\xe8\x59\x42\x5f\x7b\x1e\x03\xbe\x66\xc1\xc9\x85\x7b\x5d\x73\x83\x18\xfc\xc8\x60\x24\x9f\x48\xd8\x29\x35\x50\x8f\x8e\x88\x6d\xaa\x23\xba\x2f\x8d\x3d\x73\x76\x46\xe6\x7e\xce\x1d\x5c\xc3\xcc\x1d\xc2\x9a\x28\xe2\x04\x43\x38\x20\xf3\x71\x5b\xc1\xbb\x5c\x0b\x2d\x05\x0d\xc2\x0e\x9d\x06\xc7\x9a\xe2\xf7\xf3\xe1\xaf\xa7\x2c\xa9\xe8\x81\x16\x43\x1e\x0d\x59\x63\xf9\xe6\xc2\x9f\x1f\xc7\x8e\x3d\x3e\x74\x68\x32\xfe\xcb\xf1\x6c\xef\x69\xb1\x0e\xe1\x24\xfa\x6f\x4f\xae\xae\xbb\x8d\x90\x7c\xcd\x2e\xe1\x01\x5c\x42\xd8\xf4\x4c\xe0\xcf\x23\xc0\x8f\xed\xfe\x6d\x44\x94\xf5\x31\xa3\xe1\x5d\xe6\x06\xb0\x77\x81\x7e\xef\x5d\x43\x69\x86\xf5\xa2\x29\x38\xf0\x37\xbc\x4b\xfa\x1c\x4a\xc0\x6d\x44\x45\xbf\xf1\x82\x07\x30\x3e\x5e\xe5\x19\xd2\x33\xec\xf2\x23\x2b\xb6\xd8\x7e\x39\x72\x87\x9a\x1f\x71\xd6\x75\x4c\x83\x13\xb4\x79\xb1\x34\x97\x52\x45\xaf\x5e\x9a\x13\x14\xc5\x72\xf4\x8e\x07\xe8\x6a\x93\xe9\xfb\x10\x2e\x96\x11\xca\x97\x4c\x94\x4f\x45\x79\xec\xaa\x94\xdf\x71\x22\x7b\xaf\xb3\xe8\xf3\x91\xbb\xf3\x1e\x9d\x38\x2c\x53\x77\xa6\xf1\xf1\x35\x50\x8c\xa9\x9b\x97\x36\x2a\xcc\x2b\x4f\x84\x8c\x80\x5d\x15\xd7\x28\x4c\xf0\xeb\x18\x46\x26\xf4\x3a\x39\xa8\xc3\xc6\x7e\x8a\xd1\x03\xfa\x24\x85\x66\x7f\x44\x6a\xbf\x3a\xf3\x16\x68\x61\x34\xac\x59\xa4\xdf\x30\xd6\x7e\xfb\xcf\x0d\xad\x13\x3a\xcf\x08\x3d\x09\x7f\x65\xc5\xe8\x31\x3e\x1f\x77\x69\xa9\x9a\x05\x3f\xd9\xf3\xf2\x44\x1f\xc5\x9c\xc3\x3d\x4e\x27\xbe\xe6\xc0\x33\xb8\x0f\xde\x7b\xc1\x6b\x48\xd8\x9d\xf8\x5f\xe6\x7b\x0e\x5d\xf1\x93\xb1\x17\x87\x34\x53\xc9\x58\x8b\xe6\x91\x9a\xec\x5f\xfb\xc4\x58\xfb\x74\x9e\x66\xd6\xf4\xa7\x27\xa9\x0e\xce\x1a\xfa\x0c\xfa\x6d\xe7\x19\xd9\x9e\x98\x4b\x14\xb6\xbc\xe7\x92\x95\x4a\xbf\x9f\x5c\xc7\x3b\xb5\xa5\x5e\x45\x9e\x6d\xe7\x70\x72\xb1\xe6\x25\x86\x67\x9e\x6d\x4f\xbc\x07\x1e\xe6\x61\xcb\xa3\xa3\xb0\xa5\x3d\x00\x37\xd7\x47\xaf\x15\x35\xb6\x27\xe6\xcb\x28\x05\x82\xe6\xfb\xcb\xc5\xa3\x8c\xae\xd7\x2a\x53\xfd\xad\x71\xa4\x40\x1c\x6c\x7b\xe2\xc7\x53\xbd\xc3\x40\xdb\x79\x7c\x50\x5a\xa7\x82\xdc\x8f\x87\x64\xd1\x41\xe7\x9f\xf5\x75\x91\x4e\xab\x1b\x82\x9b\x12\xa3\xed\x1c\x03\xb4\x67\xd8\xf0\xea\xe5\x35\x1c\x87\x39\x09\x9f\xce\xaf\xc3\xf3\xce\x28\x7e\xee\x4c\x96\x81\x6a\x37\x52\xfd\x20\x23\x03\xb6\xde\xe3\x88\x99\x1e\xe3\xe1\x89\x73\x0c\x72\x1e\x73\xff\xf0\xa3\xbb\x26\x19\x5f\x99\x7c\x08\x32\x36\xc8\x8e\x8c\x1e\xd7\xd6\xdd\xfc\x7c\xa1\xc7\x82\x47\xe6\x4d\x3b\x22\x94\xe3\x31\x37\x07\x39\x30\x20\x85\x63\x63\x5a\xcf\xcf\xcb\x98\x81\x1f\x46\x0e\xa2\x8b\xe8\xf4\xf9\xc8\xca\xb1\x59\x7d\xa0\x9e\xf7\x05\xa9\xfd\xc8\xa1\xf4\x70\x12\xc3\x3c\x45\x48\xbe\x0f\x1f\x06\xe4\x33\xd9\x24\xd7\x08\x45\x45\x7f\x0b\x47\x19\x43\xdf\x5c\x62\xb3\x3d\x71\x1f\x35\xea\xe1\x41\x82\x5f\x05\xc3\xbf\x56\xca\xb2\xc7\x1d\xf2\xff\x44\xd2\x9b\xab\x00\x60\x64\xef\xcb\xa7\x92\x5e\xe7\x46\x1f\x95\xd9\x11\xc9\x79\x82\xc0\x86\xf2\x6a\x44\x15\x6e\x60\x05\x72\xbc\xa1\xed\xdf\xd8\xae\x37\x12\xab\xac\x41\xf5\x32\x7d\xb2\xe4\x9a\x9b\x63\x51\xab\x00\x60\x53\x1f\x08\x7b\x1d\x8e\x81\x22\xba\xd2\x96\x50\x0d\x1b\xdd\xf6\x24\x7e\x03\xfa\x9d\xd6\x03\x0d\x4f\xeb\x93\xe8\xd1\x90\x31\xb4\x9e\x83\x91\x72\xf2\x2b\x58\x11\x57\x31\xec\x95\xef\xc3\xb5\x02\x7b\x59\x12\x78\xf1\xe3\x45\xe9\x6a\x0d\x9e\xf7\x30\xab\xa7\xa4\x02\xd5\x26\xaa\x73\x81\x4f\x69\x7d\xe2\x32\x87\xce\x45\xfb\xbf\x01\x00\x00\xff\xff\x07\xe4\x39\x04\x8f\x8d\x00\x00"), - }, - "/src/reflect/reflect_go111.go": &vfsgen۰CompressedFileInfo{ - name: "reflect_go111.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 220471985, time.UTC), - uncompressedSize: 3460, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x56\xdf\x6f\xdb\x36\x10\x7e\x16\xff\x8a\x8b\x30\x04\x64\xad\x28\xc9\x6b\x5a\x07\x28\x86\xa2\xcb\x86\xb6\xc3\xd2\x76\x0f\x41\x50\x30\x32\xa5\xd0\x95\x8e\x02\x49\x39\xce\xd2\xfc\xef\xc3\x91\xb4\xfc\xa3\x2e\x92\x02\xdb\x8b\x21\xf3\xc7\xdd\x7d\xdf\x7d\x77\xc7\xe3\x63\x98\xdc\x0c\xba\x9d\xc1\xdc\xb1\xf5\x9f\x83\xc6\x9c\x96\xa7\xa7\xe5\x29\x63\xbd\xac\xbe\xca\x46\x81\x55\x75\xab\x2a\xcf\x98\xee\x7a\x63\x3d\x70\x96\xe5\x03\x3a\x59\xab\x9c\xb1\x2c\x6f\xb4\xbf\x1d\x6e\xca\xca\x74\xc7\x8d\xe9\x6f\x95\x9d\xbb\xf5\xc7\xdc\xe5\x4c\x30\x56\x0f\x58\x41\xa7\xfc\xad\x99\xfd\xa5\x2a\xa5\x17\xca\x72\xd3\x83\xf3\x56\x63\x53\xc0\x02\x3e\xcb\x76\x50\x05\x68\xd0\xe8\x05\xf0\x2f\x05\x78\x78\x61\xfd\x7d\xaf\x0a\xa8\x11\xa2\xbb\xf2\x4f\xa3\xd1\x2b\x2b\xe0\x81\x65\x0b\x69\xa1\xb7\xa3\x11\x96\xe9\x1a\x16\xa5\xbf\xef\xcb\x3f\x34\xce\xb8\x80\xe9\x14\x2e\xe8\x74\x2d\x2b\x45\x17\x32\xef\xe1\x6c\x0a\xfc\x85\x5e\xad\x7e\xbc\xef\x95\xe0\xdb\xb6\x79\xb0\x21\x04\xcb\xc8\xa0\x86\x57\x70\x02\xdf\xbe\x81\x86\xf3\x29\xb4\x0a\xb9\xf7\x65\xc4\xe1\x42\x14\x59\xd6\x4b\xd4\x15\xcf\x13\x49\x67\x10\xac\xa0\x6c\x41\x59\x6b\x2c\xfd\x5f\xc8\x56\xcf\x12\x7a\xd0\x38\x53\xcb\x9c\xcc\x3f\xb2\x2c\xeb\x28\xa2\xc3\xb5\xcd\x2b\x7d\x1d\x1d\x1f\x78\x5f\xa2\xec\xd4\x87\xba\xe6\x5d\xf8\x12\xa5\x76\x6f\x96\x94\x00\x45\xe8\xf6\xfa\xce\x61\x02\xa6\x87\x09\xe4\x60\x6a\x18\x50\xa5\xf3\xc9\xf9\xe8\xd6\xc3\x14\xbc\x27\xa0\xc9\x01\x41\x66\x59\x16\xf8\x0c\x5b\xbb\xbe\xe9\x97\x0b\x96\x3d\x82\x6a\x5d\xa4\xb3\x73\x14\x7c\xa4\x7c\xe5\xe8\x5d\x84\xc1\x13\x7d\x83\x46\xcf\xb5\x20\xee\xc2\x27\x11\xd8\x39\xf1\x9f\x31\xd7\x6d\x10\x16\x03\xf9\x7f\x39\x8b\x3e\xd6\xb4\x75\xdb\xbc\xcd\x5d\xf9\xb6\x35\x37\xb2\x2d\x7f\x95\x6d\xcb\xf3\x5f\xa2\x89\x4b\xe5\xf3\x02\xe6\x8e\xe4\xb6\x92\x57\x79\x41\x68\xb8\x16\xe5\x5b\xe5\x79\x4e\x06\x72\x51\x5e\x06\x29\x07\x9e\x59\x66\xab\x85\x8d\x0c\x9b\x9b\xb9\xaa\x3c\x2d\x93\x24\xdd\xdf\x56\xf6\xbd\x9a\x25\x53\x01\x55\x38\x3b\xdd\xf6\x51\xbe\x57\x77\x9c\x36\xa2\xb9\x1a\x61\xba\x53\x47\x61\x37\x04\x40\xfe\x45\xf9\x29\xec\x72\x12\xbf\x55\x7e\xb0\xc8\x1e\x53\xe9\xf2\x54\xa1\x02\x2a\x42\xb6\x51\xba\x1a\xe1\xea\x3a\xed\xa5\x8f\x55\x75\xf2\xc0\x1a\x40\x2a\x64\x96\x51\x0c\xb0\x13\xc3\x2a\xf8\x17\x73\x57\x7e\x08\x38\x59\x26\x52\x31\xd7\xad\x6c\x0e\xe9\x27\xca\x0a\x0e\xa6\x70\x12\xe0\x52\x7b\x08\x7d\x61\xfa\x7d\x53\x29\x60\x41\x51\x79\x1e\xef\x8b\xf3\xf3\xb5\x85\xcb\x5b\x5d\x7b\xb1\xe6\x6b\x93\xda\x1f\x72\xfb\x24\xb9\xc4\xee\x46\x5d\x8c\x42\x89\x80\xbf\x23\x7d\xed\x74\x93\xf0\xb5\x97\xf2\x13\xce\x54\xad\x51\xcd\x28\x6f\x81\x0a\x32\x33\x05\xd4\x6d\x70\xb0\xad\xe0\x32\x70\x1e\x14\x77\x16\xb2\x43\x32\xa6\xa3\x94\x38\xaf\x0d\xe6\x22\xd9\x71\x97\xad\xae\x14\x49\x8a\xd4\x3a\x85\x9c\xee\x84\xb5\x9c\x65\x48\xeb\xbe\x7c\x3f\x74\x17\x38\x2a\x2d\x5e\x78\x58\xb5\xa4\xf2\xc2\x7d\x96\x56\xcb\x99\xae\x7e\x54\x4d\xa3\xc9\x10\x85\xc1\xa3\x45\xba\xb0\x15\x4e\x28\x28\x5d\x87\x86\xaa\x51\xc0\x2b\xc0\xa7\xcc\xdd\x69\x7f\x0b\xde\x18\xa8\xd5\x1d\x68\xec\x07\x0f\xd2\x36\x43\xa7\xd0\xbb\x7d\x26\xcf\x7f\xc2\x64\x27\xf1\xfe\x47\x36\x37\x12\xab\x6b\xd8\x47\x01\x1e\x1d\xfd\x24\xa2\x67\x83\xd9\xa5\xfc\xf0\xf0\x79\xf8\x9e\x09\x8d\x65\xb5\xb1\xf0\xa5\x80\x25\x25\xdf\x4a\x6c\x14\xd5\x73\xc2\xba\xdc\x1a\xa4\xb1\x15\x3f\xd5\x41\x07\xa7\xb1\x81\x7f\x94\x35\xb1\x5f\x8c\x4e\x77\x7c\x6a\x72\x78\xf2\x32\xcc\x57\x7c\x09\x7a\x32\x19\xbd\xfa\x02\xbc\xb4\x0d\x1d\xd0\x78\xa5\xaf\xcb\x50\x75\xa2\x20\xee\x91\x6b\xf1\x12\x0e\x96\xbe\x7c\xed\x9c\x6e\x50\xde\xb4\xea\xa3\xe1\x74\xfe\xe9\xee\x1e\x63\xa3\x85\xa5\x1f\x3b\x6d\xd8\x91\x0e\xa8\x41\x85\x3d\xb2\x35\xee\xae\x83\xa6\x64\xac\xea\xe1\xf0\x70\x9f\x0e\x8e\x8f\xa1\xb7\xaa\x97\x56\x81\x0b\xc7\x08\xa7\x55\x9d\xd4\x48\x7e\x17\x44\x87\x5b\x0d\xae\x55\x16\x8f\x00\x59\x96\xb9\x55\x5d\xbe\x93\x5f\x55\xf0\xc1\x03\x58\x14\x05\x74\x05\x74\x14\x86\x6a\x55\x17\x4b\x34\x6c\x94\x6f\x5a\xd5\x85\xb6\xb5\x4b\x67\xb7\xa6\x33\x5b\x26\x16\x71\x12\xc6\x64\xe4\x97\xd6\x96\x89\xd5\x3d\x64\x92\xa3\x44\xe6\x77\x6c\x56\x12\xd1\x78\x18\x9c\x7a\x92\x47\x32\xb3\xbd\xab\x31\x65\x83\xa2\x0e\x0a\x8f\xc0\xd7\xa3\xf0\x52\x79\xbe\x5c\xc9\xdf\x58\xdd\x5c\x60\x04\x40\xd2\x08\xcd\x5e\x7e\x55\x3c\x4d\x99\x02\x70\x72\x4a\x87\x2b\xd3\xdf\x73\x8d\x57\x67\x78\x5d\x40\xbc\x15\xda\x39\x5e\xe1\x35\x4c\x63\x32\x62\x07\x44\x8d\x1b\xe4\x87\xa4\xd2\xd2\xc1\x46\xe3\x7b\xaa\xc1\xde\x59\x83\xcd\xa8\x6a\xa8\xcc\x10\xb5\xfd\xc8\x32\x34\x83\x1f\x9b\xe8\x87\x81\x86\x0a\xcb\xa4\x6d\xdc\x6b\x6b\xe5\x3d\xed\xac\xdf\x07\x61\xe8\x87\xf5\x3c\x8e\x92\x31\x00\x91\x0a\xa4\x80\x54\x04\x5b\x65\x39\x9a\x23\xae\x12\x6f\x05\x0c\x78\x67\x65\xff\xbb\x8b\xf3\x93\xa7\x42\x09\x16\x4a\x19\x72\xfb\xd1\xec\x83\x93\x8f\x45\x45\xaf\xf7\xce\x20\x95\x19\xea\x56\x8c\x13\x4a\xa4\xa7\x88\x72\x43\xeb\xc3\x7b\x8f\x26\xcc\x6f\xaa\xed\x95\xe5\x73\x57\x5e\xa4\x27\x5b\xf2\x5c\x93\x62\x69\x90\x05\xdf\x31\x52\x62\xc1\xdd\x69\x5f\xdd\x42\x60\xe8\x81\x65\x95\x74\x0a\x4e\xce\x68\xe8\x85\x67\x06\xf9\x4c\xab\xa7\x1b\xab\x29\xd1\x0f\x94\xf5\xf0\xc5\x7d\x49\xbc\x9e\x88\x02\x76\x00\xaf\x96\x53\xa0\xa2\x80\x13\xf1\xc8\xb2\x99\xaa\xe5\xd0\xfa\x64\x33\xbc\x18\xb7\x15\x64\x06\xbf\x55\x43\x91\x6c\x3a\x1b\x27\xbf\xf2\x57\xfa\x3a\x09\x6f\x33\x04\xbd\x3f\x04\xbd\x0e\x61\x54\x75\x88\x25\x69\x3a\x01\xb3\xca\x13\xad\x8f\xec\xdf\x00\x00\x00\xff\xff\x88\x68\xc5\x60\x84\x0d\x00\x00"), - }, - "/src/reflect/reflect_go1111.go": &vfsgen۰CompressedFileInfo{ - name: "reflect_go1111.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 220613759, time.UTC), - uncompressedSize: 3559, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x57\xdf\x4f\xdc\xb8\x16\x7e\x8e\xff\x8a\x43\x74\x85\x6c\x08\x01\x5e\x69\x07\xa9\xba\xaa\x7a\xb9\xab\xb6\xab\xa5\xed\x3e\x20\x54\x99\x8c\x13\x3c\x4d\x8e\x23\xdb\x19\x86\xa5\xfc\xef\xab\x63\x7b\x92\x19\x3a\x15\x54\x5a\x69\x5f\x50\xc6\x3f\xbe\xf3\x9d\xef\xfc\x32\xc7\xc7\x70\x78\x33\xe8\x76\x0e\x0b\xc7\xa6\x1f\x8d\x39\x2d\x4f\x4f\xcb\x53\xc6\x7a\x59\x7d\x93\x8d\x02\xab\xea\x56\x55\x9e\x31\xdd\xf5\xc6\x7a\xe0\x2c\xcb\x07\x74\xb2\x56\x39\x63\x59\xde\x68\x7f\x3b\xdc\x94\x95\xe9\x8e\x1b\xd3\xdf\x2a\xbb\x70\xd3\xc7\xc2\xe5\x4c\x30\x56\x0f\x58\x41\xa7\xfc\xad\x99\xff\xa1\x2a\xa5\x97\xca\x72\xd3\x83\xf3\x56\x63\x53\xc0\x12\xbe\xc8\x76\x50\x05\x68\xd0\xe8\x05\xf0\xaf\x70\x60\xfd\x7d\xaf\x0a\xf0\x70\x40\x97\x3f\x85\x1f\x35\x42\x34\x5c\xfe\x6e\x34\x7a\x65\x05\x3c\xb0\x6c\x29\x2d\xf4\x76\x84\x63\x99\xae\x61\x59\xfa\xfb\xbe\xfc\x4d\xe3\x9c\x0b\x98\xcd\xe0\x82\x4e\xd7\xb2\x52\x74\x21\xf3\x1e\xce\x66\xc0\x0f\xf4\x7a\x95\xe0\x05\xdf\xc6\xe6\x01\x43\x08\x96\x11\xa0\x86\xd7\x70\x02\xdf\xbf\x83\x86\xf3\x19\xb4\x0a\xb9\xf7\x65\xf4\xc8\x05\x16\x59\xd6\x4b\xd4\x15\xcf\x93\x5c\x67\x10\x50\x50\xb6\xa0\xac\x35\x96\x7e\x2f\x65\xab\xe7\x49\x07\xd0\x38\x57\xab\x9c\xe0\x1f\x59\x96\x75\xc4\x68\x7f\xc2\xbc\xd2\xd7\xd1\xf0\x9e\xf7\x25\xca\x4e\x7d\xac\x6b\xde\x85\x2f\x51\x6a\xf7\x76\x45\xa1\x50\xe4\xdd\x4e\xdb\x39\x1c\x82\xe9\xe1\x10\x72\x30\x35\x0c\xa8\xd2\xf9\x64\x7c\x34\xeb\x81\x74\x58\x2b\xfc\x83\x04\xde\x93\x06\xc9\x76\x50\x83\x2e\x06\xb1\x67\xb0\x83\x18\xfd\xe5\x82\x65\x8f\xa0\x5a\x17\xb5\xee\x1c\x79\x16\xe3\xb1\x66\xf1\x3e\xfa\xc8\x93\xb6\x83\x46\xcf\xb5\x20\x61\xc3\x27\xa9\xdb\x39\xf1\x8f\xc9\xda\x6d\xa8\x19\x89\xfc\x6b\x82\x46\xf3\x93\xa6\xdd\x53\x51\x17\xae\x7c\xd7\x9a\x1b\xd9\x96\xff\x95\x6d\xcb\xf3\xff\x44\xfc\x4b\xe5\xf3\x02\x16\x8e\x40\xd7\x89\x59\x5e\x90\xab\x5c\x8b\xf2\x9d\xf2\x3c\x27\x80\x5c\x94\x97\xa1\x08\x42\x10\x58\x66\xab\xa5\x8d\xf2\x9b\x9b\x85\xaa\x3c\x2d\x53\x32\xbb\x3f\xad\xec\x7b\x35\x4f\x50\xc1\xe5\x70\x76\xb6\x6d\xa3\xfc\xa0\xee\x38\x6d\x44\xb8\x1a\x61\xf6\xa4\x02\xc3\x6e\x20\x40\xf6\x45\xf9\x39\xec\x72\x72\xc9\x2a\x3f\x58\x64\x8f\xa9\xfc\x79\xaa\x72\x01\x15\x79\xb6\x51\xfe\x1a\xe1\xea\x3a\xed\xa5\x8f\x75\x5d\xf3\x20\x29\xc0\xd4\x05\x58\x46\x34\xe0\x09\x8d\x35\xff\x83\x85\x2b\x3f\x06\x57\x59\x26\x52\x27\xa8\x5b\xd9\xec\xd3\x9f\x98\x76\xb0\x37\x83\x93\xe0\xf1\xd7\x02\x7c\x68\x2a\xb3\x1f\x7b\x53\x01\x4b\x22\xe6\x79\xbc\x2f\xce\xcf\x27\x84\xcb\x5b\x5d\x7b\x31\x49\xb6\xa9\xee\x4f\xe5\x7d\x56\x5f\x12\x78\xa3\x6e\x5e\x92\x48\x21\x71\x76\x05\x65\x62\xb4\x19\x90\x89\x42\xf9\x19\xe7\xaa\xd6\xa8\xe6\x14\xd7\xa0\x13\xc1\xcc\x00\x75\x1b\xac\x6f\xa7\x7f\x19\x62\x12\x32\xf2\x2c\x44\x8f\x6a\x80\x8e\x12\x3d\xaf\x0d\xe6\x22\xe1\xb8\xcb\x56\x57\x8a\x52\x8e\xb2\x79\x06\x39\xdd\x09\x6b\x39\xcb\x90\xd6\x7d\xf9\x61\xe8\x2e\x70\xcc\xc4\x78\xe1\x61\xdd\xec\xca\x0b\xf7\x45\x5a\x2d\xe7\xba\xfa\x59\x29\x8e\x90\x81\x85\xc1\xa3\x65\xba\xb0\x45\x27\x54\xa3\xae\x43\xab\xd6\x28\xe0\x35\xe0\x73\x70\x77\xda\xdf\x82\x37\x06\x6a\x75\x07\x1a\xfb\xc1\x83\xb4\xcd\xd0\x29\xf4\x6e\x17\xe4\xf9\x2f\x40\x76\x12\xef\x7f\x86\xb9\x11\x75\x5d\xc3\x2e\x09\xf0\xe8\xe8\x17\x3d\x7a\xb1\x33\x4f\x25\xdf\xdf\x7f\x99\x7f\x2f\x74\x8d\x65\xb5\xb1\xf0\xb5\x80\x15\x05\xdf\x4a\x6c\x14\xd5\x7b\xf2\x75\xb5\x35\xa2\x63\x1f\x7f\xae\xfd\x0e\x4e\x63\x03\x7f\x29\x6b\x62\x3f\x19\x8d\x3e\xb1\xa9\xc9\xe0\xc9\xab\x30\xb9\xf1\x15\xe8\xc3\xc3\xd1\xaa\x2f\xc0\x4b\xdb\xd0\x01\x8d\x57\xfa\xba\x0c\x25\x29\x0a\xd2\x1e\xb9\x16\xaf\x60\x6f\xe5\xcb\x37\xce\xe9\x06\xe5\x4d\xab\x3e\x19\x4e\xe7\x9f\x1f\x0d\x91\x1b\x2d\xac\xfc\xd8\x89\xc3\x8e\x74\x40\x5d\x3f\xec\x11\xd6\xb8\x3b\x91\xa6\x60\xac\xeb\x61\x7f\x7f\x57\x1e\x1c\x1f\x43\x6f\x55\x2f\xad\x02\x17\x8e\x91\x9f\x56\x75\x52\x23\xd9\x5d\x92\x1c\x6e\x3d\xf5\xd6\x51\x3c\x02\x64\x59\xe6\xd6\x75\xf9\x5e\x7e\x53\xc1\x06\x0f\xce\xa2\x28\xa0\x2b\xa0\x23\x1a\xaa\x55\x5d\x2c\xd1\xb0\x51\xbe\x6d\x55\x17\x7a\xda\x53\x39\xbb\x49\xce\x6c\x95\x54\xc4\xc3\x30\x63\xa3\xbe\xb4\xb6\x4a\xaa\xee\x10\x93\x0c\x25\x31\x7f\x50\xb3\x92\x88\xc6\xc3\xe0\xd4\xb3\x3a\x12\xcc\xf6\xae\xc6\x14\x0d\x62\x1d\x32\x3c\x3a\x3e\x8d\xca\x4b\xe5\xf9\x6a\x9d\xfe\xc6\xea\xe6\x02\xa3\x03\x94\x1a\x61\x12\xc8\x6f\x8a\xa7\x29\x54\x00\x1e\x9e\xd2\xe1\xca\xf4\xf7\x5c\xe3\xd5\x19\x5e\x17\x10\x6f\x85\x5e\x8f\x57\x78\x0d\xb3\x18\x8c\xd8\x01\x51\xe3\x86\xf8\x21\xa8\xb4\xb4\xb7\xd1\xf8\x9e\x6b\xb0\x77\xd6\x60\x33\x66\x35\x54\x66\x88\xb9\xfd\xc8\x32\x34\x83\x1f\x9b\xe8\xc7\x81\x26\x0e\xcb\xa4\x6d\xdc\x1b\x6b\xe5\x3d\xed\x4c\xef\x87\xf0\x28\x08\xeb\x79\x9c\x33\x23\x01\x91\x0a\xa4\x80\x54\x04\x5b\x65\x39\xc2\x91\x56\x49\xb7\x02\x06\xbc\xb3\xb2\xff\xbf\x8b\xc3\x95\xa7\x42\x09\x08\xa5\x0c\xb1\xfd\x64\x76\xb9\x93\x8f\x45\x45\xff\x21\x74\x06\xa9\xcc\x50\xb7\x62\x9c\x50\x22\x3d\x55\x94\x1b\x5a\x1f\x1e\x8b\x34\x61\xfe\xa7\xda\x5e\x59\xbe\x70\xe5\x45\x7a\xef\x25\xcb\x35\x65\x2c\x0d\xb2\x60\x3b\x32\x25\x15\xdc\x9d\xf6\xd5\x2d\x04\x85\x1e\x58\x56\x49\xa7\xe0\xe4\x8c\x86\x5e\x78\x86\x90\xcd\xb4\x7a\xba\xb1\x9a\x02\xfd\x40\x51\x0f\x5f\xdc\x97\xa4\xeb\x89\x28\xe0\x89\xc3\xeb\xe5\x44\x54\x14\x70\x22\x1e\x59\x36\x57\xb5\x1c\x5a\x9f\x30\xc3\x73\x73\x3b\x83\xcc\xe0\xb7\x6a\x28\x8a\x4d\x67\xe3\xb3\x40\xf9\x2b\x7d\x9d\x12\x6f\x93\x82\xde\x4d\x41\x4f\x14\xc6\xac\x0e\x5c\x52\x4e\x27\xc7\xac\xf2\x24\xeb\x23\xfb\x3b\x00\x00\xff\xff\x8a\x4a\xd5\xea\xe7\x0d\x00\x00"), - }, - "/src/reflect/reflect_test.go": &vfsgen۰CompressedFileInfo{ - name: "reflect_test.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 533068494, time.UTC), - uncompressedSize: 4512, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x57\x6d\x6f\xdb\x38\x12\xfe\x6c\xfd\x8a\x39\xdd\x5d\x2b\xdd\x09\xb2\x65\xb7\x29\xa0\x22\x1f\xd2\xbc\x14\x59\xb4\xf1\xa2\x0e\x76\x3f\x18\xde\x05\x23\x8d\x2c\x36\x14\xa9\x25\x29\xa7\x5e\x43\xff\x7d\x41\xda\x96\xe5\xb7\xc6\x7d\x03\xea\x90\x33\xcf\x3c\xe4\xf0\x19\x8e\xe9\x6e\x17\xfe\xff\x50\x51\x96\xc2\x67\xe5\x38\x25\x49\x1e\xc9\x14\x41\x62\xc6\x30\xd1\x7f\x6a\x54\xda\x71\x68\x51\x0a\xa9\xc1\x73\x3a\x6e\x41\x74\xee\x3a\x1d\x77\x05\x30\x43\x83\xa1\x7c\xea\x3a\xbe\xe3\x64\x15\x4f\xe0\x1e\x95\xbe\x60\x74\xca\x0b\xe4\xda\xd3\xf0\xbf\x15\x22\xbc\xf7\x61\xe1\x74\x74\x38\x7a\xa4\xa5\xe7\x3b\x75\x0b\x3f\x62\x34\xc1\xe1\x0c\x65\xc6\xc4\xd3\x89\x31\x37\x15\x4f\x3e\x90\xb9\xa8\x4e\x5d\xe4\x42\x4a\x32\x1f\x66\x57\x54\x62\xa2\x6f\x33\x92\xe0\x89\x81\xf7\xf3\x12\x19\xe5\x8f\x6a\x24\xa4\xc6\xf4\xc4\xa8\xf7\x97\xef\xa8\x56\x27\x82\x2f\x73\xc2\x2f\x18\x13\xc9\x89\xf8\x3b\x52\xe0\xbb\xb9\x46\x75\x21\xd1\x1e\xf6\xc9\xdb\x1a\x66\x99\x42\xfd\x41\x24\x8f\xa7\x6a\x83\x46\xea\x21\xbf\xe5\x33\xc2\xe8\x81\x65\x56\xc5\x10\x2e\x81\xde\x78\xb2\x6d\xb8\x24\x0a\x17\x4e\xa7\x63\xfe\x77\xae\xa8\x8c\x01\xb6\x01\x9f\x30\x99\x05\xc6\x69\x0e\x21\x6e\x9c\xbf\x11\x56\xe1\xa2\x36\x9e\x3a\x80\xa3\xd1\x23\xe4\xe9\xd7\xa3\x3b\x06\xb2\xe3\x19\x66\x5e\xe4\xef\x51\x6f\x33\x5f\x61\x46\x2a\xa6\x97\x28\xa7\x53\xef\x1c\x8b\x96\x55\xa2\x87\xd9\x0d\x45\x96\x1a\x39\x8e\x1e\xa7\xbb\x86\xba\x87\x19\xbe\x3b\xf0\xfa\x8b\xb9\x98\x9f\x2a\x86\xc7\xcb\xec\x39\x8e\xf7\x97\xdf\x1d\x7a\xc1\xa6\xdf\xbf\x2c\x72\x94\x34\xf9\x11\x8a\x53\xee\xf1\x73\x1c\xbf\x53\x9d\xdf\x72\x8d\xf2\x87\x58\xee\x85\xf8\x48\xf8\xdc\x56\xc2\xc9\x4a\xcc\x88\x84\x14\xb1\xbc\xfe\xab\x22\xcc\xb0\x29\x38\x87\xf1\xe4\xaa\x6d\x5a\x38\x9d\x6e\x17\xec\x94\x6a\x8a\xca\xe9\x2c\x38\x65\x01\xd8\x0f\x2d\x2b\x34\x75\xb9\x88\x02\x88\x5a\x53\xca\xf5\xa0\x6f\xaa\x1b\x36\xa3\xc6\xd9\x0b\x5f\x07\x60\x3f\x1a\x53\xc6\x04\x31\xb8\x5e\xf8\xda\x0f\x60\x7b\xd6\x80\xdc\x1c\x19\x13\x6e\x00\xcd\xa0\x71\x15\xe4\x11\xbd\xf1\x84\x72\x1d\x40\xd4\xf3\x03\xd8\x33\x34\xd0\x17\xe3\x81\x31\x9b\x1d\xf7\x03\x18\xd4\x01\xec\x5b\x1a\xf0\x3b\xa2\x68\x62\x1c\xbd\xf0\x75\x1d\xc0\xce\xb4\x81\xa1\x94\x42\x7a\x9c\x32\x3f\x80\xf6\xb8\xb5\xbf\x72\x4c\xb9\x9e\x28\x2d\x29\x9f\x2e\xa2\x18\x5c\xc1\xd1\x0d\xa0\x1f\x83\xab\x9f\x84\x5b\x9b\x2d\x6f\x61\xd6\x9e\x00\xd6\xe8\xf6\x8a\x19\x8f\x02\xc8\x78\xbf\x31\x59\x95\x6e\x39\xb6\x75\x5a\x26\x94\x11\xa6\x0e\xab\xd2\xf7\xdb\xde\x95\x2c\x67\x6d\xdb\x31\x5d\xce\xb6\x22\xdb\xc2\xcc\xdd\xb6\xe7\xeb\xba\x44\x5b\x2c\xcf\x09\xf3\xaa\x6e\xa3\x8f\x2b\x73\x76\x04\xd7\xa0\xfa\xcb\x49\x7b\x97\x47\xd4\x19\x7c\x9b\x3a\x27\x30\xda\xb8\x2f\x3f\x8f\xf1\x47\x79\x0e\xa2\x8f\xaf\xb5\xe1\xb1\xd7\x3f\x6a\x5b\xa2\x55\x4f\x68\x55\xcf\xb2\x48\x07\xdb\xb6\xc1\x9e\x6d\x3c\xb1\x15\xb1\x58\x44\x75\x1d\x40\x33\xeb\xd7\x3b\x3b\xd7\x79\x78\x47\xee\x3c\x5b\x46\x9b\x71\xbb\x82\xa2\x89\xad\xd1\xb3\x57\x2d\xb4\x2d\xa4\x23\x8e\x13\x62\x15\xb2\x6c\xd1\xbe\x7a\xe3\xc3\xb8\x23\xe6\x76\x96\xa7\xf1\x9b\xd3\x5f\x21\x0f\x44\xc4\x10\xad\x14\xda\xc5\x44\x31\xf4\xf7\xa4\x7e\x8e\x68\x67\x75\xdb\x45\xee\x28\x83\x99\x02\x2c\x4a\x3d\x8f\x81\x0b\x0d\x3a\x47\x50\xa4\xc0\xd0\xa6\x61\xc4\xb1\x09\x53\xae\x57\x8d\xae\x9d\x65\xdb\xbd\x73\x70\x9b\x80\xf6\x78\xaf\x4b\xae\x02\x5b\xd3\xbd\x65\x8e\x43\xf7\xce\x72\x9b\x62\xdf\xd2\x4e\xfd\x23\x55\x05\xd1\x49\x8e\x29\xe8\x79\xb9\x6e\xa2\x51\xd8\x3b\xda\x46\xcf\x5e\x79\xd1\x7e\x1b\x6d\x3a\xe2\xee\xc1\x6c\x9a\xdb\x5e\xb7\xdb\xeb\x84\xcb\x17\xc1\xa2\x6e\xf5\xbf\xc3\x1e\x57\xb9\x5f\xeb\x8d\x77\x42\xef\x58\xb6\xcf\xb1\xfa\x19\xdf\x4c\x6b\x4a\x7b\x8c\xbf\x0a\xa5\xe8\x03\x43\x60\x42\x94\xca\x54\xcd\x0b\x33\x8a\x02\x58\xff\x5d\x2b\xd4\xed\x6e\xbb\x9a\x2f\x34\xe8\x76\xe1\x7e\x78\x35\x8c\xe1\x86\x7e\x69\x18\xe6\x6b\xdc\xfc\x00\xc7\xc6\x79\x8c\xa5\x76\x9c\xb6\x01\x74\x4e\x55\x08\x23\x44\xc8\xb5\x2e\x55\xdc\xed\x4e\xa9\xce\xab\x87\x30\x11\x45\x77\x2a\xca\x1c\xe5\x67\xb5\x19\x50\xa5\x2a\x54\xdd\x37\x67\x83\x70\xf3\x00\xbb\x35\xc6\x7e\xbf\xf7\x66\xb0\xff\xea\x2a\x20\x3e\xdf\x7b\xf3\xdf\x09\xbe\x7c\x34\x63\x7a\x43\xa5\xd2\x5e\xcf\xf7\xc3\x8f\xa8\x73\x91\x7a\x3d\xdf\x71\x3a\x34\x83\xa9\xd0\x26\xb4\x08\xcd\xcf\x3e\xcf\x0f\xef\xaa\x62\x58\x69\xcf\x7f\x6b\x3d\xff\x3a\x87\x9e\xfd\xc5\xa0\xc3\x6b\xf3\xda\xc8\x3c\x77\x09\x88\xad\xfb\xbf\xb3\x00\x9e\x08\xd7\xd0\x73\x03\x63\xf0\x9d\x4e\xbd\xd4\x65\x37\xf3\xfb\x1c\x21\x21\x8c\xc1\x03\x32\xf1\x04\x19\xa1\x4c\xc1\x13\xd5\x79\x6c\xe0\x36\xa4\x63\xde\x88\xff\xb1\xa0\x73\x30\x49\x6b\x2a\xb8\x97\xf1\x00\x64\x32\x93\x01\x10\x39\x55\x3e\x2c\x40\xa2\xae\x24\x87\x8c\x87\xa4\x2c\xd9\xdc\x6b\x79\xdf\x42\xfd\x76\xc9\x05\xdf\xfa\xef\x8f\x65\x9c\x39\x05\x9b\x69\x0c\x97\x84\x9b\x8e\x24\x91\xa4\x50\x4a\x51\xa2\xd4\x73\x78\x69\xd7\x7c\x09\x22\x83\x8a\xa7\x98\x51\x8e\xe9\x32\xe3\x51\x2e\x2a\x96\xf2\x97\x1a\x4a\xc2\x69\x12\x1a\x63\x11\x5e\x12\xc6\xec\xed\xdf\xfe\xfd\x4b\x18\xfb\x64\xd3\x50\xd7\xa6\xf7\x1d\x7f\x45\x1b\x2b\x54\x0a\x15\xc8\x8a\x6b\x5a\x60\x38\x42\x7d\x43\x39\x61\xf4\x6f\x94\x01\x3c\xe5\x34\xc9\x81\x2a\xdb\x3c\x55\x55\x2e\xd5\x86\x87\x39\xbc\xb7\xb5\xf4\xcb\xa8\xf5\x8a\xa7\x9c\x6a\xcf\xd2\x37\x0a\xdd\xe7\x54\x99\x70\x62\x25\xa9\x24\x02\xe5\x10\x85\x91\x2d\xfa\x39\x68\x01\x29\x6a\x94\x05\xe5\x68\x7b\x73\x42\x2a\x85\x40\x78\x0a\x99\xbd\x2c\xa6\x77\xad\x9f\xf3\xa4\x2c\x91\xa7\x5e\x63\x1a\xc7\x83\x68\x12\xc0\x66\x3e\xe8\xc7\x93\x30\x0c\x7d\x73\x57\xd4\x23\x2d\xc1\x66\x97\x10\x85\xf0\xef\x41\xe4\xd4\xce\x3f\x01\x00\x00\xff\xff\xab\x6e\xee\x69\xa0\x11\x00\x00"), - }, - "/src/reflect/swapper.go": &vfsgen۰CompressedFileInfo{ - name: "swapper.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 220928330, time.UTC), - uncompressedSize: 834, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x52\x4d\x8f\xd3\x30\x10\x3d\x7b\x7e\xc5\x23\x42\x28\xd6\x56\x69\xf7\x5a\xa9\xdc\x00\xad\x58\xd8\x43\x25\xee\x6e\x3a\x6e\x6c\x5a\xdb\xb2\x9d\x16\x68\xf3\xdf\x91\x93\xb2\x95\x40\x5a\x2d\x87\x48\x93\x79\x6f\x3e\xde\x1b\xcf\xe7\xb8\xdb\xf4\x66\xbf\x85\x4d\x44\x41\xb5\xdf\xd5\x8e\x11\x59\xef\xb9\xcd\x44\xe6\x10\x7c\xcc\xa8\x76\x26\x77\xfd\xa6\x69\xfd\x61\xbe\xf3\xa1\xe3\x68\xd3\x2d\xb0\xa9\x22\xd2\xbd\x6b\xb1\x3e\xa9\x10\x38\xd6\x69\x6f\x5a\x86\x71\x99\xa3\x56\x2d\x9f\x07\x89\x82\xd7\x66\x06\x5b\xd2\x12\x67\x12\x47\x2c\x57\xf8\xa6\xf6\x3d\x3f\xe9\xa9\x42\x92\x30\x1a\xc7\xe6\xb3\x71\xdb\x5a\xe2\xcd\x0a\xeb\xb1\xd1\x99\x84\x08\xca\x99\xb6\x7e\x37\xf2\x3f\xc4\xe8\xe3\xf9\x0b\xe7\xce\x6f\x97\xa8\xae\x53\xab\x19\x4a\xe1\xf2\xb9\xc1\x20\x49\x0c\x24\xe6\x73\x7c\x54\x29\x23\xa8\xdc\x41\xfb\x88\x71\x56\x82\xd7\x48\xe6\x17\x63\x01\xe5\xb6\xb8\x6f\xf0\xd5\xe7\xce\xb8\x1d\xb2\x47\x3a\xa9\xd0\x90\x38\x3e\xb2\x2b\x5b\xf6\xc6\xe5\xfa\xd8\x3c\xb2\xab\xa5\x24\x91\x4e\x26\xb7\x1d\x46\xf4\x4c\xa2\x55\x89\xb1\x58\x92\x10\x91\x73\x1f\xdd\x3f\x5a\x31\x2d\x5f\x5d\x6d\x5d\xe2\x8f\x3f\x5b\xfe\x01\xdf\xe7\xb2\x4a\x54\x6e\xc7\x95\xc4\x70\xed\x77\xff\x42\x3f\x12\xa2\x18\x65\x8a\x43\x0b\x5c\x2e\xb0\x53\x34\x02\xe2\xf5\xc3\x0a\x7d\xa0\xf1\x1b\x48\xa8\xa2\xd4\xa6\xe6\xa1\x9c\xcd\xa9\xfd\xd3\xc6\x72\x9b\xaf\x97\x69\x3e\x71\xae\xab\xb7\x2a\x46\xf5\xb3\x14\x7a\xad\x5f\x41\xf7\x5a\x27\xce\x95\x2c\xa4\x5a\xd2\x0b\x7a\x8c\x9e\x4c\x36\x12\xef\x57\x93\xb3\x97\xcb\x94\xb2\xb7\xd4\x28\xf0\xbf\xf4\x15\x79\x06\x77\x2b\x78\xad\x49\x08\x7b\x0b\xf3\x21\x14\x05\xaa\x79\x28\x95\xb5\x29\x6c\xd5\xac\x39\x5f\xff\x67\xcf\x90\x95\x7f\x61\x76\x86\x7c\x08\xe3\xeb\x1a\xe8\x77\x00\x00\x00\xff\xff\xf3\x76\x65\x45\x42\x03\x00\x00"), - }, - "/src/regexp": &vfsgen۰DirInfo{ - name: "regexp", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 221091616, time.UTC), - }, - "/src/regexp/regexp_test.go": &vfsgen۰FileInfo{ - name: "regexp_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 221150389, time.UTC), - content: []byte("\x2f\x2f\x20\x2b\x62\x75\x69\x6c\x64\x20\x6a\x73\x0a\x0a\x70\x61\x63\x6b\x61\x67\x65\x20\x72\x65\x67\x65\x78\x70\x0a\x0a\x69\x6d\x70\x6f\x72\x74\x20\x28\x0a\x09\x22\x74\x65\x73\x74\x69\x6e\x67\x22\x0a\x29\x0a\x0a\x66\x75\x6e\x63\x20\x54\x65\x73\x74\x4f\x6e\x65\x50\x61\x73\x73\x43\x75\x74\x6f\x66\x66\x28\x74\x20\x2a\x74\x65\x73\x74\x69\x6e\x67\x2e\x54\x29\x20\x7b\x0a\x09\x74\x2e\x53\x6b\x69\x70\x28\x29\x20\x2f\x2f\x20\x22\x4d\x61\x78\x69\x6d\x75\x6d\x20\x63\x61\x6c\x6c\x20\x73\x74\x61\x63\x6b\x20\x73\x69\x7a\x65\x20\x65\x78\x63\x65\x65\x64\x65\x64\x22\x20\x6f\x6e\x20\x56\x38\x0a\x7d\x0a"), - }, - "/src/runtime": &vfsgen۰DirInfo{ - name: "runtime", - modTime: time.Date(2019, 3, 10, 16, 38, 53, 760281362, time.UTC), - }, - "/src/runtime/debug": &vfsgen۰DirInfo{ - name: "debug", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 221365921, time.UTC), - }, - "/src/runtime/debug/debug.go": &vfsgen۰CompressedFileInfo{ - name: "debug.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 221418324, time.UTC), - uncompressedSize: 298, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\xce\xb1\x4e\x03\x31\x0c\xc6\xf1\xb9\x7e\x8a\x6f\x2c\x02\x9a\x34\xa5\x3c\x00\x0c\x9d\x8a\x10\xf0\x02\x49\xce\x1c\xa6\x77\x6e\x75\x71\x24\x2a\xd4\x77\x47\xbd\x0e\x87\xd8\xf0\xe2\xe1\x2f\xff\x64\xe7\x70\x9d\xaa\x74\x0d\x3e\x0b\xd1\x21\xe6\x5d\x6c\x19\x0d\xa7\xda\x12\xbd\x57\xcd\x28\x6c\x9b\xc7\x67\x1e\x32\xab\xcd\x45\x6d\x15\xae\x30\x2e\x7c\xd3\xcc\x39\x3c\xed\x0d\xd2\x1f\x3a\xee\x59\x8d\x9b\x05\x5e\xd8\xea\xa0\x10\x15\x93\xd8\x9d\xef\x4d\xb4\x5d\xd0\x6c\xb8\x84\xa5\xf7\x74\x9a\xf0\x6d\xfc\x7a\xb5\x98\x77\xf3\x74\x34\x2e\x67\x7a\xf4\xff\xad\x3b\x87\xb7\x0f\xfe\x1b\x20\x05\x4b\x6c\x1e\xb0\x57\xdc\xdf\xdd\x26\x31\x94\x63\x31\xee\xcb\x0d\xc2\xda\x63\x3b\x96\x55\xf8\x5d\xa6\x57\xc3\xda\x5f\x86\x4e\xf4\x13\x00\x00\xff\xff\xad\x79\xbd\xd2\x2a\x01\x00\x00"), - }, - "/src/runtime/pprof": &vfsgen۰DirInfo{ - name: "pprof", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 221589850, time.UTC), - }, - "/src/runtime/pprof/pprof.go": &vfsgen۰CompressedFileInfo{ - name: "pprof.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 221644124, time.UTC), - uncompressedSize: 660, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x92\x4f\x6b\xc2\x40\x10\xc5\xcf\x99\x4f\x31\xe4\xb4\x69\x45\xfb\x15\x8a\x97\x1e\xda\x22\xb5\xa5\x07\xf1\xb0\x26\x13\xd9\x9a\xfd\xc3\x64\x56\x2b\xe2\x77\x2f\x6b\xa4\x2c\x18\x0a\x3d\xee\xcc\xfb\x0d\xef\x3d\x76\x36\xc3\xfb\x4d\x34\x5d\x83\x5f\x3d\x40\xd0\xf5\x4e\x6f\x09\x43\x60\xdf\x02\x18\x1b\x3c\x0b\x2a\x28\x4a\xe3\x4b\x28\xca\xfe\xe8\xea\x12\x2a\x00\x39\x06\xc2\x05\xfb\xd6\x74\x84\xbd\x70\xac\x05\x4f\x50\x38\x6d\x09\xd3\xdb\xb8\x2d\x14\x36\x22\x22\x26\x66\xfa\x12\x85\xbe\xa1\xb0\x69\x80\x56\x87\x95\x71\x42\xdc\xea\x9a\x4e\xe7\xf5\x6a\x1d\x8d\x93\x20\x0c\x45\xed\xa3\x13\x6c\xa3\xab\x55\x85\xc6\x09\x14\x07\x36\x42\xc3\xc4\xf8\xe9\x67\x7a\xf1\x24\xad\x2a\x24\x66\xcf\x70\x06\x48\x5b\x54\x01\xef\xae\x8e\x2a\xbc\xe8\xde\xbd\x3a\x60\x06\x35\xb4\x89\xdb\x0c\x4d\x8e\x99\x24\xb2\x43\x67\xba\xf1\x43\xf3\x64\x68\xf0\x92\xc9\x1f\xc6\xc5\xaf\xda\x92\xaa\xae\xf9\x33\x79\x59\x8e\xeb\x1f\x9b\x46\xed\x75\x17\x09\xb3\x3a\x26\xd8\xef\x4c\x18\x6c\x9e\xc6\xb9\x37\xb2\x7e\x4f\xb7\x68\x0e\x2c\x45\xb3\xcc\x17\x1f\x57\x28\x6f\xe2\xef\xf8\x4b\xf1\x21\xe3\xf2\x9b\x17\xfc\x89\x74\xf8\xf7\xd1\x67\xef\x77\x31\xa8\xcb\xff\x18\xea\xa9\x7e\xf3\xdc\x20\x3f\x01\x00\x00\xff\xff\x14\x4a\xfc\x56\x94\x02\x00\x00"), - }, - "/src/runtime/runtime.go": &vfsgen۰CompressedFileInfo{ - name: "runtime.go", - modTime: time.Date(2019, 3, 10, 16, 38, 53, 760369022, time.UTC), - uncompressedSize: 5788, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x58\xef\x72\xdb\xb8\x11\xff\x4c\x3e\xc5\x96\xd3\xde\x91\x8e\x22\xd9\xe9\x25\x9d\x66\xea\x0f\x89\xee\xec\xcb\x34\xb6\x3c\x96\xd3\xde\x4c\x9a\xb9\x81\xc0\xa5\x04\x0b\x04\x58\x00\xb4\xac\xf3\xe8\x01\xfa\x20\x7d\xb1\x3e\x49\x67\x01\xfe\x93\x2d\x5f\xda\x4e\xf9\x45\xe2\xe2\xb7\x8b\xc5\xfe\xc3\x2e\x27\x13\x78\xb1\xa8\x85\xcc\xe1\xd6\xc6\x71\xc5\xf8\x9a\x2d\x11\x4c\xad\x9c\x28\x31\x8e\x45\x59\x69\xe3\x20\x8d\xa3\xa4\xa1\x4d\x84\x72\x68\x14\x93\x13\xbb\xb5\x49\x1c\x47\xc9\x52\xb8\x55\xbd\x18\x73\x5d\x4e\x96\xba\x5a\xa1\xb9\xb5\xfd\x9f\x5b\x9b\xc4\x59\x1c\x73\xad\xac\x83\xf3\xd9\x6c\x0e\xa7\x60\xb7\x76\x4c\x7f\x3b\xea\xbb\xeb\xe9\x8f\x70\x0a\x09\x81\x03\x6d\xaa\xcb\x4a\x48\x34\x44\x6d\x65\x25\x71\x3c\x99\x40\xc1\xd6\x08\x85\x36\x80\xc6\x68\x33\x5e\xea\xd8\x6d\x2b\x04\x2c\x18\x47\xb0\xce\xd4\xdc\xc1\x43\x1c\xfd\xec\xa9\x47\xfe\x27\xde\x05\x4c\xa0\xf5\x18\xeb\x0c\xbd\x09\xb5\x8c\x77\x71\x5c\xd4\x8a\x43\xea\x1a\x9e\xac\x59\x49\xdb\x3f\xc4\x60\xd0\xd5\x46\x81\x1b\x5b\x67\xe2\xdd\x13\x8e\x6a\xbd\xac\x98\x5b\x1d\x62\x49\x92\x6e\x0b\xa1\x84\x4b\x33\x5a\xbb\xb5\x57\xeb\x25\xbc\x3d\x85\x5b\x3b\x3e\x97\x7a\xc1\xe4\xf8\x1c\x5d\x9a\xfc\xb6\x71\x83\x4d\xb2\x40\xf8\x9a\x85\x33\x92\xd5\x8a\x98\x7b\x11\xb7\x76\xb6\xb8\x45\xee\xae\x9c\x49\x46\xe0\x77\x0a\xb2\x02\xb9\x95\x5c\x39\x93\x64\x07\xd9\x7f\x20\xf3\x3e\xe1\xf6\xd4\xaf\x31\xbb\x95\xd1\x9b\xeb\x10\x2e\x81\x81\x64\x8c\x3f\x34\x81\x13\x34\x48\x3d\x8a\xd8\x27\x13\x60\x77\x5a\xe4\x90\x23\xcb\x81\xeb\x1c\x01\xa5\x28\x85\x62\x4e\x68\x15\x47\x77\xcc\x00\x06\x77\xc7\x11\xc2\x29\x7c\x73\xb3\xad\xf0\x9d\xb5\x68\x08\xe0\x77\x78\xd8\xc5\xd1\xcf\x70\x0a\xd8\x99\xf9\x7c\x76\x3d\x9b\xdd\xec\xf9\xa2\x32\x9a\xa3\xb5\x07\x2c\xde\xac\x90\x21\x45\x01\x2d\xee\xd4\xe3\x3e\xa9\x1c\x0b\xa1\x30\x27\x11\x9d\x3f\x27\x49\x1c\xed\xe2\x68\xa9\x8d\xd6\x8e\x24\x36\x4c\x41\x1e\xaa\xbb\xd6\x48\x41\x8f\x46\x72\x03\xff\xcd\xf3\x82\x03\x62\x3c\x6f\x82\xcf\x6f\x32\x99\xf8\x94\xf9\x1e\x0b\x56\x4b\x77\x1e\x64\x08\x0b\x4a\x6f\x60\xa9\x15\x8e\x80\x33\xf5\xad\x83\xda\x22\x08\x07\xcc\x42\xc1\xa4\x5c\x30\xbe\x06\xa6\xb6\xa5\x36\x38\xf6\x42\x6e\x66\xdf\xcf\xde\xc2\x1c\x11\x44\x01\x0c\x16\xe8\x1c\x1a\xb0\x5a\xd6\x64\x47\x2f\x11\x31\xc7\x7c\xdc\x87\xed\xa4\xb6\x66\x22\x35\x67\x72\xb2\xd4\x7d\x0c\xbf\x37\xc8\xd6\x95\x16\xaa\x8b\xe4\xf1\xf7\xb8\xa8\x97\x4b\x34\x69\xd6\xa1\xa6\x4c\x4a\x34\xa9\x5d\x8b\x0a\x84\x72\x19\xa4\x15\x87\x5a\x28\x57\x39\x33\x82\x42\x48\x6c\x9c\x33\x02\x29\x14\x12\x66\x04\x7a\x0d\x0b\xad\xa5\x17\x2b\x54\xa1\x0f\x78\xab\x0d\xc2\x4b\xdc\xa4\x8d\x95\xad\x63\x7c\x9d\x64\x63\xda\x32\x4d\x6c\x25\x85\x4b\x46\x90\xfc\x4d\x25\xd9\xf8\x83\xca\xf1\x3e\x68\xf1\x02\x5e\x05\x47\x78\xc9\xbf\xe2\xdf\xe3\x11\x24\xc9\x88\x7e\x0a\x26\x2d\x7a\x37\x54\xcc\x38\x1f\x3c\xc4\xdc\xee\x54\x2f\xc2\x11\x92\xd1\x90\x2c\x68\xcb\x59\x41\x2a\xa4\x5e\x03\x97\x66\x2f\x4e\x9e\x83\x64\x2d\xe4\x89\xfe\x6f\x29\x6e\x7a\x95\xbc\x06\xcd\x79\x8e\xb3\x2e\x48\xf6\x17\x4e\x1a\x61\x23\x70\xa6\xc6\x47\xce\xb0\x9d\x37\x46\x50\x71\xf8\xfc\xa5\x71\x47\x46\xa4\x41\xbd\x3a\x26\xbe\xc9\xa4\xe5\x3a\x33\xac\x44\x1b\x62\xce\x81\x28\x2b\x89\x25\x2a\x87\xb9\xaf\xc4\xa1\x80\x9f\xde\xda\x71\xdc\x45\xd9\x87\x16\x43\xb1\x56\x69\x6b\xc5\x42\xe2\x78\x4f\x95\x20\x34\xe5\xe1\x6d\xa8\xcb\x51\xb3\xdf\x03\x34\xea\x7c\x13\x08\x0f\x3b\xd8\xc5\xa1\x96\x37\x88\x50\xcc\x1f\xba\xf2\xcd\x45\xcb\x9c\xc1\x25\xde\x53\x78\xa6\x05\xbd\x07\x86\x11\x50\x36\xb4\x01\xd6\x4a\xdf\x93\x39\xb8\x1f\xae\xa6\x10\x9e\x46\xb1\x38\x3a\xa3\x4d\xe8\x39\xa2\x7f\xe1\xdd\xe7\x4e\x73\x8d\x44\x67\x14\xd4\xf4\xb4\x84\x8f\x14\xd8\xf4\x08\xe5\xe2\xe8\x07\xe5\xcc\x76\x28\xb1\xab\x56\x53\x9f\x48\xdd\xab\xc6\xfb\xfe\x96\xd8\xbf\x1c\x78\x6d\xa8\x04\xd4\x4e\x28\x4c\xb2\x50\x72\x09\x9d\x04\x87\xef\xd5\xe3\x10\x4e\xa1\x20\x27\x23\x50\x42\x66\x83\x02\x79\xf1\xee\xa7\xab\xeb\xd9\x74\x9e\xaa\x90\x9e\xfb\x21\x70\x32\xd0\xc6\xf2\x15\xe6\x41\x1d\x4e\x19\x50\xb2\x35\xa6\x7c\xc5\x54\xe7\x80\x43\xdb\x5a\x74\x37\xa2\x44\x5d\xbb\x83\x17\x00\xc9\x26\x99\xc0\xa5\xb6\x98\xf2\x0c\x76\xd9\x08\x8e\xb3\x38\xfa\xd3\x4b\xde\x6d\x7e\x59\x97\xd3\xab\x4f\xe9\xf3\xda\x5d\xd6\x65\x67\x8f\x27\xb0\xc7\xc6\x73\xda\x31\xd9\xc1\x6d\x9b\x78\x71\x1b\x02\x17\x58\xce\x1d\x73\x76\x10\x05\x93\x09\x9c\xa3\x42\xc3\x24\x58\xc7\x9c\xb0\x4e\x70\x3b\x8e\xa3\x77\x52\x6a\xde\xc7\xc7\x9b\xef\x60\x32\x81\xc5\xd6\xa1\x05\x46\x4b\x8c\xd2\x83\xa9\x1c\xac\x13\x52\x82\x50\x54\x9f\xe3\xe8\x86\x34\x08\xbc\xcf\xb3\xa5\x78\x87\x8a\x32\xa7\x30\x88\x79\x16\x47\xf3\xad\x05\x38\xbc\x99\x5e\x38\xe6\xcb\x57\x61\x74\x49\x17\x85\xc3\x12\x52\x5b\x97\xa0\x0b\xf8\xe9\xfe\x9e\x58\x17\x28\xf5\x26\x8b\xa3\x8f\x5a\xaf\xeb\xca\xee\x8b\x51\x75\xb9\x40\x43\x68\x5f\xd1\xd1\x80\x0c\xb0\x38\xba\xf0\x2a\x3d\x8b\x2f\xc3\x72\x1c\x9d\x19\x44\xfb\x58\xbd\x1e\x47\xa7\xb0\xb1\x37\xe5\x05\x13\xaa\x3d\x28\x25\xce\x0a\x59\xb5\x6f\xd7\x1f\x91\x55\x9d\x6d\xff\x1b\xcb\x12\x63\x67\xa7\xff\xc4\x4a\x81\xe5\x43\xde\xa4\xec\x63\x16\xa1\x40\xd0\x9a\xad\x98\xb2\x0d\x56\xd1\x1d\x7b\x18\xab\xb4\x7a\xd9\xe1\x03\xfc\x1a\x25\x32\x8b\xf9\x13\xb8\x69\x17\x9c\x06\xb7\x42\x98\xcd\x03\x43\xc8\x0c\x3b\x94\xef\x23\x76\x60\xcb\xde\x02\x3a\x80\x83\x5d\x3f\xea\xcd\x4b\x89\x77\x28\xa1\x10\xf7\x98\xbf\xb4\xe2\x97\xb6\x94\xd5\x06\x5b\x2e\x6d\xf6\x6d\x3d\x99\x44\xe1\x48\xc2\x36\x9a\xd5\xa4\x95\xd2\x9b\xb0\x48\xe6\xec\x96\x0e\x99\x70\x1c\x47\x73\xba\x7a\x1b\xc3\x3c\x3e\xa7\x97\xb6\xd8\x82\xbf\x9e\x7b\x25\x1a\xa6\xc6\x59\x81\x29\x8e\x2e\xe6\x15\x53\x4f\x04\x95\x64\xce\xfe\x24\xb6\xc1\x3d\xe6\x9d\x32\xbe\xc2\xc0\x3c\xe0\xe5\x44\xdd\x67\xf6\xc0\xc0\xdd\x32\xbf\xaf\xf9\xfa\x47\x66\x57\x44\xed\x99\x2b\xa3\x0b\x21\xa9\x75\x5c\xd4\x7c\x8d\x0e\x56\xcc\xae\xc0\xb1\x85\xc4\x38\x3a\x9f\xf6\x19\xd9\xb3\x9c\x4f\xa1\x44\xc7\x72\xe6\x58\x1c\xcd\xdc\x0a\xcd\x9e\x9a\x04\xd1\x44\x6d\xb3\xb4\xcf\x83\xc6\x8b\xe7\xcc\x2c\x68\xfe\xe2\x5a\x4a\xe4\x4f\xdc\x45\x37\xda\xf9\xf4\x69\x21\x50\x78\xef\x5a\x1e\x4a\xaa\x0d\xa5\xc5\x8a\x55\x15\x2a\xd8\xac\x50\x41\x9f\x53\xff\xfa\xc7\x3f\xc1\xad\x84\x05\x56\xea\x9a\xae\xa4\x8f\xcc\x1e\x94\x89\x2a\x07\x6a\xe0\x29\xe6\x24\xb3\x7b\xf2\x53\xc5\x94\xb6\xc8\xb5\xca\x2d\x58\xa1\x38\xc2\xc9\x1f\xff\x40\x95\xfb\x8a\xd5\x16\x7d\x89\xbb\xb4\xbd\x81\x3d\xf5\xb2\xb5\xd7\xe7\x57\xaf\xdf\x7c\xe9\x37\xe2\xc2\xf0\x5a\x32\x03\x8b\xba\x28\x42\x8c\x1b\xe4\xd4\x39\x9c\x4f\xa1\x22\x4e\xc8\x6b\x13\xac\x44\xf7\xb7\x75\xed\x3a\x73\xf0\x39\xa5\xf2\x3f\x7d\xf1\xea\xf5\xeb\xec\x77\x24\xb7\xd9\xec\x07\x95\xff\xaf\x9b\xb5\x07\xb7\x71\xe4\x65\xc3\xd0\x36\xbf\x7f\x45\xbe\x9f\x5e\x7d\x3a\x33\x2c\xd8\xa2\x90\x9a\x35\xc2\x8b\x96\xa6\x0b\x98\x5e\x7d\x0a\xe6\x6b\x53\xe0\x7c\x4a\xd7\x3f\x45\x4f\x2b\x92\xba\x90\x38\xf2\x7d\x73\xb7\x8b\xa7\xf9\x50\xb8\x42\x13\x92\x78\x50\x2c\x1f\xe5\x2e\xbc\x39\xa1\xec\xbc\xac\xcb\xb9\xf8\x05\xa7\x92\x59\x1b\x4a\x11\x95\x94\xa9\x9f\xa4\xc6\x71\xf4\x7e\x4b\xab\xf0\xf9\xcd\xc9\x97\xfe\x52\x8b\x3c\x6d\x70\xa8\xae\xd4\xb7\x3e\xeb\x6a\x7a\x4b\xd8\x75\x37\xee\x35\xb2\xbc\xbd\x28\xd3\x12\x8e\xda\xff\xc3\x0e\x66\x8e\xee\x4c\x28\x26\xc5\x2f\x68\xd2\xfb\x11\x50\xcb\xed\xd0\xd0\x94\xfe\xb0\x6b\x80\xa1\xe9\x22\x74\xaf\x98\xae\xd8\xdf\x6b\xec\xda\x0a\x32\x6b\xad\xf0\xbe\xd2\xc6\x77\x9b\x02\xa5\x2f\x9a\xb9\xb0\xa4\xef\x06\xb8\x56\x77\x68\xac\x4f\xa1\xae\x0b\xfc\x39\xf4\x67\x19\xf8\x7e\x2b\xcd\xda\x76\x0b\x7e\xf5\xe9\xfa\xc1\x63\xd8\x3d\x16\x44\x7d\x1d\xb5\x72\x83\x09\x86\x3a\xcb\x43\x23\xcc\xa0\xb1\xf4\x23\xc4\x53\x61\x97\xac\xc4\x7e\x30\xfd\xca\x33\x10\x06\xed\x01\x49\xcc\x99\x36\x57\xd3\x3d\x75\xbc\xf4\x41\xef\xa3\x84\x24\x93\xd0\xf8\x7c\x81\xe5\x95\x2f\x67\x78\xcd\x9c\xd7\x12\x4e\xe1\xf5\xc9\x2b\x38\x82\x93\xe3\x57\xdf\xf5\x3e\x7b\x2f\x35\x5f\x0f\xa0\xa9\x69\xf0\x8f\x7c\x7b\x51\x3b\xbc\x6f\x70\x6d\x2a\x0c\xb0\x4d\x13\xd6\x4f\x03\xea\x0e\xad\x13\x4b\x02\x50\xf5\x19\xc3\x87\x02\x84\xfb\xd6\x76\xa3\x01\x39\xb5\x9b\x2b\x46\xe4\x56\x2b\x72\x34\x90\x6b\xb2\x91\xd5\xa3\x50\x39\x37\xc2\x22\x18\x2c\xf5\x5d\x10\x04\x5c\x97\xc4\x31\xde\x9f\x5c\x82\x9a\x74\xc7\xa4\x8b\xba\x80\xcf\x5f\xe8\x3a\x1a\x51\x2a\x35\xbd\x7f\xa3\xe0\xa1\x6f\x01\xcf\x4f\x97\x7e\x72\xfc\xd5\xcf\x02\xc7\x7e\x50\x6c\x5e\xb8\xae\xb6\xb4\xfd\x08\xec\xde\xb4\x98\xf4\x84\xc1\x10\xd8\x8c\xaa\x7e\x50\xec\x47\xbb\xbe\x5d\xff\xa8\xf9\x7a\x36\xbf\x59\x19\x64\xbe\x13\x6f\xe9\x9f\x94\x7c\x66\xe5\x2f\x21\x2f\x0e\x7d\x8e\xb2\x5b\x3b\xbe\x59\x61\x83\x18\x5a\xcc\xb8\x1b\xc3\x38\x85\xa7\xff\xe0\xd2\x87\x9f\x12\xb2\x8d\xe4\xb9\xd3\x55\x8b\x6a\xa3\x74\xd7\x97\x86\x76\x29\x58\xdd\x8f\x91\x7f\xc5\xf0\xdd\x8e\x01\x5f\x6a\x40\x75\x27\x8c\x56\x7e\x3a\x74\x1a\x38\x73\x7c\x15\xb6\xb3\x63\xb8\x59\xa1\x41\x9a\x2a\x37\x08\x2b\x76\xb7\x1f\x18\xcd\xd5\xa5\x72\x60\x72\xc3\xb6\xb6\xcb\xd8\x7e\x56\x58\x6a\x6f\x5a\xef\xe2\x37\xdf\x3d\x1e\x69\x3d\xcc\x7f\x2b\x9c\x15\x29\x56\x70\xb4\x57\x95\x8e\xc2\x57\xc4\x07\x9a\xf5\x95\xe0\x69\xd2\x20\xdf\xfa\xb1\xd7\xd6\x55\x28\x43\x49\xef\x95\x3f\x23\x56\xef\xa4\xb8\xc3\x74\xbf\xbc\xb5\xeb\x7e\xf2\x4a\x6d\xe3\x81\xac\x17\xed\x8f\xdb\x78\xd9\x06\x37\x53\xb6\xac\xd0\x22\x30\xd3\x5f\x1b\x1e\xbd\x31\xac\x1a\xc3\xe5\xff\x61\xf4\x5e\xa2\x0b\xf3\x76\xc5\x0f\x94\xc5\xa7\x15\xb0\x10\x2a\xf7\x73\xda\xb0\xd0\x10\xe1\x83\x2a\x74\x8f\x6f\x29\x7e\x40\x0f\x8c\xb5\xe2\x8a\xea\x5c\xd1\x2d\x0e\x2a\xde\xa3\xa2\xe6\x2f\x82\x4e\x6a\x37\xd3\xff\x3b\x00\x00\xff\xff\xa9\x51\x33\x3f\x9c\x16\x00\x00"), - }, - "/src/strings": &vfsgen۰DirInfo{ - name: "strings", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 533200223, time.UTC), - }, - "/src/strings/strings.go": &vfsgen۰CompressedFileInfo{ - name: "strings.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 222212394, time.UTC), - uncompressedSize: 1759, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x94\xd1\x6f\xe3\x44\x10\xc6\x9f\xbd\x7f\xc5\x60\x1e\xce\xa6\xa9\x9d\xb4\x4d\x49\x83\x82\x74\x0d\x52\x29\x42\xea\xe9\x0a\xe2\xe1\x74\x0f\xeb\xf5\x38\x9e\x64\xbd\x6b\xed\xac\xdb\x0b\xa8\xff\x3b\x5a\x3b\x6e\x73\xe5\x10\x02\xfa\xe4\xc6\xb3\xbf\xf9\xe6\xf3\x37\x9b\xe7\x70\x52\x74\xa4\x4b\xd8\xb2\x10\xad\x54\x3b\xb9\x41\x60\xef\xc8\x6c\x58\x08\x6a\x5a\xeb\x3c\x24\x22\x8a\x3b\x43\xca\x96\x98\x77\xbe\x5a\xc4\x42\x44\xf1\x86\x7c\xdd\x15\x99\xb2\x4d\xbe\xb1\x6d\x8d\x6e\xcb\x2f\x0f\x5b\x8e\x45\x2a\x44\xd5\x19\x05\xb7\xa6\xc4\x4f\xd7\x7b\x8f\x09\x1f\xc8\x13\x50\x50\xec\x3d\xa6\x40\xc6\xc3\x1f\x22\x72\xe8\x3b\x67\x60\xcb\xd9\xad\xf1\xe8\x8c\xd4\x77\xc5\x16\x95\x4f\x38\xcd\xd6\x52\xeb\x24\xa6\x00\xb9\xab\xe2\x49\x28\xba\xd1\xb6\x90\x3a\xbb\x41\x9f\xc4\xf7\x3d\x31\x1e\xeb\x2a\x67\x9b\x75\x2d\xdd\xda\x96\x18\x4f\x40\xa5\x69\x40\x26\xa9\x78\x3a\x56\x93\xf0\x04\x18\xdb\x83\x9c\xff\x2a\xe3\x75\x11\xb6\x7f\xe9\xf6\xb3\x64\xff\xff\x3a\xea\x91\xf0\x2f\xba\xae\x6d\x67\xfc\xdf\x74\x34\xb0\x5c\xc1\x54\x44\x79\x0e\xdc\xa2\x22\xa9\x41\x49\x46\x16\x11\x3f\x92\x57\x75\xa8\x09\x3f\x80\x46\xd3\xc3\x61\xb5\x82\xe9\x52\x44\xa3\xd6\x10\x80\xec\x7d\x67\xb0\xef\x72\x6b\x86\x0f\x90\x70\x0a\x27\x30\x7b\x7d\xf6\xfb\xe1\x31\x3d\x3a\x3f\xfd\x02\xff\xa5\x88\xaa\x5e\xf4\x6a\x05\x1c\x94\x3c\x9f\x9a\x89\x28\x7a\xfa\x0c\xf2\x24\x44\x54\x59\xd7\x57\xb5\x96\xc3\x58\xc7\x4e\xa7\x03\x2c\xbc\x59\xad\xe0\x74\x36\xd0\x0a\x87\x72\x77\x40\x99\x93\x13\x11\x45\x0c\x2b\xe0\x0f\xad\xe5\x93\x51\xd0\xf2\x63\x80\x8f\x9d\xcc\xb3\xab\x49\x01\xdf\x5c\x87\x5d\x41\x97\xc2\x61\xea\xf4\x60\x6f\xa0\xe7\x39\xfc\xda\xb2\x77\x28\x1b\x38\xd4\x65\x43\x19\x38\xd4\x84\x0c\xd6\xc0\xb8\x62\x9d\x61\x59\x61\x06\xbf\x21\x28\x69\xde\x78\x28\x2d\xf8\x5a\xfa\xac\xe7\xfc\x72\xf7\xc3\xdd\x12\x6e\xfd\x1b\x0e\x03\x30\x15\x1a\xfb\xb7\xe0\x6b\x04\x34\x9e\xdc\xf3\x92\x66\x87\x56\xf0\xf6\xdd\x6d\x40\x41\x81\x40\x4d\xab\xb1\x41\xe3\xb1\xec\x71\xc3\x5f\x63\x1d\x02\x56\x15\x29\x42\xe3\xf5\x1e\x82\x7b\x37\x77\x6f\xdf\xaf\x7f\x5c\x6d\x79\x48\x43\x45\x4a\x6a\xbd\x87\x44\x3e\x58\x2a\xa1\xe3\xa0\xfe\xc3\xc7\xb0\xac\x13\x20\xc3\x1e\xe5\x31\xb2\x63\x04\x79\xf0\x02\x4a\x72\xa8\xbc\xde\x7f\x07\xd6\x01\xdb\x06\xe1\x27\xf9\x20\xef\x95\xa3\xd6\x8f\x36\x15\x47\x62\xa9\x02\x6b\x10\xf0\x13\xb1\xe7\x34\x3b\xc2\x5e\x77\x61\x52\x62\x20\x1e\x54\x3f\x5a\xb7\x9b\x40\x89\x15\x3a\x28\x6d\x00\x91\x87\xce\x78\xd2\xc1\x11\x87\x6f\x18\x24\x18\xc4\x12\xb8\xb6\x8f\x06\x1e\x48\x42\xeb\x6c\x45\x3a\xdc\x36\x47\x64\x69\xca\xe1\x04\x48\x87\x50\xa0\x51\x75\x23\xdd\x8e\x41\x3e\x48\xd2\x32\xf8\x9c\x30\x22\xd4\xde\xb7\xbc\xcc\xf3\xcf\x2e\x39\x2d\xcd\x26\xdf\xd8\x9c\x98\x3b\xe4\x7c\xb6\xb8\xba\x9a\x7e\xdd\xff\xa3\x6c\x13\xec\x3e\x3d\x9f\x9f\x4d\x2f\x17\xf3\xf3\xf3\x30\xce\x21\x40\xc3\xe4\x49\x91\x15\x5d\x95\x7e\x39\x4c\xca\xb6\xfb\x75\x8d\x6a\x97\xa4\x21\x48\x54\x41\x91\xc9\xb2\x74\x21\xb9\x86\x74\x1f\xdd\xe3\x74\x3d\xd7\x87\x0f\xc0\x60\x2c\xb2\x92\x2d\x4e\xe0\xb1\x26\x55\x43\x8b\xae\xb2\xae\xe1\x31\x64\xef\x2c\x85\x3b\x03\x1a\x69\xa8\xed\xb4\xf4\x64\x4d\x36\x20\x5f\xc7\x6f\x02\x6c\x81\x77\xd4\x02\xf9\x0c\xee\xff\xc9\x89\x30\x37\xf9\xfc\x62\x71\x31\x5f\x5c\xaa\xc5\x4c\x4e\x67\x57\x97\x78\x71\x26\xd5\xfc\xac\xba\x9c\xcf\x0a\x35\xbf\x9c\xce\xbe\x55\xf2\x62\x7e\x71\xb6\x98\x86\xa6\xe3\x64\x50\x88\xe8\x09\x50\x33\xc2\xcb\xbc\x5f\xad\xa0\x18\x16\x5a\x1a\x52\x49\x7c\xc8\xf8\x12\x48\x6b\xdc\x48\xdd\x07\xce\x56\x60\xac\x39\xfd\x1d\x9d\x1d\xf7\x2c\x38\x42\x58\x42\xb1\x87\x07\xa9\x3b\x8c\xd3\xb0\xc2\x4f\xe2\xcf\x00\x00\x00\xff\xff\x3c\x43\xb4\x54\xdf\x06\x00\x00"), - }, - "/src/strings/strings_test.go": &vfsgen۰CompressedFileInfo{ - name: "strings_test.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 533570947, time.UTC), - uncompressedSize: 388, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x90\xc1\x4a\xc4\x40\x0c\x86\xcf\xe6\x29\xc2\x9c\x76\x55\xba\xcf\xa0\x1e\x16\x04\x41\x3a\xbd\xcb\xd8\xa6\x75\x6c\x27\x33\x24\x19\x3c\x88\xef\x2e\xa5\xf5\x24\xe2\x6d\x8f\x81\xef\xcb\x07\xff\xe9\x84\x37\xaf\x35\x2e\x03\xbe\x2b\x40\x09\xfd\x1c\x26\x42\x35\x89\x3c\xe9\x8b\x91\x1a\x40\x4c\x25\x8b\xa1\x5b\xaf\xc8\x93\x03\x18\x2b\xf7\xd8\x91\xda\xfd\xaa\x92\xdc\x2d\x4b\xee\xf5\x60\x78\xbd\x33\x4d\x77\xc4\x4f\xb8\xb2\xc6\xcf\xb1\x1c\x9c\x54\xb6\x98\xa8\x69\x29\x0c\x4f\x94\xbc\x05\xd3\x5b\xfc\x61\x37\xfb\x99\xa4\xad\x8c\x9c\x0d\xb5\x96\xb5\x48\x03\x46\xc6\x73\x2e\x6f\x24\x8f\xde\x1d\xe1\xeb\x77\xf9\x2c\xf9\xe3\xa2\xdd\x87\x9c\x4a\x10\xf2\xdb\x42\x7f\xa7\x2b\x6b\x18\x77\xec\x9f\xe7\xdf\x01\x00\x00\xff\xff\xe9\xc8\x01\xe4\x84\x01\x00\x00"), - }, - "/src/sync": &vfsgen۰DirInfo{ - name: "sync", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 223786077, time.UTC), - }, - "/src/sync/atomic": &vfsgen۰DirInfo{ - name: "atomic", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 223002354, time.UTC), - }, - "/src/sync/atomic/atomic.go": &vfsgen۰CompressedFileInfo{ - name: "atomic.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 222676490, time.UTC), - uncompressedSize: 3060, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x56\xcf\x6f\x9b\x3e\x14\x3f\xe3\xbf\xe2\x7d\x39\x54\xd0\x7e\x45\xa4\xad\xea\xa1\x52\x0e\xd5\x0e\x53\xa5\x49\x9b\x54\x75\x77\x07\x4c\xea\xcc\xb1\x91\xb1\x69\xa2\x28\xff\xfb\x64\x03\xc1\x80\x61\x5d\xb2\xf6\x84\x8b\xfc\xf9\xc1\x7b\x9f\xf7\x9a\xc5\x02\x6e\x56\x9a\xb2\x0c\x36\x25\x42\x05\x4e\x7f\xe1\x35\x01\xac\xc4\x96\xa6\x08\xd1\x6d\x21\xa4\x82\x08\x05\xa1\xe6\x25\xce\x49\x88\x50\x10\xae\xa9\x7a\xd1\xab\x24\x15\xdb\xc5\x5a\x14\x2f\x44\x6e\xca\xee\xb0\x29\x43\x14\x23\x94\x6b\x9e\xc2\xd3\x2b\x2e\x1e\xb9\xfa\xfc\x29\xc2\x59\x26\xe1\x9a\x9a\xf3\xff\xc0\xc9\x2b\xd8\x63\x5c\x3f\xe0\x80\x02\xc1\x32\xb8\x5f\xc2\xb5\xb9\x88\x02\xfb\x80\xa5\xb9\x89\x02\x49\x94\x96\x1c\x04\xcb\xd0\xb1\x4f\x7c\x77\xdb\x11\xdf\xdd\x9e\x88\xef\x6e\xe3\xfa\x71\x1e\xf1\x33\x75\x2c\x6b\xc7\xb3\x6e\x4c\xeb\x0b\x5c\x3f\x53\xc7\xb6\x76\x7c\xeb\xc6\xb8\xbe\xd0\x79\xa1\xa4\xc3\x5e\x28\xd9\xd1\x17\x4a\xc6\xed\xe1\x3c\x81\x1f\x82\x72\x45\x4e\x02\x36\x12\x49\xf3\xb2\xd1\xe9\xbd\x8b\x07\x7f\xff\xbd\xea\x17\xb1\x2d\xb0\x24\x0f\x3c\x9b\x08\x93\x60\x59\x2f\x51\x2b\x21\x98\x91\xa1\x39\x34\xdc\x4b\x73\xc7\xbc\xea\x8b\xb5\x6a\x4a\x6a\x82\x82\xe3\x49\x3d\xc7\xac\x24\xd3\xfa\xc3\xcc\xb9\xfa\xa6\x7f\xef\xaa\xef\x8d\xe6\xc9\x81\xfe\x88\x12\x78\x03\xdc\xb3\xf0\x21\x55\xf0\xc4\xbc\x67\xc2\x66\xfd\x5d\x5d\xcc\xcf\x42\x67\x66\x30\x10\xff\xd8\xd3\x43\x96\x79\x86\x22\x23\x4c\xe1\xd1\x8e\x35\x76\xda\xc9\x83\x9b\xfa\x92\x7f\x02\xcd\xd9\x51\xf0\xc6\xae\xd6\x18\xef\xc4\xb3\x55\x3c\xc3\x75\xfa\x8e\xde\x4a\xbf\xe8\x3b\x46\xd9\xed\xbe\xa3\xbf\x7e\x2f\x52\xf1\xc4\xb3\xd3\x19\xee\xe1\xf3\x94\xbe\x09\x3c\x6e\xbd\xd3\xed\x06\x52\xef\xd9\x01\xa8\x5f\x67\xa7\xb4\x93\x20\x4f\x04\xdc\xa6\xcf\xe2\x06\x25\x77\x8b\x3c\x8b\x1b\x15\xb1\x57\xb5\x49\xe8\xdc\x60\xfa\xfe\x21\x79\x89\x9e\x94\x90\xc4\x33\x59\x15\x66\xed\x5c\x1d\xba\x1e\x55\x98\x8d\x90\xc3\x2c\x37\x48\xf3\xfd\x73\x48\xef\xac\x19\xac\x7e\x83\xac\x37\xe0\x2d\xf8\x2d\xca\x9e\xdc\xb6\x70\x5b\xff\x39\xfc\xfc\x42\xb4\x34\x83\x5e\x4c\xb0\x45\x15\x5c\xff\xc4\x4c\x93\xd8\xf6\x33\x8a\x21\xda\x81\x85\xe4\x38\x25\x87\x63\xec\x74\xad\x4a\x2a\x1f\xce\x1a\xf2\xa0\x68\x0e\x3b\xb3\x71\x39\xb5\x4b\x38\x28\x30\xa7\x69\x14\x96\x7b\x9e\x2e\xea\x1f\xbd\xf7\x50\x1a\x2c\x88\xdc\x5e\xaa\x0c\x9f\xa1\x11\x60\xa9\xc3\xd8\xee\x62\x9a\x1b\x65\xf8\xaf\x66\xba\xba\x82\x4d\x99\x3c\x1a\x2d\x8e\xd9\xf7\xd5\x86\xa4\x2a\xda\xc5\xc9\x57\xa2\xa2\x30\x15\xbc\x54\x52\xa7\x4a\xc8\x30\x36\x88\xf1\xd5\x2a\xa9\xbc\x97\xff\xe8\x90\x72\x03\xa0\xa5\x22\x5c\xb1\x3d\xa8\x7d\x41\xb2\x29\xcb\xc6\xef\x12\x76\xe8\x88\x7e\x07\x00\x00\xff\xff\x2a\xf7\xf1\xfd\xf4\x0b\x00\x00"), - }, - "/src/sync/atomic/atomic_test.go": &vfsgen۰FileInfo{ - name: "atomic_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 223062879, time.UTC), - content: []byte("\x2f\x2f\x20\x2b\x62\x75\x69\x6c\x64\x20\x6a\x73\x0a\x0a\x70\x61\x63\x6b\x61\x67\x65\x20\x61\x74\x6f\x6d\x69\x63\x5f\x74\x65\x73\x74\x0a\x0a\x69\x6d\x70\x6f\x72\x74\x20\x22\x74\x65\x73\x74\x69\x6e\x67\x22\x0a\x0a\x66\x75\x6e\x63\x20\x54\x65\x73\x74\x48\x61\x6d\x6d\x65\x72\x53\x74\x6f\x72\x65\x4c\x6f\x61\x64\x28\x74\x20\x2a\x74\x65\x73\x74\x69\x6e\x67\x2e\x54\x29\x20\x7b\x0a\x09\x74\x2e\x53\x6b\x69\x70\x28\x22\x75\x73\x65\x20\x6f\x66\x20\x75\x6e\x73\x61\x66\x65\x22\x29\x0a\x7d\x0a"), - }, - "/src/sync/cond.go": &vfsgen۰CompressedFileInfo{ - name: "cond.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 223211458, time.UTC), - uncompressedSize: 511, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x8f\x31\x73\xab\x30\x10\x84\x6b\xdd\xaf\xd8\x12\x1e\x83\x71\xfd\x6c\x9a\xe7\x96\xee\x4d\x26\xb5\x2c\x84\x7d\x41\x3e\x31\x20\x92\x61\x32\xfc\xf7\x8c\x90\x93\x14\xb6\x9a\x93\x76\x75\xfb\xcd\x56\x15\x8a\xf3\xcc\xae\xc5\xdb\x44\x34\x68\xd3\xeb\x8b\xc5\xb4\x88\x21\x0a\xcb\x60\x71\xf2\xd2\x62\x0a\xe3\x6c\x02\x3e\x49\x55\x15\x3a\xb6\xae\x9d\x30\x4f\xb6\xc5\x79\xc1\xbb\x16\x76\x4e\x83\x6f\x83\xb3\x37\x2b\x41\x07\xf6\x42\x4a\xfc\xc9\x0f\x0b\x90\x26\xa9\x06\xe9\x34\xde\xf4\x76\x8c\x7e\xe0\x6e\xf3\xe3\x6c\x78\x0a\xa4\xcc\xd5\x46\x13\xc6\x0f\xcb\x29\xdd\xe9\x19\x53\xec\xc7\x23\x0f\x60\xd9\x32\x60\xae\x5a\x70\xf6\xde\xd1\x4a\xd4\xcd\x62\x90\x19\xfc\x89\x4d\x72\xbc\x6a\x0e\x59\x1e\xab\x98\x9d\x14\x05\x29\xee\x60\x76\xe6\x8a\xba\x86\xb0\x8b\x86\x4a\x6f\xdc\x74\x6f\xb3\x9f\xac\x9c\xd4\x1a\x97\x9a\xdd\x8b\x38\x6f\xfa\x2c\x27\x75\x2c\xe3\xd7\xa4\x36\x49\x7b\x24\xfe\xe7\x8b\x68\x97\x98\x1b\x4c\x22\x6b\xbf\x91\x46\x1b\xe6\x51\xee\xc9\x52\x96\x94\xd8\xc7\x12\x61\x9c\xed\x93\xb0\x7f\xa3\xd7\xad\xd1\xd3\xbd\x83\xe0\x6f\x1d\x13\xb7\x75\xd4\xd8\x93\xea\xfc\x08\x8e\xf2\xfe\x00\xc6\x11\x72\x00\x17\xc5\x6f\xaf\xef\x6c\xb5\xd2\x4a\x5f\x01\x00\x00\xff\xff\x2c\xcb\x53\xaf\xff\x01\x00\x00"), - }, - "/src/sync/export_test.go": &vfsgen۰CompressedFileInfo{ - name: "export_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 223318328, time.UTC), - uncompressedSize: 168, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\xca\x4d\x0a\xc2\x30\x10\x05\xe0\x7d\x4e\xf1\x96\x8a\x3f\xf1\x02\xde\x41\x0a\xae\x25\x4d\x5f\x35\xda\x4c\x42\x32\x29\x94\xd2\xbb\xbb\x15\xdc\x7f\xd6\xe2\xd0\xb7\x30\x0d\x78\x57\x63\xb2\xf3\x1f\xf7\x24\xea\x22\xde\x18\x6b\xd1\x71\x64\xa1\x78\x0e\xe8\x17\x28\xab\xd6\x23\x84\x1c\xa0\x09\x2f\x37\x13\x92\x4e\x29\x23\xc4\x3c\x31\x52\xd4\x69\x48\x52\xcf\x66\x76\x05\x5d\x13\x0d\x91\x8f\x5c\x92\xbf\x05\xc1\x15\x63\x13\xbf\xdb\x23\x88\x62\x45\xa1\xb6\x22\xb8\x60\xfb\xd3\x77\xc9\xbf\x7e\xdd\xcc\x37\x00\x00\xff\xff\x78\xcd\x49\xae\xa8\x00\x00\x00"), - }, - "/src/sync/pool.go": &vfsgen۰CompressedFileInfo{ - name: "pool.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 223439701, time.UTC), - uncompressedSize: 505, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x90\xcf\x4e\xf3\x30\x10\xc4\xcf\xde\xa7\x98\xaf\xa7\xe4\x03\x5a\xb8\x56\xca\x89\x03\x37\x54\x89\x63\x55\x21\xe3\x6e\x2a\x83\xeb\x58\xce\x5a\xa4\x54\x79\x77\xe4\x24\xfd\x83\x20\x97\x68\x77\x46\xbf\x99\xf5\x62\x81\x9b\xb7\x64\xdd\x16\xef\x2d\x51\xd0\xe6\x43\xef\x18\xed\xc1\x1b\x22\xbb\x0f\x4d\x14\xcc\x92\x6f\x75\xcd\x33\x22\x39\x04\xc6\xaa\x69\x1c\x5a\x89\xc9\x08\x8e\xa4\x5c\x63\xb4\x43\xfe\x46\xdb\x7c\xd5\x58\x2f\x1c\x27\xe5\xc5\x7e\x31\x92\xf5\x12\x24\x12\xa9\x56\x9a\xc8\x58\x6f\x06\x4b\xad\x0d\x1f\x7b\x52\xcf\xfc\x09\xa0\x4e\xde\x14\x25\xae\x95\x9e\x28\x6f\x51\x04\xfc\xcf\xb1\x25\x9e\x58\x7e\x7a\x72\x05\x5b\xc3\xb1\x2f\xc2\x7c\xa0\x97\xa8\x2a\xdc\xe7\x7d\x16\xc2\x3c\xd3\xff\x55\xf0\xd6\x0d\x3b\x15\x59\x52\xf4\xa3\x50\x94\xa4\x54\x4f\xe7\xa5\xb7\x8e\xf2\xdc\x61\x59\x61\xe2\xad\xaf\xd9\x77\x0f\x1b\x52\xd3\x80\x8b\x65\xf9\xcb\x33\x01\xbb\x3f\x6e\x58\x25\x29\xba\xeb\x1b\xca\xe9\x88\x2e\x37\x3f\xf5\x1c\x01\x43\x9b\x4b\x9e\x0e\x81\xfd\xf6\x94\x74\x8b\xae\x3c\xf3\x63\xf2\x62\xf7\xfc\x1a\x79\x67\x5b\xe1\x98\xb3\x1e\x1d\x6b\x9f\x42\x61\xc6\xff\xf4\xc4\x39\xae\xa7\xef\x00\x00\x00\xff\xff\xd6\xf1\x0f\x08\xf9\x01\x00\x00"), - }, - "/src/sync/sync.go": &vfsgen۰CompressedFileInfo{ - name: "sync.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 223579740, time.UTC), - uncompressedSize: 2015, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x55\xdb\x6e\xe3\x36\x10\x7d\x36\xbf\x62\x60\x14\xa8\x94\xd8\x52\xd2\x2d\xb6\x40\xb0\x7e\x28\xb2\xc5\x22\x40\xbb\x0b\x34\x29\xfa\x10\x18\x0d\x25\x8d\x4c\xc6\x14\xa9\x72\x28\xab\x6e\x90\x7f\x5f\x0c\xa5\xf8\x92\x9b\x5f\x4c\x90\x33\x67\xce\x9c\xb9\x28\xcf\xe1\xb4\xe8\xb4\xa9\xe0\x9e\x84\x68\x65\xb9\x96\x2b\x04\xda\xda\x52\x08\xdd\xb4\xce\x07\x98\xae\x74\x50\x5d\x91\x95\xae\xc9\x57\xae\x55\xe8\xef\x69\x7f\xb8\xa7\xa9\x10\x1b\xe9\x81\xb0\xf9\x5b\xea\x80\x9e\x60\x01\x8d\x5c\x63\xd2\xc8\xf6\xf6\xa4\xd3\x36\x7c\xf8\x69\x79\xbb\x2c\x95\xb4\x50\x38\x67\x52\x21\xf2\x9c\xcd\x7f\xed\xdd\x1a\x2d\x04\x2f\xcb\x35\x41\x50\x08\xb6\x6b\x0a\xf4\xe0\x6a\xe8\x47\x28\x39\xd8\x14\x5b\xf0\x9d\x0d\xba\xc1\x7f\xae\xb1\xf1\x68\x50\x12\x42\x72\x57\x2a\xf8\x34\x87\xe0\x3b\xbc\x4b\x19\x35\x28\x19\x40\xc9\x0d\x82\x75\x01\xb6\x18\x40\x96\xff\x76\xda\x63\x15\xf1\x09\x1b\xd9\x2a\xe7\xd9\xf5\xd3\xbc\x54\x77\xa0\xed\x21\xf0\x68\xfc\x47\x17\xf0\xbf\x34\x13\x79\xce\x98\x37\x4a\x13\xb4\x1e\x37\x68\x03\x81\x04\x8b\x3d\x94\xd2\x18\x08\xee\x2d\x5f\x7e\xea\xbd\xb3\x2b\xb3\x7d\x22\x70\x1c\x9f\x71\xb5\x85\x02\x43\x8f\x68\x21\x29\xb0\x94\x1d\xe1\x6b\x49\x2a\x49\x20\x8d\x47\x59\x6d\x41\xdb\xd2\x63\x83\x36\xbc\xc8\xa7\x57\xda\x44\xd4\x48\x4c\x21\xb4\x68\x2b\x6d\x57\x91\x29\xbd\x47\xf5\x48\x2d\x8f\x25\xea\x0d\x56\x50\x7b\xd7\x44\x1c\x2e\x9b\x45\x13\xa1\x2d\x47\xed\x08\x2a\x7c\x83\xc6\x4e\xb3\x6b\x44\x50\x21\xb4\x74\x91\xe7\xef\xb6\x8f\x26\xea\x90\xf2\x5f\x3e\x7c\xcc\x9e\xba\x68\x6c\x8b\x57\x9a\x68\xf8\x4b\x85\xa8\x3b\x5b\xbe\x92\x50\x42\x30\x9a\xa6\xf0\x20\x26\x6f\x64\x9c\xd0\x0c\x6a\x69\x08\x53\xf1\x28\x06\xb2\xc7\x8a\x68\x02\xa3\xd7\x78\x70\x3f\x83\xa2\x0b\x50\x3b\x0f\xad\x77\xb5\x36\x51\x58\x67\x03\xda\x0a\x2b\x88\x5e\x48\x9c\xfb\x70\x3e\xb0\xd2\x14\xb5\xa5\xae\xe5\x59\xc2\x6a\x06\xe4\xe0\xbe\xa3\x00\x5c\xee\x28\x9e\x6c\x10\x74\xd3\x9a\xa8\xa8\x0c\xda\x59\x90\xf4\x4a\x76\x11\xff\xe6\xdb\xe7\x6f\x17\x70\x65\x37\x48\x41\xaf\x64\x60\x0c\x4d\x19\x5c\xd5\xa0\xc3\x8f\x04\xad\x23\xd2\x85\x41\xae\xf8\x0e\x74\xc6\x64\x49\x57\xe8\xa1\x72\xcc\x8a\xdc\x0c\x5c\x50\xe8\x7b\xcd\x4d\x87\x8d\xdb\x0c\x40\x50\xba\x86\x3d\xb2\xb7\x24\x1e\x15\x7c\xd2\x79\x06\x46\xd7\x6e\x18\x6b\x96\x5c\xd7\x90\x9c\x10\xcc\xf7\x75\xbc\xa5\x65\x0a\x8b\x05\x9c\xf1\xf3\xa4\x54\x70\x31\x16\xf6\x60\x1f\x4c\xd8\x2f\x02\xb1\xcd\x64\xbf\x49\x6e\x69\x09\x0b\x90\x2d\x37\x73\x72\xb0\x42\x1e\x4a\xf5\x38\x83\x23\xbb\x2c\xcb\x18\xe8\x11\xd0\x10\xbe\x8b\x73\x74\x3d\x83\x52\x45\x3f\x31\x99\xf0\x46\x10\xd1\x6d\x47\x1d\xe6\x0b\x38\x1f\xf8\x1d\x5d\xef\x12\x9a\x54\x68\x30\x60\xb2\x7b\x9d\x01\x8d\x78\x8f\x62\x72\x42\xf3\x39\x37\xd9\x73\x31\xc7\xd9\x3e\xd4\x51\x49\x5b\xb9\xba\xde\x4b\xb9\x2b\xf6\x5f\x71\x09\x0c\xaf\xba\x06\x8b\x58\x61\x95\x3f\x15\x3a\xe3\x28\xa7\xa7\x42\x4c\x7a\x96\xf6\x28\xb9\x58\x0f\x83\x36\xe9\x0f\x4a\xe0\x31\x74\xde\x32\x3d\x31\x96\xa3\xbf\x3d\x5b\xb2\x3b\x9f\xce\x2f\x96\xe2\x85\x70\xfd\xab\x40\xfb\xcc\x47\xe3\x21\x75\xc6\x3d\xd2\xea\x94\x25\x8c\xb1\xc6\x55\xfd\x42\x11\xeb\x82\xae\xb7\xbf\x6b\x0a\x97\x0a\xcb\x75\x42\xfa\x7f\x04\x16\xa6\x0d\x3e\x85\x87\xe7\xe6\xa5\xb4\xd7\xad\xb6\x89\x06\x6d\x43\x1a\x15\x8b\xe3\x1e\x13\x1b\x46\x7b\x9c\xec\x4b\xd7\x6e\xf9\x6b\xc2\x6e\xd9\xe8\xfe\x55\x5a\xf7\xac\xbd\xad\x64\x06\x0d\x26\x29\x23\x7e\xfc\x99\xd1\x78\x62\x02\x34\xda\x18\x4d\x58\x3a\x5b\xc1\x02\xce\xcf\xe2\x6f\x17\xea\x9e\xb2\x2f\xc6\x15\xd2\x64\x5f\x30\x24\xd3\xcf\x32\xe0\x34\xcd\xbe\x62\x9f\xa4\xd9\xa5\x34\x26\x99\xae\x30\xdc\xe8\x86\x6f\xaf\x18\x38\x49\xe1\xe4\x10\x73\xa4\x79\xf5\x34\xa8\x58\x1d\x7c\x90\x46\x92\x41\x79\xd7\x27\x04\x14\xbc\xb6\xab\xd8\x1a\xfb\xb8\x43\x94\x1f\xa2\xcd\x9f\x83\xdb\x6f\xde\x3b\x3f\x8d\xb5\x78\x14\xdf\x03\x00\x00\xff\xff\xaa\x5d\x20\xc4\xdf\x07\x00\x00"), - }, - "/src/sync/sync_test.go": &vfsgen۰CompressedFileInfo{ - name: "sync_test.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 223698630, time.UTC), - uncompressedSize: 240, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd2\xd7\x57\xd0\x4e\x2a\xcd\xcc\x49\x51\xc8\x2a\xe6\xe2\x2a\x48\x4c\xce\x4e\x4c\x4f\x55\x28\xae\xcc\x4b\x8e\x2f\x49\x2d\x2e\xe1\xe2\xca\xcc\x2d\xc8\x2f\x2a\x51\xd0\xe0\xe2\x54\x02\x09\x64\xe6\xa5\x2b\x71\x69\x72\x71\xa5\x95\xe6\x25\x2b\x84\xa4\x16\x97\x04\xe4\xe7\xe7\x68\x94\x28\x68\x41\x25\xf5\x42\x34\x15\xaa\xb9\x38\x4b\xf4\x82\xb3\x33\x0b\x34\x34\xb9\x6a\xd1\x94\xba\x3b\x93\xa0\x38\x28\x35\x27\x35\xb1\x38\x95\x48\x1d\xce\xf9\x79\x29\xce\xf9\x05\x95\x78\x95\x03\x02\x00\x00\xff\xff\x93\xcf\x90\x60\xf0\x00\x00\x00"), - }, - "/src/sync/waitgroup.go": &vfsgen۰CompressedFileInfo{ - name: "waitgroup.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 223838274, time.UTC), - uncompressedSize: 446, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\xd0\x4d\x4e\xc3\x30\x10\x05\xe0\xb5\xe7\x14\x8f\x2e\x2a\x87\x0a\x5a\xe8\x0e\x35\x48\xac\x38\x02\x0b\xc4\xc2\x38\x6e\x62\x1a\x26\x51\x32\xa6\xaa\xaa\xdc\x1d\xd9\x04\x08\x3f\xcd\x2a\x7a\x1e\x7d\x7e\x9e\xe5\x12\x8b\xe7\xe0\xeb\x02\x2f\x3d\x51\x6b\xec\xce\x94\x0e\xfd\x81\x2d\x91\x1c\x5a\x87\x07\xe3\xe5\xbe\x6b\x42\x8b\x5e\xba\x60\x05\x47\x52\xb6\x09\x2c\xae\x83\x67\x21\x65\x2b\xa4\xcf\x56\x86\xc7\x99\xe3\x40\xa4\x7a\x31\xe2\xae\xf0\xb8\x7e\x0a\x9e\x65\x7d\x4d\x03\xd1\x36\xb0\x85\xde\x97\x38\xff\x62\x33\xdc\x15\x85\x2e\x5c\x2d\x26\x7a\x59\xf4\xf7\xe5\xe5\xe7\x15\x8b\x1c\xe9\x8c\x94\xdf\x62\x92\x6f\xb0\x8a\x93\xaa\x35\xec\xad\x9e\xc5\xc2\x37\x60\x57\x1a\xf1\x6f\xd3\xd2\xe3\xfc\x2c\x23\x35\xfc\x36\x6e\xb1\xc2\x7c\x9e\x92\x0a\x79\x0e\xf6\x75\x32\xc7\x00\xaf\x66\xe7\xf4\x8f\x67\xfd\xa7\xe4\xf9\x94\x39\xfb\x66\x6c\xdd\xf4\x4e\xa7\x38\x9b\xa8\xec\xeb\xa8\x9c\xda\x46\xfc\xd5\x69\x0b\x7f\xcb\x46\x75\x73\x91\xa0\x0f\xe2\x3d\x00\x00\xff\xff\x08\x4a\xda\xa3\xbe\x01\x00\x00"), - }, - "/src/syscall": &vfsgen۰DirInfo{ - name: "syscall", - modTime: time.Date(2019, 4, 10, 21, 27, 44, 476613264, time.UTC), - }, - "/src/syscall/syscall.go": &vfsgen۰CompressedFileInfo{ - name: "syscall.go", - modTime: time.Date(2019, 3, 5, 14, 33, 26, 82012629, time.UTC), - uncompressedSize: 1346, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x94\x41\x6f\xf3\x36\x0c\x86\xcf\xd6\xaf\x60\x8d\x01\xb1\xf1\xb9\x76\x7b\x0d\x90\x4b\x8b\xa1\xe8\x69\x05\xda\x61\x87\xae\x07\xd9\xa6\x1d\xa6\x0a\x65\x48\x74\x96\x6e\xc8\x7f\x1f\x64\x39\x6d\x92\x02\x1b\xf0\xdd\x0c\x8b\xa4\xf8\xf2\x79\xc5\xaa\x82\x1f\xf5\x48\xa6\x85\x8d\x57\x6a\xd0\xcd\xbb\xee\x11\xfc\x87\x6f\xb4\x31\x4a\xd1\x76\xb0\x4e\x20\x53\x49\x3a\xb2\xd7\x1d\xa6\x4a\x25\x69\x4f\xb2\x1e\xeb\xb2\xb1\xdb\xaa\xb7\xc3\x1a\xdd\xc6\x7f\x7d\x6c\x7c\xaa\x72\xa5\x76\xda\xc1\x5f\xda\x31\x71\xff\xe4\x88\x05\x5b\x58\x41\xa7\x8d\xc7\xe9\xc8\x10\xe3\xdd\xd8\x75\xe8\xe0\xf5\xad\xfe\x10\x54\xaa\x1b\xb9\x01\x62\x92\x2c\x87\x7f\x54\xb2\xf1\xe5\x83\xb1\xb5\x36\xe5\x33\x4a\x96\xfe\xd2\x99\xd1\xaf\xef\x2d\x7b\x6b\x30\x2d\x60\xe3\xcb\x47\x16\x74\xac\xcd\x6f\xf5\x06\x1b\xc9\x42\x7e\x4c\x4d\xa8\x03\x83\x9c\x7d\x5d\x92\xc3\xd5\x0a\x6e\xa6\xb3\x93\xc2\x0f\xa1\x70\x33\x97\xcc\xcb\x7b\x6d\x4c\x96\x1a\xdb\xa7\x05\x78\x71\xc4\xfd\x69\x85\x3c\xe4\x9e\xb4\xbd\x02\x26\xa3\x92\xe4\xa0\x92\x43\x9e\xab\xc3\x2c\x60\x08\x62\xff\x88\xc2\x63\x37\xd4\xc1\xd5\xc5\x24\x42\x1f\xff\xd3\x06\x3a\x67\x5d\x5a\x40\x3a\xa7\x2e\x03\x14\xc1\x2d\x04\x30\x1e\xd8\x0a\xe8\x9d\x26\xa3\x6b\x83\x05\x78\x44\x58\x8b\x0c\x7e\x59\x55\xff\x49\xa7\x36\xb6\xae\xb6\xda\x0b\xba\xaa\xb5\x4d\x35\x93\xf6\xe5\xb6\x4d\x73\x15\xc4\x7c\x83\x26\x6e\xc4\x73\x79\x2f\x76\xe6\x90\xd5\x33\xbd\x49\x68\x6f\x9f\xce\x4e\x61\xb9\x82\x0b\x95\x97\x21\xe1\x4e\xea\xe0\x5b\xe6\xd5\x94\xf9\x3b\xb7\xd8\x11\xcf\x03\xbb\x0c\x2a\x1f\x79\x67\xdf\x31\xfb\xee\x84\x7a\x82\xe5\x50\x46\xc7\x41\x93\x3a\xe7\xa6\x87\x01\xb9\x3d\x61\x5b\x40\x5d\x96\x65\xae\x92\xce\xba\xe8\x9f\xd0\x3a\x71\x8b\xfb\xbb\x0f\xc1\xb3\xc8\xc5\x9f\xbc\xc8\xa3\xc5\x08\x56\x2b\xb8\xbe\x8d\xae\xaa\x1d\xea\xf7\x68\x87\x9f\x74\xd8\xeb\x92\xde\xf2\x1c\xaa\x0a\x5a\xcb\x0b\x81\xd1\x63\x1c\xb7\xe1\x02\x3c\x71\x83\x40\x02\xad\xc5\x48\x1f\xf7\x51\x33\xfd\x8d\xb0\x1d\x8d\x50\xe0\x00\xcd\x5a\x3b\xdd\x08\x3a\xaf\x2e\xdc\x7a\x72\x11\xfd\xb8\x5d\xbe\x85\xc1\x1c\xa9\x8e\x1e\xb3\x01\xe2\x0b\x2f\x9f\x6c\x20\xef\x26\xa4\x55\x05\x6c\xaf\xed\xf0\x19\xf9\xeb\x9e\x24\x6b\x6c\x8b\x40\x2c\x53\xc8\x73\x74\x50\x86\x7b\x92\x17\xa7\x87\x02\x46\x62\x19\xc4\x4d\x61\x79\x01\x37\x05\xdc\x4c\xef\xa3\xaa\xbe\x66\x0a\xe4\xa1\xb1\x03\x61\x0b\x9d\xb3\x5b\x08\xcd\x7b\x38\xee\x1f\xb1\xa0\x77\x96\x5a\x88\xfb\x87\xb8\x0f\xd2\xb3\x38\x04\x59\x23\x38\xd4\xe6\xb8\xa5\x3e\xb3\xc2\x68\x78\x21\x79\x79\x5c\x25\x47\x7e\x7e\x76\x69\x01\x0d\x44\xb7\x12\x4b\xe8\x3d\xf0\xa6\x02\xea\x80\xdb\x69\x0e\x9b\xef\xb8\x3f\xea\x00\xb7\x89\x6c\xa3\x93\x80\xe6\xd7\xae\x8e\x3f\xae\x6f\xd5\x41\xfd\x1b\x00\x00\xff\xff\xa9\xfc\xcd\x86\x42\x05\x00\x00"), - }, - "/src/syscall/syscall_darwin.go": &vfsgen۰CompressedFileInfo{ - name: "syscall_darwin.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 533942322, time.UTC), - uncompressedSize: 844, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x90\x41\x6b\x32\x31\x10\x86\xcf\x9b\x5f\x31\xec\x29\xe1\x0b\x8a\x7e\xad\x37\x4f\xc5\x83\x27\x8b\x16\xda\x9e\x64\x36\x66\x35\xdb\x6c\x36\x4c\x66\x91\x52\xfc\xef\x45\x71\xeb\x41\x2d\x6d\xf1\xb2\x0c\x2f\x9b\xe7\x79\x67\xfa\x7d\xf8\x57\xb4\xce\xaf\xa0\x4a\x42\x44\x34\x6f\xb8\xb6\x90\xde\x93\x41\xef\x85\x70\x75\x6c\x88\x41\x8a\x2c\x5f\x3b\xde\xb4\x45\xcf\x34\x75\x7f\xdd\xc4\x8d\xa5\x2a\x9d\x86\x2a\xe5\x42\x09\x51\xb6\xc1\xc0\xfe\xf3\xf8\x20\xcb\xc3\x20\x95\x82\xd6\x05\x8e\x4c\xf0\x21\x32\x57\x42\x95\x7a\xd3\xc0\x96\x02\xfa\x59\x51\x59\xc3\xb2\x54\x30\x1e\x5f\xc8\xbd\x2b\xcc\x72\x4b\x8e\xed\x92\x09\xeb\xd8\x78\x17\xac\xda\x63\x32\xb2\xdc\x52\x80\xc5\xeb\x62\xf9\x3c\x9f\x3e\x4d\x44\xb6\x13\x5d\x78\xd4\xc9\xda\x85\x36\xcd\x82\x55\x62\x77\x6c\x76\x5c\x4b\x32\x61\xd4\x80\x03\x0d\x38\xd4\x80\xff\xbb\x27\x0a\x24\x0d\x34\xd0\xb0\x0b\x34\x58\x22\x98\x10\x85\xe6\xe0\xed\xb4\x57\x38\x67\xa6\xd1\xd9\x2f\x1a\xf0\x4e\x03\xde\x6b\xc0\xd1\x1f\xb5\xdf\x43\xcf\x3b\xbc\xdc\xa6\x44\xc4\xe0\x8c\xcc\xbf\xa8\xe0\x12\x84\x86\xc1\xd5\xd1\xdb\xda\x06\xb6\xab\xfc\x24\x27\xdc\x5e\xbb\xd2\x6f\xd7\x9e\x5f\x47\x5d\xf2\xdd\xf6\xe6\xf3\x1f\x72\xf7\x4d\x3e\x03\x00\x00\xff\xff\xb8\x46\xa3\x7f\x4c\x03\x00\x00"), - }, - "/src/syscall/syscall_linux.go": &vfsgen۰FileInfo{ - name: "syscall_linux.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 224187091, time.UTC), - content: []byte("\x2f\x2f\x20\x2b\x62\x75\x69\x6c\x64\x20\x6a\x73\x0a\x0a\x70\x61\x63\x6b\x61\x67\x65\x20\x73\x79\x73\x63\x61\x6c\x6c\x0a\x0a\x63\x6f\x6e\x73\x74\x20\x65\x78\x69\x74\x54\x72\x61\x70\x20\x3d\x20\x53\x59\x53\x5f\x45\x58\x49\x54\x5f\x47\x52\x4f\x55\x50\x0a"), - }, - "/src/syscall/syscall_nonlinux.go": &vfsgen۰FileInfo{ - name: "syscall_nonlinux.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 224294407, time.UTC), - content: []byte("\x2f\x2f\x20\x2b\x62\x75\x69\x6c\x64\x20\x6a\x73\x2c\x21\x6c\x69\x6e\x75\x78\x0a\x0a\x70\x61\x63\x6b\x61\x67\x65\x20\x73\x79\x73\x63\x61\x6c\x6c\x0a\x0a\x63\x6f\x6e\x73\x74\x20\x65\x78\x69\x74\x54\x72\x61\x70\x20\x3d\x20\x53\x59\x53\x5f\x45\x58\x49\x54\x0a"), - }, - "/src/syscall/syscall_unix.go": &vfsgen۰CompressedFileInfo{ - name: "syscall_unix.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 534522478, time.UTC), - uncompressedSize: 3370, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xe4\x57\x4d\x6f\x1b\x37\x10\x3d\xef\xfe\x8a\x09\x51\x04\xdc\x88\x5d\x7d\xb4\x0d\x8a\xba\x3a\x38\xae\x6a\x08\x70\xed\x20\xb2\x9b\x16\x41\x60\x50\xda\x59\x99\xd2\x8a\x54\x49\xae\x1c\x21\xd1\x7f\x2f\xf8\xb1\x96\x2c\xe9\x50\x23\x41\x50\x20\x37\x61\xe7\xcd\xcc\xe3\x9b\x21\x67\xd4\x6e\x43\x6b\x5c\x8b\xaa\x80\x99\x61\xcf\xee\x85\x2c\xd4\xbd\x49\xd3\x25\x9f\xcc\xf9\x14\xc1\xac\xcd\x84\x57\x55\x9a\x8a\xc5\x52\x69\x0b\x34\x4d\x88\xae\xa5\x15\x0b\x24\x69\x42\x6a\x69\x78\x89\x24\x4d\x13\x32\x15\xf6\xae\x1e\xe7\x13\xb5\x68\x4f\xd5\xf2\x0e\xf5\xcc\x6c\x7f\xcc\x0c\x49\xb3\x34\x2d\x6b\x39\x81\xe8\x7e\x8b\x72\x65\x68\x06\xef\xde\x1b\xab\x85\x9c\xc2\xc7\x34\x59\x6a\x35\x41\x63\xe0\x97\x3e\xcc\x4c\x7e\x5e\xa9\x31\xaf\xf2\x73\xb4\x94\x44\x0b\xc9\xd2\x44\x94\xd0\xe0\xfa\x1e\x77\x23\x0b\x2c\x85\xc4\xc2\x85\x48\x34\xda\x5a\x4b\x90\xa2\x4a\x93\x4d\x9a\xcc\xcc\x40\xae\x5c\xc0\xe8\x13\xc2\xa1\x5c\xb9\x50\x28\x57\x73\x5c\x1f\xcb\x77\x35\x9e\xe1\xc4\x92\x2c\x3f\xe3\x55\x45\x89\x43\x11\x06\x3e\x58\xf0\xf3\x4e\x0b\x3e\x47\xda\x1c\x80\x41\x0c\x97\x5f\xa0\x9c\xda\x3b\x9a\x65\x69\x52\x2a\x0d\xc2\x41\x3b\x27\x20\xe0\xd7\x03\xc8\x09\x88\x56\xcb\xf3\x9e\xe3\xda\xe1\x1a\xc0\x50\x16\xf8\x81\x8a\x2c\x1f\xf9\xe0\x34\x4b\x13\x9f\xf6\x9d\x78\x0f\x7d\x70\xe0\x16\x90\x3e\x81\x56\x20\xe5\x59\xcf\x71\xbd\x8b\xdf\xa4\x8d\x18\xce\x31\xdd\x44\xfd\x0d\x5a\x94\xab\xdb\x09\x9d\x33\x58\x41\xe0\x9e\x7d\x59\xf5\x7d\xee\x43\xc1\xf3\x91\x23\xc9\x60\x95\x3d\x90\xa9\xe5\x96\xce\xd7\xe5\xf2\x1b\x56\x68\x91\xce\x3d\x97\x15\xd7\x4d\xab\xff\xa1\x8a\xba\x42\x78\x31\x33\x79\x68\x02\x6f\xe4\x95\x46\x5e\xac\xaf\xb5\xc0\xe2\x5a\x5d\x28\x5e\x40\x1f\x4a\x5e\x19\xf4\xe6\x85\x90\xb5\xb9\x92\x08\x7d\xf8\xbe\xdb\xe8\x1c\xe2\xbd\x5a\x5f\xf2\x05\x52\xc9\x17\xf8\x70\xc0\x6d\x70\x47\xb4\xc0\x12\x35\x38\x1f\x9a\x45\xe2\x13\xb5\x42\xed\x6b\xde\x6e\xc3\xb6\xa3\x41\x94\x10\x8d\x58\xa4\xc9\x86\x06\x11\x1e\x33\xef\xf7\x3d\xd4\x05\x12\xe5\x31\xe2\xce\xf2\xe8\x9a\x38\x85\x92\xa3\x27\xb4\xba\x46\x4f\xe8\x9f\x5a\x68\x3c\x52\x8d\x68\x71\xd5\x48\x3c\xb9\x00\x3c\x56\x8e\x64\xc9\xa5\x98\x50\xe2\xb1\x2e\xe3\x1e\xed\xc6\x39\x1f\xca\x95\x9a\x23\x25\xd1\x4e\x1e\xb5\xf2\x23\x27\xcf\xc1\x29\xbb\x6d\xa8\x51\xb0\x53\xab\xf9\x92\x01\xef\x32\xe0\x3d\x06\xfc\x07\xa8\x85\xb4\x4b\xab\x33\xa0\xba\xcb\x40\xf7\x9a\x0f\x0c\x50\x6b\x18\x68\x2d\x95\x57\x5f\x94\x50\xba\x83\x3e\x2e\x1f\x19\x35\x64\x4e\xa0\x84\x67\x5b\x89\xb5\xc3\x96\x0d\xe7\xfd\xac\xd9\xf6\x41\x8a\xe9\xa8\x8e\x57\xbb\x93\xe5\x43\x69\x69\x96\xb1\x03\x53\x77\x6b\xf2\xbc\x1e\x0c\xbd\xc6\xe0\x15\x11\x25\xb8\x7c\x4e\xec\xd1\xdf\xa3\xdb\xb7\x6f\x86\xd7\x03\x78\xfe\x1c\x28\xef\xba\x6f\x5d\xf8\xf4\x09\xc2\xcf\x5e\xe8\x2b\xae\x35\x5f\xc7\x22\x0e\xa5\x45\x2d\x79\x15\xda\x90\xf2\x9e\xa3\x6a\x2a\x31\xc1\x9d\x87\x6d\xbc\xb6\xc8\xc0\xbb\xed\x3e\x6a\xc9\xa1\xbf\xf7\x0c\x17\x9c\x7c\xe7\x1d\x48\x74\x74\xf8\xa5\x16\xd2\x5e\xab\x33\x25\x8d\xaa\x30\x82\x0f\xa5\xd9\x4b\xc4\xa0\xc3\xa0\xb3\x7f\x54\xfc\x20\xec\xb5\xfb\xed\xd5\x0f\xb3\x24\x3f\x57\xee\x73\x7c\xf4\x7c\xb6\xb7\x5c\xcb\xf8\x0e\xee\x65\x69\xee\x6a\x88\x3f\x38\x3d\x3b\x1b\x8c\xf6\xdb\xe7\xe5\x41\x25\x19\xf0\x1f\x19\xf0\x9f\x18\xf0\x97\x5f\xa8\x97\x5e\x3e\xb1\x99\x76\x29\x7c\x95\xc6\x7a\xd6\x87\x5e\xa7\x07\x1f\xa1\xdd\x86\x39\x6a\x99\x2b\xa3\xb1\x42\x6e\x10\x94\x84\xab\x11\xfc\xc5\xe0\x8e\x2f\x97\x28\x0d\x08\x09\x42\x0a\x0b\xaa\x04\xa2\x0c\x81\xb8\x40\x34\xc5\xdf\x29\xc7\xe6\x69\x15\x79\xc3\xef\xbf\xa1\x3b\xfd\x39\xbd\xab\x1f\x94\xba\x54\x03\xad\x95\xfe\xef\x82\xfd\xef\x54\x7a\xaa\x18\x47\xda\xe5\xdb\xbe\xc3\x9f\xd3\x48\xaf\xd6\x16\x5f\x5b\xfd\xbb\x56\x8b\xb8\x4d\x9a\x87\xd5\x85\xbe\x08\x43\x01\x5d\x83\x79\x81\x76\xa7\xca\xee\x6a\x70\x23\xa4\xfd\xf9\xd4\x8f\x82\x2c\xbf\xc4\x7b\x5a\xa1\xa4\x26\x83\x16\x74\x9b\xc5\x98\xc1\xd8\x39\x6a\x2e\xa7\x08\x61\xdc\x38\x44\x5c\x5d\xc6\xee\xb9\xef\xec\xaf\x2b\x0c\x06\xc3\xcb\x3f\x4f\x2f\x9a\xb5\xc5\xcf\x8c\x11\xda\xb8\x30\x33\x18\x07\x01\xf6\x0c\x21\x39\x83\xce\x56\x8b\x70\x94\x8c\x86\x3f\x31\xf9\x6b\x25\xdc\x4c\x8b\x53\xe8\xc6\x7f\xa4\x99\xd3\xd9\x2d\x49\x9b\xf4\xdf\x00\x00\x00\xff\xff\x77\x4c\x60\x3e\x2a\x0d\x00\x00"), - }, - "/src/syscall/syscall_windows.go": &vfsgen۰CompressedFileInfo{ - name: "syscall_windows.go", - modTime: time.Date(2019, 3, 30, 12, 48, 4, 535202773, time.UTC), - uncompressedSize: 2566, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x96\xdf\x6f\xdb\x36\x10\xc7\x9f\xad\xbf\xe2\xe0\x87\x81\xf4\xb8\x38\x72\x97\xcc\x29\xe0\x87\x20\x76\xd3\x01\xee\x52\x24\x2e\x0a\xac\x28\x0a\x4a\x3c\xc9\x6c\x29\x52\x20\x29\xa3\x4e\x9a\xff\x7d\xa0\x7e\xd8\xca\x92\x02\x1b\x1a\x18\x7d\x91\x45\xde\x97\x77\x9f\xfb\x21\xc2\xe3\x31\xfc\x9a\x54\x52\x09\xf8\xec\xa2\xa8\xe4\xe9\x17\x9e\x23\xb8\xad\x4b\xb9\x52\x51\x24\x8b\xd2\x58\x0f\x43\x5b\x69\x2f\x0b\x1c\x46\xd1\x86\x5b\x28\xa4\xae\xdc\x95\x46\x98\xc1\x6f\x71\x14\x65\x95\x4e\xe1\xa6\x39\x42\xbc\xe5\x25\x03\xcd\x6d\xee\x18\xf0\x98\x01\x9f\x30\xe0\x2f\xa0\x92\xda\x97\xde\x52\x20\x36\x66\x60\x27\xdd\x06\x03\xb4\x16\x16\xd6\x6a\x43\xe1\x2e\x1a\x94\x56\x6a\xff\x9e\x5b\x2d\x75\x4e\x68\x34\xb0\xe8\x2b\xab\x3b\x35\xe9\x42\x53\x06\xc7\x0c\x16\xe7\x17\x17\x8b\x9b\xe8\xfe\x21\xc3\xe9\xf7\x20\x18\xf0\xdf\x19\xf0\x13\x06\xfc\xf4\x90\x40\x67\xff\x05\x88\x01\xff\x83\x01\x9f\x32\xe0\x67\x87\x84\x8b\x27\xff\x97\x2e\x68\x8e\xc3\x23\x28\xe3\xc9\x41\x61\x4f\x7e\x10\x36\x3c\x82\x36\x0e\xe2\xf8\xe4\xa0\xec\xd3\xe7\x65\x0f\x8f\x20\x8f\x83\x3e\x9e\x1e\x24\x15\x65\xb8\x50\x32\xb1\xdc\x6e\x49\x26\x15\x6a\x5e\x20\x8c\xc2\xd1\xf8\x94\x02\x59\x73\x2d\x14\xfe\x78\xe0\x7f\x45\xcd\xd1\x97\xd6\xa4\x5c\x08\x8b\xce\x3d\x8a\x12\x6c\x7b\x90\x29\x05\x12\x76\x9e\x9d\x82\x08\x18\x2d\xf9\xed\x76\xbe\x5c\x52\x58\x1a\x2e\x08\x0d\xae\x8d\x0d\x5e\x5b\x2f\xbf\xcc\x97\xcb\x45\xd8\xbb\x7b\xe3\xf2\x97\x30\x74\x5b\xe7\xb1\x80\xd0\x7e\x07\xda\x78\xe0\x1b\x2e\x15\x4f\x14\x32\x70\x88\xb0\xf6\xbe\x74\x2f\xc7\xe3\x5c\xfa\x75\x95\x1c\xa5\xa6\x18\xe7\xa6\x5c\xa3\xfd\xec\xf6\x2f\x89\x32\xc9\xb8\xe0\xce\xa3\x1d\x0b\x93\x8e\xdb\xdb\xd9\x1d\x15\x62\x78\xbf\xc7\x2b\x1b\xbc\xb7\xd6\xa4\x14\x5e\x49\xfd\x93\xf1\xe5\xe8\x6f\xbc\x78\x5d\xf7\x8e\xac\x41\x6a\x4f\x81\x64\x02\x9a\x9d\xba\x35\x32\x83\x35\xcc\x66\x70\xb3\x9a\x7f\xba\x7a\xb7\x7a\xfb\x6e\xf5\xe9\xf5\xf9\x5f\xf3\xe5\x22\x18\xbb\x14\xe2\x68\x70\xff\x50\xba\xb8\xbe\xbe\xba\x7e\x42\x39\xa9\x95\xed\xe2\x78\x07\x72\x89\xfe\xc2\x68\x67\x14\xbe\x31\x02\x49\xda\xbc\xb7\x1c\x0c\x0a\x23\xda\x49\x7a\x31\xa1\x40\xc2\xf0\xd4\x55\xa4\xbd\x32\xce\xab\xa2\xd8\x36\x75\xdc\x27\xf8\xde\x4a\x8f\xaf\x64\xc8\xae\x19\xd0\xce\x63\x52\x65\xf0\xe1\x63\xb2\xf5\xc8\x40\x18\xbd\xf3\xce\xc0\x6c\xd0\x2a\x5e\x96\x28\x60\x74\xb5\x7b\x7f\x14\x35\x24\xdb\xb8\x9c\xcd\x20\x86\x6f\xdf\x7a\xcb\x49\x9d\x71\x3d\xd4\x2b\xd3\xe6\x45\x92\x2a\xa3\xd1\x60\x30\xaa\xa3\xcd\xa0\x09\x47\x14\xea\xda\x42\xf7\x25\xd2\x52\xd5\x45\xfa\xce\x47\x11\xcc\x5d\x7a\x8b\xaf\xd2\x87\xd9\x0a\x5f\x20\x7e\x95\x3e\x0d\x75\xea\xca\x14\x4a\xd3\xfc\x45\x38\xba\x34\xc1\x4a\xe8\xc3\x7a\x17\x05\xd7\x62\x29\x35\x12\x0a\x24\x2d\xc4\xfe\xd2\xd8\x55\x75\x77\xa0\xa7\x5e\x99\x73\x9b\x6f\xfa\x07\x18\x70\x9b\xa7\x30\xea\xfa\xc3\x6d\xbe\x81\xd1\x87\x69\x7c\x36\xf9\xd8\xfe\x74\xc2\x27\x5b\xa7\xa5\x62\x4f\xf7\xef\x12\x3d\xea\x0d\xf9\x82\x5b\x70\xde\x4a\x9d\x53\x20\x1b\xae\x2a\x6c\x97\x0c\x32\x53\x69\x01\x89\x31\xaa\xef\x71\x38\x64\x90\x71\xe5\xb0\xef\x69\x25\x0b\xfc\xdb\x68\xfc\x53\x67\xc6\x16\xdc\x4b\xa3\x89\xbf\x95\x30\x0a\x86\x5b\xa3\x51\xee\x0d\xe1\xc6\x4e\xa1\x9b\x89\x27\xa9\x8f\x1f\x33\xfb\x6d\x89\xbd\xcd\x00\x59\xa5\xfe\x6e\x77\x1d\xf4\x8d\x14\xea\x1f\x42\xdb\x54\x1e\xd0\x47\xf7\xd1\x3f\x01\x00\x00\xff\xff\x47\x14\x60\x60\x06\x0a\x00\x00"), - }, - "/src/testing": &vfsgen۰DirInfo{ - name: "testing", - modTime: time.Date(2019, 3, 27, 13, 36, 51, 785397840, time.UTC), - }, - "/src/testing/example.go": &vfsgen۰CompressedFileInfo{ - name: "example.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 224716063, time.UTC), - uncompressedSize: 1424, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x54\x5d\x6b\xf3\x36\x14\xbe\x96\x7e\xc5\xa9\x20\x45\x5a\x5d\x85\xdd\x06\x7c\x51\xb6\x06\x0a\xa5\x2b\xcd\x7a\x57\x18\xaa\x73\xec\x6a\xb5\x25\x23\xc9\x49\xc7\x9a\xff\x3e\x74\xec\x7c\x8e\xf7\xe6\xbd\x09\x91\x2c\x3d\xe7\xf9\x38\x47\xf3\x39\xdc\xbc\x0f\xb6\x5d\xc3\xdf\x91\xf3\xde\x54\x9f\xa6\x41\x48\x18\x93\x75\x0d\xe7\xb6\xeb\x7d\x48\x20\x39\x13\x75\x97\x04\x67\xc2\xc7\xfc\x1b\x53\xb0\xae\xa1\xbf\xc9\x76\x28\xb8\xe2\xbc\x1e\x5c\x05\x61\x70\xf7\x5f\xa6\xeb\x5b\x94\xd8\xc0\x83\x4b\x18\x9c\x69\xa7\x2d\x05\xd2\x7f\xc2\xbb\xf7\xad\x82\x7f\x39\xb3\x35\xfc\x52\x7d\x98\x94\xfe\xc9\x2b\x56\x77\x49\x3f\x07\xeb\x52\x2d\x45\x59\x96\xf0\xf2\xfa\x04\x00\xb3\xf8\xe6\x44\x01\xd8\xe8\x27\xd3\xa1\xe2\x6c\xc7\x39\x9b\xcf\xe1\x37\xd3\xa7\x21\x20\xc4\xb4\xf6\x43\xd2\x9c\x8d\x7f\x60\x51\x82\x8f\x7a\x45\x0b\xce\xb6\x05\x60\x08\x79\x33\x61\xd7\x2f\x6d\x8b\x52\x68\x01\x37\x7b\x3c\xb8\x01\xa1\x27\x08\xa1\x88\x52\x3e\x7f\x55\x82\xb3\xed\x81\xd5\xb2\xcf\xb4\x5a\x27\x47\x64\x0c\x81\x60\x15\x67\xcc\x47\x7d\xff\x65\x93\xfc\x95\x98\xb1\x43\x69\x28\x61\xcb\x33\x29\x13\x88\x53\x76\x49\x3f\xf9\xad\x54\x9c\xf9\x4f\x28\x21\x85\x01\x27\x25\x2d\x1a\x07\x43\x0f\xd6\x81\x81\x35\xd6\x18\x02\xae\xa1\x32\x6d\x0b\xd1\xc3\x16\xa1\x32\x0e\x02\x56\x7e\x83\x01\x6c\x0d\xe9\x03\x01\x47\x47\xa1\x37\xce\x56\x51\x73\x46\xf7\x20\x67\x20\xc9\x5c\xb6\x8e\x89\x84\xd7\x5d\xfa\x7d\x08\x26\x59\xef\xe4\x91\x85\x5e\x0d\xef\x92\xd8\x29\xc5\x39\x1b\x79\xf8\x88\x50\xdb\x16\x0b\x08\x18\x93\x3f\xb8\x5b\x40\x83\x09\xfc\x90\x7a\x72\x9a\x6d\x35\x9d\x95\x93\x01\x07\xc5\x71\x72\x9d\xd1\x9d\x80\x66\x9d\x1d\xbf\x1f\x03\xd8\x2f\xe5\x96\x9c\x97\x2a\xdf\xfe\x0b\x28\xae\x17\xec\xfc\xe6\xfc\x8b\xad\xcf\x00\x4e\x12\x39\x89\xa4\x3e\x4d\x44\x4c\x5d\xbb\xa0\x8b\xd6\x35\x13\x1f\x92\xb4\x80\xd9\x86\x1a\xe9\x04\x34\x97\x39\x0b\x90\x7a\x8b\x6d\x4c\x80\xda\xd8\x16\xc6\x26\xe7\x8c\xe1\x5e\x01\x45\x40\xb2\x1b\x4f\xb1\x4e\x73\xa0\xff\x0c\xb6\x5b\xf5\xa6\x42\xe9\x87\x94\xbf\x6f\x8d\xfb\xc1\x01\x6c\xf4\x1f\xe4\xe4\xa4\x12\x1b\xfd\xea\x7c\x58\x63\x0e\x9d\xf4\xd9\x1a\xa2\x0f\xe9\xd1\x3a\x8c\xb2\xf1\x49\x65\xf5\xc7\x9d\x0c\xad\xe0\xfa\x9a\x3a\xb5\x3c\xf1\x85\x11\x6b\x4a\x5c\xaf\x26\x7f\x44\xe3\xd3\xe2\xcd\xe5\x29\x22\x4a\x72\xd8\xd7\x52\xd3\xb6\x28\x80\xe2\x3a\xe3\x95\x7b\x99\xed\x00\xdb\x88\x07\x4e\x59\xf2\x55\x09\x04\xf3\x73\xd5\x8f\x15\x1b\x9f\x0a\x42\x3a\x16\x1b\xdd\x20\x90\xab\x12\x84\x80\xef\xef\xcb\x59\x3c\x7b\x22\x6e\x6f\x6f\x61\x79\xf7\xf0\xb8\x80\x59\x04\x39\x8b\x2a\x83\x1f\x5f\x8a\x02\xf2\x00\x14\x04\x38\x06\x9d\xa7\xae\x36\x6d\xc4\xa3\xb4\x8b\x17\xe8\x7f\xf8\xcf\x77\xab\xd5\x09\xfe\x25\xba\x3a\xf2\xbe\x64\x4a\x73\x29\xa7\x47\x62\xc7\xd9\x4e\xaa\x71\xda\x5f\x06\xb7\x1f\x5e\xcd\x19\x36\x7a\x99\xfb\x29\x60\x1a\x82\xe3\x3b\xfe\x5f\x00\x00\x00\xff\xff\x6d\xa8\x39\x72\x90\x05\x00\x00"), - }, - "/src/testing/ioutil.go": &vfsgen۰CompressedFileInfo{ - name: "ioutil.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 224830486, time.UTC), - uncompressedSize: 1163, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x53\x61\x6f\x23\x35\x10\xfd\x6c\xff\x8a\x21\x12\xc8\xbe\x8d\x36\xbb\x69\x2f\x52\x7b\x04\xe9\xc8\x05\x74\x52\x29\x28\x6d\x05\x12\x42\x95\xb3\x3b\x2e\x43\x37\xf6\xca\xf6\x96\x44\xd0\xff\x8e\x6c\x6f\xb7\x94\x4f\x7c\x48\x76\x3c\x9e\x7d\xf3\xe6\xcd\xdb\xc5\x02\x8a\xfd\x40\x5d\x0b\x7f\x78\xce\x7b\xd5\x3c\xaa\x07\x84\x80\x3e\x90\x79\xe0\x9c\x0e\xbd\x75\x01\x04\x67\xb3\xfd\x29\xa0\x9f\x71\x36\x23\x1b\xff\x6d\x8a\x7d\x70\x8d\x35\x4f\x29\x3c\x99\x26\x3e\x03\x1d\x70\xc6\x25\xe7\x4f\xca\x81\x53\xa6\x85\x81\x4c\x38\x5b\x4e\xe7\xc3\x00\xb1\xb6\xfc\x61\x08\x78\xe4\x5c\x0f\xa6\x01\x87\x1e\xb1\x15\x72\xac\x85\xbf\x38\x73\x18\x06\x67\xc6\x84\x88\xa8\xe5\xb5\xfd\x53\xc8\xf2\xce\xd0\xf1\x5a\x19\x2b\x24\x14\x40\x26\xac\xce\x85\xf5\xe5\xf7\x18\x7a\x6a\x85\x94\x92\x3f\x8f\xa0\x06\x8f\xe1\x66\xd0\x9a\x8e\x42\x82\x0f\x8e\xcc\x43\x02\x4e\x1c\xca\x2b\xdb\x3c\x0a\xc9\x99\x83\xcb\x75\xe2\xc5\x19\x69\x70\xb0\x5e\x43\x15\xcb\x98\x83\xf5\xc4\x8b\xb3\x67\x9e\x13\xef\xea\xd5\xea\xfc\xfd\xf2\x3d\x14\x50\x57\xf5\xd9\x45\x75\xbe\x5c\x9e\xc1\x62\x01\x8d\x35\x3e\x28\x13\x3c\x68\x67\x0f\x70\x3d\x1c\xd0\x51\xa3\x3a\xd8\x61\x43\x3d\xfa\xdc\x38\x42\x4c\x14\xee\x4c\xf7\x42\x22\x0f\x3b\xca\x59\x7e\x0e\x56\x09\x32\x41\xd4\x78\x01\x05\xb8\x2f\x6b\xbc\x90\xf2\xd7\xfa\xf2\xb7\x38\xdc\x62\x01\x1f\x21\x4e\x18\xc8\x1a\xd5\x41\x63\xfb\x13\x58\x0d\x64\x87\x40\x5d\x79\x8b\x87\xfe\x3b\xea\x70\x0e\xc1\x82\x7a\xb2\xd4\x02\x1e\x83\x53\x90\x97\xe9\xcb\xac\x4e\x18\xcb\x44\xef\x50\xd3\x71\x14\x48\x82\xd0\xf0\xce\xfa\x32\x23\xa0\x73\xf1\x67\x9d\x8c\x92\xb4\x94\xc4\xb2\x3e\xf5\xf8\x44\x4e\x48\xce\x99\x69\xac\xd1\x1d\x35\x21\xde\x55\x9c\x69\xeb\x80\x52\xfc\x01\x08\xbe\x86\xba\xaa\xaa\x18\x16\x45\x92\xd5\xa8\x03\xc6\xdb\x08\x56\x8c\x5d\xe3\x02\x7f\x52\xe1\xf7\x1b\xec\x95\x53\x21\xb6\x2b\x60\xe4\x55\xbc\xd9\x23\x67\x4c\x67\x5a\x89\xc7\x8f\x3d\x9a\x34\x44\x44\x9d\xa7\xcc\xfd\xee\xd3\xcf\xbb\xbf\x53\xb4\xd9\x6d\x3f\xde\x6e\x73\xbc\xfd\x65\x73\x35\x87\x6a\x55\x55\x11\x83\x74\xac\xfd\xec\xb7\x47\xf2\x41\xa0\xcb\xf3\xa5\xfc\x34\x4e\x51\x7c\x78\x3d\xc0\x37\x50\x67\x5b\xb0\xff\x1a\x68\xcc\xbc\x71\xcb\x6b\xd5\xeb\x8e\x59\xf4\x10\x63\x8d\x35\x81\xcc\x80\x3c\x9f\xf7\x0e\xd5\x63\xb6\x57\xf2\xc0\xe4\x5e\x87\xaa\x4d\xa3\x69\xea\x30\x89\x36\x6d\x28\x07\xf3\x7f\x6d\x66\xd4\xe4\x72\x12\x65\x7a\x4b\x26\x5b\xc7\xcb\x2f\xd6\x60\xa8\xcb\xd6\xce\x76\x9b\xcd\xd2\x6b\xa9\x7b\x8b\x1a\x1d\xe8\x72\xd3\x59\x8f\x91\x6e\xfc\x5c\xf7\x83\x86\xf4\xdd\x97\xdf\x0e\x5a\xa3\xe3\xec\xfe\x45\x7c\xb2\xe5\xc6\xf6\x27\xf1\xd5\x7e\xd0\x73\xd0\xff\xb7\xcd\x98\xda\x0f\xba\xbc\xc9\xab\x97\xf3\x58\xcf\x9f\xf9\x3f\x01\x00\x00\xff\xff\x2f\x92\x73\x9b\x8b\x04\x00\x00"), - }, - "/src/testing/testing.go": &vfsgen۰CompressedFileInfo{ - name: "testing.go", - modTime: time.Date(2019, 3, 5, 14, 5, 37, 324073976, time.UTC), - uncompressedSize: 642, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x91\x4f\x6f\xd3\x40\x10\xc5\xcf\xde\x4f\xf1\xc8\x85\x16\x2c\xfb\x1e\x01\x17\x50\xf9\x23\x44\x0f\x6d\xcf\x68\x63\x8f\xe3\xc1\xeb\x59\xb3\x33\x4b\x04\x55\xbe\x3b\xda\xa4\x11\x21\xea\x79\xe7\xf7\x7b\x6f\x66\xdb\x16\xaf\x37\x99\x43\x8f\x1f\xea\xdc\xe2\xbb\xc9\x6f\x09\x46\x6a\x2c\x5b\xe7\x78\x5e\x62\x32\xac\x52\x16\xe3\x99\x56\xce\xb5\x2d\xee\x47\x42\x5e\xd4\x12\xf9\x19\x9d\x0f\x81\xd2\x37\x3f\x13\xbc\xf4\x18\x92\x9f\xe9\x6e\xe2\x05\x89\xc2\x6f\x44\xc1\x13\xda\xbc\x3f\x0c\x6a\x5d\x0c\x65\x72\xf1\xc2\x1d\x78\x80\x8d\x94\x08\x3e\x11\xfe\x50\x8a\x4f\x42\xc5\x10\xb3\xf4\x0d\x3e\xc5\x1d\xfd\xa2\x54\x5f\x7a\x8a\x86\x15\x12\x0d\x3c\x2f\x81\x66\x12\xa3\x1e\x43\x4c\xf8\x18\x97\x91\xd2\x97\x3b\x78\x83\x8d\xac\x28\x5c\x0d\x8d\xd8\x11\x3a\x2f\x2f\x0d\x59\xa9\x08\x6c\xf4\x67\xb8\x37\x8e\xd2\xe0\x41\xa9\x74\x52\x82\x5a\xde\x28\x58\xd4\xc8\xf7\x8d\x1b\xb2\x74\x67\xfb\x5e\x69\x59\x93\xc5\xae\xa1\x96\x58\xb6\x78\x74\x55\xdb\xe2\xe1\x99\xd3\x24\xfa\x99\x39\x91\xc2\xa3\x58\x4a\x90\x0f\x97\x2b\x35\x07\xfc\xfe\xf6\xc3\xed\x1a\x9f\x4f\xa5\xca\x85\x96\xa8\xca\x9b\x40\x8d\xab\x12\x59\x4e\x82\xd5\x9b\x2c\x93\xc4\x9d\xbc\x5b\xb9\xbd\x3b\x36\xbb\x7a\xd5\xc5\x79\x8e\x72\xfd\xef\x13\xce\x2a\x9e\xb2\x6e\xca\x5b\x69\xfa\xbd\xc6\xc0\x81\x6a\x04\x16\xaa\x11\x27\xac\xdf\x5e\x34\x3a\xe0\xd7\xae\xe2\x01\x2f\xe2\x54\xa0\x53\xfe\x7f\xb6\xc7\xbd\xab\xf6\xee\xf9\x27\x57\x55\x37\x1c\x68\x7d\xcc\x72\x55\xf5\x95\x85\xd6\xc7\xcc\x42\xed\xdd\xdf\x00\x00\x00\xff\xff\x1b\x9f\xb2\xfc\x82\x02\x00\x00"), - }, - "/src/text": &vfsgen۰DirInfo{ - name: "text", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 225056982, time.UTC), - }, - "/src/text/template": &vfsgen۰DirInfo{ - name: "template", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 225121786, time.UTC), - }, - "/src/text/template/template.go": &vfsgen۰FileInfo{ - name: "template.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 225166851, time.UTC), - content: []byte("\x2f\x2f\x20\x2b\x62\x75\x69\x6c\x64\x20\x6a\x73\x0a\x0a\x70\x61\x63\x6b\x61\x67\x65\x20\x74\x65\x6d\x70\x6c\x61\x74\x65\x0a\x0a\x63\x6f\x6e\x73\x74\x20\x6d\x61\x78\x45\x78\x65\x63\x44\x65\x70\x74\x68\x20\x3d\x20\x33\x30\x30\x30\x0a"), - }, - "/src/time": &vfsgen۰DirInfo{ - name: "time", - modTime: time.Date(2019, 4, 10, 21, 38, 35, 793313431, time.UTC), - }, - "/src/time/time.go": &vfsgen۰CompressedFileInfo{ - name: "time.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 225365536, time.UTC), - uncompressedSize: 2155, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x55\xdf\x6f\xdb\x36\x10\x7e\x26\xff\x8a\x9b\xb0\x21\x64\xa3\x48\xf9\x51\x64\x58\x10\x0f\xd8\x92\x35\x08\xd0\xd4\xc0\x92\xbe\xac\x28\x06\x9a\x3a\xd9\x74\x64\x52\x20\xa9\x38\x8e\xeb\xff\x7d\x20\x29\x2b\x76\xbb\x15\x98\x9e\xc4\xe3\xf1\xee\xfb\x3e\x1e\xef\xca\x12\x0e\x27\x9d\x6a\x2a\x98\x3b\x4a\x5b\x21\x1f\xc5\x14\xc1\xab\x05\x52\xaa\x16\xad\xb1\x1e\x18\x25\x99\xed\x74\xb0\x65\x94\x92\x6c\xaa\xfc\xac\x9b\x14\xd2\x2c\xca\xa9\x69\x67\x68\xe7\xee\xf5\x67\xee\x32\xca\x29\x2d\x4b\xb8\x13\x8f\x08\xae\xb3\x29\x5a\xf1\x51\xab\x67\xa8\x3b\x2d\x41\xe8\x2a\x99\x1e\xd4\x02\xc1\x79\xdb\x49\x0f\xca\x83\x45\xdf\x59\xed\x40\x58\x04\xd1\x2c\xc5\xca\x81\xd2\xb2\xe9\x2a\xac\x60\xa9\xfc\x0c\xfc\x4c\x39\xd8\x42\x64\x15\xba\x56\x79\x84\xeb\xab\x3f\x78\x1e\x12\x4e\x50\x8a\xce\x21\xf8\x19\xae\x0e\x2c\x82\x46\x0c\x47\x6b\x63\x41\x69\x8f\x56\x8b\x46\xbd\x08\xaf\x8c\x2e\xf1\x79\x6f\x0d\xa6\x7e\x45\x54\x5e\x0b\x8f\x05\xdc\x23\x82\x72\xae\x43\x98\x79\xdf\xba\x8b\xb2\xfc\x2e\xef\xe8\xea\xca\xd3\x9f\x7f\x29\x68\x64\xa9\xb4\xf2\x8c\xc3\x9a\x92\xb2\x04\xf1\x64\x54\x05\x15\x8a\x0a\xa4\xa9\x10\xb0\x51\x0b\xa5\x63\x6e\x4a\x9e\x84\x85\xbf\x21\x8a\x31\x82\x20\x13\x3b\xce\xe1\x98\xd3\x0d\xa5\x7e\xd5\x22\xf4\xda\x07\x07\xbb\x95\x6b\x4d\x89\x82\xf4\x29\xed\xcf\x4e\x29\x59\xce\x50\xf7\xcb\xf3\xb7\x94\xb4\x68\x95\xa9\x86\x65\xdd\x3b\x07\x68\x2c\xaa\x51\x0b\x89\xeb\x4d\x0e\x9d\xd2\xbe\xf5\x96\x53\x22\xec\x74\x1b\x70\xbb\x4d\x49\xc8\x6c\x3a\x0f\x6f\xe6\xae\x18\x4f\xe6\x28\x3d\x25\x42\x7a\xf5\x84\x00\x13\x63\x9a\x80\x72\xe0\xfb\xde\x48\xd1\x24\xd2\x15\x5c\x8c\x60\xee\x8a\x9b\xc6\x4c\x44\x53\xdc\xa0\x67\x59\x10\x36\xe3\xc5\x07\x5c\x32\x4e\x89\x0b\x1e\x55\x71\xef\xad\xd2\xd3\x60\x50\xc1\xa0\x74\x85\xcf\xbf\xaf\x3c\x32\x97\xc3\x01\x3b\xe0\x94\xcc\xbf\xb5\xf3\x60\x57\x35\x28\x18\x8d\xe0\xe8\x04\xbe\x7c\x81\x79\xff\xbb\xa6\x84\x34\x01\xc7\x7b\x23\x0b\x2d\xa2\xa8\xd9\xc7\x87\xab\x8c\x12\x92\x2a\x8c\x92\x0d\xfd\xc6\xc5\x7d\x52\x87\x27\x70\x01\xf3\xcf\x3b\x7b\x2f\x46\x87\xbd\x4f\x9f\xc3\xcf\x7a\xbd\x77\x26\x87\xaa\xb8\x12\x4d\xc3\xb2\x29\xfa\x70\x37\xc1\x67\x5c\xd7\x0e\x7d\xc6\x8b\x5b\x1d\x2e\xff\x0d\x1c\x9d\x1f\xe7\x50\x8b\xc6\xe1\x66\x33\x48\xd5\x5f\xe8\x07\xa1\x0d\xe3\xe9\x86\x02\xec\x84\xee\x7b\xa2\xed\x27\x4c\x69\xce\xdf\xc6\x44\x31\x0a\xbb\x53\x4d\xa3\x1c\x4a\xa3\x2b\x3e\xa4\xd3\x66\xc9\x38\x30\x87\x32\x79\xe5\xa0\xfb\xff\xb3\xd3\x1c\x16\x46\x9b\x64\x8f\xf7\xa6\x83\xd8\x7b\x00\x07\x60\x1a\xca\x3e\xcd\x7d\xca\x90\xa7\x18\x4c\xc3\x4f\xfb\x1b\x3c\x07\x3d\xa4\xbf\x6f\x10\x5b\x56\xc1\x75\x67\x63\xc1\xc7\x34\x32\xa4\x59\x88\x47\x64\x72\x26\x74\x5f\xd5\xeb\x4d\xb8\xed\x81\x7e\x22\xfb\xa3\x4b\x6c\x4d\xe7\xb3\x3c\x88\x73\xdb\xbf\xe5\x54\x8d\x2c\x56\x34\x87\x35\xc8\xc6\x38\x64\x92\xc3\x26\x01\x63\x55\xb9\x2b\x07\xa7\xe4\xf2\x48\x0e\xa8\x9c\x17\x36\xc6\xb5\xcc\xc3\x9b\xdd\x27\x16\xf1\xf9\xa2\x2f\xf2\x11\x78\xdb\x21\x25\x95\xaa\xeb\x80\x99\xf9\x22\xbe\xb4\xa3\x7d\x91\xf8\xa0\xcd\xde\x15\x84\x1a\x8d\x27\x7f\x85\x93\xcb\xcb\xb3\x93\x50\x9f\x50\x96\xb0\x10\x7e\x56\xdc\x89\xe7\xdb\xf4\x76\x77\x0b\x73\x7b\xe2\x12\x8e\x63\x2d\xc7\xc5\x08\x8e\xe3\xa6\x2f\xb6\xef\x71\xf7\x71\xfd\x3f\xa1\x28\xd9\x65\x17\x6b\x93\x92\x90\xd6\x17\x7d\xd3\xf8\x61\xd4\xe7\x26\x3d\xd9\xc3\xd1\xb0\x19\xac\xbb\xda\x71\x4a\x02\x30\x32\x35\xe0\x8b\x9a\xf9\x42\xd8\x69\xec\x5e\x24\x5c\x43\x00\x7f\x78\xc2\x77\x54\x37\xed\x7f\x88\x1e\x9a\x49\x48\xfa\x35\x2d\xd9\xa0\xb0\xaf\xbc\x06\x05\x38\x25\x4b\xe1\x7e\x4b\x3c\x2e\x02\xc0\xc4\x89\xfe\x0b\xbb\xbe\x80\x07\xff\x01\x4f\x6d\xac\xc4\xbf\x54\xfb\x4e\x35\xf8\xce\xd8\x07\x74\x3e\x34\xa3\x17\xd5\x8e\x75\xb3\x8a\x98\x82\x62\x1b\x4a\x43\x93\x0e\x2f\xfc\xde\x74\x56\xa2\x8b\x5d\xc1\xc5\xd6\x15\x5e\x6e\x62\x52\xdc\x8c\xff\x1c\x8f\x1f\x18\x87\x43\xc8\xca\x46\x4d\xca\x60\x2d\xc3\x31\xa5\x6b\x53\xbc\xa8\x36\xcb\x43\xb0\xb2\x7c\xed\x67\xa0\x1c\x48\xd3\xaa\x30\xa9\xac\x59\x40\x0a\xfa\x3a\xe7\xbc\xe9\xa7\x47\x9a\xc6\x4a\x4f\xc3\xac\x64\x4e\x69\x19\x47\x1d\x58\x14\x4d\x9c\x5e\xc3\x91\xca\xa0\xd3\x07\x9e\x0f\x93\x68\x68\x9d\x7d\xf4\x1c\x24\x4c\x56\x1e\x63\xf3\xd9\x6f\x3d\x5f\x15\x8d\xdb\xf6\x9c\x18\x64\x5c\xa7\xca\xda\xed\x4f\xa9\x7f\x67\x5b\xbf\xc0\xe1\x6a\x26\xec\x95\xa9\x30\xcb\x41\xf2\xbe\x17\xd2\x0d\xfd\x27\x00\x00\xff\xff\xbc\xb4\x65\x1c\x6b\x08\x00\x00"), - }, - "/src/time/time_test.go": &vfsgen۰CompressedFileInfo{ - name: "time_test.go", - modTime: time.Date(2019, 4, 10, 21, 38, 13, 208335917, time.UTC), - uncompressedSize: 147, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\x8c\xc1\x0e\x82\x30\x10\x05\xcf\xec\x57\xbc\xf4\xd4\x6a\x02\x7f\xe2\x05\xee\xa6\xd6\x05\x56\xa0\x6d\xe8\x36\x1e\x8c\xff\x6e\x9a\x78\x9d\xc9\xcc\x30\xe0\xfa\xa8\xb2\x3f\xf1\x2a\x44\xd9\x87\xcd\x2f\x0c\x95\x83\xef\xca\x45\x89\xe4\xc8\xe9\x54\x58\xea\x4c\x03\x12\x17\x43\x8e\x68\xae\x31\x60\xe2\xa2\xe3\xce\x9c\xad\xe2\xf2\xb7\xfd\xe4\xf0\xa1\x4e\xfb\x71\x93\x6c\x4d\x3b\xf5\xb7\xf4\xb6\x0e\x52\x10\x93\xc2\x87\x50\x4f\xaf\x0c\x8e\xa9\x2e\x2b\xe6\x74\x42\x57\x46\xeb\x8d\xa3\x2f\xfd\x02\x00\x00\xff\xff\x49\x24\xa9\x3b\x93\x00\x00\x00"), - }, - "/src/unicode": &vfsgen۰DirInfo{ - name: "unicode", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 225492852, time.UTC), - }, - "/src/unicode/unicode.go": &vfsgen۰CompressedFileInfo{ - name: "unicode.go", - modTime: time.Date(2019, 1, 3, 14, 55, 7, 225540323, time.UTC), - uncompressedSize: 658, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\x91\x41\x8f\xd3\x30\x10\x85\xcf\xf6\xaf\x78\xa7\x28\x51\xba\x64\xcb\x71\xd5\x72\x29\x12\x08\xb1\x97\x72\xac\x0a\xf2\x3a\x93\xc6\xe0\xd8\xd6\xc4\x91\x40\xdb\xfe\x77\x64\x27\x0d\xcb\xcd\x9e\x79\xf3\x66\xe6\x9b\xa6\x41\xfd\x32\x19\xdb\xe2\xe7\x28\x65\x50\xfa\x97\xba\x10\x26\x67\xb4\x6f\x49\xca\x6e\x72\x1a\xd1\x97\x3f\xb4\x1a\x09\xc6\xc5\x0d\x18\x3c\x39\xda\x20\x45\x8e\xca\x5d\x08\xa7\xf3\xe1\xfe\xae\x50\x0e\x2a\x04\x6a\x8f\x93\xa3\x45\xd8\xf9\xc9\xb5\xcf\x2a\x04\xe3\x2e\x78\xf1\xde\x56\x78\x95\xc2\x74\x98\x4d\x77\x78\xc4\xf5\x8a\x67\xf5\xfb\x90\xbf\xfb\x25\xfe\x2a\x85\x60\x8a\x13\x3b\x1c\x29\x58\xa5\x69\x20\x17\x0f\xbd\xe2\x0d\x3a\x65\x47\x92\xe2\x26\x85\xf5\x78\xda\xe3\x51\x8a\xde\xa4\x87\x25\x57\xae\x83\x55\x52\x74\x9e\x61\x3d\x76\xe8\x4d\x36\x1c\xb2\xc8\xa3\x46\xd9\x9b\x07\xeb\xab\xe6\xbd\x14\x42\x73\x0a\x17\x6b\xe1\x69\x38\xa3\x69\x10\x88\x3b\xcf\x83\x72\x9a\xa0\xd9\x44\xa3\x95\x45\x72\xfc\xe4\x43\x4f\xfc\xe5\xdb\x13\x2e\x14\xa1\xda\x96\x69\x1c\xd1\x13\x27\x44\x63\x24\xd5\xc2\x77\xd0\x3e\xfc\x49\x2b\xc7\x9e\xb0\x02\x92\x22\x6d\x9e\xc0\x94\x9a\xdf\x7d\xf5\x55\x5a\x98\x51\x14\xe0\xfc\x5a\x12\x9f\x4d\x86\x24\x44\x4b\x36\xaa\x34\xdd\x3d\xf3\x31\x05\x4e\x19\xd1\xb9\x4a\x0a\xd3\x61\x16\x7d\x48\x0c\x33\xf7\x5c\x79\x87\xf7\xb6\x57\x8d\xb2\xe4\x87\x37\x91\xaa\xf8\xbe\xc5\x75\xd6\x64\xcf\x62\x5b\x55\x1b\x44\x9e\xd2\xa4\x09\xf0\x3f\x1f\xd4\x73\xa3\x35\x7d\x5b\x96\xc1\xee\xbf\x26\xb9\x7b\x6f\xb0\xc7\x90\x44\x20\xbb\x5c\x33\x1d\x6b\x8f\x01\x35\xb6\x73\xf5\x4d\xae\xe6\xf7\x9b\xde\xe4\xdf\x00\x00\x00\xff\xff\x20\xe3\x22\xd1\x92\x02\x00\x00"), - }, - } - fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src"].(os.FileInfo), - } - fs["/src"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/bytes"].(os.FileInfo), - fs["/src/crypto"].(os.FileInfo), - fs["/src/database"].(os.FileInfo), - fs["/src/debug"].(os.FileInfo), - fs["/src/encoding"].(os.FileInfo), - fs["/src/fmt"].(os.FileInfo), - fs["/src/go"].(os.FileInfo), - fs["/src/internal"].(os.FileInfo), - fs["/src/io"].(os.FileInfo), - fs["/src/math"].(os.FileInfo), - fs["/src/net"].(os.FileInfo), - fs["/src/os"].(os.FileInfo), - fs["/src/reflect"].(os.FileInfo), - fs["/src/regexp"].(os.FileInfo), - fs["/src/runtime"].(os.FileInfo), - fs["/src/strings"].(os.FileInfo), - fs["/src/sync"].(os.FileInfo), - fs["/src/syscall"].(os.FileInfo), - fs["/src/testing"].(os.FileInfo), - fs["/src/text"].(os.FileInfo), - fs["/src/time"].(os.FileInfo), - fs["/src/unicode"].(os.FileInfo), - } - fs["/src/bytes"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/bytes/bytes.go"].(os.FileInfo), - fs["/src/bytes/bytes_test.go"].(os.FileInfo), - } - fs["/src/crypto"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/crypto/internal"].(os.FileInfo), - fs["/src/crypto/rand"].(os.FileInfo), - fs["/src/crypto/x509"].(os.FileInfo), - } - fs["/src/crypto/internal"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/crypto/internal/subtle"].(os.FileInfo), - } - fs["/src/crypto/internal/subtle"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/crypto/internal/subtle/aliasing.go"].(os.FileInfo), - } - fs["/src/crypto/rand"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/crypto/rand/rand.go"].(os.FileInfo), - } - fs["/src/crypto/x509"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/crypto/x509/x509.go"].(os.FileInfo), - fs["/src/crypto/x509/x509_test.go"].(os.FileInfo), - } - fs["/src/database"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/database/sql"].(os.FileInfo), - } - fs["/src/database/sql"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/database/sql/driver"].(os.FileInfo), - } - fs["/src/database/sql/driver"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/database/sql/driver/driver_test.go"].(os.FileInfo), - } - fs["/src/debug"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/debug/elf"].(os.FileInfo), - } - fs["/src/debug/elf"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/debug/elf/elf_test.go"].(os.FileInfo), - } - fs["/src/encoding"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/encoding/gob"].(os.FileInfo), - fs["/src/encoding/json"].(os.FileInfo), - } - fs["/src/encoding/gob"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/encoding/gob/gob_test.go"].(os.FileInfo), - } - fs["/src/encoding/json"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/encoding/json/stream_test.go"].(os.FileInfo), - } - fs["/src/fmt"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/fmt/fmt_test.go"].(os.FileInfo), - } - fs["/src/go"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/go/token"].(os.FileInfo), - } - fs["/src/go/token"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/go/token/token_test.go"].(os.FileInfo), - } - fs["/src/internal"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/internal/bytealg"].(os.FileInfo), - fs["/src/internal/cpu"].(os.FileInfo), - fs["/src/internal/fmtsort"].(os.FileInfo), - fs["/src/internal/poll"].(os.FileInfo), - fs["/src/internal/syscall"].(os.FileInfo), - fs["/src/internal/testenv"].(os.FileInfo), - } - fs["/src/internal/bytealg"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/internal/bytealg/bytealg.go"].(os.FileInfo), - } - fs["/src/internal/cpu"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/internal/cpu/cpu.go"].(os.FileInfo), - } - fs["/src/internal/fmtsort"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/internal/fmtsort/fmtsort_test.go"].(os.FileInfo), - } - fs["/src/internal/poll"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/internal/poll/fd_poll.go"].(os.FileInfo), - } - fs["/src/internal/syscall"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/internal/syscall/unix"].(os.FileInfo), - } - fs["/src/internal/syscall/unix"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/internal/syscall/unix/unix.go"].(os.FileInfo), - } - fs["/src/internal/testenv"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/internal/testenv/testenv.go"].(os.FileInfo), - } - fs["/src/io"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/io/io_test.go"].(os.FileInfo), - } - fs["/src/math"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/math/big"].(os.FileInfo), - fs["/src/math/bits"].(os.FileInfo), - fs["/src/math/math.go"].(os.FileInfo), - fs["/src/math/math_test.go"].(os.FileInfo), - fs["/src/math/rand"].(os.FileInfo), - } - fs["/src/math/big"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/math/big/big.go"].(os.FileInfo), - fs["/src/math/big/big_test.go"].(os.FileInfo), - } - fs["/src/math/bits"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/math/bits/bits.go"].(os.FileInfo), - } - fs["/src/math/rand"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/math/rand/rand_test.go"].(os.FileInfo), - } - fs["/src/net"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/net/http"].(os.FileInfo), - fs["/src/net/net.go"].(os.FileInfo), - } - fs["/src/net/http"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/net/http/cookiejar"].(os.FileInfo), - fs["/src/net/http/fetch.go"].(os.FileInfo), - fs["/src/net/http/http.go"].(os.FileInfo), - } - fs["/src/net/http/cookiejar"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/net/http/cookiejar/example_test.go"].(os.FileInfo), - } - fs["/src/os"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/os/os.go"].(os.FileInfo), - fs["/src/os/signal"].(os.FileInfo), - } - fs["/src/os/signal"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/os/signal/signal.go"].(os.FileInfo), - } - fs["/src/reflect"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/reflect/example_test.go"].(os.FileInfo), - fs["/src/reflect/reflect.go"].(os.FileInfo), - fs["/src/reflect/reflect_go111.go"].(os.FileInfo), - fs["/src/reflect/reflect_go1111.go"].(os.FileInfo), - fs["/src/reflect/reflect_test.go"].(os.FileInfo), - fs["/src/reflect/swapper.go"].(os.FileInfo), - } - fs["/src/regexp"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/regexp/regexp_test.go"].(os.FileInfo), - } - fs["/src/runtime"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/runtime/debug"].(os.FileInfo), - fs["/src/runtime/pprof"].(os.FileInfo), - fs["/src/runtime/runtime.go"].(os.FileInfo), - } - fs["/src/runtime/debug"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/runtime/debug/debug.go"].(os.FileInfo), - } - fs["/src/runtime/pprof"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/runtime/pprof/pprof.go"].(os.FileInfo), - } - fs["/src/strings"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/strings/strings.go"].(os.FileInfo), - fs["/src/strings/strings_test.go"].(os.FileInfo), - } - fs["/src/sync"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/sync/atomic"].(os.FileInfo), - fs["/src/sync/cond.go"].(os.FileInfo), - fs["/src/sync/export_test.go"].(os.FileInfo), - fs["/src/sync/pool.go"].(os.FileInfo), - fs["/src/sync/sync.go"].(os.FileInfo), - fs["/src/sync/sync_test.go"].(os.FileInfo), - fs["/src/sync/waitgroup.go"].(os.FileInfo), - } - fs["/src/sync/atomic"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/sync/atomic/atomic.go"].(os.FileInfo), - fs["/src/sync/atomic/atomic_test.go"].(os.FileInfo), - } - fs["/src/syscall"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/syscall/syscall.go"].(os.FileInfo), - fs["/src/syscall/syscall_darwin.go"].(os.FileInfo), - fs["/src/syscall/syscall_linux.go"].(os.FileInfo), - fs["/src/syscall/syscall_nonlinux.go"].(os.FileInfo), - fs["/src/syscall/syscall_unix.go"].(os.FileInfo), - fs["/src/syscall/syscall_windows.go"].(os.FileInfo), - } - fs["/src/testing"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/testing/example.go"].(os.FileInfo), - fs["/src/testing/ioutil.go"].(os.FileInfo), - fs["/src/testing/testing.go"].(os.FileInfo), - } - fs["/src/text"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/text/template"].(os.FileInfo), - } - fs["/src/text/template"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/text/template/template.go"].(os.FileInfo), - } - fs["/src/time"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/time/time.go"].(os.FileInfo), - fs["/src/time/time_test.go"].(os.FileInfo), - } - fs["/src/unicode"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/src/unicode/unicode.go"].(os.FileInfo), - } - - return fs -}() - -type vfsgen۰FS map[string]interface{} - -func (fs vfsgen۰FS) Open(path string) (http.File, error) { - path = pathpkg.Clean("/" + path) - f, ok := fs[path] - if !ok { - return nil, &os.PathError{Op: "open", Path: path, Err: os.ErrNotExist} - } - - switch f := f.(type) { - case *vfsgen۰CompressedFileInfo: - gr, err := gzip.NewReader(bytes.NewReader(f.compressedContent)) - if err != nil { - // This should never happen because we generate the gzip bytes such that they are always valid. - panic("unexpected error reading own gzip compressed bytes: " + err.Error()) - } - return &vfsgen۰CompressedFile{ - vfsgen۰CompressedFileInfo: f, - gr: gr, - }, nil - case *vfsgen۰FileInfo: - return &vfsgen۰File{ - vfsgen۰FileInfo: f, - Reader: bytes.NewReader(f.content), - }, nil - case *vfsgen۰DirInfo: - return &vfsgen۰Dir{ - vfsgen۰DirInfo: f, - }, nil - default: - // This should never happen because we generate only the above types. - panic(fmt.Sprintf("unexpected type %T", f)) - } -} - -// vfsgen۰CompressedFileInfo is a static definition of a gzip compressed file. -type vfsgen۰CompressedFileInfo struct { - name string - modTime time.Time - compressedContent []byte - uncompressedSize int64 -} - -func (f *vfsgen۰CompressedFileInfo) Readdir(count int) ([]os.FileInfo, error) { - return nil, fmt.Errorf("cannot Readdir from file %s", f.name) -} -func (f *vfsgen۰CompressedFileInfo) Stat() (os.FileInfo, error) { return f, nil } - -func (f *vfsgen۰CompressedFileInfo) GzipBytes() []byte { - return f.compressedContent -} - -func (f *vfsgen۰CompressedFileInfo) Name() string { return f.name } -func (f *vfsgen۰CompressedFileInfo) Size() int64 { return f.uncompressedSize } -func (f *vfsgen۰CompressedFileInfo) Mode() os.FileMode { return 0444 } -func (f *vfsgen۰CompressedFileInfo) ModTime() time.Time { return f.modTime } -func (f *vfsgen۰CompressedFileInfo) IsDir() bool { return false } -func (f *vfsgen۰CompressedFileInfo) Sys() interface{} { return nil } - -// vfsgen۰CompressedFile is an opened compressedFile instance. -type vfsgen۰CompressedFile struct { - *vfsgen۰CompressedFileInfo - gr *gzip.Reader - grPos int64 // Actual gr uncompressed position. - seekPos int64 // Seek uncompressed position. -} - -func (f *vfsgen۰CompressedFile) Read(p []byte) (n int, err error) { - if f.grPos > f.seekPos { - // Rewind to beginning. - err = f.gr.Reset(bytes.NewReader(f.compressedContent)) - if err != nil { - return 0, err - } - f.grPos = 0 - } - if f.grPos < f.seekPos { - // Fast-forward. - _, err = io.CopyN(ioutil.Discard, f.gr, f.seekPos-f.grPos) - if err != nil { - return 0, err - } - f.grPos = f.seekPos - } - n, err = f.gr.Read(p) - f.grPos += int64(n) - f.seekPos = f.grPos - return n, err -} -func (f *vfsgen۰CompressedFile) Seek(offset int64, whence int) (int64, error) { - switch whence { - case io.SeekStart: - f.seekPos = 0 + offset - case io.SeekCurrent: - f.seekPos += offset - case io.SeekEnd: - f.seekPos = f.uncompressedSize + offset - default: - panic(fmt.Errorf("invalid whence value: %v", whence)) - } - return f.seekPos, nil -} -func (f *vfsgen۰CompressedFile) Close() error { - return f.gr.Close() -} - -// vfsgen۰FileInfo is a static definition of an uncompressed file (because it's not worth gzip compressing). -type vfsgen۰FileInfo struct { - name string - modTime time.Time - content []byte -} - -func (f *vfsgen۰FileInfo) Readdir(count int) ([]os.FileInfo, error) { - return nil, fmt.Errorf("cannot Readdir from file %s", f.name) -} -func (f *vfsgen۰FileInfo) Stat() (os.FileInfo, error) { return f, nil } - -func (f *vfsgen۰FileInfo) NotWorthGzipCompressing() {} - -func (f *vfsgen۰FileInfo) Name() string { return f.name } -func (f *vfsgen۰FileInfo) Size() int64 { return int64(len(f.content)) } -func (f *vfsgen۰FileInfo) Mode() os.FileMode { return 0444 } -func (f *vfsgen۰FileInfo) ModTime() time.Time { return f.modTime } -func (f *vfsgen۰FileInfo) IsDir() bool { return false } -func (f *vfsgen۰FileInfo) Sys() interface{} { return nil } - -// vfsgen۰File is an opened file instance. -type vfsgen۰File struct { - *vfsgen۰FileInfo - *bytes.Reader -} - -func (f *vfsgen۰File) Close() error { - return nil -} - -// vfsgen۰DirInfo is a static definition of a directory. -type vfsgen۰DirInfo struct { - name string - modTime time.Time - entries []os.FileInfo -} - -func (d *vfsgen۰DirInfo) Read([]byte) (int, error) { - return 0, fmt.Errorf("cannot Read from directory %s", d.name) -} -func (d *vfsgen۰DirInfo) Close() error { return nil } -func (d *vfsgen۰DirInfo) Stat() (os.FileInfo, error) { return d, nil } - -func (d *vfsgen۰DirInfo) Name() string { return d.name } -func (d *vfsgen۰DirInfo) Size() int64 { return 0 } -func (d *vfsgen۰DirInfo) Mode() os.FileMode { return 0755 | os.ModeDir } -func (d *vfsgen۰DirInfo) ModTime() time.Time { return d.modTime } -func (d *vfsgen۰DirInfo) IsDir() bool { return true } -func (d *vfsgen۰DirInfo) Sys() interface{} { return nil } - -// vfsgen۰Dir is an opened dir instance. -type vfsgen۰Dir struct { - *vfsgen۰DirInfo - pos int // Position within entries for Seek and Readdir. -} - -func (d *vfsgen۰Dir) Seek(offset int64, whence int) (int64, error) { - if offset == 0 && whence == io.SeekStart { - d.pos = 0 - return 0, nil - } - return 0, fmt.Errorf("unsupported Seek in directory %s", d.name) -} - -func (d *vfsgen۰Dir) Readdir(count int) ([]os.FileInfo, error) { - if d.pos >= len(d.entries) && count > 0 { - return nil, io.EOF - } - if count <= 0 || count > len(d.entries)-d.pos { - count = len(d.entries) - d.pos - } - e := d.entries[d.pos : d.pos+count] - d.pos += count - return e, nil -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/package.go b/vendor/github.com/gopherjs/gopherjs/compiler/package.go deleted file mode 100644 index f841b145b..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/package.go +++ /dev/null @@ -1,809 +0,0 @@ -package compiler - -import ( - "bytes" - "encoding/json" - "fmt" - "go/ast" - "go/constant" - "go/token" - "go/types" - "sort" - "strings" - - "github.com/gopherjs/gopherjs/compiler/analysis" - "github.com/neelance/astrewrite" - "golang.org/x/tools/go/gcexportdata" - "golang.org/x/tools/go/types/typeutil" -) - -type pkgContext struct { - *analysis.Info - additionalSelections map[*ast.SelectorExpr]selection - - typeNames []*types.TypeName - pkgVars map[string]string - objectNames map[types.Object]string - varPtrNames map[*types.Var]string - anonTypes []*types.TypeName - anonTypeMap typeutil.Map - escapingVars map[*types.Var]bool - indentation int - dependencies map[types.Object]bool - minify bool - fileSet *token.FileSet - errList ErrorList -} - -func (p *pkgContext) SelectionOf(e *ast.SelectorExpr) (selection, bool) { - if sel, ok := p.Selections[e]; ok { - return sel, true - } - if sel, ok := p.additionalSelections[e]; ok { - return sel, true - } - return nil, false -} - -type selection interface { - Kind() types.SelectionKind - Recv() types.Type - Index() []int - Obj() types.Object - Type() types.Type -} - -type fakeSelection struct { - kind types.SelectionKind - recv types.Type - index []int - obj types.Object - typ types.Type -} - -func (sel *fakeSelection) Kind() types.SelectionKind { return sel.kind } -func (sel *fakeSelection) Recv() types.Type { return sel.recv } -func (sel *fakeSelection) Index() []int { return sel.index } -func (sel *fakeSelection) Obj() types.Object { return sel.obj } -func (sel *fakeSelection) Type() types.Type { return sel.typ } - -type funcContext struct { - *analysis.FuncInfo - p *pkgContext - parent *funcContext - sig *types.Signature - allVars map[string]int - localVars []string - resultNames []ast.Expr - flowDatas map[*types.Label]*flowData - caseCounter int - labelCases map[*types.Label]int - output []byte - delayedOutput []byte - posAvailable bool - pos token.Pos -} - -type flowData struct { - postStmt func() - beginCase int - endCase int -} - -type ImportContext struct { - Packages map[string]*types.Package - Import func(string) (*Archive, error) -} - -// packageImporter implements go/types.Importer interface. -type packageImporter struct { - importContext *ImportContext - importError *error // A pointer to importError in Compile. -} - -func (pi packageImporter) Import(path string) (*types.Package, error) { - if path == "unsafe" { - return types.Unsafe, nil - } - - a, err := pi.importContext.Import(path) - if err != nil { - if *pi.importError == nil { - // If import failed, show first error of import only (https://github.com/gopherjs/gopherjs/issues/119). - *pi.importError = err - } - return nil, err - } - - return pi.importContext.Packages[a.ImportPath], nil -} - -func Compile(importPath string, files []*ast.File, fileSet *token.FileSet, importContext *ImportContext, minify bool) (*Archive, error) { - typesInfo := &types.Info{ - Types: make(map[ast.Expr]types.TypeAndValue), - Defs: make(map[*ast.Ident]types.Object), - Uses: make(map[*ast.Ident]types.Object), - Implicits: make(map[ast.Node]types.Object), - Selections: make(map[*ast.SelectorExpr]*types.Selection), - Scopes: make(map[ast.Node]*types.Scope), - } - - var importError error - var errList ErrorList - var previousErr error - config := &types.Config{ - Importer: packageImporter{ - importContext: importContext, - importError: &importError, - }, - Sizes: sizes32, - Error: func(err error) { - if previousErr != nil && previousErr.Error() == err.Error() { - return - } - errList = append(errList, err) - previousErr = err - }, - } - typesPkg, err := config.Check(importPath, fileSet, files, typesInfo) - if importError != nil { - return nil, importError - } - if errList != nil { - if len(errList) > 10 { - pos := token.NoPos - if last, ok := errList[9].(types.Error); ok { - pos = last.Pos - } - errList = append(errList[:10], types.Error{Fset: fileSet, Pos: pos, Msg: "too many errors"}) - } - return nil, errList - } - if err != nil { - return nil, err - } - importContext.Packages[importPath] = typesPkg - - exportData := new(bytes.Buffer) - if err := gcexportdata.Write(exportData, nil, typesPkg); err != nil { - return nil, fmt.Errorf("failed to write export data: %v", err) - } - encodedFileSet := new(bytes.Buffer) - if err := fileSet.Write(json.NewEncoder(encodedFileSet).Encode); err != nil { - return nil, err - } - - simplifiedFiles := make([]*ast.File, len(files)) - for i, file := range files { - simplifiedFiles[i] = astrewrite.Simplify(file, typesInfo, false) - } - - isBlocking := func(f *types.Func) bool { - archive, err := importContext.Import(f.Pkg().Path()) - if err != nil { - panic(err) - } - fullName := f.FullName() - for _, d := range archive.Declarations { - if string(d.FullName) == fullName { - return d.Blocking - } - } - panic(fullName) - } - pkgInfo := analysis.AnalyzePkg(simplifiedFiles, fileSet, typesInfo, typesPkg, isBlocking) - c := &funcContext{ - FuncInfo: pkgInfo.InitFuncInfo, - p: &pkgContext{ - Info: pkgInfo, - additionalSelections: make(map[*ast.SelectorExpr]selection), - - pkgVars: make(map[string]string), - objectNames: make(map[types.Object]string), - varPtrNames: make(map[*types.Var]string), - escapingVars: make(map[*types.Var]bool), - indentation: 1, - dependencies: make(map[types.Object]bool), - minify: minify, - fileSet: fileSet, - }, - allVars: make(map[string]int), - flowDatas: map[*types.Label]*flowData{nil: {}}, - caseCounter: 1, - labelCases: make(map[*types.Label]int), - } - for name := range reservedKeywords { - c.allVars[name] = 1 - } - - // imports - var importDecls []*Decl - var importedPaths []string - for _, importedPkg := range typesPkg.Imports() { - if importedPkg == types.Unsafe { - // Prior to Go 1.9, unsafe import was excluded by Imports() method, - // but now we do it here to maintain previous behavior. - continue - } - c.p.pkgVars[importedPkg.Path()] = c.newVariableWithLevel(importedPkg.Name(), true) - importedPaths = append(importedPaths, importedPkg.Path()) - } - sort.Strings(importedPaths) - for _, impPath := range importedPaths { - id := c.newIdent(fmt.Sprintf(`%s.$init`, c.p.pkgVars[impPath]), types.NewSignature(nil, nil, nil, false)) - call := &ast.CallExpr{Fun: id} - c.Blocking[call] = true - c.Flattened[call] = true - importDecls = append(importDecls, &Decl{ - Vars: []string{c.p.pkgVars[impPath]}, - DeclCode: []byte(fmt.Sprintf("\t%s = $packages[\"%s\"];\n", c.p.pkgVars[impPath], impPath)), - InitCode: c.CatchOutput(1, func() { c.translateStmt(&ast.ExprStmt{X: call}, nil) }), - }) - } - - var functions []*ast.FuncDecl - var vars []*types.Var - for _, file := range simplifiedFiles { - for _, decl := range file.Decls { - switch d := decl.(type) { - case *ast.FuncDecl: - sig := c.p.Defs[d.Name].(*types.Func).Type().(*types.Signature) - var recvType types.Type - if sig.Recv() != nil { - recvType = sig.Recv().Type() - if ptr, isPtr := recvType.(*types.Pointer); isPtr { - recvType = ptr.Elem() - } - } - if sig.Recv() == nil { - c.objectName(c.p.Defs[d.Name].(*types.Func)) // register toplevel name - } - if !isBlank(d.Name) { - functions = append(functions, d) - } - case *ast.GenDecl: - switch d.Tok { - case token.TYPE: - for _, spec := range d.Specs { - o := c.p.Defs[spec.(*ast.TypeSpec).Name].(*types.TypeName) - c.p.typeNames = append(c.p.typeNames, o) - c.objectName(o) // register toplevel name - } - case token.VAR: - for _, spec := range d.Specs { - for _, name := range spec.(*ast.ValueSpec).Names { - if !isBlank(name) { - o := c.p.Defs[name].(*types.Var) - vars = append(vars, o) - c.objectName(o) // register toplevel name - } - } - } - case token.CONST: - // skip, constants are inlined - } - } - } - } - - collectDependencies := func(f func()) []string { - c.p.dependencies = make(map[types.Object]bool) - f() - var deps []string - for o := range c.p.dependencies { - qualifiedName := o.Pkg().Path() + "." + o.Name() - if f, ok := o.(*types.Func); ok && f.Type().(*types.Signature).Recv() != nil { - deps = append(deps, qualifiedName+"~") - continue - } - deps = append(deps, qualifiedName) - } - sort.Strings(deps) - return deps - } - - // variables - var varDecls []*Decl - varsWithInit := make(map[*types.Var]bool) - for _, init := range c.p.InitOrder { - for _, o := range init.Lhs { - varsWithInit[o] = true - } - } - for _, o := range vars { - var d Decl - if !o.Exported() { - d.Vars = []string{c.objectName(o)} - } - if c.p.HasPointer[o] && !o.Exported() { - d.Vars = append(d.Vars, c.varPtrName(o)) - } - if _, ok := varsWithInit[o]; !ok { - d.DceDeps = collectDependencies(func() { - d.InitCode = []byte(fmt.Sprintf("\t\t%s = %s;\n", c.objectName(o), c.translateExpr(c.zeroValue(o.Type())).String())) - }) - } - d.DceObjectFilter = o.Name() - varDecls = append(varDecls, &d) - } - for _, init := range c.p.InitOrder { - lhs := make([]ast.Expr, len(init.Lhs)) - for i, o := range init.Lhs { - ident := ast.NewIdent(o.Name()) - c.p.Defs[ident] = o - lhs[i] = c.setType(ident, o.Type()) - varsWithInit[o] = true - } - var d Decl - d.DceDeps = collectDependencies(func() { - c.localVars = nil - d.InitCode = c.CatchOutput(1, func() { - c.translateStmt(&ast.AssignStmt{ - Lhs: lhs, - Tok: token.DEFINE, - Rhs: []ast.Expr{init.Rhs}, - }, nil) - }) - d.Vars = append(d.Vars, c.localVars...) - }) - if len(init.Lhs) == 1 { - if !analysis.HasSideEffect(init.Rhs, c.p.Info.Info) { - d.DceObjectFilter = init.Lhs[0].Name() - } - } - varDecls = append(varDecls, &d) - } - - // functions - var funcDecls []*Decl - var mainFunc *types.Func - for _, fun := range functions { - o := c.p.Defs[fun.Name].(*types.Func) - funcInfo := c.p.FuncDeclInfos[o] - d := Decl{ - FullName: o.FullName(), - Blocking: len(funcInfo.Blocking) != 0, - } - if fun.Recv == nil { - d.Vars = []string{c.objectName(o)} - d.DceObjectFilter = o.Name() - switch o.Name() { - case "main": - mainFunc = o - d.DceObjectFilter = "" - case "init": - d.InitCode = c.CatchOutput(1, func() { - id := c.newIdent("", types.NewSignature(nil, nil, nil, false)) - c.p.Uses[id] = o - call := &ast.CallExpr{Fun: id} - if len(c.p.FuncDeclInfos[o].Blocking) != 0 { - c.Blocking[call] = true - } - c.translateStmt(&ast.ExprStmt{X: call}, nil) - }) - d.DceObjectFilter = "" - } - } - if fun.Recv != nil { - recvType := o.Type().(*types.Signature).Recv().Type() - ptr, isPointer := recvType.(*types.Pointer) - namedRecvType, _ := recvType.(*types.Named) - if isPointer { - namedRecvType = ptr.Elem().(*types.Named) - } - d.DceObjectFilter = namedRecvType.Obj().Name() - if !fun.Name.IsExported() { - d.DceMethodFilter = o.Name() + "~" - } - } - - d.DceDeps = collectDependencies(func() { - d.DeclCode = c.translateToplevelFunction(fun, funcInfo) - }) - funcDecls = append(funcDecls, &d) - } - if typesPkg.Name() == "main" { - if mainFunc == nil { - return nil, fmt.Errorf("missing main function") - } - id := c.newIdent("", types.NewSignature(nil, nil, nil, false)) - c.p.Uses[id] = mainFunc - call := &ast.CallExpr{Fun: id} - ifStmt := &ast.IfStmt{ - Cond: c.newIdent("$pkg === $mainPkg", types.Typ[types.Bool]), - Body: &ast.BlockStmt{ - List: []ast.Stmt{ - &ast.ExprStmt{X: call}, - &ast.AssignStmt{ - Lhs: []ast.Expr{c.newIdent("$mainFinished", types.Typ[types.Bool])}, - Tok: token.ASSIGN, - Rhs: []ast.Expr{c.newConst(types.Typ[types.Bool], constant.MakeBool(true))}, - }, - }, - }, - } - if len(c.p.FuncDeclInfos[mainFunc].Blocking) != 0 { - c.Blocking[call] = true - c.Flattened[ifStmt] = true - } - funcDecls = append(funcDecls, &Decl{ - InitCode: c.CatchOutput(1, func() { - c.translateStmt(ifStmt, nil) - }), - }) - } - - // named types - var typeDecls []*Decl - for _, o := range c.p.typeNames { - if o.IsAlias() { - continue - } - typeName := c.objectName(o) - d := Decl{ - Vars: []string{typeName}, - DceObjectFilter: o.Name(), - } - d.DceDeps = collectDependencies(func() { - d.DeclCode = c.CatchOutput(0, func() { - typeName := c.objectName(o) - lhs := typeName - if isPkgLevel(o) { - lhs += " = $pkg." + encodeIdent(o.Name()) - } - size := int64(0) - constructor := "null" - switch t := o.Type().Underlying().(type) { - case *types.Struct: - params := make([]string, t.NumFields()) - for i := 0; i < t.NumFields(); i++ { - params[i] = fieldName(t, i) + "_" - } - constructor = fmt.Sprintf("function(%s) {\n\t\tthis.$val = this;\n\t\tif (arguments.length === 0) {\n", strings.Join(params, ", ")) - for i := 0; i < t.NumFields(); i++ { - constructor += fmt.Sprintf("\t\t\tthis.%s = %s;\n", fieldName(t, i), c.translateExpr(c.zeroValue(t.Field(i).Type())).String()) - } - constructor += "\t\t\treturn;\n\t\t}\n" - for i := 0; i < t.NumFields(); i++ { - constructor += fmt.Sprintf("\t\tthis.%[1]s = %[1]s_;\n", fieldName(t, i)) - } - constructor += "\t}" - case *types.Basic, *types.Array, *types.Slice, *types.Chan, *types.Signature, *types.Interface, *types.Pointer, *types.Map: - size = sizes32.Sizeof(t) - } - c.Printf(`%s = $newType(%d, %s, "%s.%s", %t, "%s", %t, %s);`, lhs, size, typeKind(o.Type()), o.Pkg().Name(), o.Name(), o.Name() != "", o.Pkg().Path(), o.Exported(), constructor) - }) - d.MethodListCode = c.CatchOutput(0, func() { - named := o.Type().(*types.Named) - if _, ok := named.Underlying().(*types.Interface); ok { - return - } - var methods []string - var ptrMethods []string - for i := 0; i < named.NumMethods(); i++ { - method := named.Method(i) - name := method.Name() - if reservedKeywords[name] { - name += "$" - } - pkgPath := "" - if !method.Exported() { - pkgPath = method.Pkg().Path() - } - t := method.Type().(*types.Signature) - entry := fmt.Sprintf(`{prop: "%s", name: %s, pkg: "%s", typ: $funcType(%s)}`, name, encodeString(method.Name()), pkgPath, c.initArgs(t)) - if _, isPtr := t.Recv().Type().(*types.Pointer); isPtr { - ptrMethods = append(ptrMethods, entry) - continue - } - methods = append(methods, entry) - } - if len(methods) > 0 { - c.Printf("%s.methods = [%s];", c.typeName(named), strings.Join(methods, ", ")) - } - if len(ptrMethods) > 0 { - c.Printf("%s.methods = [%s];", c.typeName(types.NewPointer(named)), strings.Join(ptrMethods, ", ")) - } - }) - switch t := o.Type().Underlying().(type) { - case *types.Array, *types.Chan, *types.Interface, *types.Map, *types.Pointer, *types.Slice, *types.Signature, *types.Struct: - d.TypeInitCode = c.CatchOutput(0, func() { - c.Printf("%s.init(%s);", c.objectName(o), c.initArgs(t)) - }) - } - }) - typeDecls = append(typeDecls, &d) - } - - // anonymous types - for _, t := range c.p.anonTypes { - d := Decl{ - Vars: []string{t.Name()}, - DceObjectFilter: t.Name(), - } - d.DceDeps = collectDependencies(func() { - d.DeclCode = []byte(fmt.Sprintf("\t%s = $%sType(%s);\n", t.Name(), strings.ToLower(typeKind(t.Type())[5:]), c.initArgs(t.Type()))) - }) - typeDecls = append(typeDecls, &d) - } - - var allDecls []*Decl - for _, d := range append(append(append(importDecls, typeDecls...), varDecls...), funcDecls...) { - d.DeclCode = removeWhitespace(d.DeclCode, minify) - d.MethodListCode = removeWhitespace(d.MethodListCode, minify) - d.TypeInitCode = removeWhitespace(d.TypeInitCode, minify) - d.InitCode = removeWhitespace(d.InitCode, minify) - allDecls = append(allDecls, d) - } - - if len(c.p.errList) != 0 { - return nil, c.p.errList - } - - return &Archive{ - ImportPath: importPath, - Name: typesPkg.Name(), - Imports: importedPaths, - ExportData: exportData.Bytes(), - Declarations: allDecls, - FileSet: encodedFileSet.Bytes(), - Minified: minify, - }, nil -} - -func (c *funcContext) initArgs(ty types.Type) string { - switch t := ty.(type) { - case *types.Array: - return fmt.Sprintf("%s, %d", c.typeName(t.Elem()), t.Len()) - case *types.Chan: - return fmt.Sprintf("%s, %t, %t", c.typeName(t.Elem()), t.Dir()&types.SendOnly != 0, t.Dir()&types.RecvOnly != 0) - case *types.Interface: - methods := make([]string, t.NumMethods()) - for i := range methods { - method := t.Method(i) - pkgPath := "" - if !method.Exported() { - pkgPath = method.Pkg().Path() - } - methods[i] = fmt.Sprintf(`{prop: "%s", name: "%s", pkg: "%s", typ: $funcType(%s)}`, method.Name(), method.Name(), pkgPath, c.initArgs(method.Type())) - } - return fmt.Sprintf("[%s]", strings.Join(methods, ", ")) - case *types.Map: - return fmt.Sprintf("%s, %s", c.typeName(t.Key()), c.typeName(t.Elem())) - case *types.Pointer: - return fmt.Sprintf("%s", c.typeName(t.Elem())) - case *types.Slice: - return fmt.Sprintf("%s", c.typeName(t.Elem())) - case *types.Signature: - params := make([]string, t.Params().Len()) - for i := range params { - params[i] = c.typeName(t.Params().At(i).Type()) - } - results := make([]string, t.Results().Len()) - for i := range results { - results[i] = c.typeName(t.Results().At(i).Type()) - } - return fmt.Sprintf("[%s], [%s], %t", strings.Join(params, ", "), strings.Join(results, ", "), t.Variadic()) - case *types.Struct: - pkgPath := "" - fields := make([]string, t.NumFields()) - for i := range fields { - field := t.Field(i) - if !field.Exported() { - pkgPath = field.Pkg().Path() - } - fields[i] = fmt.Sprintf(`{prop: "%s", name: %s, embedded: %t, exported: %t, typ: %s, tag: %s}`, fieldName(t, i), encodeString(field.Name()), field.Anonymous(), field.Exported(), c.typeName(field.Type()), encodeString(t.Tag(i))) - } - return fmt.Sprintf(`"%s", [%s]`, pkgPath, strings.Join(fields, ", ")) - default: - panic("invalid type") - } -} - -func (c *funcContext) translateToplevelFunction(fun *ast.FuncDecl, info *analysis.FuncInfo) []byte { - o := c.p.Defs[fun.Name].(*types.Func) - sig := o.Type().(*types.Signature) - var recv *ast.Ident - if fun.Recv != nil && fun.Recv.List[0].Names != nil { - recv = fun.Recv.List[0].Names[0] - } - - var joinedParams string - primaryFunction := func(funcRef string) []byte { - if fun.Body == nil { - return []byte(fmt.Sprintf("\t%s = function() {\n\t\t$throwRuntimeError(\"native function not implemented: %s\");\n\t};\n", funcRef, o.FullName())) - } - - params, fun := translateFunction(fun.Type, recv, fun.Body, c, sig, info, funcRef) - joinedParams = strings.Join(params, ", ") - return []byte(fmt.Sprintf("\t%s = %s;\n", funcRef, fun)) - } - - code := bytes.NewBuffer(nil) - - if fun.Recv == nil { - funcRef := c.objectName(o) - code.Write(primaryFunction(funcRef)) - if fun.Name.IsExported() { - fmt.Fprintf(code, "\t$pkg.%s = %s;\n", encodeIdent(fun.Name.Name), funcRef) - } - return code.Bytes() - } - - recvType := sig.Recv().Type() - ptr, isPointer := recvType.(*types.Pointer) - namedRecvType, _ := recvType.(*types.Named) - if isPointer { - namedRecvType = ptr.Elem().(*types.Named) - } - typeName := c.objectName(namedRecvType.Obj()) - funName := fun.Name.Name - if reservedKeywords[funName] { - funName += "$" - } - - if _, isStruct := namedRecvType.Underlying().(*types.Struct); isStruct { - code.Write(primaryFunction(typeName + ".ptr.prototype." + funName)) - fmt.Fprintf(code, "\t%s.prototype.%s = function(%s) { return this.$val.%s(%s); };\n", typeName, funName, joinedParams, funName, joinedParams) - return code.Bytes() - } - - if isPointer { - if _, isArray := ptr.Elem().Underlying().(*types.Array); isArray { - code.Write(primaryFunction(typeName + ".prototype." + funName)) - fmt.Fprintf(code, "\t$ptrType(%s).prototype.%s = function(%s) { return (new %s(this.$get())).%s(%s); };\n", typeName, funName, joinedParams, typeName, funName, joinedParams) - return code.Bytes() - } - return primaryFunction(fmt.Sprintf("$ptrType(%s).prototype.%s", typeName, funName)) - } - - value := "this.$get()" - if isWrapped(recvType) { - value = fmt.Sprintf("new %s(%s)", typeName, value) - } - code.Write(primaryFunction(typeName + ".prototype." + funName)) - fmt.Fprintf(code, "\t$ptrType(%s).prototype.%s = function(%s) { return %s.%s(%s); };\n", typeName, funName, joinedParams, value, funName, joinedParams) - return code.Bytes() -} - -func translateFunction(typ *ast.FuncType, recv *ast.Ident, body *ast.BlockStmt, outerContext *funcContext, sig *types.Signature, info *analysis.FuncInfo, funcRef string) ([]string, string) { - if info == nil { - panic("nil info") - } - - c := &funcContext{ - FuncInfo: info, - p: outerContext.p, - parent: outerContext, - sig: sig, - allVars: make(map[string]int, len(outerContext.allVars)), - localVars: []string{}, - flowDatas: map[*types.Label]*flowData{nil: {}}, - caseCounter: 1, - labelCases: make(map[*types.Label]int), - } - for k, v := range outerContext.allVars { - c.allVars[k] = v - } - prevEV := c.p.escapingVars - - var params []string - for _, param := range typ.Params.List { - if len(param.Names) == 0 { - params = append(params, c.newVariable("param")) - continue - } - for _, ident := range param.Names { - if isBlank(ident) { - params = append(params, c.newVariable("param")) - continue - } - params = append(params, c.objectName(c.p.Defs[ident])) - } - } - - bodyOutput := string(c.CatchOutput(1, func() { - if len(c.Blocking) != 0 { - c.p.Scopes[body] = c.p.Scopes[typ] - c.handleEscapingVars(body) - } - - if c.sig != nil && c.sig.Results().Len() != 0 && c.sig.Results().At(0).Name() != "" { - c.resultNames = make([]ast.Expr, c.sig.Results().Len()) - for i := 0; i < c.sig.Results().Len(); i++ { - result := c.sig.Results().At(i) - c.Printf("%s = %s;", c.objectName(result), c.translateExpr(c.zeroValue(result.Type())).String()) - id := ast.NewIdent("") - c.p.Uses[id] = result - c.resultNames[i] = c.setType(id, result.Type()) - } - } - - if recv != nil && !isBlank(recv) { - this := "this" - if isWrapped(c.p.TypeOf(recv)) { - this = "this.$val" - } - c.Printf("%s = %s;", c.translateExpr(recv), this) - } - - c.translateStmtList(body.List) - if len(c.Flattened) != 0 && !endsWithReturn(body.List) { - c.translateStmt(&ast.ReturnStmt{}, nil) - } - })) - - sort.Strings(c.localVars) - - var prefix, suffix, functionName string - - if len(c.Flattened) != 0 { - c.localVars = append(c.localVars, "$s") - prefix = prefix + " $s = 0;" - } - - if c.HasDefer { - c.localVars = append(c.localVars, "$deferred") - suffix = " }" + suffix - if len(c.Blocking) != 0 { - suffix = " }" + suffix - } - } - - if len(c.Blocking) != 0 { - c.localVars = append(c.localVars, "$r") - if funcRef == "" { - funcRef = "$b" - functionName = " $b" - } - var stores, loads string - for _, v := range c.localVars { - loads += fmt.Sprintf("%s = $f.%s; ", v, v) - stores += fmt.Sprintf("$f.%s = %s; ", v, v) - } - prefix = prefix + " var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; " + loads + "}" - suffix = " if ($f === undefined) { $f = { $blk: " + funcRef + " }; } " + stores + "return $f;" + suffix - } - - if c.HasDefer { - prefix = prefix + " var $err = null; try {" - deferSuffix := " } catch(err) { $err = err;" - if len(c.Blocking) != 0 { - deferSuffix += " $s = -1;" - } - if c.resultNames == nil && c.sig.Results().Len() > 0 { - deferSuffix += fmt.Sprintf(" return%s;", c.translateResults(nil)) - } - deferSuffix += " } finally { $callDeferred($deferred, $err);" - if c.resultNames != nil { - deferSuffix += fmt.Sprintf(" if (!$curGoroutine.asleep) { return %s; }", c.translateResults(c.resultNames)) - } - if len(c.Blocking) != 0 { - deferSuffix += " if($curGoroutine.asleep) {" - } - suffix = deferSuffix + suffix - } - - if len(c.Flattened) != 0 { - prefix = prefix + " s: while (true) { switch ($s) { case 0:" - suffix = " } return; }" + suffix - } - - if c.HasDefer { - prefix = prefix + " $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred);" - } - - if prefix != "" { - bodyOutput = strings.Repeat("\t", c.p.indentation+1) + "/* */" + prefix + "\n" + bodyOutput - } - if suffix != "" { - bodyOutput = bodyOutput + strings.Repeat("\t", c.p.indentation+1) + "/* */" + suffix + "\n" - } - if len(c.localVars) != 0 { - bodyOutput = fmt.Sprintf("%svar %s;\n", strings.Repeat("\t", c.p.indentation+1), strings.Join(c.localVars, ", ")) + bodyOutput - } - - c.p.escapingVars = prevEV - - return params, fmt.Sprintf("function%s(%s) {\n%s%s}", functionName, strings.Join(params, ", "), bodyOutput, strings.Repeat("\t", c.p.indentation)) -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/genmin.go b/vendor/github.com/gopherjs/gopherjs/compiler/prelude/genmin.go deleted file mode 100644 index 739dbf216..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/genmin.go +++ /dev/null @@ -1,63 +0,0 @@ -// +build ignore - -package main - -import ( - "bytes" - "fmt" - "go/build" - "io/ioutil" - "log" - "os/exec" - "path/filepath" - "strings" - - "github.com/gopherjs/gopherjs/compiler/prelude" -) - -func main() { - if err := run(); err != nil { - log.Fatalln(err) - } -} - -func run() error { - bpkg, err := build.Import("github.com/gopherjs/gopherjs", "", build.FindOnly) - if err != nil { - return fmt.Errorf("failed to locate path for github.com/gopherjs/gopherjs: %v", err) - } - - preludeDir := filepath.Join(bpkg.Dir, "compiler", "prelude") - - args := []string{ - filepath.Join(bpkg.Dir, "node_modules", ".bin", "uglifyjs"), - "--config-file", - filepath.Join(preludeDir, "uglifyjs_options.json"), - } - - stderr := new(bytes.Buffer) - cmd := exec.Command(args[0], args[1:]...) - cmd.Stdin = strings.NewReader(prelude.Prelude) - cmd.Stderr = stderr - - out, err := cmd.Output() - if err != nil { - return fmt.Errorf("failed to run %v: %v\n%s", strings.Join(args, " "), err, stderr.String()) - } - - fn := "prelude_min.go" - - outStr := fmt.Sprintf(`// Code generated by genmin; DO NOT EDIT. - -package prelude - -// Minified is an uglifyjs-minified version of Prelude. -const Minified = %q -`, out) - - if err := ioutil.WriteFile(fn, []byte(outStr), 0644); err != nil { - return fmt.Errorf("failed to write to %v: %v", fn, err) - } - - return nil -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/goroutines.go b/vendor/github.com/gopherjs/gopherjs/compiler/prelude/goroutines.go deleted file mode 100644 index d9780b65d..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/goroutines.go +++ /dev/null @@ -1,358 +0,0 @@ -package prelude - -const goroutines = ` -var $stackDepthOffset = 0; -var $getStackDepth = function() { - var err = new Error(); - if (err.stack === undefined) { - return undefined; - } - return $stackDepthOffset + err.stack.split("\n").length; -}; - -var $panicStackDepth = null, $panicValue; -var $callDeferred = function(deferred, jsErr, fromPanic) { - if (!fromPanic && deferred !== null && deferred.index >= $curGoroutine.deferStack.length) { - throw jsErr; - } - if (jsErr !== null) { - var newErr = null; - try { - $curGoroutine.deferStack.push(deferred); - $panic(new $jsErrorPtr(jsErr)); - } catch (err) { - newErr = err; - } - $curGoroutine.deferStack.pop(); - $callDeferred(deferred, newErr); - return; - } - if ($curGoroutine.asleep) { - return; - } - - $stackDepthOffset--; - var outerPanicStackDepth = $panicStackDepth; - var outerPanicValue = $panicValue; - - var localPanicValue = $curGoroutine.panicStack.pop(); - if (localPanicValue !== undefined) { - $panicStackDepth = $getStackDepth(); - $panicValue = localPanicValue; - } - - try { - while (true) { - if (deferred === null) { - deferred = $curGoroutine.deferStack[$curGoroutine.deferStack.length - 1]; - if (deferred === undefined) { - /* The panic reached the top of the stack. Clear it and throw it as a JavaScript error. */ - $panicStackDepth = null; - if (localPanicValue.Object instanceof Error) { - throw localPanicValue.Object; - } - var msg; - if (localPanicValue.constructor === $String) { - msg = localPanicValue.$val; - } else if (localPanicValue.Error !== undefined) { - msg = localPanicValue.Error(); - } else if (localPanicValue.String !== undefined) { - msg = localPanicValue.String(); - } else { - msg = localPanicValue; - } - throw new Error(msg); - } - } - var call = deferred.pop(); - if (call === undefined) { - $curGoroutine.deferStack.pop(); - if (localPanicValue !== undefined) { - deferred = null; - continue; - } - return; - } - var r = call[0].apply(call[2], call[1]); - if (r && r.$blk !== undefined) { - deferred.push([r.$blk, [], r]); - if (fromPanic) { - throw null; - } - return; - } - - if (localPanicValue !== undefined && $panicStackDepth === null) { - throw null; /* error was recovered */ - } - } - } finally { - if (localPanicValue !== undefined) { - if ($panicStackDepth !== null) { - $curGoroutine.panicStack.push(localPanicValue); - } - $panicStackDepth = outerPanicStackDepth; - $panicValue = outerPanicValue; - } - $stackDepthOffset++; - } -}; - -var $panic = function(value) { - $curGoroutine.panicStack.push(value); - $callDeferred(null, null, true); -}; -var $recover = function() { - if ($panicStackDepth === null || ($panicStackDepth !== undefined && $panicStackDepth !== $getStackDepth() - 2)) { - return $ifaceNil; - } - $panicStackDepth = null; - return $panicValue; -}; -var $throw = function(err) { throw err; }; - -var $noGoroutine = { asleep: false, exit: false, deferStack: [], panicStack: [] }; -var $curGoroutine = $noGoroutine, $totalGoroutines = 0, $awakeGoroutines = 0, $checkForDeadlock = true; -var $mainFinished = false; -var $go = function(fun, args) { - $totalGoroutines++; - $awakeGoroutines++; - var $goroutine = function() { - try { - $curGoroutine = $goroutine; - var r = fun.apply(undefined, args); - if (r && r.$blk !== undefined) { - fun = function() { return r.$blk(); }; - args = []; - return; - } - $goroutine.exit = true; - } catch (err) { - if (!$goroutine.exit) { - throw err; - } - } finally { - $curGoroutine = $noGoroutine; - if ($goroutine.exit) { /* also set by runtime.Goexit() */ - $totalGoroutines--; - $goroutine.asleep = true; - } - if ($goroutine.asleep) { - $awakeGoroutines--; - if (!$mainFinished && $awakeGoroutines === 0 && $checkForDeadlock) { - console.error("fatal error: all goroutines are asleep - deadlock!"); - if ($global.process !== undefined) { - $global.process.exit(2); - } - } - } - } - }; - $goroutine.asleep = false; - $goroutine.exit = false; - $goroutine.deferStack = []; - $goroutine.panicStack = []; - $schedule($goroutine); -}; - -var $scheduled = []; -var $runScheduled = function() { - try { - var r; - while ((r = $scheduled.shift()) !== undefined) { - r(); - } - } finally { - if ($scheduled.length > 0) { - setTimeout($runScheduled, 0); - } - } -}; - -var $schedule = function(goroutine) { - if (goroutine.asleep) { - goroutine.asleep = false; - $awakeGoroutines++; - } - $scheduled.push(goroutine); - if ($curGoroutine === $noGoroutine) { - $runScheduled(); - } -}; - -var $setTimeout = function(f, t) { - $awakeGoroutines++; - return setTimeout(function() { - $awakeGoroutines--; - f(); - }, t); -}; - -var $block = function() { - if ($curGoroutine === $noGoroutine) { - $throwRuntimeError("cannot block in JavaScript callback, fix by wrapping code in goroutine"); - } - $curGoroutine.asleep = true; -}; - -var $send = function(chan, value) { - if (chan.$closed) { - $throwRuntimeError("send on closed channel"); - } - var queuedRecv = chan.$recvQueue.shift(); - if (queuedRecv !== undefined) { - queuedRecv([value, true]); - return; - } - if (chan.$buffer.length < chan.$capacity) { - chan.$buffer.push(value); - return; - } - - var thisGoroutine = $curGoroutine; - var closedDuringSend; - chan.$sendQueue.push(function(closed) { - closedDuringSend = closed; - $schedule(thisGoroutine); - return value; - }); - $block(); - return { - $blk: function() { - if (closedDuringSend) { - $throwRuntimeError("send on closed channel"); - } - } - }; -}; -var $recv = function(chan) { - var queuedSend = chan.$sendQueue.shift(); - if (queuedSend !== undefined) { - chan.$buffer.push(queuedSend(false)); - } - var bufferedValue = chan.$buffer.shift(); - if (bufferedValue !== undefined) { - return [bufferedValue, true]; - } - if (chan.$closed) { - return [chan.$elem.zero(), false]; - } - - var thisGoroutine = $curGoroutine; - var f = { $blk: function() { return this.value; } }; - var queueEntry = function(v) { - f.value = v; - $schedule(thisGoroutine); - }; - chan.$recvQueue.push(queueEntry); - $block(); - return f; -}; -var $close = function(chan) { - if (chan.$closed) { - $throwRuntimeError("close of closed channel"); - } - chan.$closed = true; - while (true) { - var queuedSend = chan.$sendQueue.shift(); - if (queuedSend === undefined) { - break; - } - queuedSend(true); /* will panic */ - } - while (true) { - var queuedRecv = chan.$recvQueue.shift(); - if (queuedRecv === undefined) { - break; - } - queuedRecv([chan.$elem.zero(), false]); - } -}; -var $select = function(comms) { - var ready = []; - var selection = -1; - for (var i = 0; i < comms.length; i++) { - var comm = comms[i]; - var chan = comm[0]; - switch (comm.length) { - case 0: /* default */ - selection = i; - break; - case 1: /* recv */ - if (chan.$sendQueue.length !== 0 || chan.$buffer.length !== 0 || chan.$closed) { - ready.push(i); - } - break; - case 2: /* send */ - if (chan.$closed) { - $throwRuntimeError("send on closed channel"); - } - if (chan.$recvQueue.length !== 0 || chan.$buffer.length < chan.$capacity) { - ready.push(i); - } - break; - } - } - - if (ready.length !== 0) { - selection = ready[Math.floor(Math.random() * ready.length)]; - } - if (selection !== -1) { - var comm = comms[selection]; - switch (comm.length) { - case 0: /* default */ - return [selection]; - case 1: /* recv */ - return [selection, $recv(comm[0])]; - case 2: /* send */ - $send(comm[0], comm[1]); - return [selection]; - } - } - - var entries = []; - var thisGoroutine = $curGoroutine; - var f = { $blk: function() { return this.selection; } }; - var removeFromQueues = function() { - for (var i = 0; i < entries.length; i++) { - var entry = entries[i]; - var queue = entry[0]; - var index = queue.indexOf(entry[1]); - if (index !== -1) { - queue.splice(index, 1); - } - } - }; - for (var i = 0; i < comms.length; i++) { - (function(i) { - var comm = comms[i]; - switch (comm.length) { - case 1: /* recv */ - var queueEntry = function(value) { - f.selection = [i, value]; - removeFromQueues(); - $schedule(thisGoroutine); - }; - entries.push([comm[0].$recvQueue, queueEntry]); - comm[0].$recvQueue.push(queueEntry); - break; - case 2: /* send */ - var queueEntry = function() { - if (comm[0].$closed) { - $throwRuntimeError("send on closed channel"); - } - f.selection = [i]; - removeFromQueues(); - $schedule(thisGoroutine); - return comm[1]; - }; - entries.push([comm[0].$sendQueue, queueEntry]); - comm[0].$sendQueue.push(queueEntry); - break; - } - })(i); - } - $block(); - return f; -}; -` diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/jsmapping.go b/vendor/github.com/gopherjs/gopherjs/compiler/prelude/jsmapping.go deleted file mode 100644 index dc29cba6b..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/jsmapping.go +++ /dev/null @@ -1,379 +0,0 @@ -package prelude - -const jsmapping = ` -var $jsObjectPtr, $jsErrorPtr; - -var $needsExternalization = function(t) { - switch (t.kind) { - case $kindBool: - case $kindInt: - case $kindInt8: - case $kindInt16: - case $kindInt32: - case $kindUint: - case $kindUint8: - case $kindUint16: - case $kindUint32: - case $kindUintptr: - case $kindFloat32: - case $kindFloat64: - return false; - default: - return t !== $jsObjectPtr; - } -}; - -var $externalize = function(v, t) { - if (t === $jsObjectPtr) { - return v; - } - switch (t.kind) { - case $kindBool: - case $kindInt: - case $kindInt8: - case $kindInt16: - case $kindInt32: - case $kindUint: - case $kindUint8: - case $kindUint16: - case $kindUint32: - case $kindUintptr: - case $kindFloat32: - case $kindFloat64: - return v; - case $kindInt64: - case $kindUint64: - return $flatten64(v); - case $kindArray: - if ($needsExternalization(t.elem)) { - return $mapArray(v, function(e) { return $externalize(e, t.elem); }); - } - return v; - case $kindFunc: - return $externalizeFunction(v, t, false); - case $kindInterface: - if (v === $ifaceNil) { - return null; - } - if (v.constructor === $jsObjectPtr) { - return v.$val.object; - } - return $externalize(v.$val, v.constructor); - case $kindMap: - var m = {}; - var keys = $keys(v); - for (var i = 0; i < keys.length; i++) { - var entry = v[keys[i]]; - m[$externalize(entry.k, t.key)] = $externalize(entry.v, t.elem); - } - return m; - case $kindPtr: - if (v === t.nil) { - return null; - } - return $externalize(v.$get(), t.elem); - case $kindSlice: - if ($needsExternalization(t.elem)) { - return $mapArray($sliceToArray(v), function(e) { return $externalize(e, t.elem); }); - } - return $sliceToArray(v); - case $kindString: - if ($isASCII(v)) { - return v; - } - var s = "", r; - for (var i = 0; i < v.length; i += r[1]) { - r = $decodeRune(v, i); - var c = r[0]; - if (c > 0xFFFF) { - var h = Math.floor((c - 0x10000) / 0x400) + 0xD800; - var l = (c - 0x10000) % 0x400 + 0xDC00; - s += String.fromCharCode(h, l); - continue; - } - s += String.fromCharCode(c); - } - return s; - case $kindStruct: - var timePkg = $packages["time"]; - if (timePkg !== undefined && v.constructor === timePkg.Time.ptr) { - var milli = $div64(v.UnixNano(), new $Int64(0, 1000000)); - return new Date($flatten64(milli)); - } - - var noJsObject = {}; - var searchJsObject = function(v, t) { - if (t === $jsObjectPtr) { - return v; - } - switch (t.kind) { - case $kindPtr: - if (v === t.nil) { - return noJsObject; - } - return searchJsObject(v.$get(), t.elem); - case $kindStruct: - var f = t.fields[0]; - return searchJsObject(v[f.prop], f.typ); - case $kindInterface: - return searchJsObject(v.$val, v.constructor); - default: - return noJsObject; - } - }; - var o = searchJsObject(v, t); - if (o !== noJsObject) { - return o; - } - - o = {}; - for (var i = 0; i < t.fields.length; i++) { - var f = t.fields[i]; - if (!f.exported) { - continue; - } - o[f.name] = $externalize(v[f.prop], f.typ); - } - return o; - } - $throwRuntimeError("cannot externalize " + t.string); -}; - -var $externalizeFunction = function(v, t, passThis) { - if (v === $throwNilPointerError) { - return null; - } - if (v.$externalizeWrapper === undefined) { - $checkForDeadlock = false; - v.$externalizeWrapper = function() { - var args = []; - for (var i = 0; i < t.params.length; i++) { - if (t.variadic && i === t.params.length - 1) { - var vt = t.params[i].elem, varargs = []; - for (var j = i; j < arguments.length; j++) { - varargs.push($internalize(arguments[j], vt)); - } - args.push(new (t.params[i])(varargs)); - break; - } - args.push($internalize(arguments[i], t.params[i])); - } - var result = v.apply(passThis ? this : undefined, args); - switch (t.results.length) { - case 0: - return; - case 1: - return $externalize(result, t.results[0]); - default: - for (var i = 0; i < t.results.length; i++) { - result[i] = $externalize(result[i], t.results[i]); - } - return result; - } - }; - } - return v.$externalizeWrapper; -}; - -var $internalize = function(v, t, recv) { - if (t === $jsObjectPtr) { - return v; - } - if (t === $jsObjectPtr.elem) { - $throwRuntimeError("cannot internalize js.Object, use *js.Object instead"); - } - if (v && v.__internal_object__ !== undefined) { - return $assertType(v.__internal_object__, t, false); - } - var timePkg = $packages["time"]; - if (timePkg !== undefined && t === timePkg.Time) { - if (!(v !== null && v !== undefined && v.constructor === Date)) { - $throwRuntimeError("cannot internalize time.Time from " + typeof v + ", must be Date"); - } - return timePkg.Unix(new $Int64(0, 0), new $Int64(0, v.getTime() * 1000000)); - } - switch (t.kind) { - case $kindBool: - return !!v; - case $kindInt: - return parseInt(v); - case $kindInt8: - return parseInt(v) << 24 >> 24; - case $kindInt16: - return parseInt(v) << 16 >> 16; - case $kindInt32: - return parseInt(v) >> 0; - case $kindUint: - return parseInt(v); - case $kindUint8: - return parseInt(v) << 24 >>> 24; - case $kindUint16: - return parseInt(v) << 16 >>> 16; - case $kindUint32: - case $kindUintptr: - return parseInt(v) >>> 0; - case $kindInt64: - case $kindUint64: - return new t(0, v); - case $kindFloat32: - case $kindFloat64: - return parseFloat(v); - case $kindArray: - if (v.length !== t.len) { - $throwRuntimeError("got array with wrong size from JavaScript native"); - } - return $mapArray(v, function(e) { return $internalize(e, t.elem); }); - case $kindFunc: - return function() { - var args = []; - for (var i = 0; i < t.params.length; i++) { - if (t.variadic && i === t.params.length - 1) { - var vt = t.params[i].elem, varargs = arguments[i]; - for (var j = 0; j < varargs.$length; j++) { - args.push($externalize(varargs.$array[varargs.$offset + j], vt)); - } - break; - } - args.push($externalize(arguments[i], t.params[i])); - } - var result = v.apply(recv, args); - switch (t.results.length) { - case 0: - return; - case 1: - return $internalize(result, t.results[0]); - default: - for (var i = 0; i < t.results.length; i++) { - result[i] = $internalize(result[i], t.results[i]); - } - return result; - } - }; - case $kindInterface: - if (t.methods.length !== 0) { - $throwRuntimeError("cannot internalize " + t.string); - } - if (v === null) { - return $ifaceNil; - } - if (v === undefined) { - return new $jsObjectPtr(undefined); - } - switch (v.constructor) { - case Int8Array: - return new ($sliceType($Int8))(v); - case Int16Array: - return new ($sliceType($Int16))(v); - case Int32Array: - return new ($sliceType($Int))(v); - case Uint8Array: - return new ($sliceType($Uint8))(v); - case Uint16Array: - return new ($sliceType($Uint16))(v); - case Uint32Array: - return new ($sliceType($Uint))(v); - case Float32Array: - return new ($sliceType($Float32))(v); - case Float64Array: - return new ($sliceType($Float64))(v); - case Array: - return $internalize(v, $sliceType($emptyInterface)); - case Boolean: - return new $Bool(!!v); - case Date: - if (timePkg === undefined) { - /* time package is not present, internalize as &js.Object{Date} so it can be externalized into original Date. */ - return new $jsObjectPtr(v); - } - return new timePkg.Time($internalize(v, timePkg.Time)); - case Function: - var funcType = $funcType([$sliceType($emptyInterface)], [$jsObjectPtr], true); - return new funcType($internalize(v, funcType)); - case Number: - return new $Float64(parseFloat(v)); - case String: - return new $String($internalize(v, $String)); - default: - if ($global.Node && v instanceof $global.Node) { - return new $jsObjectPtr(v); - } - var mapType = $mapType($String, $emptyInterface); - return new mapType($internalize(v, mapType)); - } - case $kindMap: - var m = {}; - var keys = $keys(v); - for (var i = 0; i < keys.length; i++) { - var k = $internalize(keys[i], t.key); - m[t.key.keyFor(k)] = { k: k, v: $internalize(v[keys[i]], t.elem) }; - } - return m; - case $kindPtr: - if (t.elem.kind === $kindStruct) { - return $internalize(v, t.elem); - } - case $kindSlice: - return new t($mapArray(v, function(e) { return $internalize(e, t.elem); })); - case $kindString: - v = String(v); - if ($isASCII(v)) { - return v; - } - var s = ""; - var i = 0; - while (i < v.length) { - var h = v.charCodeAt(i); - if (0xD800 <= h && h <= 0xDBFF) { - var l = v.charCodeAt(i + 1); - var c = (h - 0xD800) * 0x400 + l - 0xDC00 + 0x10000; - s += $encodeRune(c); - i += 2; - continue; - } - s += $encodeRune(h); - i++; - } - return s; - case $kindStruct: - var noJsObject = {}; - var searchJsObject = function(t) { - if (t === $jsObjectPtr) { - return v; - } - if (t === $jsObjectPtr.elem) { - $throwRuntimeError("cannot internalize js.Object, use *js.Object instead"); - } - switch (t.kind) { - case $kindPtr: - return searchJsObject(t.elem); - case $kindStruct: - var f = t.fields[0]; - var o = searchJsObject(f.typ); - if (o !== noJsObject) { - var n = new t.ptr(); - n[f.prop] = o; - return n; - } - return noJsObject; - default: - return noJsObject; - } - }; - var o = searchJsObject(t); - if (o !== noJsObject) { - return o; - } - } - $throwRuntimeError("cannot internalize " + t.string); -}; - -/* $isASCII reports whether string s contains only ASCII characters. */ -var $isASCII = function(s) { - for (var i = 0; i < s.length; i++) { - if (s.charCodeAt(i) >= 128) { - return false; - } - } - return true; -}; -` diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/numeric.go b/vendor/github.com/gopherjs/gopherjs/compiler/prelude/numeric.go deleted file mode 100644 index 063d09f46..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/numeric.go +++ /dev/null @@ -1,196 +0,0 @@ -package prelude - -const numeric = ` -var $min = Math.min; -var $mod = function(x, y) { return x % y; }; -var $parseInt = parseInt; -var $parseFloat = function(f) { - if (f !== undefined && f !== null && f.constructor === Number) { - return f; - } - return parseFloat(f); -}; - -var $froundBuf = new Float32Array(1); -var $fround = Math.fround || function(f) { - $froundBuf[0] = f; - return $froundBuf[0]; -}; - -var $imul = Math.imul || function(a, b) { - var ah = (a >>> 16) & 0xffff; - var al = a & 0xffff; - var bh = (b >>> 16) & 0xffff; - var bl = b & 0xffff; - return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0) >> 0); -}; - -var $floatKey = function(f) { - if (f !== f) { - $idCounter++; - return "NaN$" + $idCounter; - } - return String(f); -}; - -var $flatten64 = function(x) { - return x.$high * 4294967296 + x.$low; -}; - -var $shiftLeft64 = function(x, y) { - if (y === 0) { - return x; - } - if (y < 32) { - return new x.constructor(x.$high << y | x.$low >>> (32 - y), (x.$low << y) >>> 0); - } - if (y < 64) { - return new x.constructor(x.$low << (y - 32), 0); - } - return new x.constructor(0, 0); -}; - -var $shiftRightInt64 = function(x, y) { - if (y === 0) { - return x; - } - if (y < 32) { - return new x.constructor(x.$high >> y, (x.$low >>> y | x.$high << (32 - y)) >>> 0); - } - if (y < 64) { - return new x.constructor(x.$high >> 31, (x.$high >> (y - 32)) >>> 0); - } - if (x.$high < 0) { - return new x.constructor(-1, 4294967295); - } - return new x.constructor(0, 0); -}; - -var $shiftRightUint64 = function(x, y) { - if (y === 0) { - return x; - } - if (y < 32) { - return new x.constructor(x.$high >>> y, (x.$low >>> y | x.$high << (32 - y)) >>> 0); - } - if (y < 64) { - return new x.constructor(0, x.$high >>> (y - 32)); - } - return new x.constructor(0, 0); -}; - -var $mul64 = function(x, y) { - var high = 0, low = 0; - if ((y.$low & 1) !== 0) { - high = x.$high; - low = x.$low; - } - for (var i = 1; i < 32; i++) { - if ((y.$low & 1<>> (32 - i); - low += (x.$low << i) >>> 0; - } - } - for (var i = 0; i < 32; i++) { - if ((y.$high & 1< yHigh) || (xHigh === yHigh && xLow > yLow))) { - yHigh = (yHigh << 1 | yLow >>> 31) >>> 0; - yLow = (yLow << 1) >>> 0; - n++; - } - for (var i = 0; i <= n; i++) { - high = high << 1 | low >>> 31; - low = (low << 1) >>> 0; - if ((xHigh > yHigh) || (xHigh === yHigh && xLow >= yLow)) { - xHigh = xHigh - yHigh; - xLow = xLow - yLow; - if (xLow < 0) { - xHigh--; - xLow += 4294967296; - } - low++; - if (low === 4294967296) { - high++; - low = 0; - } - } - yLow = (yLow >>> 1 | yHigh << (32 - 1)) >>> 0; - yHigh = yHigh >>> 1; - } - - if (returnRemainder) { - return new x.constructor(xHigh * rs, xLow * rs); - } - return new x.constructor(high * s, low * s); -}; - -var $divComplex = function(n, d) { - var ninf = n.$real === Infinity || n.$real === -Infinity || n.$imag === Infinity || n.$imag === -Infinity; - var dinf = d.$real === Infinity || d.$real === -Infinity || d.$imag === Infinity || d.$imag === -Infinity; - var nnan = !ninf && (n.$real !== n.$real || n.$imag !== n.$imag); - var dnan = !dinf && (d.$real !== d.$real || d.$imag !== d.$imag); - if(nnan || dnan) { - return new n.constructor(NaN, NaN); - } - if (ninf && !dinf) { - return new n.constructor(Infinity, Infinity); - } - if (!ninf && dinf) { - return new n.constructor(0, 0); - } - if (d.$real === 0 && d.$imag === 0) { - if (n.$real === 0 && n.$imag === 0) { - return new n.constructor(NaN, NaN); - } - return new n.constructor(Infinity, Infinity); - } - var a = Math.abs(d.$real); - var b = Math.abs(d.$imag); - if (a <= b) { - var ratio = d.$real / d.$imag; - var denom = d.$real * ratio + d.$imag; - return new n.constructor((n.$real * ratio + n.$imag) / denom, (n.$imag * ratio - n.$real) / denom); - } - var ratio = d.$imag / d.$real; - var denom = d.$imag * ratio + d.$real; - return new n.constructor((n.$imag * ratio + n.$real) / denom, (n.$imag - n.$real * ratio) / denom); -}; -` diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/prelude.go b/vendor/github.com/gopherjs/gopherjs/compiler/prelude/prelude.go deleted file mode 100644 index c27601e88..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/prelude.go +++ /dev/null @@ -1,425 +0,0 @@ -package prelude - -//go:generate go run genmin.go - -// Prelude is the GopherJS JavaScript interop layer. -const Prelude = prelude + numeric + types + goroutines + jsmapping - -const prelude = `Error.stackTraceLimit = Infinity; - -var $global, $module; -if (typeof window !== "undefined") { /* web page */ - $global = window; -} else if (typeof self !== "undefined") { /* web worker */ - $global = self; -} else if (typeof global !== "undefined") { /* Node.js */ - $global = global; - $global.require = require; -} else { /* others (e.g. Nashorn) */ - $global = this; -} - -if ($global === undefined || $global.Array === undefined) { - throw new Error("no global object found"); -} -if (typeof module !== "undefined") { - $module = module; -} - -var $packages = {}, $idCounter = 0; -var $keys = function(m) { return m ? Object.keys(m) : []; }; -var $flushConsole = function() {}; -var $throwRuntimeError; /* set by package "runtime" */ -var $throwNilPointerError = function() { $throwRuntimeError("invalid memory address or nil pointer dereference"); }; -var $call = function(fn, rcvr, args) { return fn.apply(rcvr, args); }; -var $makeFunc = function(fn) { return function() { return $externalize(fn(this, new ($sliceType($jsObjectPtr))($global.Array.prototype.slice.call(arguments, []))), $emptyInterface); }; }; -var $unused = function(v) {}; - -var $mapArray = function(array, f) { - var newArray = new array.constructor(array.length); - for (var i = 0; i < array.length; i++) { - newArray[i] = f(array[i]); - } - return newArray; -}; - -var $methodVal = function(recv, name) { - var vals = recv.$methodVals || {}; - recv.$methodVals = vals; /* noop for primitives */ - var f = vals[name]; - if (f !== undefined) { - return f; - } - var method = recv[name]; - f = function() { - $stackDepthOffset--; - try { - return method.apply(recv, arguments); - } finally { - $stackDepthOffset++; - } - }; - vals[name] = f; - return f; -}; - -var $methodExpr = function(typ, name) { - var method = typ.prototype[name]; - if (method.$expr === undefined) { - method.$expr = function() { - $stackDepthOffset--; - try { - if (typ.wrapped) { - arguments[0] = new typ(arguments[0]); - } - return Function.call.apply(method, arguments); - } finally { - $stackDepthOffset++; - } - }; - } - return method.$expr; -}; - -var $ifaceMethodExprs = {}; -var $ifaceMethodExpr = function(name) { - var expr = $ifaceMethodExprs["$" + name]; - if (expr === undefined) { - expr = $ifaceMethodExprs["$" + name] = function() { - $stackDepthOffset--; - try { - return Function.call.apply(arguments[0][name], arguments); - } finally { - $stackDepthOffset++; - } - }; - } - return expr; -}; - -var $subslice = function(slice, low, high, max) { - if (high === undefined) { - high = slice.$length; - } - if (max === undefined) { - max = slice.$capacity; - } - if (low < 0 || high < low || max < high || high > slice.$capacity || max > slice.$capacity) { - $throwRuntimeError("slice bounds out of range"); - } - if (slice === slice.constructor.nil) { - return slice; - } - var s = new slice.constructor(slice.$array); - s.$offset = slice.$offset + low; - s.$length = high - low; - s.$capacity = max - low; - return s; -}; - -var $substring = function(str, low, high) { - if (low < 0 || high < low || high > str.length) { - $throwRuntimeError("slice bounds out of range"); - } - return str.substring(low, high); -}; - -var $sliceToArray = function(slice) { - if (slice.$array.constructor !== Array) { - return slice.$array.subarray(slice.$offset, slice.$offset + slice.$length); - } - return slice.$array.slice(slice.$offset, slice.$offset + slice.$length); -}; - -var $decodeRune = function(str, pos) { - var c0 = str.charCodeAt(pos); - - if (c0 < 0x80) { - return [c0, 1]; - } - - if (c0 !== c0 || c0 < 0xC0) { - return [0xFFFD, 1]; - } - - var c1 = str.charCodeAt(pos + 1); - if (c1 !== c1 || c1 < 0x80 || 0xC0 <= c1) { - return [0xFFFD, 1]; - } - - if (c0 < 0xE0) { - var r = (c0 & 0x1F) << 6 | (c1 & 0x3F); - if (r <= 0x7F) { - return [0xFFFD, 1]; - } - return [r, 2]; - } - - var c2 = str.charCodeAt(pos + 2); - if (c2 !== c2 || c2 < 0x80 || 0xC0 <= c2) { - return [0xFFFD, 1]; - } - - if (c0 < 0xF0) { - var r = (c0 & 0x0F) << 12 | (c1 & 0x3F) << 6 | (c2 & 0x3F); - if (r <= 0x7FF) { - return [0xFFFD, 1]; - } - if (0xD800 <= r && r <= 0xDFFF) { - return [0xFFFD, 1]; - } - return [r, 3]; - } - - var c3 = str.charCodeAt(pos + 3); - if (c3 !== c3 || c3 < 0x80 || 0xC0 <= c3) { - return [0xFFFD, 1]; - } - - if (c0 < 0xF8) { - var r = (c0 & 0x07) << 18 | (c1 & 0x3F) << 12 | (c2 & 0x3F) << 6 | (c3 & 0x3F); - if (r <= 0xFFFF || 0x10FFFF < r) { - return [0xFFFD, 1]; - } - return [r, 4]; - } - - return [0xFFFD, 1]; -}; - -var $encodeRune = function(r) { - if (r < 0 || r > 0x10FFFF || (0xD800 <= r && r <= 0xDFFF)) { - r = 0xFFFD; - } - if (r <= 0x7F) { - return String.fromCharCode(r); - } - if (r <= 0x7FF) { - return String.fromCharCode(0xC0 | r >> 6, 0x80 | (r & 0x3F)); - } - if (r <= 0xFFFF) { - return String.fromCharCode(0xE0 | r >> 12, 0x80 | (r >> 6 & 0x3F), 0x80 | (r & 0x3F)); - } - return String.fromCharCode(0xF0 | r >> 18, 0x80 | (r >> 12 & 0x3F), 0x80 | (r >> 6 & 0x3F), 0x80 | (r & 0x3F)); -}; - -var $stringToBytes = function(str) { - var array = new Uint8Array(str.length); - for (var i = 0; i < str.length; i++) { - array[i] = str.charCodeAt(i); - } - return array; -}; - -var $bytesToString = function(slice) { - if (slice.$length === 0) { - return ""; - } - var str = ""; - for (var i = 0; i < slice.$length; i += 10000) { - str += String.fromCharCode.apply(undefined, slice.$array.subarray(slice.$offset + i, slice.$offset + Math.min(slice.$length, i + 10000))); - } - return str; -}; - -var $stringToRunes = function(str) { - var array = new Int32Array(str.length); - var rune, j = 0; - for (var i = 0; i < str.length; i += rune[1], j++) { - rune = $decodeRune(str, i); - array[j] = rune[0]; - } - return array.subarray(0, j); -}; - -var $runesToString = function(slice) { - if (slice.$length === 0) { - return ""; - } - var str = ""; - for (var i = 0; i < slice.$length; i++) { - str += $encodeRune(slice.$array[slice.$offset + i]); - } - return str; -}; - -var $copyString = function(dst, src) { - var n = Math.min(src.length, dst.$length); - for (var i = 0; i < n; i++) { - dst.$array[dst.$offset + i] = src.charCodeAt(i); - } - return n; -}; - -var $copySlice = function(dst, src) { - var n = Math.min(src.$length, dst.$length); - $copyArray(dst.$array, src.$array, dst.$offset, src.$offset, n, dst.constructor.elem); - return n; -}; - -var $copyArray = function(dst, src, dstOffset, srcOffset, n, elem) { - if (n === 0 || (dst === src && dstOffset === srcOffset)) { - return; - } - - if (src.subarray) { - dst.set(src.subarray(srcOffset, srcOffset + n), dstOffset); - return; - } - - switch (elem.kind) { - case $kindArray: - case $kindStruct: - if (dst === src && dstOffset > srcOffset) { - for (var i = n - 1; i >= 0; i--) { - elem.copy(dst[dstOffset + i], src[srcOffset + i]); - } - return; - } - for (var i = 0; i < n; i++) { - elem.copy(dst[dstOffset + i], src[srcOffset + i]); - } - return; - } - - if (dst === src && dstOffset > srcOffset) { - for (var i = n - 1; i >= 0; i--) { - dst[dstOffset + i] = src[srcOffset + i]; - } - return; - } - for (var i = 0; i < n; i++) { - dst[dstOffset + i] = src[srcOffset + i]; - } -}; - -var $clone = function(src, type) { - var clone = type.zero(); - type.copy(clone, src); - return clone; -}; - -var $pointerOfStructConversion = function(obj, type) { - if(obj.$proxies === undefined) { - obj.$proxies = {}; - obj.$proxies[obj.constructor.string] = obj; - } - var proxy = obj.$proxies[type.string]; - if (proxy === undefined) { - var properties = {}; - for (var i = 0; i < type.elem.fields.length; i++) { - (function(fieldProp) { - properties[fieldProp] = { - get: function() { return obj[fieldProp]; }, - set: function(value) { obj[fieldProp] = value; } - }; - })(type.elem.fields[i].prop); - } - proxy = Object.create(type.prototype, properties); - proxy.$val = proxy; - obj.$proxies[type.string] = proxy; - proxy.$proxies = obj.$proxies; - } - return proxy; -}; - -var $append = function(slice) { - return $internalAppend(slice, arguments, 1, arguments.length - 1); -}; - -var $appendSlice = function(slice, toAppend) { - if (toAppend.constructor === String) { - var bytes = $stringToBytes(toAppend); - return $internalAppend(slice, bytes, 0, bytes.length); - } - return $internalAppend(slice, toAppend.$array, toAppend.$offset, toAppend.$length); -}; - -var $internalAppend = function(slice, array, offset, length) { - if (length === 0) { - return slice; - } - - var newArray = slice.$array; - var newOffset = slice.$offset; - var newLength = slice.$length + length; - var newCapacity = slice.$capacity; - - if (newLength > newCapacity) { - newOffset = 0; - newCapacity = Math.max(newLength, slice.$capacity < 1024 ? slice.$capacity * 2 : Math.floor(slice.$capacity * 5 / 4)); - - if (slice.$array.constructor === Array) { - newArray = slice.$array.slice(slice.$offset, slice.$offset + slice.$length); - newArray.length = newCapacity; - var zero = slice.constructor.elem.zero; - for (var i = slice.$length; i < newCapacity; i++) { - newArray[i] = zero(); - } - } else { - newArray = new slice.$array.constructor(newCapacity); - newArray.set(slice.$array.subarray(slice.$offset, slice.$offset + slice.$length)); - } - } - - $copyArray(newArray, array, newOffset + slice.$length, offset, length, slice.constructor.elem); - - var newSlice = new slice.constructor(newArray); - newSlice.$offset = newOffset; - newSlice.$length = newLength; - newSlice.$capacity = newCapacity; - return newSlice; -}; - -var $equal = function(a, b, type) { - if (type === $jsObjectPtr) { - return a === b; - } - switch (type.kind) { - case $kindComplex64: - case $kindComplex128: - return a.$real === b.$real && a.$imag === b.$imag; - case $kindInt64: - case $kindUint64: - return a.$high === b.$high && a.$low === b.$low; - case $kindArray: - if (a.length !== b.length) { - return false; - } - for (var i = 0; i < a.length; i++) { - if (!$equal(a[i], b[i], type.elem)) { - return false; - } - } - return true; - case $kindStruct: - for (var i = 0; i < type.fields.length; i++) { - var f = type.fields[i]; - if (!$equal(a[f.prop], b[f.prop], f.typ)) { - return false; - } - } - return true; - case $kindInterface: - return $interfaceIsEqual(a, b); - default: - return a === b; - } -}; - -var $interfaceIsEqual = function(a, b) { - if (a === $ifaceNil || b === $ifaceNil) { - return a === b; - } - if (a.constructor !== b.constructor) { - return false; - } - if (a.constructor === $jsObjectPtr) { - return a.object === b.object; - } - if (!a.constructor.comparable) { - $throwRuntimeError("comparing uncomparable type " + a.constructor.string); - } - return $equal(a.$val, b.$val, a.constructor); -}; -` diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/prelude_min.go b/vendor/github.com/gopherjs/gopherjs/compiler/prelude/prelude_min.go deleted file mode 100644 index 0918ffa0b..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/prelude_min.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by genmin; DO NOT EDIT. - -package prelude - -// Minified is an uglifyjs-minified version of Prelude. -const Minified = "var $global,$module;if(Error.stackTraceLimit=1/0,\"undefined\"!=typeof window?$global=window:\"undefined\"!=typeof self?$global=self:\"undefined\"!=typeof global?($global=global).require=require:$global=this,void 0===$global||void 0===$global.Array)throw new Error(\"no global object found\");\"undefined\"!=typeof module&&($module=module);var $throwRuntimeError,$packages={},$idCounter=0,$keys=function(e){return e?Object.keys(e):[]},$flushConsole=function(){},$throwNilPointerError=function(){$throwRuntimeError(\"invalid memory address or nil pointer dereference\")},$call=function(e,n,r){return e.apply(n,r)},$makeFunc=function(e){return function(){return $externalize(e(this,new($sliceType($jsObjectPtr))($global.Array.prototype.slice.call(arguments,[]))),$emptyInterface)}},$unused=function(e){},$mapArray=function(e,n){for(var r=new e.constructor(e.length),t=0;te.$capacity||t>e.$capacity)&&$throwRuntimeError(\"slice bounds out of range\"),e===e.constructor.nil)return e;var i=new e.constructor(e.$array);return i.$offset=e.$offset+n,i.$length=r-n,i.$capacity=t-n,i},$substring=function(e,n,r){return(n<0||re.length)&&$throwRuntimeError(\"slice bounds out of range\"),e.substring(n,r)},$sliceToArray=function(e){return e.$array.constructor!==Array?e.$array.subarray(e.$offset,e.$offset+e.$length):e.$array.slice(e.$offset,e.$offset+e.$length)},$decodeRune=function(e,n){var r=e.charCodeAt(n);if(r<128)return[r,1];if(r!=r||r<192)return[65533,1];var t=e.charCodeAt(n+1);if(t!=t||t<128||192<=t)return[65533,1];if(r<224)return(a=(31&r)<<6|63&t)<=127?[65533,1]:[a,2];var i=e.charCodeAt(n+2);if(i!=i||i<128||192<=i)return[65533,1];if(r<240)return(a=(15&r)<<12|(63&t)<<6|63&i)<=2047?[65533,1]:55296<=a&&a<=57343?[65533,1]:[a,3];var a,o=e.charCodeAt(n+3);return o!=o||o<128||192<=o?[65533,1]:r<248?(a=(7&r)<<18|(63&t)<<12|(63&i)<<6|63&o)<=65535||11141111114111||55296<=e&&e<=57343)&&(e=65533),e<=127?String.fromCharCode(e):e<=2047?String.fromCharCode(192|e>>6,128|63&e):e<=65535?String.fromCharCode(224|e>>12,128|e>>6&63,128|63&e):String.fromCharCode(240|e>>18,128|e>>12&63,128|e>>6&63,128|63&e)},$stringToBytes=function(e){for(var n=new Uint8Array(e.length),r=0;rt){for(var o=i-1;o>=0;o--)a.copy(e[r+o],n[t+o]);return}for(o=0;ot)for(o=i-1;o>=0;o--)e[r+o]=n[t+o];else for(o=0;o$)if(a=0,$=Math.max(o,e.$capacity<1024?2*e.$capacity:Math.floor(5*e.$capacity/4)),e.$array.constructor===Array){(i=e.$array.slice(e.$offset,e.$offset+e.$length)).length=$;for(var c=e.constructor.elem.zero,u=e.$length;u<$;u++)i[u]=c()}else(i=new e.$array.constructor($)).set(e.$array.subarray(e.$offset,e.$offset+e.$length));$copyArray(i,n,a+e.$length,r,t,e.constructor.elem);var l=new e.constructor(i);return l.$offset=a,l.$length=o,l.$capacity=$,l},$equal=function(e,n,r){if(r===$jsObjectPtr)return e===n;switch(r.kind){case $kindComplex64:case $kindComplex128:return e.$real===n.$real&&e.$imag===n.$imag;case $kindInt64:case $kindUint64:return e.$high===n.$high&&e.$low===n.$low;case $kindArray:if(e.length!==n.length)return!1;for(var t=0;t>>16&65535)*t+r*(n>>>16&65535)<<16>>>0)>>0},$floatKey=function(e){return e!=e?\"NaN$\"+ ++$idCounter:String(e)},$flatten64=function(e){return 4294967296*e.$high+e.$low},$shiftLeft64=function(e,n){return 0===n?e:n<32?new e.constructor(e.$high<>>32-n,e.$low<>>0):n<64?new e.constructor(e.$low<>n,(e.$low>>>n|e.$high<<32-n)>>>0):n<64?new e.constructor(e.$high>>31,e.$high>>n-32>>>0):e.$high<0?new e.constructor(-1,4294967295):new e.constructor(0,0)},$shiftRightUint64=function(e,n){return 0===n?e:n<32?new e.constructor(e.$high>>>n,(e.$low>>>n|e.$high<<32-n)>>>0):n<64?new e.constructor(0,e.$high>>>n-32):new e.constructor(0,0)},$mul64=function(e,n){var r=0,t=0;0!=(1&n.$low)&&(r=e.$high,t=e.$low);for(var i=1;i<32;i++)0!=(n.$low&1<>>32-i,t+=e.$low<>>0);for(i=0;i<32;i++)0!=(n.$high&1<$||a===$&&o>c);)$=($<<1|c>>>31)>>>0,c=c<<1>>>0,s++;for(var f=0;f<=s;f++)u=u<<1|l>>>31,l=l<<1>>>0,(a>$||a===$&&o>=c)&&(a-=$,(o-=c)<0&&(a--,o+=4294967296),4294967296===++l&&(u++,l=0)),c=(c>>>1|$<<31)>>>0,$>>>=1;return r?new e.constructor(a*i,o*i):new e.constructor(u*t,l*t)},$divComplex=function(e,n){var r=e.$real===1/0||e.$real===-1/0||e.$imag===1/0||e.$imag===-1/0,t=n.$real===1/0||n.$real===-1/0||n.$imag===1/0||n.$imag===-1/0,i=!r&&(e.$real!=e.$real||e.$imag!=e.$imag),a=!t&&(n.$real!=n.$real||n.$imag!=n.$imag);if(i||a)return new e.constructor(NaN,NaN);if(r&&!t)return new e.constructor(1/0,1/0);if(!r&&t)return new e.constructor(0,0);if(0===n.$real&&0===n.$imag)return 0===e.$real&&0===e.$imag?new e.constructor(NaN,NaN):new e.constructor(1/0,1/0);if(Math.abs(n.$real)<=Math.abs(n.$imag)){var o=n.$real/n.$imag,$=n.$real*o+n.$imag;return new e.constructor((e.$real*o+e.$imag)/$,(e.$imag*o-e.$real)/$)}o=n.$imag/n.$real,$=n.$imag*o+n.$real;return new e.constructor((e.$imag*o+e.$real)/$,(e.$imag-e.$real*o)/$)},$kindBool=1,$kindInt=2,$kindInt8=3,$kindInt16=4,$kindInt32=5,$kindInt64=6,$kindUint=7,$kindUint8=8,$kindUint16=9,$kindUint32=10,$kindUint64=11,$kindUintptr=12,$kindFloat32=13,$kindFloat64=14,$kindComplex64=15,$kindComplex128=16,$kindArray=17,$kindChan=18,$kindFunc=19,$kindInterface=20,$kindMap=21,$kindPtr=22,$kindSlice=23,$kindString=24,$kindStruct=25,$kindUnsafePointer=26,$methodSynthesizers=[],$addMethodSynthesizer=function(e){null!==$methodSynthesizers?$methodSynthesizers.push(e):e()},$synthesizeMethods=function(){$methodSynthesizers.forEach(function(e){e()}),$methodSynthesizers=null},$ifaceKeyFor=function(e){if(e===$ifaceNil)return\"nil\";var n=e.constructor;return n.string+\"$\"+n.keyFor(e.$val)},$identity=function(e){return e},$typeIDCounter=0,$idKey=function(e){return void 0===e.$id&&($idCounter++,e.$id=$idCounter),String(e.$id)},$newType=function(e,n,r,t,i,a,o){var $;switch(n){case $kindBool:case $kindInt:case $kindInt8:case $kindInt16:case $kindInt32:case $kindUint:case $kindUint8:case $kindUint16:case $kindUint32:case $kindUintptr:case $kindUnsafePointer:($=function(e){this.$val=e}).wrapped=!0,$.keyFor=$identity;break;case $kindString:($=function(e){this.$val=e}).wrapped=!0,$.keyFor=function(e){return\"$\"+e};break;case $kindFloat32:case $kindFloat64:($=function(e){this.$val=e}).wrapped=!0,$.keyFor=function(e){return $floatKey(e)};break;case $kindInt64:($=function(e,n){this.$high=e+Math.floor(Math.ceil(n)/4294967296)>>0,this.$low=n>>>0,this.$val=this}).keyFor=function(e){return e.$high+\"$\"+e.$low};break;case $kindUint64:($=function(e,n){this.$high=e+Math.floor(Math.ceil(n)/4294967296)>>>0,this.$low=n>>>0,this.$val=this}).keyFor=function(e){return e.$high+\"$\"+e.$low};break;case $kindComplex64:($=function(e,n){this.$real=$fround(e),this.$imag=$fround(n),this.$val=this}).keyFor=function(e){return e.$real+\"$\"+e.$imag};break;case $kindComplex128:($=function(e,n){this.$real=e,this.$imag=n,this.$val=this}).keyFor=function(e){return e.$real+\"$\"+e.$imag};break;case $kindArray:($=function(e){this.$val=e}).wrapped=!0,$.ptr=$newType(4,$kindPtr,\"*\"+r,!1,\"\",!1,function(e){this.$get=function(){return e},this.$set=function(e){$.copy(this,e)},this.$val=e}),$.init=function(e,n){$.elem=e,$.len=n,$.comparable=e.comparable,$.keyFor=function(n){return Array.prototype.join.call($mapArray(n,function(n){return String(e.keyFor(n)).replace(/\\\\/g,\"\\\\\\\\\").replace(/\\$/g,\"\\\\$\")}),\"$\")},$.copy=function(n,r){$copyArray(n,r,0,0,r.length,e)},$.ptr.init($),Object.defineProperty($.ptr.nil,\"nilCheck\",{get:$throwNilPointerError})};break;case $kindChan:($=function(e){this.$val=e}).wrapped=!0,$.keyFor=$idKey,$.init=function(e,n,r){$.elem=e,$.sendOnly=n,$.recvOnly=r};break;case $kindFunc:($=function(e){this.$val=e}).wrapped=!0,$.init=function(e,n,r){$.params=e,$.results=n,$.variadic=r,$.comparable=!1};break;case $kindInterface:($={implementedBy:{},missingMethodFor:{}}).keyFor=$ifaceKeyFor,$.init=function(e){$.methods=e,e.forEach(function(e){$ifaceNil[e.prop]=$throwNilPointerError})};break;case $kindMap:($=function(e){this.$val=e}).wrapped=!0,$.init=function(e,n){$.key=e,$.elem=n,$.comparable=!1};break;case $kindPtr:($=o||function(e,n,r){this.$get=e,this.$set=n,this.$target=r,this.$val=this}).keyFor=$idKey,$.init=function(e){$.elem=e,$.wrapped=e.kind===$kindArray,$.nil=new $($throwNilPointerError,$throwNilPointerError)};break;case $kindSlice:($=function(e){e.constructor!==$.nativeArray&&(e=new $.nativeArray(e)),this.$array=e,this.$offset=0,this.$length=e.length,this.$capacity=e.length,this.$val=this}).init=function(e){$.elem=e,$.comparable=!1,$.nativeArray=$nativeArray(e.kind),$.nil=new $([])};break;case $kindStruct:($=function(e){this.$val=e}).wrapped=!0,$.ptr=$newType(4,$kindPtr,\"*\"+r,!1,i,a,o),$.ptr.elem=$,$.ptr.prototype.$get=function(){return this},$.ptr.prototype.$set=function(e){$.copy(this,e)},$.init=function(e,n){$.pkgPath=e,$.fields=n,n.forEach(function(e){e.typ.comparable||($.comparable=!1)}),$.keyFor=function(e){var r=e.$val;return $mapArray(n,function(e){return String(e.typ.keyFor(r[e.prop])).replace(/\\\\/g,\"\\\\\\\\\").replace(/\\$/g,\"\\\\$\")}).join(\"$\")},$.copy=function(e,r){for(var t=0;t0;){var a=[],o=[];t.forEach(function(e){if(!i[e.typ.string])switch(i[e.typ.string]=!0,e.typ.named&&(o=o.concat(e.typ.methods),e.indirect&&(o=o.concat($ptrType(e.typ).methods))),e.typ.kind){case $kindStruct:e.typ.fields.forEach(function(n){if(n.embedded){var r=n.typ,t=r.kind===$kindPtr;a.push({typ:t?r.elem:r,indirect:e.indirect||t})}});break;case $kindInterface:o=o.concat(e.typ.methods)}}),o.forEach(function(e){void 0===n[e.name]&&(n[e.name]=e)}),t=a}return e.methodSetCache=[],Object.keys(n).sort().forEach(function(r){e.methodSetCache.push(n[r])}),e.methodSetCache},$Bool=$newType(1,$kindBool,\"bool\",!0,\"\",!1,null),$Int=$newType(4,$kindInt,\"int\",!0,\"\",!1,null),$Int8=$newType(1,$kindInt8,\"int8\",!0,\"\",!1,null),$Int16=$newType(2,$kindInt16,\"int16\",!0,\"\",!1,null),$Int32=$newType(4,$kindInt32,\"int32\",!0,\"\",!1,null),$Int64=$newType(8,$kindInt64,\"int64\",!0,\"\",!1,null),$Uint=$newType(4,$kindUint,\"uint\",!0,\"\",!1,null),$Uint8=$newType(1,$kindUint8,\"uint8\",!0,\"\",!1,null),$Uint16=$newType(2,$kindUint16,\"uint16\",!0,\"\",!1,null),$Uint32=$newType(4,$kindUint32,\"uint32\",!0,\"\",!1,null),$Uint64=$newType(8,$kindUint64,\"uint64\",!0,\"\",!1,null),$Uintptr=$newType(4,$kindUintptr,\"uintptr\",!0,\"\",!1,null),$Float32=$newType(4,$kindFloat32,\"float32\",!0,\"\",!1,null),$Float64=$newType(8,$kindFloat64,\"float64\",!0,\"\",!1,null),$Complex64=$newType(8,$kindComplex64,\"complex64\",!0,\"\",!1,null),$Complex128=$newType(16,$kindComplex128,\"complex128\",!0,\"\",!1,null),$String=$newType(8,$kindString,\"string\",!0,\"\",!1,null),$UnsafePointer=$newType(4,$kindUnsafePointer,\"unsafe.Pointer\",!0,\"\",!1,null),$nativeArray=function(e){switch(e){case $kindInt:return Int32Array;case $kindInt8:return Int8Array;case $kindInt16:return Int16Array;case $kindInt32:return Int32Array;case $kindUint:return Uint32Array;case $kindUint8:return Uint8Array;case $kindUint16:return Uint16Array;case $kindUint32:case $kindUintptr:return Uint32Array;case $kindFloat32:return Float32Array;case $kindFloat64:return Float64Array;default:return Array}},$toNativeArray=function(e,n){var r=$nativeArray(e);return r===Array?n:new r(n)},$arrayTypes={},$arrayType=function(e,n){var r=e.id+\"$\"+n,t=$arrayTypes[r];return void 0===t&&(t=$newType(12,$kindArray,\"[\"+n+\"]\"+e.string,!1,\"\",!1,null),$arrayTypes[r]=t,t.init(e,n)),t},$chanType=function(e,n,r){var t=(r?\"<-\":\"\")+\"chan\"+(n?\"<- \":\" \")+e.string,i=n?\"SendChan\":r?\"RecvChan\":\"Chan\",a=e[i];return void 0===a&&(a=$newType(4,$kindChan,t,!1,\"\",!1,null),e[i]=a,a.init(e,n,r)),a},$Chan=function(e,n){(n<0||n>2147483647)&&$throwRuntimeError(\"makechan: size out of range\"),this.$elem=e,this.$capacity=n,this.$buffer=[],this.$sendQueue=[],this.$recvQueue=[],this.$closed=!1},$chanNil=new $Chan(null,0);$chanNil.$sendQueue=$chanNil.$recvQueue={length:0,push:function(){},shift:function(){},indexOf:function(){return-1}};var $funcTypes={},$funcType=function(e,n,r){var t=$mapArray(e,function(e){return e.id}).join(\",\")+\"$\"+$mapArray(n,function(e){return e.id}).join(\",\")+\"$\"+r,i=$funcTypes[t];if(void 0===i){var a=$mapArray(e,function(e){return e.string});r&&(a[a.length-1]=\"...\"+a[a.length-1].substr(2));var o=\"func(\"+a.join(\", \")+\")\";1===n.length?o+=\" \"+n[0].string:n.length>1&&(o+=\" (\"+$mapArray(n,function(e){return e.string}).join(\", \")+\")\"),i=$newType(4,$kindFunc,o,!1,\"\",!1,null),$funcTypes[t]=i,i.init(e,n,r)}return i},$interfaceTypes={},$interfaceType=function(e){var n=$mapArray(e,function(e){return e.pkg+\",\"+e.name+\",\"+e.typ.id}).join(\"$\"),r=$interfaceTypes[n];if(void 0===r){var t=\"interface {}\";0!==e.length&&(t=\"interface { \"+$mapArray(e,function(e){return(\"\"!==e.pkg?e.pkg+\".\":\"\")+e.name+e.typ.string.substr(4)}).join(\"; \")+\" }\"),r=$newType(8,$kindInterface,t,!1,\"\",!1,null),$interfaceTypes[n]=r,r.init(e)}return r},$emptyInterface=$interfaceType([]),$ifaceNil={},$error=$newType(8,$kindInterface,\"error\",!0,\"\",!1,null);$error.init([{prop:\"Error\",name:\"Error\",pkg:\"\",typ:$funcType([],[$String],!1)}]);var $panicValue,$jsObjectPtr,$jsErrorPtr,$mapTypes={},$mapType=function(e,n){var r=e.id+\"$\"+n.id,t=$mapTypes[r];return void 0===t&&(t=$newType(4,$kindMap,\"map[\"+e.string+\"]\"+n.string,!1,\"\",!1,null),$mapTypes[r]=t,t.init(e,n)),t},$makeMap=function(e,n){for(var r={},t=0;t2147483647)&&$throwRuntimeError(\"makeslice: len out of range\"),(r<0||r2147483647)&&$throwRuntimeError(\"makeslice: cap out of range\");var t=new e.nativeArray(r);if(e.nativeArray===Array)for(var i=0;i=$curGoroutine.deferStack.length)throw n;if(null!==n){var t=null;try{$curGoroutine.deferStack.push(e),$panic(new $jsErrorPtr(n))}catch(e){t=e}return $curGoroutine.deferStack.pop(),void $callDeferred(e,t)}if(!$curGoroutine.asleep){$stackDepthOffset--;var i=$panicStackDepth,a=$panicValue,o=$curGoroutine.panicStack.pop();void 0!==o&&($panicStackDepth=$getStackDepth(),$panicValue=o);try{for(;;){if(null===e&&void 0===(e=$curGoroutine.deferStack[$curGoroutine.deferStack.length-1])){if($panicStackDepth=null,o.Object instanceof Error)throw o.Object;var $;throw $=o.constructor===$String?o.$val:void 0!==o.Error?o.Error():void 0!==o.String?o.String():o,new Error($)}var c=e.pop();if(void 0===c){if($curGoroutine.deferStack.pop(),void 0!==o){e=null;continue}return}var u=c[0].apply(c[2],c[1]);if(u&&void 0!==u.$blk){if(e.push([u.$blk,[],u]),r)throw null;return}if(void 0!==o&&null===$panicStackDepth)throw null}}finally{void 0!==o&&(null!==$panicStackDepth&&$curGoroutine.panicStack.push(o),$panicStackDepth=i,$panicValue=a),$stackDepthOffset++}}},$panic=function(e){$curGoroutine.panicStack.push(e),$callDeferred(null,null,!0)},$recover=function(){return null===$panicStackDepth||void 0!==$panicStackDepth&&$panicStackDepth!==$getStackDepth()-2?$ifaceNil:($panicStackDepth=null,$panicValue)},$throw=function(e){throw e},$noGoroutine={asleep:!1,exit:!1,deferStack:[],panicStack:[]},$curGoroutine=$noGoroutine,$totalGoroutines=0,$awakeGoroutines=0,$checkForDeadlock=!0,$mainFinished=!1,$go=function(e,n){$totalGoroutines++,$awakeGoroutines++;var r=function(){try{$curGoroutine=r;var t=e.apply(void 0,n);if(t&&void 0!==t.$blk)return e=function(){return t.$blk()},void(n=[]);r.exit=!0}catch(e){if(!r.exit)throw e}finally{$curGoroutine=$noGoroutine,r.exit&&($totalGoroutines--,r.asleep=!0),r.asleep&&($awakeGoroutines--,!$mainFinished&&0===$awakeGoroutines&&$checkForDeadlock&&(console.error(\"fatal error: all goroutines are asleep - deadlock!\"),void 0!==$global.process&&$global.process.exit(2)))}};r.asleep=!1,r.exit=!1,r.deferStack=[],r.panicStack=[],$schedule(r)},$scheduled=[],$runScheduled=function(){try{for(var e;void 0!==(e=$scheduled.shift());)e()}finally{$scheduled.length>0&&setTimeout($runScheduled,0)}},$schedule=function(e){e.asleep&&(e.asleep=!1,$awakeGoroutines++),$scheduled.push(e),$curGoroutine===$noGoroutine&&$runScheduled()},$setTimeout=function(e,n){return $awakeGoroutines++,setTimeout(function(){$awakeGoroutines--,e()},n)},$block=function(){$curGoroutine===$noGoroutine&&$throwRuntimeError(\"cannot block in JavaScript callback, fix by wrapping code in goroutine\"),$curGoroutine.asleep=!0},$send=function(e,n){e.$closed&&$throwRuntimeError(\"send on closed channel\");var r=e.$recvQueue.shift();if(void 0===r){if(!(e.$buffer.length65535){var u=Math.floor((c-65536)/1024)+55296,l=(c-65536)%1024+56320;$+=String.fromCharCode(u,l)}else $+=String.fromCharCode(c)}return $;case $kindStruct:var s=$packages.time;if(void 0!==s&&e.constructor===s.Time.ptr){var f=$div64(e.UnixNano(),new $Int64(0,1e6));return new Date($flatten64(f))}var d={},p=function(e,n){if(n===$jsObjectPtr)return e;switch(n.kind){case $kindPtr:return e===n.nil?d:p(e.$get(),n.elem);case $kindStruct:var r=n.fields[0];return p(e[r.prop],r.typ);case $kindInterface:return p(e.$val,e.constructor);default:return d}},h=p(e,n);if(h!==d)return h;h={};for(i=0;i>24;case $kindInt16:return parseInt(e)<<16>>16;case $kindInt32:return parseInt(e)>>0;case $kindUint:return parseInt(e);case $kindUint8:return parseInt(e)<<24>>>24;case $kindUint16:return parseInt(e)<<16>>>16;case $kindUint32:case $kindUintptr:return parseInt(e)>>>0;case $kindInt64:case $kindUint64:return new n(0,e);case $kindFloat32:case $kindFloat64:return parseFloat(e);case $kindArray:return e.length!==n.len&&$throwRuntimeError(\"got array with wrong size from JavaScript native\"),$mapArray(e,function(e){return $internalize(e,n.elem)});case $kindFunc:return function(){for(var t=[],i=0;i=128)return!1;return!0};\n" diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/types.go b/vendor/github.com/gopherjs/gopherjs/compiler/prelude/types.go deleted file mode 100644 index 0d37509ba..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/types.go +++ /dev/null @@ -1,747 +0,0 @@ -package prelude - -const types = ` -var $kindBool = 1; -var $kindInt = 2; -var $kindInt8 = 3; -var $kindInt16 = 4; -var $kindInt32 = 5; -var $kindInt64 = 6; -var $kindUint = 7; -var $kindUint8 = 8; -var $kindUint16 = 9; -var $kindUint32 = 10; -var $kindUint64 = 11; -var $kindUintptr = 12; -var $kindFloat32 = 13; -var $kindFloat64 = 14; -var $kindComplex64 = 15; -var $kindComplex128 = 16; -var $kindArray = 17; -var $kindChan = 18; -var $kindFunc = 19; -var $kindInterface = 20; -var $kindMap = 21; -var $kindPtr = 22; -var $kindSlice = 23; -var $kindString = 24; -var $kindStruct = 25; -var $kindUnsafePointer = 26; - -var $methodSynthesizers = []; -var $addMethodSynthesizer = function(f) { - if ($methodSynthesizers === null) { - f(); - return; - } - $methodSynthesizers.push(f); -}; -var $synthesizeMethods = function() { - $methodSynthesizers.forEach(function(f) { f(); }); - $methodSynthesizers = null; -}; - -var $ifaceKeyFor = function(x) { - if (x === $ifaceNil) { - return 'nil'; - } - var c = x.constructor; - return c.string + '$' + c.keyFor(x.$val); -}; - -var $identity = function(x) { return x; }; - -var $typeIDCounter = 0; - -var $idKey = function(x) { - if (x.$id === undefined) { - $idCounter++; - x.$id = $idCounter; - } - return String(x.$id); -}; - -var $newType = function(size, kind, string, named, pkg, exported, constructor) { - var typ; - switch(kind) { - case $kindBool: - case $kindInt: - case $kindInt8: - case $kindInt16: - case $kindInt32: - case $kindUint: - case $kindUint8: - case $kindUint16: - case $kindUint32: - case $kindUintptr: - case $kindUnsafePointer: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.keyFor = $identity; - break; - - case $kindString: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.keyFor = function(x) { return "$" + x; }; - break; - - case $kindFloat32: - case $kindFloat64: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.keyFor = function(x) { return $floatKey(x); }; - break; - - case $kindInt64: - typ = function(high, low) { - this.$high = (high + Math.floor(Math.ceil(low) / 4294967296)) >> 0; - this.$low = low >>> 0; - this.$val = this; - }; - typ.keyFor = function(x) { return x.$high + "$" + x.$low; }; - break; - - case $kindUint64: - typ = function(high, low) { - this.$high = (high + Math.floor(Math.ceil(low) / 4294967296)) >>> 0; - this.$low = low >>> 0; - this.$val = this; - }; - typ.keyFor = function(x) { return x.$high + "$" + x.$low; }; - break; - - case $kindComplex64: - typ = function(real, imag) { - this.$real = $fround(real); - this.$imag = $fround(imag); - this.$val = this; - }; - typ.keyFor = function(x) { return x.$real + "$" + x.$imag; }; - break; - - case $kindComplex128: - typ = function(real, imag) { - this.$real = real; - this.$imag = imag; - this.$val = this; - }; - typ.keyFor = function(x) { return x.$real + "$" + x.$imag; }; - break; - - case $kindArray: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.ptr = $newType(4, $kindPtr, "*" + string, false, "", false, function(array) { - this.$get = function() { return array; }; - this.$set = function(v) { typ.copy(this, v); }; - this.$val = array; - }); - typ.init = function(elem, len) { - typ.elem = elem; - typ.len = len; - typ.comparable = elem.comparable; - typ.keyFor = function(x) { - return Array.prototype.join.call($mapArray(x, function(e) { - return String(elem.keyFor(e)).replace(/\\/g, "\\\\").replace(/\$/g, "\\$"); - }), "$"); - }; - typ.copy = function(dst, src) { - $copyArray(dst, src, 0, 0, src.length, elem); - }; - typ.ptr.init(typ); - Object.defineProperty(typ.ptr.nil, "nilCheck", { get: $throwNilPointerError }); - }; - break; - - case $kindChan: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.keyFor = $idKey; - typ.init = function(elem, sendOnly, recvOnly) { - typ.elem = elem; - typ.sendOnly = sendOnly; - typ.recvOnly = recvOnly; - }; - break; - - case $kindFunc: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.init = function(params, results, variadic) { - typ.params = params; - typ.results = results; - typ.variadic = variadic; - typ.comparable = false; - }; - break; - - case $kindInterface: - typ = { implementedBy: {}, missingMethodFor: {} }; - typ.keyFor = $ifaceKeyFor; - typ.init = function(methods) { - typ.methods = methods; - methods.forEach(function(m) { - $ifaceNil[m.prop] = $throwNilPointerError; - }); - }; - break; - - case $kindMap: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.init = function(key, elem) { - typ.key = key; - typ.elem = elem; - typ.comparable = false; - }; - break; - - case $kindPtr: - typ = constructor || function(getter, setter, target) { - this.$get = getter; - this.$set = setter; - this.$target = target; - this.$val = this; - }; - typ.keyFor = $idKey; - typ.init = function(elem) { - typ.elem = elem; - typ.wrapped = (elem.kind === $kindArray); - typ.nil = new typ($throwNilPointerError, $throwNilPointerError); - }; - break; - - case $kindSlice: - typ = function(array) { - if (array.constructor !== typ.nativeArray) { - array = new typ.nativeArray(array); - } - this.$array = array; - this.$offset = 0; - this.$length = array.length; - this.$capacity = array.length; - this.$val = this; - }; - typ.init = function(elem) { - typ.elem = elem; - typ.comparable = false; - typ.nativeArray = $nativeArray(elem.kind); - typ.nil = new typ([]); - }; - break; - - case $kindStruct: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.ptr = $newType(4, $kindPtr, "*" + string, false, pkg, exported, constructor); - typ.ptr.elem = typ; - typ.ptr.prototype.$get = function() { return this; }; - typ.ptr.prototype.$set = function(v) { typ.copy(this, v); }; - typ.init = function(pkgPath, fields) { - typ.pkgPath = pkgPath; - typ.fields = fields; - fields.forEach(function(f) { - if (!f.typ.comparable) { - typ.comparable = false; - } - }); - typ.keyFor = function(x) { - var val = x.$val; - return $mapArray(fields, function(f) { - return String(f.typ.keyFor(val[f.prop])).replace(/\\/g, "\\\\").replace(/\$/g, "\\$"); - }).join("$"); - }; - typ.copy = function(dst, src) { - for (var i = 0; i < fields.length; i++) { - var f = fields[i]; - switch (f.typ.kind) { - case $kindArray: - case $kindStruct: - f.typ.copy(dst[f.prop], src[f.prop]); - continue; - default: - dst[f.prop] = src[f.prop]; - continue; - } - } - }; - /* nil value */ - var properties = {}; - fields.forEach(function(f) { - properties[f.prop] = { get: $throwNilPointerError, set: $throwNilPointerError }; - }); - typ.ptr.nil = Object.create(constructor.prototype, properties); - typ.ptr.nil.$val = typ.ptr.nil; - /* methods for embedded fields */ - $addMethodSynthesizer(function() { - var synthesizeMethod = function(target, m, f) { - if (target.prototype[m.prop] !== undefined) { return; } - target.prototype[m.prop] = function() { - var v = this.$val[f.prop]; - if (f.typ === $jsObjectPtr) { - v = new $jsObjectPtr(v); - } - if (v.$val === undefined) { - v = new f.typ(v); - } - return v[m.prop].apply(v, arguments); - }; - }; - fields.forEach(function(f) { - if (f.embedded) { - $methodSet(f.typ).forEach(function(m) { - synthesizeMethod(typ, m, f); - synthesizeMethod(typ.ptr, m, f); - }); - $methodSet($ptrType(f.typ)).forEach(function(m) { - synthesizeMethod(typ.ptr, m, f); - }); - } - }); - }); - }; - break; - - default: - $panic(new $String("invalid kind: " + kind)); - } - - switch (kind) { - case $kindBool: - case $kindMap: - typ.zero = function() { return false; }; - break; - - case $kindInt: - case $kindInt8: - case $kindInt16: - case $kindInt32: - case $kindUint: - case $kindUint8 : - case $kindUint16: - case $kindUint32: - case $kindUintptr: - case $kindUnsafePointer: - case $kindFloat32: - case $kindFloat64: - typ.zero = function() { return 0; }; - break; - - case $kindString: - typ.zero = function() { return ""; }; - break; - - case $kindInt64: - case $kindUint64: - case $kindComplex64: - case $kindComplex128: - var zero = new typ(0, 0); - typ.zero = function() { return zero; }; - break; - - case $kindPtr: - case $kindSlice: - typ.zero = function() { return typ.nil; }; - break; - - case $kindChan: - typ.zero = function() { return $chanNil; }; - break; - - case $kindFunc: - typ.zero = function() { return $throwNilPointerError; }; - break; - - case $kindInterface: - typ.zero = function() { return $ifaceNil; }; - break; - - case $kindArray: - typ.zero = function() { - var arrayClass = $nativeArray(typ.elem.kind); - if (arrayClass !== Array) { - return new arrayClass(typ.len); - } - var array = new Array(typ.len); - for (var i = 0; i < typ.len; i++) { - array[i] = typ.elem.zero(); - } - return array; - }; - break; - - case $kindStruct: - typ.zero = function() { return new typ.ptr(); }; - break; - - default: - $panic(new $String("invalid kind: " + kind)); - } - - typ.id = $typeIDCounter; - $typeIDCounter++; - typ.size = size; - typ.kind = kind; - typ.string = string; - typ.named = named; - typ.pkg = pkg; - typ.exported = exported; - typ.methods = []; - typ.methodSetCache = null; - typ.comparable = true; - return typ; -}; - -var $methodSet = function(typ) { - if (typ.methodSetCache !== null) { - return typ.methodSetCache; - } - var base = {}; - - var isPtr = (typ.kind === $kindPtr); - if (isPtr && typ.elem.kind === $kindInterface) { - typ.methodSetCache = []; - return []; - } - - var current = [{typ: isPtr ? typ.elem : typ, indirect: isPtr}]; - - var seen = {}; - - while (current.length > 0) { - var next = []; - var mset = []; - - current.forEach(function(e) { - if (seen[e.typ.string]) { - return; - } - seen[e.typ.string] = true; - - if (e.typ.named) { - mset = mset.concat(e.typ.methods); - if (e.indirect) { - mset = mset.concat($ptrType(e.typ).methods); - } - } - - switch (e.typ.kind) { - case $kindStruct: - e.typ.fields.forEach(function(f) { - if (f.embedded) { - var fTyp = f.typ; - var fIsPtr = (fTyp.kind === $kindPtr); - next.push({typ: fIsPtr ? fTyp.elem : fTyp, indirect: e.indirect || fIsPtr}); - } - }); - break; - - case $kindInterface: - mset = mset.concat(e.typ.methods); - break; - } - }); - - mset.forEach(function(m) { - if (base[m.name] === undefined) { - base[m.name] = m; - } - }); - - current = next; - } - - typ.methodSetCache = []; - Object.keys(base).sort().forEach(function(name) { - typ.methodSetCache.push(base[name]); - }); - return typ.methodSetCache; -}; - -var $Bool = $newType( 1, $kindBool, "bool", true, "", false, null); -var $Int = $newType( 4, $kindInt, "int", true, "", false, null); -var $Int8 = $newType( 1, $kindInt8, "int8", true, "", false, null); -var $Int16 = $newType( 2, $kindInt16, "int16", true, "", false, null); -var $Int32 = $newType( 4, $kindInt32, "int32", true, "", false, null); -var $Int64 = $newType( 8, $kindInt64, "int64", true, "", false, null); -var $Uint = $newType( 4, $kindUint, "uint", true, "", false, null); -var $Uint8 = $newType( 1, $kindUint8, "uint8", true, "", false, null); -var $Uint16 = $newType( 2, $kindUint16, "uint16", true, "", false, null); -var $Uint32 = $newType( 4, $kindUint32, "uint32", true, "", false, null); -var $Uint64 = $newType( 8, $kindUint64, "uint64", true, "", false, null); -var $Uintptr = $newType( 4, $kindUintptr, "uintptr", true, "", false, null); -var $Float32 = $newType( 4, $kindFloat32, "float32", true, "", false, null); -var $Float64 = $newType( 8, $kindFloat64, "float64", true, "", false, null); -var $Complex64 = $newType( 8, $kindComplex64, "complex64", true, "", false, null); -var $Complex128 = $newType(16, $kindComplex128, "complex128", true, "", false, null); -var $String = $newType( 8, $kindString, "string", true, "", false, null); -var $UnsafePointer = $newType( 4, $kindUnsafePointer, "unsafe.Pointer", true, "", false, null); - -var $nativeArray = function(elemKind) { - switch (elemKind) { - case $kindInt: - return Int32Array; - case $kindInt8: - return Int8Array; - case $kindInt16: - return Int16Array; - case $kindInt32: - return Int32Array; - case $kindUint: - return Uint32Array; - case $kindUint8: - return Uint8Array; - case $kindUint16: - return Uint16Array; - case $kindUint32: - return Uint32Array; - case $kindUintptr: - return Uint32Array; - case $kindFloat32: - return Float32Array; - case $kindFloat64: - return Float64Array; - default: - return Array; - } -}; -var $toNativeArray = function(elemKind, array) { - var nativeArray = $nativeArray(elemKind); - if (nativeArray === Array) { - return array; - } - return new nativeArray(array); -}; -var $arrayTypes = {}; -var $arrayType = function(elem, len) { - var typeKey = elem.id + "$" + len; - var typ = $arrayTypes[typeKey]; - if (typ === undefined) { - typ = $newType(12, $kindArray, "[" + len + "]" + elem.string, false, "", false, null); - $arrayTypes[typeKey] = typ; - typ.init(elem, len); - } - return typ; -}; - -var $chanType = function(elem, sendOnly, recvOnly) { - var string = (recvOnly ? "<-" : "") + "chan" + (sendOnly ? "<- " : " ") + elem.string; - var field = sendOnly ? "SendChan" : (recvOnly ? "RecvChan" : "Chan"); - var typ = elem[field]; - if (typ === undefined) { - typ = $newType(4, $kindChan, string, false, "", false, null); - elem[field] = typ; - typ.init(elem, sendOnly, recvOnly); - } - return typ; -}; -var $Chan = function(elem, capacity) { - if (capacity < 0 || capacity > 2147483647) { - $throwRuntimeError("makechan: size out of range"); - } - this.$elem = elem; - this.$capacity = capacity; - this.$buffer = []; - this.$sendQueue = []; - this.$recvQueue = []; - this.$closed = false; -}; -var $chanNil = new $Chan(null, 0); -$chanNil.$sendQueue = $chanNil.$recvQueue = { length: 0, push: function() {}, shift: function() { return undefined; }, indexOf: function() { return -1; } }; - -var $funcTypes = {}; -var $funcType = function(params, results, variadic) { - var typeKey = $mapArray(params, function(p) { return p.id; }).join(",") + "$" + $mapArray(results, function(r) { return r.id; }).join(",") + "$" + variadic; - var typ = $funcTypes[typeKey]; - if (typ === undefined) { - var paramTypes = $mapArray(params, function(p) { return p.string; }); - if (variadic) { - paramTypes[paramTypes.length - 1] = "..." + paramTypes[paramTypes.length - 1].substr(2); - } - var string = "func(" + paramTypes.join(", ") + ")"; - if (results.length === 1) { - string += " " + results[0].string; - } else if (results.length > 1) { - string += " (" + $mapArray(results, function(r) { return r.string; }).join(", ") + ")"; - } - typ = $newType(4, $kindFunc, string, false, "", false, null); - $funcTypes[typeKey] = typ; - typ.init(params, results, variadic); - } - return typ; -}; - -var $interfaceTypes = {}; -var $interfaceType = function(methods) { - var typeKey = $mapArray(methods, function(m) { return m.pkg + "," + m.name + "," + m.typ.id; }).join("$"); - var typ = $interfaceTypes[typeKey]; - if (typ === undefined) { - var string = "interface {}"; - if (methods.length !== 0) { - string = "interface { " + $mapArray(methods, function(m) { - return (m.pkg !== "" ? m.pkg + "." : "") + m.name + m.typ.string.substr(4); - }).join("; ") + " }"; - } - typ = $newType(8, $kindInterface, string, false, "", false, null); - $interfaceTypes[typeKey] = typ; - typ.init(methods); - } - return typ; -}; -var $emptyInterface = $interfaceType([]); -var $ifaceNil = {}; -var $error = $newType(8, $kindInterface, "error", true, "", false, null); -$error.init([{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]); - -var $mapTypes = {}; -var $mapType = function(key, elem) { - var typeKey = key.id + "$" + elem.id; - var typ = $mapTypes[typeKey]; - if (typ === undefined) { - typ = $newType(4, $kindMap, "map[" + key.string + "]" + elem.string, false, "", false, null); - $mapTypes[typeKey] = typ; - typ.init(key, elem); - } - return typ; -}; -var $makeMap = function(keyForFunc, entries) { - var m = {}; - for (var i = 0; i < entries.length; i++) { - var e = entries[i]; - m[keyForFunc(e.k)] = e; - } - return m; -}; - -var $ptrType = function(elem) { - var typ = elem.ptr; - if (typ === undefined) { - typ = $newType(4, $kindPtr, "*" + elem.string, false, "", elem.exported, null); - elem.ptr = typ; - typ.init(elem); - } - return typ; -}; - -var $newDataPointer = function(data, constructor) { - if (constructor.elem.kind === $kindStruct) { - return data; - } - return new constructor(function() { return data; }, function(v) { data = v; }); -}; - -var $indexPtr = function(array, index, constructor) { - array.$ptr = array.$ptr || {}; - return array.$ptr[index] || (array.$ptr[index] = new constructor(function() { return array[index]; }, function(v) { array[index] = v; })); -}; - -var $sliceType = function(elem) { - var typ = elem.slice; - if (typ === undefined) { - typ = $newType(12, $kindSlice, "[]" + elem.string, false, "", false, null); - elem.slice = typ; - typ.init(elem); - } - return typ; -}; -var $makeSlice = function(typ, length, capacity) { - capacity = capacity || length; - if (length < 0 || length > 2147483647) { - $throwRuntimeError("makeslice: len out of range"); - } - if (capacity < 0 || capacity < length || capacity > 2147483647) { - $throwRuntimeError("makeslice: cap out of range"); - } - var array = new typ.nativeArray(capacity); - if (typ.nativeArray === Array) { - for (var i = 0; i < capacity; i++) { - array[i] = typ.elem.zero(); - } - } - var slice = new typ(array); - slice.$length = length; - return slice; -}; - -var $structTypes = {}; -var $structType = function(pkgPath, fields) { - var typeKey = $mapArray(fields, function(f) { return f.name + "," + f.typ.id + "," + f.tag; }).join("$"); - var typ = $structTypes[typeKey]; - if (typ === undefined) { - var string = "struct { " + $mapArray(fields, function(f) { - return f.name + " " + f.typ.string + (f.tag !== "" ? (" \"" + f.tag.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\"") : ""); - }).join("; ") + " }"; - if (fields.length === 0) { - string = "struct {}"; - } - typ = $newType(0, $kindStruct, string, false, "", false, function() { - this.$val = this; - for (var i = 0; i < fields.length; i++) { - var f = fields[i]; - var arg = arguments[i]; - this[f.prop] = arg !== undefined ? arg : f.typ.zero(); - } - }); - $structTypes[typeKey] = typ; - typ.init(pkgPath, fields); - } - return typ; -}; - -var $assertType = function(value, type, returnTuple) { - var isInterface = (type.kind === $kindInterface), ok, missingMethod = ""; - if (value === $ifaceNil) { - ok = false; - } else if (!isInterface) { - ok = value.constructor === type; - } else { - var valueTypeString = value.constructor.string; - ok = type.implementedBy[valueTypeString]; - if (ok === undefined) { - ok = true; - var valueMethodSet = $methodSet(value.constructor); - var interfaceMethods = type.methods; - for (var i = 0; i < interfaceMethods.length; i++) { - var tm = interfaceMethods[i]; - var found = false; - for (var j = 0; j < valueMethodSet.length; j++) { - var vm = valueMethodSet[j]; - if (vm.name === tm.name && vm.pkg === tm.pkg && vm.typ === tm.typ) { - found = true; - break; - } - } - if (!found) { - ok = false; - type.missingMethodFor[valueTypeString] = tm.name; - break; - } - } - type.implementedBy[valueTypeString] = ok; - } - if (!ok) { - missingMethod = type.missingMethodFor[valueTypeString]; - } - } - - if (!ok) { - if (returnTuple) { - return [type.zero(), false]; - } - $panic(new $packages["runtime"].TypeAssertionError.ptr( - $packages["runtime"]._type.ptr.nil, - (value === $ifaceNil ? $packages["runtime"]._type.ptr.nil : new $packages["runtime"]._type.ptr(value.constructor.string)), - new $packages["runtime"]._type.ptr(type.string), - missingMethod)); - } - - if (!isInterface) { - value = value.$val; - } - if (type === $jsObjectPtr) { - value = value.object; - } - return returnTuple ? [value, true] : value; -}; -` diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/uglifyjs_options.json b/vendor/github.com/gopherjs/gopherjs/compiler/prelude/uglifyjs_options.json deleted file mode 100644 index b603add95..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/prelude/uglifyjs_options.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "compress": { - "arrows": true, - "booleans": true, - "collapse_vars": true, - "comparisons": true, - "computed_props": true, - "conditionals": true, - "dead_code": true, - "drop_console": false, - "drop_debugger": true, - "ecma": 5, - "evaluate": true, - "expression": false, - "global_defs": {}, - "hoist_funs": false, - "hoist_props": true, - "hoist_vars": false, - "ie8": false, - "if_return": true, - "inline": true, - "join_vars": true, - "keep_classnames": false, - "keep_fargs": true, - "keep_fnames": false, - "keep_infinity": false, - "loops": true, - "negate_iife": true, - "passes": 1, - "properties": true, - "pure_funcs": null, - "pure_getters": "strict", - "reduce_funcs": true, - "reduce_vars": true, - "sequences": true, - "side_effects": true, - "switches": true, - "top_retain": null, - "toplevel": false, - "typeofs": true, - "unsafe": false, - "unsafe_Function": false, - "unsafe_arrows": false, - "unsafe_comps": false, - "unsafe_math": false, - "unsafe_methods": false, - "unsafe_proto": false, - "unsafe_regexp": false, - "unsafe_undefined": false, - "unused": true, - "warnings": false - }, - "mangle": { - "eval": false, - "ie8": false, - "keep_classnames": false, - "keep_fnames": false, - "properties": false, - "reserved": [], - "safari10": false, - "toplevel": false - }, - "output": { - "ascii_only": false, - "beautify": false, - "bracketize": false, - "comments": "/@license|@preserve|^!/", - "ecma": 5, - "ie8": false, - "indent_level": 4, - "indent_start": 0, - "inline_script": true, - "keep_quoted_props": false, - "max_line_len": false, - "preamble": null, - "preserve_line": false, - "quote_keys": false, - "quote_style": 0, - "safari10": false, - "semicolons": true, - "shebang": true, - "source_map": null, - "webkit": false, - "width": 80, - "wrap_iife": false - }, - "parse": { - "bare_returns": false, - "ecma": 8, - "expression": false, - "filename": null, - "html5_comments": true, - "shebang": true, - "strict": false, - "toplevel": null - }, - "wrap": false -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/statements.go b/vendor/github.com/gopherjs/gopherjs/compiler/statements.go deleted file mode 100644 index b83396235..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/statements.go +++ /dev/null @@ -1,786 +0,0 @@ -package compiler - -import ( - "fmt" - "go/ast" - "go/constant" - "go/token" - "go/types" - "strings" - - "github.com/gopherjs/gopherjs/compiler/analysis" - "github.com/gopherjs/gopherjs/compiler/astutil" - "github.com/gopherjs/gopherjs/compiler/filter" - "github.com/gopherjs/gopherjs/compiler/typesutil" -) - -func (c *funcContext) translateStmtList(stmts []ast.Stmt) { - for _, stmt := range stmts { - c.translateStmt(stmt, nil) - } - c.SetPos(token.NoPos) -} - -func (c *funcContext) translateStmt(stmt ast.Stmt, label *types.Label) { - c.SetPos(stmt.Pos()) - - stmt = filter.IncDecStmt(stmt, c.p.Info.Info) - stmt = filter.Assign(stmt, c.p.Info.Info, c.p.Info.Pkg) - - switch s := stmt.(type) { - case *ast.BlockStmt: - c.translateStmtList(s.List) - - case *ast.IfStmt: - var caseClauses []*ast.CaseClause - ifStmt := s - for { - if ifStmt.Init != nil { - panic("simplification error") - } - caseClauses = append(caseClauses, &ast.CaseClause{List: []ast.Expr{ifStmt.Cond}, Body: ifStmt.Body.List}) - elseStmt, ok := ifStmt.Else.(*ast.IfStmt) - if !ok { - break - } - ifStmt = elseStmt - } - var defaultClause *ast.CaseClause - if block, ok := ifStmt.Else.(*ast.BlockStmt); ok { - defaultClause = &ast.CaseClause{Body: block.List} - } - c.translateBranchingStmt(caseClauses, defaultClause, false, c.translateExpr, nil, c.Flattened[s]) - - case *ast.SwitchStmt: - if s.Init != nil || s.Tag != nil || len(s.Body.List) != 1 { - panic("simplification error") - } - clause := s.Body.List[0].(*ast.CaseClause) - if len(clause.List) != 0 { - panic("simplification error") - } - - prevFlowData := c.flowDatas[nil] - data := &flowData{ - postStmt: prevFlowData.postStmt, // for "continue" of outer loop - beginCase: prevFlowData.beginCase, // same - } - c.flowDatas[nil] = data - c.flowDatas[label] = data - defer func() { - delete(c.flowDatas, label) - c.flowDatas[nil] = prevFlowData - }() - - if c.Flattened[s] { - data.endCase = c.caseCounter - c.caseCounter++ - - c.Indent(func() { - c.translateStmtList(clause.Body) - }) - c.Printf("case %d:", data.endCase) - return - } - - if label != nil || analysis.HasBreak(clause) { - if label != nil { - c.Printf("%s:", label.Name()) - } - c.Printf("switch (0) { default:") - c.Indent(func() { - c.translateStmtList(clause.Body) - }) - c.Printf("}") - return - } - - c.translateStmtList(clause.Body) - - case *ast.TypeSwitchStmt: - if s.Init != nil { - c.translateStmt(s.Init, nil) - } - refVar := c.newVariable("_ref") - var expr ast.Expr - switch a := s.Assign.(type) { - case *ast.AssignStmt: - expr = a.Rhs[0].(*ast.TypeAssertExpr).X - case *ast.ExprStmt: - expr = a.X.(*ast.TypeAssertExpr).X - } - c.Printf("%s = %s;", refVar, c.translateExpr(expr)) - translateCond := func(cond ast.Expr) *expression { - if types.Identical(c.p.TypeOf(cond), types.Typ[types.UntypedNil]) { - return c.formatExpr("%s === $ifaceNil", refVar) - } - return c.formatExpr("$assertType(%s, %s, true)[1]", refVar, c.typeName(c.p.TypeOf(cond))) - } - var caseClauses []*ast.CaseClause - var defaultClause *ast.CaseClause - for _, cc := range s.Body.List { - clause := cc.(*ast.CaseClause) - var bodyPrefix []ast.Stmt - if implicit := c.p.Implicits[clause]; implicit != nil { - value := refVar - if typesutil.IsJsObject(implicit.Type().Underlying()) { - value += ".$val.object" - } else if _, ok := implicit.Type().Underlying().(*types.Interface); !ok { - value += ".$val" - } - bodyPrefix = []ast.Stmt{&ast.AssignStmt{ - Lhs: []ast.Expr{c.newIdent(c.objectName(implicit), implicit.Type())}, - Tok: token.DEFINE, - Rhs: []ast.Expr{c.newIdent(value, implicit.Type())}, - }} - } - c := &ast.CaseClause{ - List: clause.List, - Body: append(bodyPrefix, clause.Body...), - } - if len(c.List) == 0 { - defaultClause = c - continue - } - caseClauses = append(caseClauses, c) - } - c.translateBranchingStmt(caseClauses, defaultClause, true, translateCond, label, c.Flattened[s]) - - case *ast.ForStmt: - if s.Init != nil { - c.translateStmt(s.Init, nil) - } - cond := func() string { - if s.Cond == nil { - return "true" - } - return c.translateExpr(s.Cond).String() - } - c.translateLoopingStmt(cond, s.Body, nil, func() { - if s.Post != nil { - c.translateStmt(s.Post, nil) - } - }, label, c.Flattened[s]) - - case *ast.RangeStmt: - refVar := c.newVariable("_ref") - c.Printf("%s = %s;", refVar, c.translateExpr(s.X)) - - switch t := c.p.TypeOf(s.X).Underlying().(type) { - case *types.Basic: - iVar := c.newVariable("_i") - c.Printf("%s = 0;", iVar) - runeVar := c.newVariable("_rune") - c.translateLoopingStmt(func() string { return iVar + " < " + refVar + ".length" }, s.Body, func() { - c.Printf("%s = $decodeRune(%s, %s);", runeVar, refVar, iVar) - if !isBlank(s.Key) { - c.Printf("%s", c.translateAssign(s.Key, c.newIdent(iVar, types.Typ[types.Int]), s.Tok == token.DEFINE)) - } - if !isBlank(s.Value) { - c.Printf("%s", c.translateAssign(s.Value, c.newIdent(runeVar+"[0]", types.Typ[types.Rune]), s.Tok == token.DEFINE)) - } - }, func() { - c.Printf("%s += %s[1];", iVar, runeVar) - }, label, c.Flattened[s]) - - case *types.Map: - iVar := c.newVariable("_i") - c.Printf("%s = 0;", iVar) - keysVar := c.newVariable("_keys") - c.Printf("%s = $keys(%s);", keysVar, refVar) - c.translateLoopingStmt(func() string { return iVar + " < " + keysVar + ".length" }, s.Body, func() { - entryVar := c.newVariable("_entry") - c.Printf("%s = %s[%s[%s]];", entryVar, refVar, keysVar, iVar) - c.translateStmt(&ast.IfStmt{ - Cond: c.newIdent(entryVar+" === undefined", types.Typ[types.Bool]), - Body: &ast.BlockStmt{List: []ast.Stmt{&ast.BranchStmt{Tok: token.CONTINUE}}}, - }, nil) - if !isBlank(s.Key) { - c.Printf("%s", c.translateAssign(s.Key, c.newIdent(entryVar+".k", t.Key()), s.Tok == token.DEFINE)) - } - if !isBlank(s.Value) { - c.Printf("%s", c.translateAssign(s.Value, c.newIdent(entryVar+".v", t.Elem()), s.Tok == token.DEFINE)) - } - }, func() { - c.Printf("%s++;", iVar) - }, label, c.Flattened[s]) - - case *types.Array, *types.Pointer, *types.Slice: - var length string - var elemType types.Type - switch t2 := t.(type) { - case *types.Array: - length = fmt.Sprintf("%d", t2.Len()) - elemType = t2.Elem() - case *types.Pointer: - length = fmt.Sprintf("%d", t2.Elem().Underlying().(*types.Array).Len()) - elemType = t2.Elem().Underlying().(*types.Array).Elem() - case *types.Slice: - length = refVar + ".$length" - elemType = t2.Elem() - } - iVar := c.newVariable("_i") - c.Printf("%s = 0;", iVar) - c.translateLoopingStmt(func() string { return iVar + " < " + length }, s.Body, func() { - if !isBlank(s.Key) { - c.Printf("%s", c.translateAssign(s.Key, c.newIdent(iVar, types.Typ[types.Int]), s.Tok == token.DEFINE)) - } - if !isBlank(s.Value) { - c.Printf("%s", c.translateAssign(s.Value, c.setType(&ast.IndexExpr{ - X: c.newIdent(refVar, t), - Index: c.newIdent(iVar, types.Typ[types.Int]), - }, elemType), s.Tok == token.DEFINE)) - } - }, func() { - c.Printf("%s++;", iVar) - }, label, c.Flattened[s]) - - case *types.Chan: - okVar := c.newIdent(c.newVariable("_ok"), types.Typ[types.Bool]) - key := s.Key - tok := s.Tok - if key == nil { - key = ast.NewIdent("_") - tok = token.ASSIGN - } - forStmt := &ast.ForStmt{ - Body: &ast.BlockStmt{ - List: []ast.Stmt{ - &ast.AssignStmt{ - Lhs: []ast.Expr{ - key, - okVar, - }, - Rhs: []ast.Expr{ - c.setType(&ast.UnaryExpr{X: c.newIdent(refVar, t), Op: token.ARROW}, types.NewTuple(types.NewVar(0, nil, "", t.Elem()), types.NewVar(0, nil, "", types.Typ[types.Bool]))), - }, - Tok: tok, - }, - &ast.IfStmt{ - Cond: &ast.UnaryExpr{X: okVar, Op: token.NOT}, - Body: &ast.BlockStmt{List: []ast.Stmt{&ast.BranchStmt{Tok: token.BREAK}}}, - }, - s.Body, - }, - }, - } - c.Flattened[forStmt] = true - c.translateStmt(forStmt, label) - - default: - panic("") - } - - case *ast.BranchStmt: - normalLabel := "" - blockingLabel := "" - data := c.flowDatas[nil] - if s.Label != nil { - normalLabel = " " + s.Label.Name - blockingLabel = " s" // use explicit label "s", because surrounding loop may not be flattened - data = c.flowDatas[c.p.Uses[s.Label].(*types.Label)] - } - switch s.Tok { - case token.BREAK: - c.PrintCond(data.endCase == 0, fmt.Sprintf("break%s;", normalLabel), fmt.Sprintf("$s = %d; continue%s;", data.endCase, blockingLabel)) - case token.CONTINUE: - data.postStmt() - c.PrintCond(data.beginCase == 0, fmt.Sprintf("continue%s;", normalLabel), fmt.Sprintf("$s = %d; continue%s;", data.beginCase, blockingLabel)) - case token.GOTO: - c.PrintCond(false, "goto "+s.Label.Name, fmt.Sprintf("$s = %d; continue;", c.labelCase(c.p.Uses[s.Label].(*types.Label)))) - case token.FALLTHROUGH: - // handled in CaseClause - default: - panic("Unhandled branch statment: " + s.Tok.String()) - } - - case *ast.ReturnStmt: - results := s.Results - if c.resultNames != nil { - if len(s.Results) != 0 { - c.translateStmt(&ast.AssignStmt{ - Lhs: c.resultNames, - Tok: token.ASSIGN, - Rhs: s.Results, - }, nil) - } - results = c.resultNames - } - rVal := c.translateResults(results) - if len(c.Flattened) != 0 { - c.Printf("$s = -1; return%s;", rVal) - return - } - c.Printf("return%s;", rVal) - - case *ast.DeferStmt: - isBuiltin := false - isJs := false - switch fun := s.Call.Fun.(type) { - case *ast.Ident: - var builtin *types.Builtin - builtin, isBuiltin = c.p.Uses[fun].(*types.Builtin) - if isBuiltin && builtin.Name() == "recover" { - c.Printf("$deferred.push([$recover, []]);") - return - } - case *ast.SelectorExpr: - isJs = typesutil.IsJsPackage(c.p.Uses[fun.Sel].Pkg()) - } - sig := c.p.TypeOf(s.Call.Fun).Underlying().(*types.Signature) - args := c.translateArgs(sig, s.Call.Args, s.Call.Ellipsis.IsValid()) - if isBuiltin || isJs { - vars := make([]string, len(s.Call.Args)) - callArgs := make([]ast.Expr, len(s.Call.Args)) - for i, arg := range s.Call.Args { - v := c.newVariable("_arg") - vars[i] = v - callArgs[i] = c.newIdent(v, c.p.TypeOf(arg)) - } - call := c.translateExpr(&ast.CallExpr{ - Fun: s.Call.Fun, - Args: callArgs, - Ellipsis: s.Call.Ellipsis, - }) - c.Printf("$deferred.push([function(%s) { %s; }, [%s]]);", strings.Join(vars, ", "), call, strings.Join(args, ", ")) - return - } - c.Printf("$deferred.push([%s, [%s]]);", c.translateExpr(s.Call.Fun), strings.Join(args, ", ")) - - case *ast.AssignStmt: - if s.Tok != token.ASSIGN && s.Tok != token.DEFINE { - panic(s.Tok) - } - - switch { - case len(s.Lhs) == 1 && len(s.Rhs) == 1: - lhs := astutil.RemoveParens(s.Lhs[0]) - if isBlank(lhs) { - c.Printf("$unused(%s);", c.translateExpr(s.Rhs[0])) - return - } - c.Printf("%s", c.translateAssign(lhs, s.Rhs[0], s.Tok == token.DEFINE)) - - case len(s.Lhs) > 1 && len(s.Rhs) == 1: - tupleVar := c.newVariable("_tuple") - c.Printf("%s = %s;", tupleVar, c.translateExpr(s.Rhs[0])) - tuple := c.p.TypeOf(s.Rhs[0]).(*types.Tuple) - for i, lhs := range s.Lhs { - lhs = astutil.RemoveParens(lhs) - if !isBlank(lhs) { - c.Printf("%s", c.translateAssign(lhs, c.newIdent(fmt.Sprintf("%s[%d]", tupleVar, i), tuple.At(i).Type()), s.Tok == token.DEFINE)) - } - } - case len(s.Lhs) == len(s.Rhs): - tmpVars := make([]string, len(s.Rhs)) - for i, rhs := range s.Rhs { - tmpVars[i] = c.newVariable("_tmp") - if isBlank(astutil.RemoveParens(s.Lhs[i])) { - c.Printf("$unused(%s);", c.translateExpr(rhs)) - continue - } - c.Printf("%s", c.translateAssign(c.newIdent(tmpVars[i], c.p.TypeOf(s.Lhs[i])), rhs, true)) - } - for i, lhs := range s.Lhs { - lhs = astutil.RemoveParens(lhs) - if !isBlank(lhs) { - c.Printf("%s", c.translateAssign(lhs, c.newIdent(tmpVars[i], c.p.TypeOf(lhs)), s.Tok == token.DEFINE)) - } - } - - default: - panic("Invalid arity of AssignStmt.") - - } - - case *ast.DeclStmt: - decl := s.Decl.(*ast.GenDecl) - switch decl.Tok { - case token.VAR: - for _, spec := range s.Decl.(*ast.GenDecl).Specs { - valueSpec := spec.(*ast.ValueSpec) - lhs := make([]ast.Expr, len(valueSpec.Names)) - for i, name := range valueSpec.Names { - lhs[i] = name - } - rhs := valueSpec.Values - if len(rhs) == 0 { - rhs = make([]ast.Expr, len(lhs)) - for i, e := range lhs { - rhs[i] = c.zeroValue(c.p.TypeOf(e)) - } - } - c.translateStmt(&ast.AssignStmt{ - Lhs: lhs, - Tok: token.DEFINE, - Rhs: rhs, - }, nil) - } - case token.TYPE: - for _, spec := range decl.Specs { - o := c.p.Defs[spec.(*ast.TypeSpec).Name].(*types.TypeName) - c.p.typeNames = append(c.p.typeNames, o) - c.p.objectNames[o] = c.newVariableWithLevel(o.Name(), true) - c.p.dependencies[o] = true - } - case token.CONST: - // skip, constants are inlined - } - - case *ast.ExprStmt: - expr := c.translateExpr(s.X) - if expr != nil && expr.String() != "" { - c.Printf("%s;", expr) - } - - case *ast.LabeledStmt: - label := c.p.Defs[s.Label].(*types.Label) - if c.GotoLabel[label] { - c.PrintCond(false, s.Label.Name+":", fmt.Sprintf("case %d:", c.labelCase(label))) - } - c.translateStmt(s.Stmt, label) - - case *ast.GoStmt: - c.Printf("$go(%s, [%s]);", c.translateExpr(s.Call.Fun), strings.Join(c.translateArgs(c.p.TypeOf(s.Call.Fun).Underlying().(*types.Signature), s.Call.Args, s.Call.Ellipsis.IsValid()), ", ")) - - case *ast.SendStmt: - chanType := c.p.TypeOf(s.Chan).Underlying().(*types.Chan) - call := &ast.CallExpr{ - Fun: c.newIdent("$send", types.NewSignature(nil, types.NewTuple(types.NewVar(0, nil, "", chanType), types.NewVar(0, nil, "", chanType.Elem())), nil, false)), - Args: []ast.Expr{s.Chan, c.newIdent(c.translateImplicitConversionWithCloning(s.Value, chanType.Elem()).String(), chanType.Elem())}, - } - c.Blocking[call] = true - c.translateStmt(&ast.ExprStmt{X: call}, label) - - case *ast.SelectStmt: - selectionVar := c.newVariable("_selection") - var channels []string - var caseClauses []*ast.CaseClause - flattened := false - hasDefault := false - for i, cc := range s.Body.List { - clause := cc.(*ast.CommClause) - switch comm := clause.Comm.(type) { - case nil: - channels = append(channels, "[]") - hasDefault = true - case *ast.ExprStmt: - channels = append(channels, c.formatExpr("[%e]", astutil.RemoveParens(comm.X).(*ast.UnaryExpr).X).String()) - case *ast.AssignStmt: - channels = append(channels, c.formatExpr("[%e]", astutil.RemoveParens(comm.Rhs[0]).(*ast.UnaryExpr).X).String()) - case *ast.SendStmt: - chanType := c.p.TypeOf(comm.Chan).Underlying().(*types.Chan) - channels = append(channels, c.formatExpr("[%e, %s]", comm.Chan, c.translateImplicitConversionWithCloning(comm.Value, chanType.Elem())).String()) - default: - panic(fmt.Sprintf("unhandled: %T", comm)) - } - - indexLit := &ast.BasicLit{Kind: token.INT} - c.p.Types[indexLit] = types.TypeAndValue{Type: types.Typ[types.Int], Value: constant.MakeInt64(int64(i))} - - var bodyPrefix []ast.Stmt - if assign, ok := clause.Comm.(*ast.AssignStmt); ok { - switch rhsType := c.p.TypeOf(assign.Rhs[0]).(type) { - case *types.Tuple: - bodyPrefix = []ast.Stmt{&ast.AssignStmt{Lhs: assign.Lhs, Rhs: []ast.Expr{c.newIdent(selectionVar+"[1]", rhsType)}, Tok: assign.Tok}} - default: - bodyPrefix = []ast.Stmt{&ast.AssignStmt{Lhs: assign.Lhs, Rhs: []ast.Expr{c.newIdent(selectionVar+"[1][0]", rhsType)}, Tok: assign.Tok}} - } - } - - caseClauses = append(caseClauses, &ast.CaseClause{ - List: []ast.Expr{indexLit}, - Body: append(bodyPrefix, clause.Body...), - }) - - flattened = flattened || c.Flattened[clause] - } - - selectCall := c.setType(&ast.CallExpr{ - Fun: c.newIdent("$select", types.NewSignature(nil, types.NewTuple(types.NewVar(0, nil, "", types.NewInterface(nil, nil))), types.NewTuple(types.NewVar(0, nil, "", types.Typ[types.Int])), false)), - Args: []ast.Expr{c.newIdent(fmt.Sprintf("[%s]", strings.Join(channels, ", ")), types.NewInterface(nil, nil))}, - }, types.Typ[types.Int]) - c.Blocking[selectCall] = !hasDefault - c.Printf("%s = %s;", selectionVar, c.translateExpr(selectCall)) - - if len(caseClauses) != 0 { - translateCond := func(cond ast.Expr) *expression { - return c.formatExpr("%s[0] === %e", selectionVar, cond) - } - c.translateBranchingStmt(caseClauses, nil, true, translateCond, label, flattened) - } - - case *ast.EmptyStmt: - // skip - - default: - panic(fmt.Sprintf("Unhandled statement: %T\n", s)) - - } -} - -func (c *funcContext) translateBranchingStmt(caseClauses []*ast.CaseClause, defaultClause *ast.CaseClause, canBreak bool, translateCond func(ast.Expr) *expression, label *types.Label, flatten bool) { - var caseOffset, defaultCase, endCase int - if flatten { - caseOffset = c.caseCounter - defaultCase = caseOffset + len(caseClauses) - endCase = defaultCase - if defaultClause != nil { - endCase++ - } - c.caseCounter = endCase + 1 - } - - hasBreak := false - if canBreak { - prevFlowData := c.flowDatas[nil] - data := &flowData{ - postStmt: prevFlowData.postStmt, // for "continue" of outer loop - beginCase: prevFlowData.beginCase, // same - endCase: endCase, - } - c.flowDatas[nil] = data - c.flowDatas[label] = data - defer func() { - delete(c.flowDatas, label) - c.flowDatas[nil] = prevFlowData - }() - - for _, child := range caseClauses { - if analysis.HasBreak(child) { - hasBreak = true - break - } - } - if defaultClause != nil && analysis.HasBreak(defaultClause) { - hasBreak = true - } - } - - if label != nil && !flatten { - c.Printf("%s:", label.Name()) - } - - condStrs := make([]string, len(caseClauses)) - for i, clause := range caseClauses { - conds := make([]string, len(clause.List)) - for j, cond := range clause.List { - conds[j] = translateCond(cond).String() - } - condStrs[i] = strings.Join(conds, " || ") - if flatten { - c.Printf("/* */ if (%s) { $s = %d; continue; }", condStrs[i], caseOffset+i) - } - } - - if flatten { - c.Printf("/* */ $s = %d; continue;", defaultCase) - } - - prefix := "" - suffix := "" - if label != nil || hasBreak { - prefix = "switch (0) { default: " - suffix = " }" - } - - for i, clause := range caseClauses { - c.SetPos(clause.Pos()) - c.PrintCond(!flatten, fmt.Sprintf("%sif (%s) {", prefix, condStrs[i]), fmt.Sprintf("case %d:", caseOffset+i)) - c.Indent(func() { - c.translateStmtList(clause.Body) - if flatten && (i < len(caseClauses)-1 || defaultClause != nil) && !endsWithReturn(clause.Body) { - c.Printf("$s = %d; continue;", endCase) - } - }) - prefix = "} else " - } - - if defaultClause != nil { - c.PrintCond(!flatten, prefix+"{", fmt.Sprintf("case %d:", caseOffset+len(caseClauses))) - c.Indent(func() { - c.translateStmtList(defaultClause.Body) - }) - } - - c.PrintCond(!flatten, "}"+suffix, fmt.Sprintf("case %d:", endCase)) -} - -func (c *funcContext) translateLoopingStmt(cond func() string, body *ast.BlockStmt, bodyPrefix, post func(), label *types.Label, flatten bool) { - prevFlowData := c.flowDatas[nil] - data := &flowData{ - postStmt: post, - } - if flatten { - data.beginCase = c.caseCounter - data.endCase = c.caseCounter + 1 - c.caseCounter += 2 - } - c.flowDatas[nil] = data - c.flowDatas[label] = data - defer func() { - delete(c.flowDatas, label) - c.flowDatas[nil] = prevFlowData - }() - - if !flatten && label != nil { - c.Printf("%s:", label.Name()) - } - c.PrintCond(!flatten, "while (true) {", fmt.Sprintf("case %d:", data.beginCase)) - c.Indent(func() { - condStr := cond() - if condStr != "true" { - c.PrintCond(!flatten, fmt.Sprintf("if (!(%s)) { break; }", condStr), fmt.Sprintf("if(!(%s)) { $s = %d; continue; }", condStr, data.endCase)) - } - - prevEV := c.p.escapingVars - c.handleEscapingVars(body) - - if bodyPrefix != nil { - bodyPrefix() - } - c.translateStmtList(body.List) - isTerminated := false - if len(body.List) != 0 { - switch body.List[len(body.List)-1].(type) { - case *ast.ReturnStmt, *ast.BranchStmt: - isTerminated = true - } - } - if !isTerminated { - post() - } - - c.p.escapingVars = prevEV - }) - c.PrintCond(!flatten, "}", fmt.Sprintf("$s = %d; continue; case %d:", data.beginCase, data.endCase)) -} - -func (c *funcContext) translateAssign(lhs, rhs ast.Expr, define bool) string { - lhs = astutil.RemoveParens(lhs) - if isBlank(lhs) { - panic("translateAssign with blank lhs") - } - - if l, ok := lhs.(*ast.IndexExpr); ok { - if t, ok := c.p.TypeOf(l.X).Underlying().(*types.Map); ok { - if typesutil.IsJsObject(c.p.TypeOf(l.Index)) { - c.p.errList = append(c.p.errList, types.Error{Fset: c.p.fileSet, Pos: l.Index.Pos(), Msg: "cannot use js.Object as map key"}) - } - keyVar := c.newVariable("_key") - return fmt.Sprintf(`%s = %s; (%s || $throwRuntimeError("assignment to entry in nil map"))[%s.keyFor(%s)] = { k: %s, v: %s };`, keyVar, c.translateImplicitConversionWithCloning(l.Index, t.Key()), c.translateExpr(l.X), c.typeName(t.Key()), keyVar, keyVar, c.translateImplicitConversionWithCloning(rhs, t.Elem())) - } - } - - lhsType := c.p.TypeOf(lhs) - rhsExpr := c.translateImplicitConversion(rhs, lhsType) - if _, ok := rhs.(*ast.CompositeLit); ok && define { - return fmt.Sprintf("%s = %s;", c.translateExpr(lhs), rhsExpr) // skip $copy - } - - isReflectValue := false - if named, ok := lhsType.(*types.Named); ok && named.Obj().Pkg() != nil && named.Obj().Pkg().Path() == "reflect" && named.Obj().Name() == "Value" { - isReflectValue = true - } - if !isReflectValue { // this is a performance hack, but it is safe since reflect.Value has no exported fields and the reflect package does not violate this assumption - switch lhsType.Underlying().(type) { - case *types.Array, *types.Struct: - if define { - return fmt.Sprintf("%s = $clone(%s, %s);", c.translateExpr(lhs), rhsExpr, c.typeName(lhsType)) - } - return fmt.Sprintf("%s.copy(%s, %s);", c.typeName(lhsType), c.translateExpr(lhs), rhsExpr) - } - } - - switch l := lhs.(type) { - case *ast.Ident: - return fmt.Sprintf("%s = %s;", c.objectName(c.p.ObjectOf(l)), rhsExpr) - case *ast.SelectorExpr: - sel, ok := c.p.SelectionOf(l) - if !ok { - // qualified identifier - return fmt.Sprintf("%s = %s;", c.objectName(c.p.Uses[l.Sel]), rhsExpr) - } - fields, jsTag := c.translateSelection(sel, l.Pos()) - if jsTag != "" { - return fmt.Sprintf("%s.%s%s = %s;", c.translateExpr(l.X), strings.Join(fields, "."), formatJSStructTagVal(jsTag), c.externalize(rhsExpr.String(), sel.Type())) - } - return fmt.Sprintf("%s.%s = %s;", c.translateExpr(l.X), strings.Join(fields, "."), rhsExpr) - case *ast.StarExpr: - return fmt.Sprintf("%s.$set(%s);", c.translateExpr(l.X), rhsExpr) - case *ast.IndexExpr: - switch t := c.p.TypeOf(l.X).Underlying().(type) { - case *types.Array, *types.Pointer: - pattern := rangeCheck("%1e[%2f] = %3s", c.p.Types[l.Index].Value != nil, true) - if _, ok := t.(*types.Pointer); ok { // check pointer for nil (attribute getter causes a panic) - pattern = `%1e.nilCheck, ` + pattern - } - return c.formatExpr(pattern, l.X, l.Index, rhsExpr).String() + ";" - case *types.Slice: - return c.formatExpr(rangeCheck("%1e.$array[%1e.$offset + %2f] = %3s", c.p.Types[l.Index].Value != nil, false), l.X, l.Index, rhsExpr).String() + ";" - default: - panic(fmt.Sprintf("Unhandled lhs type: %T\n", t)) - } - default: - panic(fmt.Sprintf("Unhandled lhs type: %T\n", l)) - } -} - -func (c *funcContext) translateResults(results []ast.Expr) string { - tuple := c.sig.Results() - switch tuple.Len() { - case 0: - return "" - case 1: - result := c.zeroValue(tuple.At(0).Type()) - if results != nil { - result = results[0] - } - v := c.translateImplicitConversion(result, tuple.At(0).Type()) - c.delayedOutput = nil - return " " + v.String() - default: - if len(results) == 1 { - resultTuple := c.p.TypeOf(results[0]).(*types.Tuple) - - if resultTuple.Len() != tuple.Len() { - panic("invalid tuple return assignment") - } - - resultExpr := c.translateExpr(results[0]).String() - - if types.Identical(resultTuple, tuple) { - return " " + resultExpr - } - - tmpVar := c.newVariable("_returncast") - c.Printf("%s = %s;", tmpVar, resultExpr) - - // Not all the return types matched, map everything out for implicit casting - results = make([]ast.Expr, resultTuple.Len()) - for i := range results { - results[i] = c.newIdent(fmt.Sprintf("%s[%d]", tmpVar, i), resultTuple.At(i).Type()) - } - } - values := make([]string, tuple.Len()) - for i := range values { - result := c.zeroValue(tuple.At(i).Type()) - if results != nil { - result = results[i] - } - values[i] = c.translateImplicitConversion(result, tuple.At(i).Type()).String() - } - c.delayedOutput = nil - return " [" + strings.Join(values, ", ") + "]" - } -} - -func (c *funcContext) labelCase(label *types.Label) int { - labelCase, ok := c.labelCases[label] - if !ok { - labelCase = c.caseCounter - c.caseCounter++ - c.labelCases[label] = labelCase - } - return labelCase -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/typesutil/typesutil.go b/vendor/github.com/gopherjs/gopherjs/compiler/typesutil/typesutil.go deleted file mode 100644 index 600925b81..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/typesutil/typesutil.go +++ /dev/null @@ -1,16 +0,0 @@ -package typesutil - -import "go/types" - -func IsJsPackage(pkg *types.Package) bool { - return pkg != nil && pkg.Path() == "github.com/gopherjs/gopherjs/js" -} - -func IsJsObject(t types.Type) bool { - ptr, isPtr := t.(*types.Pointer) - if !isPtr { - return false - } - named, isNamed := ptr.Elem().(*types.Named) - return isNamed && IsJsPackage(named.Obj().Pkg()) && named.Obj().Name() == "Object" -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/utils.go b/vendor/github.com/gopherjs/gopherjs/compiler/utils.go deleted file mode 100644 index d5452e0a6..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/utils.go +++ /dev/null @@ -1,673 +0,0 @@ -package compiler - -import ( - "bytes" - "encoding/binary" - "fmt" - "go/ast" - "go/constant" - "go/token" - "go/types" - "net/url" - "sort" - "strconv" - "strings" - "text/template" - "unicode" - - "github.com/gopherjs/gopherjs/compiler/analysis" - "github.com/gopherjs/gopherjs/compiler/typesutil" -) - -func (c *funcContext) Write(b []byte) (int, error) { - c.writePos() - c.output = append(c.output, b...) - return len(b), nil -} - -func (c *funcContext) Printf(format string, values ...interface{}) { - c.Write([]byte(strings.Repeat("\t", c.p.indentation))) - fmt.Fprintf(c, format, values...) - c.Write([]byte{'\n'}) - c.Write(c.delayedOutput) - c.delayedOutput = nil -} - -func (c *funcContext) PrintCond(cond bool, onTrue, onFalse string) { - if !cond { - c.Printf("/* %s */ %s", strings.Replace(onTrue, "*/", "/", -1), onFalse) - return - } - c.Printf("%s", onTrue) -} - -func (c *funcContext) SetPos(pos token.Pos) { - c.posAvailable = true - c.pos = pos -} - -func (c *funcContext) writePos() { - if c.posAvailable { - c.posAvailable = false - c.Write([]byte{'\b'}) - binary.Write(c, binary.BigEndian, uint32(c.pos)) - } -} - -func (c *funcContext) Indent(f func()) { - c.p.indentation++ - f() - c.p.indentation-- -} - -func (c *funcContext) CatchOutput(indent int, f func()) []byte { - origoutput := c.output - c.output = nil - c.p.indentation += indent - f() - c.writePos() - catched := c.output - c.output = origoutput - c.p.indentation -= indent - return catched -} - -func (c *funcContext) Delayed(f func()) { - c.delayedOutput = c.CatchOutput(0, f) -} - -func (c *funcContext) translateArgs(sig *types.Signature, argExprs []ast.Expr, ellipsis bool) []string { - if len(argExprs) == 1 { - if tuple, isTuple := c.p.TypeOf(argExprs[0]).(*types.Tuple); isTuple { - tupleVar := c.newVariable("_tuple") - c.Printf("%s = %s;", tupleVar, c.translateExpr(argExprs[0])) - argExprs = make([]ast.Expr, tuple.Len()) - for i := range argExprs { - argExprs[i] = c.newIdent(c.formatExpr("%s[%d]", tupleVar, i).String(), tuple.At(i).Type()) - } - } - } - - paramsLen := sig.Params().Len() - - var varargType *types.Slice - if sig.Variadic() && !ellipsis { - varargType = sig.Params().At(paramsLen - 1).Type().(*types.Slice) - } - - preserveOrder := false - for i := 1; i < len(argExprs); i++ { - preserveOrder = preserveOrder || c.Blocking[argExprs[i]] - } - - args := make([]string, len(argExprs)) - for i, argExpr := range argExprs { - var argType types.Type - switch { - case varargType != nil && i >= paramsLen-1: - argType = varargType.Elem() - default: - argType = sig.Params().At(i).Type() - } - - arg := c.translateImplicitConversionWithCloning(argExpr, argType).String() - - if preserveOrder && c.p.Types[argExpr].Value == nil { - argVar := c.newVariable("_arg") - c.Printf("%s = %s;", argVar, arg) - arg = argVar - } - - args[i] = arg - } - - if varargType != nil { - return append(args[:paramsLen-1], fmt.Sprintf("new %s([%s])", c.typeName(varargType), strings.Join(args[paramsLen-1:], ", "))) - } - return args -} - -func (c *funcContext) translateSelection(sel selection, pos token.Pos) ([]string, string) { - var fields []string - t := sel.Recv() - for _, index := range sel.Index() { - if ptr, isPtr := t.(*types.Pointer); isPtr { - t = ptr.Elem() - } - s := t.Underlying().(*types.Struct) - if jsTag := getJsTag(s.Tag(index)); jsTag != "" { - jsFieldName := s.Field(index).Name() - for { - fields = append(fields, fieldName(s, 0)) - ft := s.Field(0).Type() - if typesutil.IsJsObject(ft) { - return fields, jsTag - } - ft = ft.Underlying() - if ptr, ok := ft.(*types.Pointer); ok { - ft = ptr.Elem().Underlying() - } - var ok bool - s, ok = ft.(*types.Struct) - if !ok || s.NumFields() == 0 { - c.p.errList = append(c.p.errList, types.Error{Fset: c.p.fileSet, Pos: pos, Msg: fmt.Sprintf("could not find field with type *js.Object for 'js' tag of field '%s'", jsFieldName), Soft: true}) - return nil, "" - } - } - } - fields = append(fields, fieldName(s, index)) - t = s.Field(index).Type() - } - return fields, "" -} - -var nilObj = types.Universe.Lookup("nil") - -func (c *funcContext) zeroValue(ty types.Type) ast.Expr { - switch t := ty.Underlying().(type) { - case *types.Basic: - switch { - case isBoolean(t): - return c.newConst(ty, constant.MakeBool(false)) - case isNumeric(t): - return c.newConst(ty, constant.MakeInt64(0)) - case isString(t): - return c.newConst(ty, constant.MakeString("")) - case t.Kind() == types.UnsafePointer: - // fall through to "nil" - case t.Kind() == types.UntypedNil: - panic("Zero value for untyped nil.") - default: - panic(fmt.Sprintf("Unhandled basic type: %v\n", t)) - } - case *types.Array, *types.Struct: - return c.setType(&ast.CompositeLit{}, ty) - case *types.Chan, *types.Interface, *types.Map, *types.Signature, *types.Slice, *types.Pointer: - // fall through to "nil" - default: - panic(fmt.Sprintf("Unhandled type: %T\n", t)) - } - id := c.newIdent("nil", ty) - c.p.Uses[id] = nilObj - return id -} - -func (c *funcContext) newConst(t types.Type, value constant.Value) ast.Expr { - id := &ast.Ident{} - c.p.Types[id] = types.TypeAndValue{Type: t, Value: value} - return id -} - -func (c *funcContext) newVariable(name string) string { - return c.newVariableWithLevel(name, false) -} - -func (c *funcContext) newVariableWithLevel(name string, pkgLevel bool) string { - if name == "" { - panic("newVariable: empty name") - } - name = encodeIdent(name) - if c.p.minify { - i := 0 - for { - offset := int('a') - if pkgLevel { - offset = int('A') - } - j := i - name = "" - for { - name = string(offset+(j%26)) + name - j = j/26 - 1 - if j == -1 { - break - } - } - if c.allVars[name] == 0 { - break - } - i++ - } - } - n := c.allVars[name] - c.allVars[name] = n + 1 - varName := name - if n > 0 { - varName = fmt.Sprintf("%s$%d", name, n) - } - - if pkgLevel { - for c2 := c.parent; c2 != nil; c2 = c2.parent { - c2.allVars[name] = n + 1 - } - return varName - } - - c.localVars = append(c.localVars, varName) - return varName -} - -func (c *funcContext) newIdent(name string, t types.Type) *ast.Ident { - ident := ast.NewIdent(name) - c.setType(ident, t) - obj := types.NewVar(0, c.p.Pkg, name, t) - c.p.Uses[ident] = obj - c.p.objectNames[obj] = name - return ident -} - -func (c *funcContext) setType(e ast.Expr, t types.Type) ast.Expr { - c.p.Types[e] = types.TypeAndValue{Type: t} - return e -} - -func (c *funcContext) pkgVar(pkg *types.Package) string { - if pkg == c.p.Pkg { - return "$pkg" - } - - pkgVar, found := c.p.pkgVars[pkg.Path()] - if !found { - pkgVar = fmt.Sprintf(`$packages["%s"]`, pkg.Path()) - } - return pkgVar -} - -func isVarOrConst(o types.Object) bool { - switch o.(type) { - case *types.Var, *types.Const: - return true - } - return false -} - -func isPkgLevel(o types.Object) bool { - return o.Parent() != nil && o.Parent().Parent() == types.Universe -} - -func (c *funcContext) objectName(o types.Object) string { - if isPkgLevel(o) { - c.p.dependencies[o] = true - - if o.Pkg() != c.p.Pkg || (isVarOrConst(o) && o.Exported()) { - return c.pkgVar(o.Pkg()) + "." + o.Name() - } - } - - name, ok := c.p.objectNames[o] - if !ok { - name = c.newVariableWithLevel(o.Name(), isPkgLevel(o)) - c.p.objectNames[o] = name - } - - if v, ok := o.(*types.Var); ok && c.p.escapingVars[v] { - return name + "[0]" - } - return name -} - -func (c *funcContext) varPtrName(o *types.Var) string { - if isPkgLevel(o) && o.Exported() { - return c.pkgVar(o.Pkg()) + "." + o.Name() + "$ptr" - } - - name, ok := c.p.varPtrNames[o] - if !ok { - name = c.newVariableWithLevel(o.Name()+"$ptr", isPkgLevel(o)) - c.p.varPtrNames[o] = name - } - return name -} - -func (c *funcContext) typeName(ty types.Type) string { - switch t := ty.(type) { - case *types.Basic: - return "$" + toJavaScriptType(t) - case *types.Named: - if t.Obj().Name() == "error" { - return "$error" - } - return c.objectName(t.Obj()) - case *types.Interface: - if t.Empty() { - return "$emptyInterface" - } - } - - anonType, ok := c.p.anonTypeMap.At(ty).(*types.TypeName) - if !ok { - c.initArgs(ty) // cause all embedded types to be registered - varName := c.newVariableWithLevel(strings.ToLower(typeKind(ty)[5:])+"Type", true) - anonType = types.NewTypeName(token.NoPos, c.p.Pkg, varName, ty) // fake types.TypeName - c.p.anonTypes = append(c.p.anonTypes, anonType) - c.p.anonTypeMap.Set(ty, anonType) - } - c.p.dependencies[anonType] = true - return anonType.Name() -} - -func (c *funcContext) externalize(s string, t types.Type) string { - if typesutil.IsJsObject(t) { - return s - } - switch u := t.Underlying().(type) { - case *types.Basic: - if isNumeric(u) && !is64Bit(u) && !isComplex(u) { - return s - } - if u.Kind() == types.UntypedNil { - return "null" - } - } - return fmt.Sprintf("$externalize(%s, %s)", s, c.typeName(t)) -} - -func (c *funcContext) handleEscapingVars(n ast.Node) { - newEscapingVars := make(map[*types.Var]bool) - for escaping := range c.p.escapingVars { - newEscapingVars[escaping] = true - } - c.p.escapingVars = newEscapingVars - - var names []string - objs := analysis.EscapingObjects(n, c.p.Info.Info) - sort.Slice(objs, func(i, j int) bool { - if objs[i].Name() == objs[j].Name() { - return objs[i].Pos() < objs[j].Pos() - } - return objs[i].Name() < objs[j].Name() - }) - for _, obj := range objs { - names = append(names, c.objectName(obj)) - c.p.escapingVars[obj] = true - } - sort.Strings(names) - for _, name := range names { - c.Printf("%s = [%s];", name, name) - } -} - -func fieldName(t *types.Struct, i int) string { - name := t.Field(i).Name() - if name == "_" || reservedKeywords[name] { - return fmt.Sprintf("%s$%d", name, i) - } - return name -} - -func typeKind(ty types.Type) string { - switch t := ty.Underlying().(type) { - case *types.Basic: - return "$kind" + toJavaScriptType(t) - case *types.Array: - return "$kindArray" - case *types.Chan: - return "$kindChan" - case *types.Interface: - return "$kindInterface" - case *types.Map: - return "$kindMap" - case *types.Signature: - return "$kindFunc" - case *types.Slice: - return "$kindSlice" - case *types.Struct: - return "$kindStruct" - case *types.Pointer: - return "$kindPtr" - default: - panic(fmt.Sprintf("Unhandled type: %T\n", t)) - } -} - -func toJavaScriptType(t *types.Basic) string { - switch t.Kind() { - case types.UntypedInt: - return "Int" - case types.Byte: - return "Uint8" - case types.Rune: - return "Int32" - case types.UnsafePointer: - return "UnsafePointer" - default: - name := t.String() - return strings.ToUpper(name[:1]) + name[1:] - } -} - -func is64Bit(t *types.Basic) bool { - return t.Kind() == types.Int64 || t.Kind() == types.Uint64 -} - -func isBoolean(t *types.Basic) bool { - return t.Info()&types.IsBoolean != 0 -} - -func isComplex(t *types.Basic) bool { - return t.Info()&types.IsComplex != 0 -} - -func isFloat(t *types.Basic) bool { - return t.Info()&types.IsFloat != 0 -} - -func isInteger(t *types.Basic) bool { - return t.Info()&types.IsInteger != 0 -} - -func isNumeric(t *types.Basic) bool { - return t.Info()&types.IsNumeric != 0 -} - -func isString(t *types.Basic) bool { - return t.Info()&types.IsString != 0 -} - -func isUnsigned(t *types.Basic) bool { - return t.Info()&types.IsUnsigned != 0 -} - -func isBlank(expr ast.Expr) bool { - if expr == nil { - return true - } - if id, isIdent := expr.(*ast.Ident); isIdent { - return id.Name == "_" - } - return false -} - -func isWrapped(ty types.Type) bool { - switch t := ty.Underlying().(type) { - case *types.Basic: - return !is64Bit(t) && !isComplex(t) && t.Kind() != types.UntypedNil - case *types.Array, *types.Chan, *types.Map, *types.Signature: - return true - case *types.Pointer: - _, isArray := t.Elem().Underlying().(*types.Array) - return isArray - } - return false -} - -func encodeString(s string) string { - buffer := bytes.NewBuffer(nil) - for _, r := range []byte(s) { - switch r { - case '\b': - buffer.WriteString(`\b`) - case '\f': - buffer.WriteString(`\f`) - case '\n': - buffer.WriteString(`\n`) - case '\r': - buffer.WriteString(`\r`) - case '\t': - buffer.WriteString(`\t`) - case '\v': - buffer.WriteString(`\v`) - case '"': - buffer.WriteString(`\"`) - case '\\': - buffer.WriteString(`\\`) - default: - if r < 0x20 || r > 0x7E { - fmt.Fprintf(buffer, `\x%02X`, r) - continue - } - buffer.WriteByte(r) - } - } - return `"` + buffer.String() + `"` -} - -func getJsTag(tag string) string { - for tag != "" { - // skip leading space - i := 0 - for i < len(tag) && tag[i] == ' ' { - i++ - } - tag = tag[i:] - if tag == "" { - break - } - - // scan to colon. - // a space or a quote is a syntax error - i = 0 - for i < len(tag) && tag[i] != ' ' && tag[i] != ':' && tag[i] != '"' { - i++ - } - if i+1 >= len(tag) || tag[i] != ':' || tag[i+1] != '"' { - break - } - name := string(tag[:i]) - tag = tag[i+1:] - - // scan quoted string to find value - i = 1 - for i < len(tag) && tag[i] != '"' { - if tag[i] == '\\' { - i++ - } - i++ - } - if i >= len(tag) { - break - } - qvalue := string(tag[:i+1]) - tag = tag[i+1:] - - if name == "js" { - value, _ := strconv.Unquote(qvalue) - return value - } - } - return "" -} - -func needsSpace(c byte) bool { - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_' || c == '$' -} - -func removeWhitespace(b []byte, minify bool) []byte { - if !minify { - return b - } - - var out []byte - var previous byte - for len(b) > 0 { - switch b[0] { - case '\b': - out = append(out, b[:5]...) - b = b[5:] - continue - case ' ', '\t', '\n': - if (!needsSpace(previous) || !needsSpace(b[1])) && !(previous == '-' && b[1] == '-') { - b = b[1:] - continue - } - case '"': - out = append(out, '"') - b = b[1:] - for { - i := bytes.IndexAny(b, "\"\\") - out = append(out, b[:i]...) - b = b[i:] - if b[0] == '"' { - break - } - // backslash - out = append(out, b[:2]...) - b = b[2:] - } - case '/': - if b[1] == '*' { - i := bytes.Index(b[2:], []byte("*/")) - b = b[i+4:] - continue - } - } - out = append(out, b[0]) - previous = b[0] - b = b[1:] - } - return out -} - -func rangeCheck(pattern string, constantIndex, array bool) string { - if constantIndex && array { - return pattern - } - lengthProp := "$length" - if array { - lengthProp = "length" - } - check := "%2f >= %1e." + lengthProp - if !constantIndex { - check = "(%2f < 0 || " + check + ")" - } - return "(" + check + ` ? ($throwRuntimeError("index out of range"), undefined) : ` + pattern + ")" -} - -func endsWithReturn(stmts []ast.Stmt) bool { - if len(stmts) > 0 { - if _, ok := stmts[len(stmts)-1].(*ast.ReturnStmt); ok { - return true - } - } - return false -} - -func encodeIdent(name string) string { - return strings.Replace(url.QueryEscape(name), "%", "$", -1) -} - -// formatJSStructTagVal returns JavaScript code for accessing an object's property -// identified by jsTag. It prefers the dot notation over the bracket notation when -// possible, since the dot notation produces slightly smaller output. -// -// For example: -// -// "my_name" -> ".my_name" -// "my name" -> `["my name"]` -// -// For more information about JavaScript property accessors and identifiers, see -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors and -// https://developer.mozilla.org/en-US/docs/Glossary/Identifier. -// -func formatJSStructTagVal(jsTag string) string { - for i, r := range jsTag { - ok := unicode.IsLetter(r) || (i != 0 && unicode.IsNumber(r)) || r == '$' || r == '_' - if !ok { - // Saw an invalid JavaScript identifier character, - // so use bracket notation. - return `["` + template.JSEscapeString(jsTag) + `"]` - } - } - // Safe to use dot notation without any escaping. - return "." + jsTag -} diff --git a/vendor/github.com/gopherjs/gopherjs/compiler/version_check.go b/vendor/github.com/gopherjs/gopherjs/compiler/version_check.go deleted file mode 100644 index ce16f081f..000000000 --- a/vendor/github.com/gopherjs/gopherjs/compiler/version_check.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build go1.12 -// +build !go1.13 - -package compiler - -const ___GOPHERJS_REQUIRES_GO_VERSION_1_12___ = true - -// Version is the GopherJS compiler version string. -const Version = "1.12-1" diff --git a/vendor/github.com/gopherjs/gopherjs/internal/sysutil/sysutil.go b/vendor/github.com/gopherjs/gopherjs/internal/sysutil/sysutil.go deleted file mode 100644 index c3631f2b2..000000000 --- a/vendor/github.com/gopherjs/gopherjs/internal/sysutil/sysutil.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build !windows - -// Package sysutil contains system-specific utilities. -package sysutil - -import "golang.org/x/sys/unix" - -// RlimitStack reports the current stack size limit in bytes. -func RlimitStack() (cur uint64, err error) { - var r unix.Rlimit - err = unix.Getrlimit(unix.RLIMIT_STACK, &r) - return uint64(r.Cur), err // Type conversion because Cur is one of uint64, int64 depending on unix flavor. -} diff --git a/vendor/github.com/gopherjs/gopherjs/internal/sysutil/sysutil_windows.go b/vendor/github.com/gopherjs/gopherjs/internal/sysutil/sysutil_windows.go deleted file mode 100644 index 5e959b2bf..000000000 --- a/vendor/github.com/gopherjs/gopherjs/internal/sysutil/sysutil_windows.go +++ /dev/null @@ -1,7 +0,0 @@ -package sysutil - -import "errors" - -func RlimitStack() (uint64, error) { - return 0, errors.New("RlimitStack is not implemented on Windows") -} diff --git a/vendor/github.com/gopherjs/gopherjs/nosync/map.go b/vendor/github.com/gopherjs/gopherjs/nosync/map.go deleted file mode 100644 index 6cd845a27..000000000 --- a/vendor/github.com/gopherjs/gopherjs/nosync/map.go +++ /dev/null @@ -1,67 +0,0 @@ -package nosync - -// Map is a concurrent map with amortized-constant-time loads, stores, and deletes. -// It is safe for multiple goroutines to call a Map's methods concurrently. -// -// The zero Map is valid and empty. -// -// A Map must not be copied after first use. -type Map struct { - m map[interface{}]interface{} -} - -// Load returns the value stored in the map for a key, or nil if no -// value is present. -// The ok result indicates whether value was found in the map. -func (m *Map) Load(key interface{}) (value interface{}, ok bool) { - value, ok = m.m[key] - return value, ok -} - -// Store sets the value for a key. -func (m *Map) Store(key, value interface{}) { - if m.m == nil { - m.m = make(map[interface{}]interface{}) - } - m.m[key] = value -} - -// LoadOrStore returns the existing value for the key if present. -// Otherwise, it stores and returns the given value. -// The loaded result is true if the value was loaded, false if stored. -func (m *Map) LoadOrStore(key, value interface{}) (actual interface{}, loaded bool) { - if value, ok := m.m[key]; ok { - return value, true - } - if m.m == nil { - m.m = make(map[interface{}]interface{}) - } - m.m[key] = value - return value, false -} - -// Delete deletes the value for a key. -func (m *Map) Delete(key interface{}) { - if m.m == nil { - return - } - delete(m.m, key) -} - -// Range calls f sequentially for each key and value present in the map. -// If f returns false, range stops the iteration. -// -// Range does not necessarily correspond to any consistent snapshot of the Map's -// contents: no key will be visited more than once, but if the value for any key -// is stored or deleted concurrently, Range may reflect any mapping for that key -// from any point during the Range call. -// -// Range may be O(N) with the number of elements in the map even if f returns -// false after a constant number of calls. -func (m *Map) Range(f func(key, value interface{}) bool) { - for k, v := range m.m { - if !f(k, v) { - break - } - } -} diff --git a/vendor/github.com/gopherjs/gopherjs/nosync/mutex.go b/vendor/github.com/gopherjs/gopherjs/nosync/mutex.go deleted file mode 100644 index 03f20dc40..000000000 --- a/vendor/github.com/gopherjs/gopherjs/nosync/mutex.go +++ /dev/null @@ -1,85 +0,0 @@ -package nosync - -// Mutex is a dummy which is non-blocking. -type Mutex struct { - locked bool -} - -// Lock locks m. It is a run-time error if m is already locked. -func (m *Mutex) Lock() { - if m.locked { - panic("nosync: mutex is already locked") - } - m.locked = true -} - -// Unlock unlocks m. It is a run-time error if m is not locked. -func (m *Mutex) Unlock() { - if !m.locked { - panic("nosync: unlock of unlocked mutex") - } - m.locked = false -} - -// RWMutex is a dummy which is non-blocking. -type RWMutex struct { - writeLocked bool - readLockCounter int -} - -// Lock locks m for writing. It is a run-time error if rw is already locked for reading or writing. -func (rw *RWMutex) Lock() { - if rw.readLockCounter != 0 || rw.writeLocked { - panic("nosync: mutex is already locked") - } - rw.writeLocked = true -} - -// Unlock unlocks rw for writing. It is a run-time error if rw is not locked for writing. -func (rw *RWMutex) Unlock() { - if !rw.writeLocked { - panic("nosync: unlock of unlocked mutex") - } - rw.writeLocked = false -} - -// RLock locks m for reading. It is a run-time error if rw is already locked for reading or writing. -func (rw *RWMutex) RLock() { - if rw.writeLocked { - panic("nosync: mutex is already locked") - } - rw.readLockCounter++ -} - -// RUnlock undoes a single RLock call; it does not affect other simultaneous readers. It is a run-time error if rw is not locked for reading. -func (rw *RWMutex) RUnlock() { - if rw.readLockCounter == 0 { - panic("nosync: unlock of unlocked mutex") - } - rw.readLockCounter-- -} - -// WaitGroup is a dummy which is non-blocking. -type WaitGroup struct { - counter int -} - -// Add adds delta, which may be negative, to the WaitGroup If the counter goes negative, Add panics. -func (wg *WaitGroup) Add(delta int) { - wg.counter += delta - if wg.counter < 0 { - panic("sync: negative WaitGroup counter") - } -} - -// Done decrements the WaitGroup counter. -func (wg *WaitGroup) Done() { - wg.Add(-1) -} - -// Wait panics if the WaitGroup counter is not zero. -func (wg *WaitGroup) Wait() { - if wg.counter != 0 { - panic("sync: WaitGroup counter not zero") - } -} diff --git a/vendor/github.com/gopherjs/gopherjs/nosync/once.go b/vendor/github.com/gopherjs/gopherjs/nosync/once.go deleted file mode 100644 index f4cb69540..000000000 --- a/vendor/github.com/gopherjs/gopherjs/nosync/once.go +++ /dev/null @@ -1,39 +0,0 @@ -package nosync - -// Once is an object that will perform exactly one action. -type Once struct { - doing bool - done bool -} - -// Do calls the function f if and only if Do is being called for the -// first time for this instance of Once. In other words, given -// var once Once -// if once.Do(f) is called multiple times, only the first call will invoke f, -// even if f has a different value in each invocation. A new instance of -// Once is required for each function to execute. -// -// Do is intended for initialization that must be run exactly once. Since f -// is niladic, it may be necessary to use a function literal to capture the -// arguments to a function to be invoked by Do: -// config.once.Do(func() { config.init(filename) }) -// -// If f causes Do to be called, it will panic. -// -// If f panics, Do considers it to have returned; future calls of Do return -// without calling f. -// -func (o *Once) Do(f func()) { - if o.done { - return - } - if o.doing { - panic("nosync: Do called within f") - } - o.doing = true - defer func() { - o.doing = false - o.done = true - }() - f() -} diff --git a/vendor/github.com/gopherjs/gopherjs/nosync/pool.go b/vendor/github.com/gopherjs/gopherjs/nosync/pool.go deleted file mode 100644 index 3d448e0fc..000000000 --- a/vendor/github.com/gopherjs/gopherjs/nosync/pool.go +++ /dev/null @@ -1,63 +0,0 @@ -package nosync - -// A Pool is a set of temporary objects that may be individually saved and -// retrieved. -// -// Any item stored in the Pool may be removed automatically at any time without -// notification. If the Pool holds the only reference when this happens, the -// item might be deallocated. -// -// A Pool is safe for use by multiple goroutines simultaneously. -// -// Pool's purpose is to cache allocated but unused items for later reuse, -// relieving pressure on the garbage collector. That is, it makes it easy to -// build efficient, thread-safe free lists. However, it is not suitable for all -// free lists. -// -// An appropriate use of a Pool is to manage a group of temporary items -// silently shared among and potentially reused by concurrent independent -// clients of a package. Pool provides a way to amortize allocation overhead -// across many clients. -// -// An example of good use of a Pool is in the fmt package, which maintains a -// dynamically-sized store of temporary output buffers. The store scales under -// load (when many goroutines are actively printing) and shrinks when -// quiescent. -// -// On the other hand, a free list maintained as part of a short-lived object is -// not a suitable use for a Pool, since the overhead does not amortize well in -// that scenario. It is more efficient to have such objects implement their own -// free list. -// -type Pool struct { - store []interface{} - New func() interface{} -} - -// Get selects an arbitrary item from the Pool, removes it from the -// Pool, and returns it to the caller. -// Get may choose to ignore the pool and treat it as empty. -// Callers should not assume any relation between values passed to Put and -// the values returned by Get. -// -// If Get would otherwise return nil and p.New is non-nil, Get returns -// the result of calling p.New. -func (p *Pool) Get() interface{} { - if len(p.store) == 0 { - if p.New != nil { - return p.New() - } - return nil - } - x := p.store[len(p.store)-1] - p.store = p.store[:len(p.store)-1] - return x -} - -// Put adds x to the pool. -func (p *Pool) Put(x interface{}) { - if x == nil { - return - } - p.store = append(p.store, x) -} diff --git a/vendor/github.com/gopherjs/gopherjs/tool.go b/vendor/github.com/gopherjs/gopherjs/tool.go deleted file mode 100644 index 4c580a139..000000000 --- a/vendor/github.com/gopherjs/gopherjs/tool.go +++ /dev/null @@ -1,963 +0,0 @@ -package main - -import ( - "bytes" - "errors" - "fmt" - "go/ast" - "go/build" - "go/doc" - "go/parser" - "go/scanner" - "go/token" - "go/types" - "io" - "io/ioutil" - "net" - "net/http" - "os" - "os/exec" - "path" - "path/filepath" - "runtime" - "sort" - "strconv" - "strings" - "syscall" - "text/template" - "time" - "unicode" - "unicode/utf8" - - gbuild "github.com/gopherjs/gopherjs/build" - "github.com/gopherjs/gopherjs/compiler" - "github.com/gopherjs/gopherjs/internal/sysutil" - "github.com/kisielk/gotool" - "github.com/neelance/sourcemap" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "golang.org/x/crypto/ssh/terminal" - "golang.org/x/tools/go/buildutil" -) - -var currentDirectory string - -func init() { - var err error - currentDirectory, err = os.Getwd() - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - currentDirectory, err = filepath.EvalSymlinks(currentDirectory) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - gopaths := filepath.SplitList(build.Default.GOPATH) - if len(gopaths) == 0 { - fmt.Fprintf(os.Stderr, "$GOPATH not set. For more details see: go help gopath\n") - os.Exit(1) - } -} - -func main() { - var ( - options = &gbuild.Options{CreateMapFile: true} - pkgObj string - tags string - ) - - flagVerbose := pflag.NewFlagSet("", 0) - flagVerbose.BoolVarP(&options.Verbose, "verbose", "v", false, "print the names of packages as they are compiled") - flagQuiet := pflag.NewFlagSet("", 0) - flagQuiet.BoolVarP(&options.Quiet, "quiet", "q", false, "suppress non-fatal warnings") - - compilerFlags := pflag.NewFlagSet("", 0) - compilerFlags.BoolVarP(&options.Minify, "minify", "m", false, "minify generated code") - compilerFlags.BoolVar(&options.Color, "color", terminal.IsTerminal(int(os.Stderr.Fd())) && os.Getenv("TERM") != "dumb", "colored output") - compilerFlags.StringVar(&tags, "tags", "", "a list of build tags to consider satisfied during the build") - compilerFlags.BoolVar(&options.MapToLocalDisk, "localmap", false, "use local paths for sourcemap") - - flagWatch := pflag.NewFlagSet("", 0) - flagWatch.BoolVarP(&options.Watch, "watch", "w", false, "watch for changes to the source files") - - cmdBuild := &cobra.Command{ - Use: "build [packages]", - Short: "compile packages and dependencies", - } - cmdBuild.Flags().StringVarP(&pkgObj, "output", "o", "", "output file") - cmdBuild.Flags().AddFlagSet(flagVerbose) - cmdBuild.Flags().AddFlagSet(flagQuiet) - cmdBuild.Flags().AddFlagSet(compilerFlags) - cmdBuild.Flags().AddFlagSet(flagWatch) - cmdBuild.Run = func(cmd *cobra.Command, args []string) { - options.BuildTags = strings.Fields(tags) - for { - s := gbuild.NewSession(options) - - err := func() error { - // Handle "gopherjs build [files]" ad-hoc package mode. - if len(args) > 0 && (strings.HasSuffix(args[0], ".go") || strings.HasSuffix(args[0], ".inc.js")) { - for _, arg := range args { - if !strings.HasSuffix(arg, ".go") && !strings.HasSuffix(arg, ".inc.js") { - return fmt.Errorf("named files must be .go or .inc.js files") - } - } - if pkgObj == "" { - basename := filepath.Base(args[0]) - pkgObj = basename[:len(basename)-3] + ".js" - } - names := make([]string, len(args)) - for i, name := range args { - name = filepath.ToSlash(name) - names[i] = name - if s.Watcher != nil { - s.Watcher.Add(name) - } - } - err := s.BuildFiles(args, pkgObj, currentDirectory) - return err - } - - // Expand import path patterns. - patternContext := gbuild.NewBuildContext("", options.BuildTags) - pkgs := (&gotool.Context{BuildContext: *patternContext}).ImportPaths(args) - - for _, pkgPath := range pkgs { - if s.Watcher != nil { - pkg, err := gbuild.NewBuildContext(s.InstallSuffix(), options.BuildTags).Import(pkgPath, "", build.FindOnly) - if err != nil { - return err - } - s.Watcher.Add(pkg.Dir) - } - pkg, err := gbuild.Import(pkgPath, 0, s.InstallSuffix(), options.BuildTags) - if err != nil { - return err - } - archive, err := s.BuildPackage(pkg) - if err != nil { - return err - } - if len(pkgs) == 1 { // Only consider writing output if single package specified. - if pkgObj == "" { - pkgObj = filepath.Base(pkg.Dir) + ".js" - } - if pkg.IsCommand() && !pkg.UpToDate { - if err := s.WriteCommandPackage(archive, pkgObj); err != nil { - return err - } - } - } - } - return nil - }() - exitCode := handleError(err, options, nil) - - if s.Watcher == nil { - os.Exit(exitCode) - } - s.WaitForChange() - } - } - - cmdInstall := &cobra.Command{ - Use: "install [packages]", - Short: "compile and install packages and dependencies", - } - cmdInstall.Flags().AddFlagSet(flagVerbose) - cmdInstall.Flags().AddFlagSet(flagQuiet) - cmdInstall.Flags().AddFlagSet(compilerFlags) - cmdInstall.Flags().AddFlagSet(flagWatch) - cmdInstall.Run = func(cmd *cobra.Command, args []string) { - options.BuildTags = strings.Fields(tags) - for { - s := gbuild.NewSession(options) - - err := func() error { - // Expand import path patterns. - patternContext := gbuild.NewBuildContext("", options.BuildTags) - pkgs := (&gotool.Context{BuildContext: *patternContext}).ImportPaths(args) - - if cmd.Name() == "get" { - goGet := exec.Command("go", append([]string{"get", "-d", "-tags=js"}, pkgs...)...) - goGet.Stdout = os.Stdout - goGet.Stderr = os.Stderr - if err := goGet.Run(); err != nil { - return err - } - } - for _, pkgPath := range pkgs { - pkg, err := gbuild.Import(pkgPath, 0, s.InstallSuffix(), options.BuildTags) - if s.Watcher != nil && pkg != nil { // add watch even on error - s.Watcher.Add(pkg.Dir) - } - if err != nil { - return err - } - - archive, err := s.BuildPackage(pkg) - if err != nil { - return err - } - - if pkg.IsCommand() && !pkg.UpToDate { - if err := s.WriteCommandPackage(archive, pkg.PkgObj); err != nil { - return err - } - } - } - return nil - }() - exitCode := handleError(err, options, nil) - - if s.Watcher == nil { - os.Exit(exitCode) - } - s.WaitForChange() - } - } - - cmdDoc := &cobra.Command{ - Use: "doc [arguments]", - Short: "display documentation for the requested, package, method or symbol", - } - cmdDoc.Run = func(cmd *cobra.Command, args []string) { - goDoc := exec.Command("go", append([]string{"doc"}, args...)...) - goDoc.Stdout = os.Stdout - goDoc.Stderr = os.Stderr - goDoc.Env = append(os.Environ(), "GOARCH=js") - err := goDoc.Run() - exitCode := handleError(err, options, nil) - os.Exit(exitCode) - } - - cmdGet := &cobra.Command{ - Use: "get [packages]", - Short: "download and install packages and dependencies", - } - cmdGet.Flags().AddFlagSet(flagVerbose) - cmdGet.Flags().AddFlagSet(flagQuiet) - cmdGet.Flags().AddFlagSet(compilerFlags) - cmdGet.Run = cmdInstall.Run - - cmdRun := &cobra.Command{ - Use: "run [gofiles...] [arguments...]", - Short: "compile and run Go program", - } - cmdRun.Flags().AddFlagSet(flagVerbose) - cmdRun.Flags().AddFlagSet(flagQuiet) - cmdRun.Flags().AddFlagSet(compilerFlags) - cmdRun.Run = func(cmd *cobra.Command, args []string) { - err := func() error { - lastSourceArg := 0 - for { - if lastSourceArg == len(args) || !(strings.HasSuffix(args[lastSourceArg], ".go") || strings.HasSuffix(args[lastSourceArg], ".inc.js")) { - break - } - lastSourceArg++ - } - if lastSourceArg == 0 { - return fmt.Errorf("gopherjs run: no go files listed") - } - - tempfile, err := ioutil.TempFile(currentDirectory, filepath.Base(args[0])+".") - if err != nil && strings.HasPrefix(currentDirectory, runtime.GOROOT()) { - tempfile, err = ioutil.TempFile("", filepath.Base(args[0])+".") - } - if err != nil { - return err - } - defer func() { - tempfile.Close() - os.Remove(tempfile.Name()) - os.Remove(tempfile.Name() + ".map") - }() - s := gbuild.NewSession(options) - if err := s.BuildFiles(args[:lastSourceArg], tempfile.Name(), currentDirectory); err != nil { - return err - } - if err := runNode(tempfile.Name(), args[lastSourceArg:], "", options.Quiet); err != nil { - return err - } - return nil - }() - exitCode := handleError(err, options, nil) - - os.Exit(exitCode) - } - - cmdTest := &cobra.Command{ - Use: "test [packages]", - Short: "test packages", - } - bench := cmdTest.Flags().String("bench", "", "Run benchmarks matching the regular expression. By default, no benchmarks run. To run all benchmarks, use '--bench=.'.") - benchtime := cmdTest.Flags().String("benchtime", "", "Run enough iterations of each benchmark to take t, specified as a time.Duration (for example, -benchtime 1h30s). The default is 1 second (1s).") - count := cmdTest.Flags().String("count", "", "Run each test and benchmark n times (default 1). Examples are always run once.") - run := cmdTest.Flags().String("run", "", "Run only those tests and examples matching the regular expression.") - short := cmdTest.Flags().Bool("short", false, "Tell long-running tests to shorten their run time.") - verbose := cmdTest.Flags().BoolP("verbose", "v", false, "Log all tests as they are run. Also print all text from Log and Logf calls even if the test succeeds.") - compileOnly := cmdTest.Flags().BoolP("compileonly", "c", false, "Compile the test binary to pkg.test.js but do not run it (where pkg is the last element of the package's import path). The file name can be changed with the -o flag.") - outputFilename := cmdTest.Flags().StringP("output", "o", "", "Compile the test binary to the named file. The test still runs (unless -c is specified).") - cmdTest.Flags().AddFlagSet(compilerFlags) - cmdTest.Run = func(cmd *cobra.Command, args []string) { - options.BuildTags = strings.Fields(tags) - err := func() error { - // Expand import path patterns. - patternContext := gbuild.NewBuildContext("", options.BuildTags) - args = (&gotool.Context{BuildContext: *patternContext}).ImportPaths(args) - - if *compileOnly && len(args) > 1 { - return errors.New("cannot use -c flag with multiple packages") - } - if *outputFilename != "" && len(args) > 1 { - return errors.New("cannot use -o flag with multiple packages") - } - - pkgs := make([]*gbuild.PackageData, len(args)) - for i, pkgPath := range args { - var err error - pkgs[i], err = gbuild.Import(pkgPath, 0, "", options.BuildTags) - if err != nil { - return err - } - } - - var exitErr error - for _, pkg := range pkgs { - if len(pkg.TestGoFiles) == 0 && len(pkg.XTestGoFiles) == 0 { - fmt.Printf("? \t%s\t[no test files]\n", pkg.ImportPath) - continue - } - s := gbuild.NewSession(options) - - tests := &testFuncs{BuildContext: s.BuildContext(), Package: pkg.Package} - collectTests := func(testPkg *gbuild.PackageData, testPkgName string, needVar *bool) error { - if testPkgName == "_test" { - for _, file := range pkg.TestGoFiles { - if err := tests.load(pkg.Package.Dir, file, testPkgName, &tests.ImportTest, &tests.NeedTest); err != nil { - return err - } - } - } else { - for _, file := range pkg.XTestGoFiles { - if err := tests.load(pkg.Package.Dir, file, "_xtest", &tests.ImportXtest, &tests.NeedXtest); err != nil { - return err - } - } - } - _, err := s.BuildPackage(testPkg) - return err - } - - if err := collectTests(&gbuild.PackageData{ - Package: &build.Package{ - ImportPath: pkg.ImportPath, - Dir: pkg.Dir, - GoFiles: append(pkg.GoFiles, pkg.TestGoFiles...), - Imports: append(pkg.Imports, pkg.TestImports...), - }, - IsTest: true, - JSFiles: pkg.JSFiles, - }, "_test", &tests.NeedTest); err != nil { - return err - } - - if err := collectTests(&gbuild.PackageData{ - Package: &build.Package{ - ImportPath: pkg.ImportPath + "_test", - Dir: pkg.Dir, - GoFiles: pkg.XTestGoFiles, - Imports: pkg.XTestImports, - }, - IsTest: true, - }, "_xtest", &tests.NeedXtest); err != nil { - return err - } - - buf := new(bytes.Buffer) - if err := testmainTmpl.Execute(buf, tests); err != nil { - return err - } - - fset := token.NewFileSet() - mainFile, err := parser.ParseFile(fset, "_testmain.go", buf, 0) - if err != nil { - return err - } - - importContext := &compiler.ImportContext{ - Packages: s.Types, - Import: func(path string) (*compiler.Archive, error) { - if path == pkg.ImportPath || path == pkg.ImportPath+"_test" { - return s.Archives[path], nil - } - return s.BuildImportPath(path) - }, - } - mainPkgArchive, err := compiler.Compile("main", []*ast.File{mainFile}, fset, importContext, options.Minify) - if err != nil { - return err - } - - if *compileOnly && *outputFilename == "" { - *outputFilename = pkg.Package.Name + "_test.js" - } - - var outfile *os.File - if *outputFilename != "" { - outfile, err = os.Create(*outputFilename) - if err != nil { - return err - } - } else { - outfile, err = ioutil.TempFile(currentDirectory, "test.") - if err != nil { - return err - } - } - defer func() { - outfile.Close() - if *outputFilename == "" { - os.Remove(outfile.Name()) - os.Remove(outfile.Name() + ".map") - } - }() - - if err := s.WriteCommandPackage(mainPkgArchive, outfile.Name()); err != nil { - return err - } - - if *compileOnly { - continue - } - - var args []string - if *bench != "" { - args = append(args, "-test.bench", *bench) - } - if *benchtime != "" { - args = append(args, "-test.benchtime", *benchtime) - } - if *count != "" { - args = append(args, "-test.count", *count) - } - if *run != "" { - args = append(args, "-test.run", *run) - } - if *short { - args = append(args, "-test.short") - } - if *verbose { - args = append(args, "-test.v") - } - status := "ok " - start := time.Now() - if err := runNode(outfile.Name(), args, runTestDir(pkg), options.Quiet); err != nil { - if _, ok := err.(*exec.ExitError); !ok { - return err - } - exitErr = err - status = "FAIL" - } - fmt.Printf("%s\t%s\t%.3fs\n", status, pkg.ImportPath, time.Since(start).Seconds()) - } - return exitErr - }() - exitCode := handleError(err, options, nil) - - os.Exit(exitCode) - } - - cmdServe := &cobra.Command{ - Use: "serve [root]", - Short: "compile on-the-fly and serve", - } - cmdServe.Flags().AddFlagSet(flagVerbose) - cmdServe.Flags().AddFlagSet(flagQuiet) - cmdServe.Flags().AddFlagSet(compilerFlags) - var addr string - cmdServe.Flags().StringVarP(&addr, "http", "", ":8080", "HTTP bind address to serve") - cmdServe.Run = func(cmd *cobra.Command, args []string) { - options.BuildTags = strings.Fields(tags) - dirs := append(filepath.SplitList(build.Default.GOPATH), build.Default.GOROOT) - var root string - - if len(args) > 1 { - cmdServe.HelpFunc()(cmd, args) - os.Exit(1) - } - - if len(args) == 1 { - root = args[0] - } - - sourceFiles := http.FileServer(serveCommandFileSystem{ - serveRoot: root, - options: options, - dirs: dirs, - sourceMaps: make(map[string][]byte), - }) - - ln, err := net.Listen("tcp", addr) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - if tcpAddr := ln.Addr().(*net.TCPAddr); tcpAddr.IP.Equal(net.IPv4zero) || tcpAddr.IP.Equal(net.IPv6zero) { // Any available addresses. - fmt.Printf("serving at http://localhost:%d and on port %d of any available addresses\n", tcpAddr.Port, tcpAddr.Port) - } else { // Specific address. - fmt.Printf("serving at http://%s\n", tcpAddr) - } - fmt.Fprintln(os.Stderr, http.Serve(tcpKeepAliveListener{ln.(*net.TCPListener)}, sourceFiles)) - } - - cmdVersion := &cobra.Command{ - Use: "version", - Short: "print GopherJS compiler version", - } - cmdVersion.Run = func(cmd *cobra.Command, args []string) { - if len(args) > 0 { - cmdServe.HelpFunc()(cmd, args) - os.Exit(1) - } - - fmt.Printf("GopherJS %s\n", compiler.Version) - } - - rootCmd := &cobra.Command{ - Use: "gopherjs", - Long: "GopherJS is a tool for compiling Go source code to JavaScript.", - } - rootCmd.AddCommand(cmdBuild, cmdGet, cmdInstall, cmdRun, cmdTest, cmdServe, cmdVersion, cmdDoc) - err := rootCmd.Execute() - if err != nil { - os.Exit(2) - } -} - -// tcpKeepAliveListener sets TCP keep-alive timeouts on accepted -// connections. It's used by ListenAndServe and ListenAndServeTLS so -// dead TCP connections (e.g. closing laptop mid-download) eventually -// go away. -type tcpKeepAliveListener struct { - *net.TCPListener -} - -func (ln tcpKeepAliveListener) Accept() (c net.Conn, err error) { - tc, err := ln.AcceptTCP() - if err != nil { - return - } - tc.SetKeepAlive(true) - tc.SetKeepAlivePeriod(3 * time.Minute) - return tc, nil -} - -type serveCommandFileSystem struct { - serveRoot string - options *gbuild.Options - dirs []string - sourceMaps map[string][]byte -} - -func (fs serveCommandFileSystem) Open(requestName string) (http.File, error) { - name := path.Join(fs.serveRoot, requestName[1:]) // requestName[0] == '/' - - dir, file := path.Split(name) - base := path.Base(dir) // base is parent folder name, which becomes the output file name. - - isPkg := file == base+".js" - isMap := file == base+".js.map" - isIndex := file == "index.html" - - if isPkg || isMap || isIndex { - // If we're going to be serving our special files, make sure there's a Go command in this folder. - s := gbuild.NewSession(fs.options) - pkg, err := gbuild.Import(path.Dir(name), 0, s.InstallSuffix(), fs.options.BuildTags) - if err != nil || pkg.Name != "main" { - isPkg = false - isMap = false - isIndex = false - } - - switch { - case isPkg: - buf := new(bytes.Buffer) - browserErrors := new(bytes.Buffer) - err := func() error { - archive, err := s.BuildPackage(pkg) - if err != nil { - return err - } - - sourceMapFilter := &compiler.SourceMapFilter{Writer: buf} - m := &sourcemap.Map{File: base + ".js"} - sourceMapFilter.MappingCallback = gbuild.NewMappingCallback(m, fs.options.GOROOT, fs.options.GOPATH, fs.options.MapToLocalDisk) - - deps, err := compiler.ImportDependencies(archive, s.BuildImportPath) - if err != nil { - return err - } - if err := compiler.WriteProgramCode(deps, sourceMapFilter); err != nil { - return err - } - - mapBuf := new(bytes.Buffer) - m.WriteTo(mapBuf) - buf.WriteString("//# sourceMappingURL=" + base + ".js.map\n") - fs.sourceMaps[name+".map"] = mapBuf.Bytes() - - return nil - }() - handleError(err, fs.options, browserErrors) - if err != nil { - buf = browserErrors - } - return newFakeFile(base+".js", buf.Bytes()), nil - - case isMap: - if content, ok := fs.sourceMaps[name]; ok { - return newFakeFile(base+".js.map", content), nil - } - } - } - - for _, d := range fs.dirs { - dir := http.Dir(filepath.Join(d, "src")) - - f, err := dir.Open(name) - if err == nil { - return f, nil - } - - // source maps are served outside of serveRoot - f, err = dir.Open(requestName) - if err == nil { - return f, nil - } - } - - if isIndex { - // If there was no index.html file in any dirs, supply our own. - return newFakeFile("index.html", []byte(``)), nil - } - - return nil, os.ErrNotExist -} - -type fakeFile struct { - name string - size int - io.ReadSeeker -} - -func newFakeFile(name string, content []byte) *fakeFile { - return &fakeFile{name: name, size: len(content), ReadSeeker: bytes.NewReader(content)} -} - -func (f *fakeFile) Close() error { - return nil -} - -func (f *fakeFile) Readdir(count int) ([]os.FileInfo, error) { - return nil, os.ErrInvalid -} - -func (f *fakeFile) Stat() (os.FileInfo, error) { - return f, nil -} - -func (f *fakeFile) Name() string { - return f.name -} - -func (f *fakeFile) Size() int64 { - return int64(f.size) -} - -func (f *fakeFile) Mode() os.FileMode { - return 0 -} - -func (f *fakeFile) ModTime() time.Time { - return time.Time{} -} - -func (f *fakeFile) IsDir() bool { - return false -} - -func (f *fakeFile) Sys() interface{} { - return nil -} - -// handleError handles err and returns an appropriate exit code. -// If browserErrors is non-nil, errors are written for presentation in browser. -func handleError(err error, options *gbuild.Options, browserErrors *bytes.Buffer) int { - switch err := err.(type) { - case nil: - return 0 - case compiler.ErrorList: - for _, entry := range err { - printError(entry, options, browserErrors) - } - return 1 - case *exec.ExitError: - return err.Sys().(syscall.WaitStatus).ExitStatus() - default: - printError(err, options, browserErrors) - return 1 - } -} - -// printError prints err to Stderr with options. If browserErrors is non-nil, errors are also written for presentation in browser. -func printError(err error, options *gbuild.Options, browserErrors *bytes.Buffer) { - e := sprintError(err) - options.PrintError("%s\n", e) - if browserErrors != nil { - fmt.Fprintln(browserErrors, `console.error("`+template.JSEscapeString(e)+`");`) - } -} - -// sprintError returns an annotated error string without trailing newline. -func sprintError(err error) string { - makeRel := func(name string) string { - if relname, err := filepath.Rel(currentDirectory, name); err == nil { - return relname - } - return name - } - - switch e := err.(type) { - case *scanner.Error: - return fmt.Sprintf("%s:%d:%d: %s", makeRel(e.Pos.Filename), e.Pos.Line, e.Pos.Column, e.Msg) - case types.Error: - pos := e.Fset.Position(e.Pos) - return fmt.Sprintf("%s:%d:%d: %s", makeRel(pos.Filename), pos.Line, pos.Column, e.Msg) - default: - return fmt.Sprintf("%s", e) - } -} - -// runNode runs script with args using Node.js in directory dir. -// If dir is empty string, current directory is used. -func runNode(script string, args []string, dir string, quiet bool) error { - var allArgs []string - if b, _ := strconv.ParseBool(os.Getenv("SOURCE_MAP_SUPPORT")); os.Getenv("SOURCE_MAP_SUPPORT") == "" || b { - allArgs = []string{"--require", "source-map-support/register"} - if err := exec.Command("node", "--require", "source-map-support/register", "--eval", "").Run(); err != nil { - if !quiet { - fmt.Fprintln(os.Stderr, "gopherjs: Source maps disabled. Install source-map-support module for nice stack traces. See https://github.com/gopherjs/gopherjs#gopherjs-run-gopherjs-test.") - } - allArgs = []string{} - } - } - - if runtime.GOOS != "windows" { - // We've seen issues with stack space limits causing - // recursion-heavy standard library tests to fail (e.g., see - // https://github.com/gopherjs/gopherjs/pull/669#issuecomment-319319483). - // - // There are two separate limits in non-Windows environments: - // - // - OS process limit - // - Node.js (V8) limit - // - // GopherJS fetches the current OS process limit, and sets the - // Node.js limit to the same value. So both limits are kept in sync - // and can be controlled by setting OS process limit. E.g.: - // - // ulimit -s 10000 && gopherjs test - // - cur, err := sysutil.RlimitStack() - if err != nil { - return fmt.Errorf("failed to get stack size limit: %v", err) - } - allArgs = append(allArgs, fmt.Sprintf("--stack_size=%v", cur/1000)) // Convert from bytes to KB. - } - - allArgs = append(allArgs, script) - allArgs = append(allArgs, args...) - - node := exec.Command("node", allArgs...) - node.Dir = dir - node.Stdin = os.Stdin - node.Stdout = os.Stdout - node.Stderr = os.Stderr - err := node.Run() - if _, ok := err.(*exec.ExitError); err != nil && !ok { - err = fmt.Errorf("could not run Node.js: %s", err.Error()) - } - return err -} - -// runTestDir returns the directory for Node.js to use when running tests for package p. -// Empty string means current directory. -func runTestDir(p *gbuild.PackageData) string { - if p.IsVirtual { - // The package is virtual and doesn't have a physical directory. Use current directory. - return "" - } - // Run tests in the package directory. - return p.Dir -} - -type testFuncs struct { - BuildContext *build.Context - Tests []testFunc - Benchmarks []testFunc - Examples []testFunc - TestMain *testFunc - Package *build.Package - ImportTest bool - NeedTest bool - ImportXtest bool - NeedXtest bool -} - -type testFunc struct { - Package string // imported package name (_test or _xtest) - Name string // function name - Output string // output, for examples - Unordered bool // output is allowed to be unordered. -} - -var testFileSet = token.NewFileSet() - -func (t *testFuncs) load(dir, file, pkg string, doImport, seen *bool) error { - f, err := buildutil.ParseFile(testFileSet, t.BuildContext, nil, dir, file, parser.ParseComments) - if err != nil { - return err - } - for _, d := range f.Decls { - n, ok := d.(*ast.FuncDecl) - if !ok { - continue - } - if n.Recv != nil { - continue - } - name := n.Name.String() - switch { - case isTestMain(n): - if t.TestMain != nil { - return errors.New("multiple definitions of TestMain") - } - t.TestMain = &testFunc{pkg, name, "", false} - *doImport, *seen = true, true - case isTest(name, "Test"): - t.Tests = append(t.Tests, testFunc{pkg, name, "", false}) - *doImport, *seen = true, true - case isTest(name, "Benchmark"): - t.Benchmarks = append(t.Benchmarks, testFunc{pkg, name, "", false}) - *doImport, *seen = true, true - } - } - ex := doc.Examples(f) - sort.Sort(byOrder(ex)) - for _, e := range ex { - *doImport = true // import test file whether executed or not - if e.Output == "" && !e.EmptyOutput { - // Don't run examples with no output. - continue - } - t.Examples = append(t.Examples, testFunc{pkg, "Example" + e.Name, e.Output, e.Unordered}) - *seen = true - } - - return nil -} - -type byOrder []*doc.Example - -func (x byOrder) Len() int { return len(x) } -func (x byOrder) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x byOrder) Less(i, j int) bool { return x[i].Order < x[j].Order } - -// isTestMain tells whether fn is a TestMain(m *testing.M) function. -func isTestMain(fn *ast.FuncDecl) bool { - if fn.Name.String() != "TestMain" || - fn.Type.Results != nil && len(fn.Type.Results.List) > 0 || - fn.Type.Params == nil || - len(fn.Type.Params.List) != 1 || - len(fn.Type.Params.List[0].Names) > 1 { - return false - } - ptr, ok := fn.Type.Params.List[0].Type.(*ast.StarExpr) - if !ok { - return false - } - // We can't easily check that the type is *testing.M - // because we don't know how testing has been imported, - // but at least check that it's *M or *something.M. - if name, ok := ptr.X.(*ast.Ident); ok && name.Name == "M" { - return true - } - if sel, ok := ptr.X.(*ast.SelectorExpr); ok && sel.Sel.Name == "M" { - return true - } - return false -} - -// isTest tells whether name looks like a test (or benchmark, according to prefix). -// It is a Test (say) if there is a character after Test that is not a lower-case letter. -// We don't want TesticularCancer. -func isTest(name, prefix string) bool { - if !strings.HasPrefix(name, prefix) { - return false - } - if len(name) == len(prefix) { // "Test" is ok - return true - } - rune, _ := utf8.DecodeRuneInString(name[len(prefix):]) - return !unicode.IsLower(rune) -} - -var testmainTmpl = template.Must(template.New("main").Parse(` -package main - -import ( -{{if not .TestMain}} - "os" -{{end}} - "testing" - "testing/internal/testdeps" - -{{if .ImportTest}} - {{if .NeedTest}}_test{{else}}_{{end}} {{.Package.ImportPath | printf "%q"}} -{{end}} -{{if .ImportXtest}} - {{if .NeedXtest}}_xtest{{else}}_{{end}} {{.Package.ImportPath | printf "%s_test" | printf "%q"}} -{{end}} -) - -var tests = []testing.InternalTest{ -{{range .Tests}} - {"{{.Name}}", {{.Package}}.{{.Name}}}, -{{end}} -} - -var benchmarks = []testing.InternalBenchmark{ -{{range .Benchmarks}} - {"{{.Name}}", {{.Package}}.{{.Name}}}, -{{end}} -} - -var examples = []testing.InternalExample{ -{{range .Examples}} - {"{{.Name}}", {{.Package}}.{{.Name}}, {{.Output | printf "%q"}}, {{.Unordered}}}, -{{end}} -} - -func main() { - m := testing.MainStart(testdeps.TestDeps{}, tests, benchmarks, examples) -{{with .TestMain}} - {{.Package}}.{{.Name}}(m) -{{else}} - os.Exit(m.Run()) -{{end}} -} - -`)) diff --git a/vendor/github.com/gopherjs/jquery/jquery.go b/vendor/github.com/gopherjs/jquery/jquery.go index 8cb6ee5f8..37c3c51e0 100644 --- a/vendor/github.com/gopherjs/jquery/jquery.go +++ b/vendor/github.com/gopherjs/jquery/jquery.go @@ -69,6 +69,8 @@ type Event struct { Which int `js:"which"` Namespace string `js:"namespace"` MetaKey bool `js:"metaKey"` + ShiftKey bool `js:"shiftKey"` + CtrlKey bool `js:"ctrlKey"` PageX int `js:"pageX"` PageY int `js:"pageY"` Type string `js:"type"` @@ -209,7 +211,7 @@ func (j JQuery) Each(fn func(int, interface{})) JQuery { } func (j JQuery) Call(name string, args ...interface{}) JQuery { - return NewJQuery( j.o.Call(name, args...) ) + return NewJQuery(j.o.Call(name, args...)) } func (j JQuery) Underlying() *js.Object { @@ -419,13 +421,13 @@ func (j JQuery) InsertBefore(i interface{}) JQuery { return j } -func (j JQuery) Show() JQuery { - j.o = j.o.Call("show") +func (j JQuery) Show(i ...interface{}) JQuery { + j.o = j.o.Call("show", i...) return j } -func (j JQuery) Hide() JQuery { - j.o.Call("hide") +func (j JQuery) Hide(i ...interface{}) JQuery { + j.o.Call("hide", i...) return j } @@ -500,6 +502,10 @@ func (j JQuery) SetWidth(i interface{}) JQuery { return j } +func (j JQuery) Index(i interface{}) int { + return j.o.Call("index", i).Int() +} + func (j JQuery) InnerHeight() int { return j.o.Call("innerHeight").Int() } diff --git a/vendor/github.com/gopherjs/jsbuiltin/LICENSE b/vendor/github.com/gopherjs/jsbuiltin/LICENSE deleted file mode 100644 index 1eebfb119..000000000 --- a/vendor/github.com/gopherjs/jsbuiltin/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2015 Richard Musiol. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/gopherjs/jsbuiltin/README.md b/vendor/github.com/gopherjs/jsbuiltin/README.md deleted file mode 100644 index c107ae4f3..000000000 --- a/vendor/github.com/gopherjs/jsbuiltin/README.md +++ /dev/null @@ -1,103 +0,0 @@ -[![Build Status](https://api.travis-ci.org/gopherjs/jsbuiltin.svg?branch=master)](https://travis-ci.org/gopherjs/jsbuiltin) [![GoDoc](https://godoc.org/github.com/gopherjs/jsbuiltin?status.png)](http://godoc.org/github.com/gopherjs/jsbuiltin) - -jsbuiltin - Built-in JavaScript functions for GopherJS ------------------------------------------------------- - -JavaScript has a small number of [built-in -functions](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects) -to handle some common day-to-day tasks. This package providers wrappers around -some of these functions for use in GopherJS. - -It is worth noting that in many cases, using Go's equivalent functionality -(such as that found in the [net/url](https://golang.org/pkg/net/url/) package) -may be preferable to using this package, and will be a necessity any time you -wish to share functionality between front-end and back-end code. - -### What is supported? -Not all JavaScript built-in functions make sense or are useful in a Go -environment. The table below shows each of the JavaScript built-in functions, -and its current state in this package. - -| Name | Supported | Comment | -|----------------------|-----------|-----------------------------| -| eval() | -- | | -| uneval() | -- | | -| isFinite() | yes | | -| isNaN() | yes | | -| parseFloat() | TODO? | See note below | -| parseInt() | TODO? | See note below | -| decodeURI() | yes | | -| decodeURIComponent() | yes | | -| encodeURI() | yes | | -| encodeURIComponent() | yes | | -| escape() | -- | deprecated circa 2000 | -| Number() | -- | See note below | -| String() | -- | Use js.Object.String() | -| unescape() | -- | deprecated circa 2000 | -| typeof operator | yes | | -| instanceof operator | yes | | - -#### Notes on unmplemented functions - -* **eval()**: Is there ever a need to eval JS code from within Go? -* **Number()**: This requires handling a bunch of corner cases which don't - normally exist in a strictly typed language such as Go. It seems that anyone - with a legitimate need for this function probably needs to write their own - wrapper to handle the cases that matter to them. -* **parseInt()** and **parseFloat()**: These could be added, but doing so - will require answering some questions about the interfce. JavaScript has - effectively two relevant data types (int and float) where Go has has 12. - Deciding how to map JS's `parseInt()` to Go's `(u?)int(8|16|32|64)` types, - and JS's `parseFloat()` Go's `float(32|64)` or `complex(64|128)` needs to - be considered, as well as how to handle error cases (Go doesn't have a `NaN` - type, so any `NaN` result probably needs to be converted to a proper Go - error). If this matters to you, comments and/or PRs are welcome. - -### Installation and Usage -Get or update this package and dependencies with: - -``` -go get -u -d -tags=js github.com/gopherjs/jsbuiltin -``` - -### Basic usage example - -This is a modified version of the Pet example in the main GopherJS documentation, -to accept and return URI-encoded pet names using the jsbuiltin package. - -```go -package main - -import ( - "github.com/gopherjs/gopherjs/js" - "github.com/gopherjs/jsbuiltin" -) - -func main() { - js.Global.Set("pet", map[string]interface{}{ - "New": New, - }) -} - -type Pet struct { - name string -} - -func New(name string) *js.Object { - return js.MakeWrapper(&Pet{name}) -} - -func (p *Pet) Name() string { - return jsbuiltin.EncodeURIComponent(p.name) -} - -func (p *Pet) SetName(uriComponent string) error { - name, err := jsbuiltin.DecodeURIComponent(uriComponent) - if err != nil { - // Malformed UTF8 in uriComponent - return err - } - p.name = name - return nil -} -``` diff --git a/vendor/github.com/gopherjs/jsbuiltin/jsbuiltin.go b/vendor/github.com/gopherjs/jsbuiltin/jsbuiltin.go deleted file mode 100755 index cddb4d8d3..000000000 --- a/vendor/github.com/gopherjs/jsbuiltin/jsbuiltin.go +++ /dev/null @@ -1,98 +0,0 @@ -// Package jsbuiltin provides minimal wrappers around some JavasScript -// built-in functions. -package jsbuiltin - -import ( - "errors" - - "github.com/gopherjs/gopherjs/js" -) - -// DecodeURI decodes a Uniform Resource Identifier (URI) previously created -// by EncodeURI() or by a similar routine. If the underlying JavaScript -// function throws an error, it is returned as an error. -func DecodeURI(uri string) (raw string, err error) { - defer func() { - if r := recover(); r != nil { - err = r.(*js.Error) - } - }() - raw = js.Global.Call("decodeURI", uri).String() - return -} - -// EncodeURI encodes a Uniform Resource Identifier (URI) by replacing each -// instance of certain characters by one, two, three, or four escape sequences -// representing the UTF-8 encoding of the character (will only be four escape -// sequences for characters composed of two "surrogate" characters). -func EncodeURI(uri string) string { - return js.Global.Call("encodeURI", uri).String() -} - -// EncodeURIComponent encodes a Uniform Resource Identifier (URI) component -// by replacing each instance of certain characters by one, two, three, or -// four escape sequences representing the UTF-8 encoding of the character -// (will only be four escape sequences for characters composed of two -// "surrogate" characters). -func EncodeURIComponent(uri string) string { - return js.Global.Call("encodeURIComponent", uri).String() -} - -// DecodeURIComponent decodes a Uniform Resource Identifier (URI) component -// previously created by EncodeURIComponent() or by a similar routine. If the -// underlying JavaScript function throws an error, it is returned as an error. -func DecodeURIComponent(uri string) (raw string, err error) { - defer func() { - if r := recover(); r != nil { - err = r.(*js.Error) - } - }() - raw = js.Global.Call("decodeURIComponent", uri).String() - return -} - -// IsFinite determines whether the passed value is a finite number, and returns -// true if it is. If needed, the parameter is first converted to a number. -func IsFinite(value interface{}) bool { - return js.Global.Call("isFinite", value).Bool() -} - -// IsNaN determines whether a value is NaN (Not-a-Number) or not. A return -// value of true indicates the input value is considered NaN by JavaScript. -func IsNaN(value interface{}) bool { - return js.Global.Call("isNaN", value).Bool() -} - -// Type constants represent the JavaScript builtin types, which may be returned -// by TypeOf(). -const ( - TypeUndefined = "undefined" - TypeNull = "null" - TypeObject = "object" - TypeBoolean = "boolean" - TypeNumber = "number" - TypeString = "string" - TypeFunction = "function" - TypeSymbol = "symbol" -) - -// TypeOf returns the JavaScript type of the passed value -func TypeOf(value interface{}) string { - return js.Global.Get("$jsbuiltin$").Call("typeoffunc", value).String() -} - -// InstanceOf returns true if value is an instance of object according to the -// built-in 'instanceof' operator. `object` must be a *js.Object representing -// a javascript constructor function. -func InstanceOf(value interface{}, object *js.Object) bool { - return js.Global.Get("$jsbuiltin$").Call("instanceoffunc", value, object).Bool() -} - -// In returns true if key is a member of obj. An error is returned if obj is not -// a JavaScript object. -func In(key string, obj *js.Object) (ok bool, err error) { - if obj == nil || obj == js.Undefined || TypeOf(obj) != TypeObject { - return false, errors.New("obj not a JavaScript object") - } - return js.Global.Get("$jsbuiltin$").Call("infunc", key, obj).Bool(), nil -} diff --git a/vendor/github.com/gopherjs/jsbuiltin/jsbuiltin.inc.js b/vendor/github.com/gopherjs/jsbuiltin/jsbuiltin.inc.js deleted file mode 100755 index be5061994..000000000 --- a/vendor/github.com/gopherjs/jsbuiltin/jsbuiltin.inc.js +++ /dev/null @@ -1,5 +0,0 @@ -$global.$jsbuiltin$ = { - typeoffunc: function(x) { return typeof x }, - instanceoffunc: function(x,y) { return x instanceof y }, - infunc: function(x,y) { return x in y } -} diff --git a/vendor/github.com/lib/pq/oid/gen.go b/vendor/github.com/lib/pq/oid/gen.go deleted file mode 100644 index 7c634cdc5..000000000 --- a/vendor/github.com/lib/pq/oid/gen.go +++ /dev/null @@ -1,93 +0,0 @@ -// +build ignore - -// Generate the table of OID values -// Run with 'go run gen.go'. -package main - -import ( - "database/sql" - "fmt" - "log" - "os" - "os/exec" - "strings" - - _ "github.com/lib/pq" -) - -// OID represent a postgres Object Identifier Type. -type OID struct { - ID int - Type string -} - -// Name returns an upper case version of the oid type. -func (o OID) Name() string { - return strings.ToUpper(o.Type) -} - -func main() { - datname := os.Getenv("PGDATABASE") - sslmode := os.Getenv("PGSSLMODE") - - if datname == "" { - os.Setenv("PGDATABASE", "pqgotest") - } - - if sslmode == "" { - os.Setenv("PGSSLMODE", "disable") - } - - db, err := sql.Open("postgres", "") - if err != nil { - log.Fatal(err) - } - rows, err := db.Query(` - SELECT typname, oid - FROM pg_type WHERE oid < 10000 - ORDER BY oid; - `) - if err != nil { - log.Fatal(err) - } - oids := make([]*OID, 0) - for rows.Next() { - var oid OID - if err = rows.Scan(&oid.Type, &oid.ID); err != nil { - log.Fatal(err) - } - oids = append(oids, &oid) - } - if err = rows.Err(); err != nil { - log.Fatal(err) - } - cmd := exec.Command("gofmt") - cmd.Stderr = os.Stderr - w, err := cmd.StdinPipe() - if err != nil { - log.Fatal(err) - } - f, err := os.Create("types.go") - if err != nil { - log.Fatal(err) - } - cmd.Stdout = f - err = cmd.Start() - if err != nil { - log.Fatal(err) - } - fmt.Fprintln(w, "// Code generated by gen.go. DO NOT EDIT.") - fmt.Fprintln(w, "\npackage oid") - fmt.Fprintln(w, "const (") - for _, oid := range oids { - fmt.Fprintf(w, "T_%s Oid = %d\n", oid.Type, oid.ID) - } - fmt.Fprintln(w, ")") - fmt.Fprintln(w, "var TypeName = map[Oid]string{") - for _, oid := range oids { - fmt.Fprintf(w, "T_%s: \"%s\",\n", oid.Type, oid.Name()) - } - fmt.Fprintln(w, "}") - w.Close() - cmd.Wait() -} diff --git a/vendor/github.com/miekg/dns/msg_generate.go b/vendor/github.com/miekg/dns/msg_generate.go deleted file mode 100644 index 35786f22c..000000000 --- a/vendor/github.com/miekg/dns/msg_generate.go +++ /dev/null @@ -1,340 +0,0 @@ -//+build ignore - -// msg_generate.go is meant to run with go generate. It will use -// go/{importer,types} to track down all the RR struct types. Then for each type -// it will generate pack/unpack methods based on the struct tags. The generated source is -// written to zmsg.go, and is meant to be checked into git. -package main - -import ( - "bytes" - "fmt" - "go/format" - "go/importer" - "go/types" - "log" - "os" - "strings" -) - -var packageHdr = ` -// *** DO NOT MODIFY *** -// AUTOGENERATED BY go generate from msg_generate.go - -package dns - -` - -// getTypeStruct will take a type and the package scope, and return the -// (innermost) struct if the type is considered a RR type (currently defined as -// those structs beginning with a RR_Header, could be redefined as implementing -// the RR interface). The bool return value indicates if embedded structs were -// resolved. -func getTypeStruct(t types.Type, scope *types.Scope) (*types.Struct, bool) { - st, ok := t.Underlying().(*types.Struct) - if !ok { - return nil, false - } - if st.Field(0).Type() == scope.Lookup("RR_Header").Type() { - return st, false - } - if st.Field(0).Anonymous() { - st, _ := getTypeStruct(st.Field(0).Type(), scope) - return st, true - } - return nil, false -} - -func main() { - // Import and type-check the package - pkg, err := importer.Default().Import("github.com/miekg/dns") - fatalIfErr(err) - scope := pkg.Scope() - - // Collect actual types (*X) - var namedTypes []string - for _, name := range scope.Names() { - o := scope.Lookup(name) - if o == nil || !o.Exported() { - continue - } - if st, _ := getTypeStruct(o.Type(), scope); st == nil { - continue - } - if name == "PrivateRR" { - continue - } - - // Check if corresponding TypeX exists - if scope.Lookup("Type"+o.Name()) == nil && o.Name() != "RFC3597" { - log.Fatalf("Constant Type%s does not exist.", o.Name()) - } - - namedTypes = append(namedTypes, o.Name()) - } - - b := &bytes.Buffer{} - b.WriteString(packageHdr) - - fmt.Fprint(b, "// pack*() functions\n\n") - for _, name := range namedTypes { - o := scope.Lookup(name) - st, _ := getTypeStruct(o.Type(), scope) - - fmt.Fprintf(b, "func (rr *%s) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) {\n", name) - fmt.Fprint(b, `off, err := rr.Hdr.pack(msg, off, compression, compress) -if err != nil { - return off, err -} -headerEnd := off -`) - for i := 1; i < st.NumFields(); i++ { - o := func(s string) { - fmt.Fprintf(b, s, st.Field(i).Name()) - fmt.Fprint(b, `if err != nil { -return off, err -} -`) - } - - if _, ok := st.Field(i).Type().(*types.Slice); ok { - switch st.Tag(i) { - case `dns:"-"`: // ignored - case `dns:"txt"`: - o("off, err = packStringTxt(rr.%s, msg, off)\n") - case `dns:"opt"`: - o("off, err = packDataOpt(rr.%s, msg, off)\n") - case `dns:"nsec"`: - o("off, err = packDataNsec(rr.%s, msg, off)\n") - case `dns:"domain-name"`: - o("off, err = packDataDomainNames(rr.%s, msg, off, compression, compress)\n") - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - continue - } - - switch { - case st.Tag(i) == `dns:"-"`: // ignored - case st.Tag(i) == `dns:"cdomain-name"`: - fallthrough - case st.Tag(i) == `dns:"domain-name"`: - o("off, err = PackDomainName(rr.%s, msg, off, compression, compress)\n") - case st.Tag(i) == `dns:"a"`: - o("off, err = packDataA(rr.%s, msg, off)\n") - case st.Tag(i) == `dns:"aaaa"`: - o("off, err = packDataAAAA(rr.%s, msg, off)\n") - case st.Tag(i) == `dns:"uint48"`: - o("off, err = packUint48(rr.%s, msg, off)\n") - case st.Tag(i) == `dns:"txt"`: - o("off, err = packString(rr.%s, msg, off)\n") - - case strings.HasPrefix(st.Tag(i), `dns:"size-base32`): // size-base32 can be packed just like base32 - fallthrough - case st.Tag(i) == `dns:"base32"`: - o("off, err = packStringBase32(rr.%s, msg, off)\n") - - case strings.HasPrefix(st.Tag(i), `dns:"size-base64`): // size-base64 can be packed just like base64 - fallthrough - case st.Tag(i) == `dns:"base64"`: - o("off, err = packStringBase64(rr.%s, msg, off)\n") - - case strings.HasPrefix(st.Tag(i), `dns:"size-hex:SaltLength`): // Hack to fix empty salt length for NSEC3 - o("if rr.%s == \"-\" { /* do nothing, empty salt */ }\n") - continue - case strings.HasPrefix(st.Tag(i), `dns:"size-hex`): // size-hex can be packed just like hex - fallthrough - case st.Tag(i) == `dns:"hex"`: - o("off, err = packStringHex(rr.%s, msg, off)\n") - - case st.Tag(i) == `dns:"octet"`: - o("off, err = packStringOctet(rr.%s, msg, off)\n") - case st.Tag(i) == "": - switch st.Field(i).Type().(*types.Basic).Kind() { - case types.Uint8: - o("off, err = packUint8(rr.%s, msg, off)\n") - case types.Uint16: - o("off, err = packUint16(rr.%s, msg, off)\n") - case types.Uint32: - o("off, err = packUint32(rr.%s, msg, off)\n") - case types.Uint64: - o("off, err = packUint64(rr.%s, msg, off)\n") - case types.String: - o("off, err = packString(rr.%s, msg, off)\n") - default: - log.Fatalln(name, st.Field(i).Name()) - } - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - } - // We have packed everything, only now we know the rdlength of this RR - fmt.Fprintln(b, "rr.Header().Rdlength = uint16(off-headerEnd)") - fmt.Fprintln(b, "return off, nil }\n") - } - - fmt.Fprint(b, "// unpack*() functions\n\n") - for _, name := range namedTypes { - o := scope.Lookup(name) - st, _ := getTypeStruct(o.Type(), scope) - - fmt.Fprintf(b, "func unpack%s(h RR_Header, msg []byte, off int) (RR, int, error) {\n", name) - fmt.Fprintf(b, "rr := new(%s)\n", name) - fmt.Fprint(b, "rr.Hdr = h\n") - fmt.Fprint(b, `if noRdata(h) { -return rr, off, nil - } -var err error -rdStart := off -_ = rdStart - -`) - for i := 1; i < st.NumFields(); i++ { - o := func(s string) { - fmt.Fprintf(b, s, st.Field(i).Name()) - fmt.Fprint(b, `if err != nil { -return rr, off, err -} -`) - } - - // size-* are special, because they reference a struct member we should use for the length. - if strings.HasPrefix(st.Tag(i), `dns:"size-`) { - structMember := structMember(st.Tag(i)) - structTag := structTag(st.Tag(i)) - switch structTag { - case "hex": - fmt.Fprintf(b, "rr.%s, off, err = unpackStringHex(msg, off, off + int(rr.%s))\n", st.Field(i).Name(), structMember) - case "base32": - fmt.Fprintf(b, "rr.%s, off, err = unpackStringBase32(msg, off, off + int(rr.%s))\n", st.Field(i).Name(), structMember) - case "base64": - fmt.Fprintf(b, "rr.%s, off, err = unpackStringBase64(msg, off, off + int(rr.%s))\n", st.Field(i).Name(), structMember) - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - fmt.Fprint(b, `if err != nil { -return rr, off, err -} -`) - continue - } - - if _, ok := st.Field(i).Type().(*types.Slice); ok { - switch st.Tag(i) { - case `dns:"-"`: // ignored - case `dns:"txt"`: - o("rr.%s, off, err = unpackStringTxt(msg, off)\n") - case `dns:"opt"`: - o("rr.%s, off, err = unpackDataOpt(msg, off)\n") - case `dns:"nsec"`: - o("rr.%s, off, err = unpackDataNsec(msg, off)\n") - case `dns:"domain-name"`: - o("rr.%s, off, err = unpackDataDomainNames(msg, off, rdStart + int(rr.Hdr.Rdlength))\n") - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - continue - } - - switch st.Tag(i) { - case `dns:"-"`: // ignored - case `dns:"cdomain-name"`: - fallthrough - case `dns:"domain-name"`: - o("rr.%s, off, err = UnpackDomainName(msg, off)\n") - case `dns:"a"`: - o("rr.%s, off, err = unpackDataA(msg, off)\n") - case `dns:"aaaa"`: - o("rr.%s, off, err = unpackDataAAAA(msg, off)\n") - case `dns:"uint48"`: - o("rr.%s, off, err = unpackUint48(msg, off)\n") - case `dns:"txt"`: - o("rr.%s, off, err = unpackString(msg, off)\n") - case `dns:"base32"`: - o("rr.%s, off, err = unpackStringBase32(msg, off, rdStart + int(rr.Hdr.Rdlength))\n") - case `dns:"base64"`: - o("rr.%s, off, err = unpackStringBase64(msg, off, rdStart + int(rr.Hdr.Rdlength))\n") - case `dns:"hex"`: - o("rr.%s, off, err = unpackStringHex(msg, off, rdStart + int(rr.Hdr.Rdlength))\n") - case `dns:"octet"`: - o("rr.%s, off, err = unpackStringOctet(msg, off)\n") - case "": - switch st.Field(i).Type().(*types.Basic).Kind() { - case types.Uint8: - o("rr.%s, off, err = unpackUint8(msg, off)\n") - case types.Uint16: - o("rr.%s, off, err = unpackUint16(msg, off)\n") - case types.Uint32: - o("rr.%s, off, err = unpackUint32(msg, off)\n") - case types.Uint64: - o("rr.%s, off, err = unpackUint64(msg, off)\n") - case types.String: - o("rr.%s, off, err = unpackString(msg, off)\n") - default: - log.Fatalln(name, st.Field(i).Name()) - } - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - // If we've hit len(msg) we return without error. - if i < st.NumFields()-1 { - fmt.Fprintf(b, `if off == len(msg) { -return rr, off, nil - } -`) - } - } - fmt.Fprintf(b, "return rr, off, err }\n\n") - } - // Generate typeToUnpack map - fmt.Fprintln(b, "var typeToUnpack = map[uint16]func(RR_Header, []byte, int) (RR, int, error){") - for _, name := range namedTypes { - if name == "RFC3597" { - continue - } - fmt.Fprintf(b, "Type%s: unpack%s,\n", name, name) - } - fmt.Fprintln(b, "}\n") - - // gofmt - res, err := format.Source(b.Bytes()) - if err != nil { - b.WriteTo(os.Stderr) - log.Fatal(err) - } - - // write result - f, err := os.Create("zmsg.go") - fatalIfErr(err) - defer f.Close() - f.Write(res) -} - -// structMember will take a tag like dns:"size-base32:SaltLength" and return the last part of this string. -func structMember(s string) string { - fields := strings.Split(s, ":") - if len(fields) == 0 { - return "" - } - f := fields[len(fields)-1] - // f should have a closing " - if len(f) > 1 { - return f[:len(f)-1] - } - return f -} - -// structTag will take a tag like dns:"size-base32:SaltLength" and return base32. -func structTag(s string) string { - fields := strings.Split(s, ":") - if len(fields) < 2 { - return "" - } - return fields[1][len("\"size-"):] -} - -func fatalIfErr(err error) { - if err != nil { - log.Fatal(err) - } -} diff --git a/vendor/github.com/miekg/dns/types_generate.go b/vendor/github.com/miekg/dns/types_generate.go deleted file mode 100644 index bf80da329..000000000 --- a/vendor/github.com/miekg/dns/types_generate.go +++ /dev/null @@ -1,271 +0,0 @@ -//+build ignore - -// types_generate.go is meant to run with go generate. It will use -// go/{importer,types} to track down all the RR struct types. Then for each type -// it will generate conversion tables (TypeToRR and TypeToString) and banal -// methods (len, Header, copy) based on the struct tags. The generated source is -// written to ztypes.go, and is meant to be checked into git. -package main - -import ( - "bytes" - "fmt" - "go/format" - "go/importer" - "go/types" - "log" - "os" - "strings" - "text/template" -) - -var skipLen = map[string]struct{}{ - "NSEC": {}, - "NSEC3": {}, - "OPT": {}, -} - -var packageHdr = ` -// *** DO NOT MODIFY *** -// AUTOGENERATED BY go generate from type_generate.go - -package dns - -import ( - "encoding/base64" - "net" -) - -` - -var TypeToRR = template.Must(template.New("TypeToRR").Parse(` -// TypeToRR is a map of constructors for each RR type. -var TypeToRR = map[uint16]func() RR{ -{{range .}}{{if ne . "RFC3597"}} Type{{.}}: func() RR { return new({{.}}) }, -{{end}}{{end}} } - -`)) - -var typeToString = template.Must(template.New("typeToString").Parse(` -// TypeToString is a map of strings for each RR type. -var TypeToString = map[uint16]string{ -{{range .}}{{if ne . "NSAPPTR"}} Type{{.}}: "{{.}}", -{{end}}{{end}} TypeNSAPPTR: "NSAP-PTR", -} - -`)) - -var headerFunc = template.Must(template.New("headerFunc").Parse(` -// Header() functions -{{range .}} func (rr *{{.}}) Header() *RR_Header { return &rr.Hdr } -{{end}} - -`)) - -// getTypeStruct will take a type and the package scope, and return the -// (innermost) struct if the type is considered a RR type (currently defined as -// those structs beginning with a RR_Header, could be redefined as implementing -// the RR interface). The bool return value indicates if embedded structs were -// resolved. -func getTypeStruct(t types.Type, scope *types.Scope) (*types.Struct, bool) { - st, ok := t.Underlying().(*types.Struct) - if !ok { - return nil, false - } - if st.Field(0).Type() == scope.Lookup("RR_Header").Type() { - return st, false - } - if st.Field(0).Anonymous() { - st, _ := getTypeStruct(st.Field(0).Type(), scope) - return st, true - } - return nil, false -} - -func main() { - // Import and type-check the package - pkg, err := importer.Default().Import("github.com/miekg/dns") - fatalIfErr(err) - scope := pkg.Scope() - - // Collect constants like TypeX - var numberedTypes []string - for _, name := range scope.Names() { - o := scope.Lookup(name) - if o == nil || !o.Exported() { - continue - } - b, ok := o.Type().(*types.Basic) - if !ok || b.Kind() != types.Uint16 { - continue - } - if !strings.HasPrefix(o.Name(), "Type") { - continue - } - name := strings.TrimPrefix(o.Name(), "Type") - if name == "PrivateRR" { - continue - } - numberedTypes = append(numberedTypes, name) - } - - // Collect actual types (*X) - var namedTypes []string - for _, name := range scope.Names() { - o := scope.Lookup(name) - if o == nil || !o.Exported() { - continue - } - if st, _ := getTypeStruct(o.Type(), scope); st == nil { - continue - } - if name == "PrivateRR" { - continue - } - - // Check if corresponding TypeX exists - if scope.Lookup("Type"+o.Name()) == nil && o.Name() != "RFC3597" { - log.Fatalf("Constant Type%s does not exist.", o.Name()) - } - - namedTypes = append(namedTypes, o.Name()) - } - - b := &bytes.Buffer{} - b.WriteString(packageHdr) - - // Generate TypeToRR - fatalIfErr(TypeToRR.Execute(b, namedTypes)) - - // Generate typeToString - fatalIfErr(typeToString.Execute(b, numberedTypes)) - - // Generate headerFunc - fatalIfErr(headerFunc.Execute(b, namedTypes)) - - // Generate len() - fmt.Fprint(b, "// len() functions\n") - for _, name := range namedTypes { - if _, ok := skipLen[name]; ok { - continue - } - o := scope.Lookup(name) - st, isEmbedded := getTypeStruct(o.Type(), scope) - if isEmbedded { - continue - } - fmt.Fprintf(b, "func (rr *%s) len() int {\n", name) - fmt.Fprintf(b, "l := rr.Hdr.len()\n") - for i := 1; i < st.NumFields(); i++ { - o := func(s string) { fmt.Fprintf(b, s, st.Field(i).Name()) } - - if _, ok := st.Field(i).Type().(*types.Slice); ok { - switch st.Tag(i) { - case `dns:"-"`: - // ignored - case `dns:"cdomain-name"`, `dns:"domain-name"`, `dns:"txt"`: - o("for _, x := range rr.%s { l += len(x) + 1 }\n") - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - continue - } - - switch { - case st.Tag(i) == `dns:"-"`: - // ignored - case st.Tag(i) == `dns:"cdomain-name"`, st.Tag(i) == `dns:"domain-name"`: - o("l += len(rr.%s) + 1\n") - case st.Tag(i) == `dns:"octet"`: - o("l += len(rr.%s)\n") - case strings.HasPrefix(st.Tag(i), `dns:"size-base64`): - fallthrough - case st.Tag(i) == `dns:"base64"`: - o("l += base64.StdEncoding.DecodedLen(len(rr.%s))\n") - case strings.HasPrefix(st.Tag(i), `dns:"size-hex`): - fallthrough - case st.Tag(i) == `dns:"hex"`: - o("l += len(rr.%s)/2 + 1\n") - case st.Tag(i) == `dns:"a"`: - o("l += net.IPv4len // %s\n") - case st.Tag(i) == `dns:"aaaa"`: - o("l += net.IPv6len // %s\n") - case st.Tag(i) == `dns:"txt"`: - o("for _, t := range rr.%s { l += len(t) + 1 }\n") - case st.Tag(i) == `dns:"uint48"`: - o("l += 6 // %s\n") - case st.Tag(i) == "": - switch st.Field(i).Type().(*types.Basic).Kind() { - case types.Uint8: - o("l += 1 // %s\n") - case types.Uint16: - o("l += 2 // %s\n") - case types.Uint32: - o("l += 4 // %s\n") - case types.Uint64: - o("l += 8 // %s\n") - case types.String: - o("l += len(rr.%s) + 1\n") - default: - log.Fatalln(name, st.Field(i).Name()) - } - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - } - fmt.Fprintf(b, "return l }\n") - } - - // Generate copy() - fmt.Fprint(b, "// copy() functions\n") - for _, name := range namedTypes { - o := scope.Lookup(name) - st, isEmbedded := getTypeStruct(o.Type(), scope) - if isEmbedded { - continue - } - fmt.Fprintf(b, "func (rr *%s) copy() RR {\n", name) - fields := []string{"*rr.Hdr.copyHeader()"} - for i := 1; i < st.NumFields(); i++ { - f := st.Field(i).Name() - if sl, ok := st.Field(i).Type().(*types.Slice); ok { - t := sl.Underlying().String() - t = strings.TrimPrefix(t, "[]") - if strings.Contains(t, ".") { - splits := strings.Split(t, ".") - t = splits[len(splits)-1] - } - fmt.Fprintf(b, "%s := make([]%s, len(rr.%s)); copy(%s, rr.%s)\n", - f, t, f, f, f) - fields = append(fields, f) - continue - } - if st.Field(i).Type().String() == "net.IP" { - fields = append(fields, "copyIP(rr."+f+")") - continue - } - fields = append(fields, "rr."+f) - } - fmt.Fprintf(b, "return &%s{%s}\n", name, strings.Join(fields, ",")) - fmt.Fprintf(b, "}\n") - } - - // gofmt - res, err := format.Source(b.Bytes()) - if err != nil { - b.WriteTo(os.Stderr) - log.Fatal(err) - } - - // write result - f, err := os.Create("ztypes.go") - fatalIfErr(err) - defer f.Close() - f.Write(res) -} - -func fatalIfErr(err error) { - if err != nil { - log.Fatal(err) - } -} diff --git a/vendor/github.com/neelance/astrewrite/LICENSE b/vendor/github.com/neelance/astrewrite/LICENSE deleted file mode 100644 index ce7f487d2..000000000 --- a/vendor/github.com/neelance/astrewrite/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2016 Richard Musiol. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vendor/github.com/neelance/astrewrite/simplify.go b/vendor/github.com/neelance/astrewrite/simplify.go deleted file mode 100644 index a4fcc51ea..000000000 --- a/vendor/github.com/neelance/astrewrite/simplify.go +++ /dev/null @@ -1,835 +0,0 @@ -package astrewrite - -import ( - "fmt" - "go/ast" - "go/constant" - "go/token" - "go/types" -) - -type simplifyContext struct { - info *types.Info - varCounter int - simplifyCalls bool -} - -func Simplify(file *ast.File, info *types.Info, simplifyCalls bool) *ast.File { - c := &simplifyContext{info: info, simplifyCalls: simplifyCalls} - - decls := make([]ast.Decl, len(file.Decls)) - for i, decl := range file.Decls { - c.varCounter = 0 - switch decl := decl.(type) { - case *ast.GenDecl: - decls[i] = c.simplifyGenDecl(nil, decl) - - case *ast.FuncDecl: - decls[i] = &ast.FuncDecl{ - Doc: decl.Doc, - Recv: decl.Recv, - Name: decl.Name, - Type: decl.Type, - Body: c.simplifyBlock(decl.Body), - } - } - } - - newFile := &ast.File{ - Doc: file.Doc, - Package: file.Package, - Name: file.Name, - Decls: decls, - Scope: file.Scope, - Imports: file.Imports, - Unresolved: file.Unresolved, - Comments: file.Comments, - } - c.info.Scopes[newFile] = c.info.Scopes[file] - return newFile -} - -func (c *simplifyContext) simplifyStmtList(stmts []ast.Stmt) []ast.Stmt { - var newStmts []ast.Stmt - for _, s := range stmts { - c.simplifyStmt(&newStmts, s) - } - return newStmts -} - -func (c *simplifyContext) simplifyGenDecl(stmts *[]ast.Stmt, decl *ast.GenDecl) *ast.GenDecl { - if decl.Tok != token.VAR { - return decl - } - - specs := make([]ast.Spec, len(decl.Specs)) - for j, spec := range decl.Specs { - switch spec := spec.(type) { - case *ast.ValueSpec: - var values []ast.Expr - if spec.Values != nil { - values = make([]ast.Expr, len(spec.Values)) - for i, v := range spec.Values { - v2 := c.simplifyExpr(stmts, v) - for _, initializer := range c.info.InitOrder { - if initializer.Rhs == v { - initializer.Rhs = v2 - } - } - values[i] = v2 - } - } - specs[j] = &ast.ValueSpec{ - Doc: spec.Doc, - Names: spec.Names, - Type: spec.Type, - Values: values, - Comment: spec.Comment, - } - default: - specs[j] = spec - } - } - - return &ast.GenDecl{ - Doc: decl.Doc, - TokPos: decl.TokPos, - Tok: token.VAR, - Lparen: decl.Lparen, - Specs: specs, - Rparen: decl.Rparen, - } -} - -func (c *simplifyContext) simplifyStmt(stmts *[]ast.Stmt, s ast.Stmt) { - if s == nil { - return - } - - switch s := s.(type) { - case *ast.ExprStmt: - *stmts = append(*stmts, &ast.ExprStmt{ - X: c.simplifyExpr2(stmts, s.X, true), - }) - - case *ast.BlockStmt: - *stmts = append(*stmts, c.simplifyBlock(s)) - - case *ast.LabeledStmt: - c.simplifyStmt(stmts, s.Stmt) - (*stmts)[len(*stmts)-1] = &ast.LabeledStmt{ - Label: s.Label, - Colon: s.Colon, - Stmt: (*stmts)[len(*stmts)-1], - } - - case *ast.AssignStmt: - lhs := make([]ast.Expr, len(s.Lhs)) - for i, x := range s.Lhs { - lhs[i] = c.simplifyExpr(stmts, x) - } - rhs := make([]ast.Expr, len(s.Rhs)) - for i, x := range s.Rhs { - rhs[i] = c.simplifyExpr2(stmts, x, true) - } - *stmts = append(*stmts, &ast.AssignStmt{ - Lhs: lhs, - Tok: s.Tok, - TokPos: s.TokPos, - Rhs: rhs, - }) - - case *ast.DeclStmt: - *stmts = append(*stmts, &ast.DeclStmt{ - Decl: c.simplifyGenDecl(stmts, s.Decl.(*ast.GenDecl)), - }) - - case *ast.IfStmt: - if s.Init != nil { - block := &ast.BlockStmt{} - *stmts = append(*stmts, block) - stmts = &block.List - c.simplifyStmt(stmts, s.Init) - } - newS := &ast.IfStmt{ - If: s.If, - Cond: c.simplifyExpr(stmts, s.Cond), - Body: c.simplifyBlock(s.Body), - Else: c.toElseBranch(c.simplifyToStmtList(s.Else), c.info.Scopes[s.Else]), - } - c.info.Scopes[newS] = c.info.Scopes[s] - *stmts = append(*stmts, newS) - - case *ast.SwitchStmt: - c.simplifySwitch(stmts, s) - - case *ast.TypeSwitchStmt: - if s.Init != nil { - block := &ast.BlockStmt{} - *stmts = append(*stmts, block) - stmts = &block.List - c.simplifyStmt(stmts, s.Init) - } - var assign ast.Stmt - switch a := s.Assign.(type) { - case *ast.ExprStmt: - ta := a.X.(*ast.TypeAssertExpr) - assign = &ast.ExprStmt{ - X: &ast.TypeAssertExpr{ - X: c.simplifyExpr(stmts, ta.X), - Lparen: ta.Lparen, - Type: ta.Type, - Rparen: ta.Rparen, - }, - } - case *ast.AssignStmt: - ta := a.Rhs[0].(*ast.TypeAssertExpr) - assign = &ast.AssignStmt{ - Lhs: a.Lhs, - Tok: a.Tok, - TokPos: a.TokPos, - Rhs: []ast.Expr{ - &ast.TypeAssertExpr{ - X: c.simplifyExpr(stmts, ta.X), - Lparen: ta.Lparen, - Type: ta.Type, - Rparen: ta.Rparen, - }, - }, - } - default: - panic("unexpected type switch assign") - } - clauses := make([]ast.Stmt, len(s.Body.List)) - for i, ccs := range s.Body.List { - cc := ccs.(*ast.CaseClause) - newClause := &ast.CaseClause{ - Case: cc.Case, - List: cc.List, - Colon: cc.Colon, - Body: c.simplifyStmtList(cc.Body), - } - if implicit, ok := c.info.Implicits[cc]; ok { - c.info.Implicits[newClause] = implicit - } - clauses[i] = newClause - } - newS := &ast.TypeSwitchStmt{ - Switch: s.Switch, - Assign: assign, - Body: &ast.BlockStmt{ - List: clauses, - }, - } - c.info.Scopes[newS] = c.info.Scopes[s] - *stmts = append(*stmts, newS) - - case *ast.ForStmt: - newS := &ast.ForStmt{ - For: s.For, - Init: s.Init, - Cond: s.Cond, - Post: s.Post, - Body: c.simplifyBlock(s.Body), - } - c.info.Scopes[newS] = c.info.Scopes[s] - *stmts = append(*stmts, newS) - - // case *ast.ForStmt: - // c.simplifyStmt(stmts, s.Init) - // var condStmts []ast.Stmt - // cond := c.newVar(&condStmts, s.Cond) - // bodyStmts := s.Body.List - // if len(condStmts) != 0 { - // bodyStmts = append(append(condStmts, &ast.IfStmt{ - // Cond: &ast.UnaryExpr{ - // Op: token.NOT, - // X: cond, - // }, - // Body: &ast.BlockStmt{ - // List: []ast.Stmt{&ast.BranchStmt{ - // Tok: token.BREAK, - // }}, - // }, - // }), bodyStmts...) - // cond = nil - // } - // *stmts = append(*stmts, &ast.ForStmt{ - // For: s.For, - // Cond: cond, - // Post: s.Post, - // Body: &ast.BlockStmt{ - // List: bodyStmts, - // }, - // }) - - case *ast.RangeStmt: - var newS ast.Stmt - switch t := c.info.TypeOf(s.X).Underlying().(type) { - case *types.Chan: - key := s.Key - tok := s.Tok - if key == nil { - key = ast.NewIdent("_") - tok = token.DEFINE - } - okVar := c.newIdent(types.Typ[types.Bool]) - if s.Tok == token.ASSIGN { - *stmts = append(*stmts, &ast.DeclStmt{ - Decl: &ast.GenDecl{ - Tok: token.VAR, - Specs: []ast.Spec{&ast.ValueSpec{ - Names: []*ast.Ident{okVar}, - Type: ast.NewIdent("bool"), - }}, - }, - }) - } - newS = &ast.ForStmt{ - For: s.For, - Body: &ast.BlockStmt{ - Lbrace: s.Body.Lbrace, - List: append([]ast.Stmt{ - &ast.AssignStmt{ - Lhs: []ast.Expr{key, okVar}, - TokPos: s.TokPos, - Tok: tok, - Rhs: []ast.Expr{c.setType(&ast.UnaryExpr{ - Op: token.ARROW, - X: c.newVar(stmts, s.X), - }, types.NewTuple( - types.NewVar(token.NoPos, nil, "", t.Elem()), - types.NewVar(token.NoPos, nil, "", types.Typ[types.Bool]), - ))}, - }, - &ast.IfStmt{ - Cond: c.setType(&ast.UnaryExpr{ - Op: token.NOT, - X: okVar, - }, types.Typ[types.Bool]), - Body: &ast.BlockStmt{ - List: []ast.Stmt{ - &ast.BranchStmt{Tok: token.BREAK}, - }, - }, - }, - }, c.simplifyStmtList(s.Body.List)...), - Rbrace: s.Body.Rbrace, - }, - } - - default: - newS = &ast.RangeStmt{ - For: s.For, - Key: s.Key, - Value: s.Value, - TokPos: s.TokPos, - Tok: s.Tok, - X: s.X, - Body: c.simplifyBlock(s.Body), - } - } - c.info.Scopes[newS] = c.info.Scopes[s] - *stmts = append(*stmts, newS) - - case *ast.IncDecStmt: - *stmts = append(*stmts, &ast.IncDecStmt{ - X: c.simplifyExpr(stmts, s.X), - TokPos: s.TokPos, - Tok: s.Tok, - }) - - case *ast.GoStmt: - *stmts = append(*stmts, &ast.GoStmt{ - Go: s.Go, - Call: c.simplifyCall(stmts, s.Call), - }) - - case *ast.SelectStmt: - clauses := make([]ast.Stmt, len(s.Body.List)) - for i, entry := range s.Body.List { - cc := entry.(*ast.CommClause) - var newComm ast.Stmt - var bodyPrefix []ast.Stmt - switch comm := cc.Comm.(type) { - case *ast.ExprStmt: - recv := comm.X.(*ast.UnaryExpr) - if recv.Op != token.ARROW { - panic("unexpected comm clause") - } - newComm = &ast.ExprStmt{ - X: &ast.UnaryExpr{ - Op: token.ARROW, - OpPos: recv.OpPos, - X: c.simplifyExpr(stmts, recv.X), - }, - } - case *ast.AssignStmt: - recv := comm.Rhs[0].(*ast.UnaryExpr) - if recv.Op != token.ARROW { - panic("unexpected comm clause") - } - simplifyLhs := false - for _, x := range comm.Lhs { - if c.simplifyCalls && ContainsCall(x) { - simplifyLhs = true - } - } - lhs := comm.Lhs - tok := comm.Tok - if simplifyLhs { - for i, x := range lhs { - id := c.newIdent(c.info.TypeOf(x)) - bodyPrefix = append(bodyPrefix, simpleAssign(c.simplifyExpr(&bodyPrefix, x), comm.Tok, id)) - lhs[i] = id - } - tok = token.DEFINE - } - newComm = &ast.AssignStmt{ - Lhs: lhs, - Tok: tok, - Rhs: []ast.Expr{c.simplifyExpr(stmts, recv)}, - } - case *ast.SendStmt: - newComm = &ast.SendStmt{ - Chan: c.simplifyExpr(stmts, comm.Chan), - Arrow: comm.Arrow, - Value: c.simplifyExpr(stmts, comm.Value), - } - case nil: - newComm = nil - default: - panic("unexpected comm clause") - } - newCC := &ast.CommClause{ - Case: cc.Case, - Comm: newComm, - Colon: cc.Colon, - Body: append(bodyPrefix, c.simplifyStmtList(cc.Body)...), - } - c.info.Scopes[newCC] = c.info.Scopes[cc] - clauses[i] = newCC - } - *stmts = append(*stmts, &ast.SelectStmt{ - Select: s.Select, - Body: &ast.BlockStmt{ - List: clauses, - }, - }) - - case *ast.DeferStmt: - *stmts = append(*stmts, &ast.DeferStmt{ - Defer: s.Defer, - Call: c.simplifyCall(stmts, s.Call), - }) - - case *ast.SendStmt: - *stmts = append(*stmts, &ast.SendStmt{ - Chan: c.simplifyExpr(stmts, s.Chan), - Arrow: s.Arrow, - Value: c.simplifyExpr(stmts, s.Value), - }) - - case *ast.ReturnStmt: - *stmts = append(*stmts, &ast.ReturnStmt{ - Return: s.Return, - Results: c.simplifyExprList(stmts, s.Results), - }) - - default: - *stmts = append(*stmts, s) - } -} - -func (c *simplifyContext) simplifyBlock(s *ast.BlockStmt) *ast.BlockStmt { - if s == nil { - return nil - } - newS := &ast.BlockStmt{ - Lbrace: s.Lbrace, - List: c.simplifyStmtList(s.List), - Rbrace: s.Rbrace, - } - c.info.Scopes[newS] = c.info.Scopes[s] - return newS -} - -func (c *simplifyContext) simplifySwitch(stmts *[]ast.Stmt, s *ast.SwitchStmt) { - wrapClause := &ast.CaseClause{} - newS := &ast.SwitchStmt{ - Switch: s.Switch, - Body: &ast.BlockStmt{List: []ast.Stmt{wrapClause}}, - } - c.info.Scopes[newS] = c.info.Scopes[s] - c.info.Scopes[wrapClause] = c.info.Scopes[s] - *stmts = append(*stmts, newS) - stmts = &wrapClause.Body - - c.simplifyStmt(stmts, s.Init) - - nonDefaultClauses, defaultClause := c.simplifyCaseClauses(s.Body.List) - tag := c.makeTag(stmts, s.Tag, len(nonDefaultClauses) != 0) - *stmts = append(*stmts, unwrapBlock(c.switchToIfElse(tag, nonDefaultClauses, defaultClause))...) -} - -func (c *simplifyContext) makeTag(stmts *[]ast.Stmt, tag ast.Expr, needsTag bool) ast.Expr { - if tag == nil { - id := ast.NewIdent("true") - c.info.Types[id] = types.TypeAndValue{Type: types.Typ[types.Bool], Value: constant.MakeBool(true)} - return id - } - if !needsTag { - *stmts = append(*stmts, simpleAssign(ast.NewIdent("_"), token.ASSIGN, tag)) - return nil - } - return c.newVar(stmts, tag) -} - -func (c *simplifyContext) simplifyCaseClauses(clauses []ast.Stmt) (nonDefaultClauses []*ast.CaseClause, defaultClause *ast.CaseClause) { - var openClauses []*ast.CaseClause - for _, cc := range clauses { - clause := cc.(*ast.CaseClause) - newClause := &ast.CaseClause{ - Case: clause.Case, - List: clause.List, - Colon: clause.Colon, - } - c.info.Scopes[newClause] = c.info.Scopes[clause] - - body := clause.Body - hasFallthrough := false - if len(body) != 0 { - if b, isBranchStmt := body[len(body)-1].(*ast.BranchStmt); isBranchStmt && b.Tok == token.FALLTHROUGH { - body = body[:len(body)-1] - hasFallthrough = true - } - } - openClauses = append(openClauses, newClause) - for _, openClause := range openClauses { - openClause.Body = append(openClause.Body, body...) - } - if !hasFallthrough { - openClauses = nil - } - - if len(clause.List) == 0 { - defaultClause = newClause - continue - } - nonDefaultClauses = append(nonDefaultClauses, newClause) - } - return -} - -func (c *simplifyContext) switchToIfElse(tag ast.Expr, nonDefaultClauses []*ast.CaseClause, defaultClause *ast.CaseClause) ast.Stmt { - if len(nonDefaultClauses) == 0 { - if defaultClause != nil { - return c.toElseBranch(c.simplifyStmtList(defaultClause.Body), c.info.Scopes[defaultClause]) - } - return nil - } - - clause := nonDefaultClauses[0] - conds := make([]ast.Expr, len(clause.List)) - for i, cond := range clause.List { - conds[i] = c.setType(&ast.BinaryExpr{ - X: tag, - Op: token.EQL, - Y: c.setType(&ast.ParenExpr{X: cond}, c.info.TypeOf(cond)), - }, types.Typ[types.Bool]) - } - - var stmts []ast.Stmt - ifStmt := &ast.IfStmt{ - If: clause.Case, - Cond: c.simplifyExpr(&stmts, c.disjunction(conds)), - Body: &ast.BlockStmt{List: c.simplifyStmtList(clause.Body)}, - Else: c.switchToIfElse(tag, nonDefaultClauses[1:], defaultClause), - } - c.info.Scopes[ifStmt] = c.info.Scopes[clause] - stmts = append(stmts, ifStmt) - return c.toElseBranch(stmts, c.info.Scopes[clause]) -} - -func (c *simplifyContext) disjunction(conds []ast.Expr) ast.Expr { - if len(conds) == 1 { - return conds[0] - } - return c.setType(&ast.BinaryExpr{ - X: conds[0], - Op: token.LOR, - Y: c.disjunction(conds[1:]), - }, types.Typ[types.Bool]) -} - -func (c *simplifyContext) simplifyToStmtList(s ast.Stmt) (stmts []ast.Stmt) { - c.simplifyStmt(&stmts, s) - return -} - -func (c *simplifyContext) toElseBranch(stmts []ast.Stmt, scope *types.Scope) ast.Stmt { - if len(stmts) == 0 { - return nil - } - if len(stmts) == 1 { - switch stmt := stmts[0].(type) { - case *ast.IfStmt, *ast.BlockStmt: - c.info.Scopes[stmt] = scope - return stmt - } - } - block := &ast.BlockStmt{ - List: stmts, - } - c.info.Scopes[block] = scope - return block -} - -func unwrapBlock(s ast.Stmt) []ast.Stmt { - if s == nil { - return nil - } - if block, ok := s.(*ast.BlockStmt); ok { - return block.List - } - return []ast.Stmt{s} -} - -func (c *simplifyContext) simplifyExpr(stmts *[]ast.Stmt, x ast.Expr) ast.Expr { - return c.simplifyExpr2(stmts, x, false) -} - -func (c *simplifyContext) simplifyExpr2(stmts *[]ast.Stmt, x ast.Expr, callOK bool) ast.Expr { - x2 := c.simplifyExpr3(stmts, x, callOK) - if t, ok := c.info.Types[x]; ok { - c.info.Types[x2] = t - } - return x2 -} - -func (c *simplifyContext) simplifyExpr3(stmts *[]ast.Stmt, x ast.Expr, callOK bool) ast.Expr { - switch x := x.(type) { - case *ast.FuncLit: - return &ast.FuncLit{ - Type: x.Type, - Body: &ast.BlockStmt{ - List: c.simplifyStmtList(x.Body.List), - }, - } - - case *ast.CompositeLit: - elts := make([]ast.Expr, len(x.Elts)) - for i, elt := range x.Elts { - if kv, ok := elt.(*ast.KeyValueExpr); ok { - elts[i] = &ast.KeyValueExpr{ - Key: kv.Key, - Colon: kv.Colon, - Value: c.simplifyExpr(stmts, kv.Value), - } - continue - } - elts[i] = c.simplifyExpr(stmts, elt) - } - return &ast.CompositeLit{ - Type: x.Type, - Lbrace: x.Lbrace, - Elts: elts, - Rbrace: x.Rbrace, - } - - case *ast.ParenExpr: - return &ast.ParenExpr{ - Lparen: x.Lparen, - X: c.simplifyExpr(stmts, x.X), - Rparen: x.Rparen, - } - - case *ast.SelectorExpr: - selExpr := &ast.SelectorExpr{ - X: c.simplifyExpr(stmts, x.X), - Sel: x.Sel, - } - if sel, ok := c.info.Selections[x]; ok { - c.info.Selections[selExpr] = sel - } - return selExpr - - case *ast.IndexExpr: - return &ast.IndexExpr{ - X: c.simplifyExpr(stmts, x.X), - Lbrack: x.Lbrack, - Index: c.simplifyExpr(stmts, x.Index), - Rbrack: x.Rbrack, - } - - case *ast.SliceExpr: - return &ast.SliceExpr{ - X: c.simplifyExpr(stmts, x.X), - Lbrack: x.Lbrack, - Low: c.simplifyExpr(stmts, x.Low), - High: c.simplifyExpr(stmts, x.High), - Max: c.simplifyExpr(stmts, x.Max), - Slice3: x.Slice3, - Rbrack: x.Rbrack, - } - - case *ast.TypeAssertExpr: - return &ast.TypeAssertExpr{ - X: c.simplifyExpr(stmts, x.X), - Lparen: x.Lparen, - Type: x.Type, - Rparen: x.Rparen, - } - - case *ast.CallExpr: - call := c.simplifyCall(stmts, x) - if callOK || !c.simplifyCalls { - return call - } - return c.newVar(stmts, call) - - case *ast.StarExpr: - return &ast.StarExpr{ - Star: x.Star, - X: c.simplifyExpr(stmts, x.X), - } - - case *ast.UnaryExpr: - return &ast.UnaryExpr{ - OpPos: x.OpPos, - Op: x.Op, - X: c.simplifyExpr(stmts, x.X), - } - - case *ast.BinaryExpr: - if (x.Op == token.LAND || x.Op == token.LOR) && c.simplifyCalls && ContainsCall(x.Y) { - v := c.newVar(stmts, x.X) - cond := v - if x.Op == token.LOR { - cond = &ast.UnaryExpr{ - Op: token.NOT, - X: cond, - } - } - var ifBody []ast.Stmt - ifBody = append(ifBody, simpleAssign(v, token.ASSIGN, c.simplifyExpr2(&ifBody, x.Y, true))) - *stmts = append(*stmts, &ast.IfStmt{ - Cond: cond, - Body: &ast.BlockStmt{ - List: ifBody, - }, - }) - return v - } - return &ast.BinaryExpr{ - X: c.simplifyExpr(stmts, x.X), - OpPos: x.OpPos, - Op: x.Op, - Y: c.simplifyExpr(stmts, x.Y), - } - - default: - return x - } -} - -func (c *simplifyContext) simplifyCall(stmts *[]ast.Stmt, x *ast.CallExpr) *ast.CallExpr { - return &ast.CallExpr{ - Fun: c.simplifyExpr(stmts, x.Fun), - Lparen: x.Lparen, - Args: c.simplifyArgs(stmts, x.Args), - Ellipsis: x.Ellipsis, - Rparen: x.Rparen, - } -} - -func (c *simplifyContext) simplifyArgs(stmts *[]ast.Stmt, args []ast.Expr) []ast.Expr { - if len(args) == 1 { - if tuple, ok := c.info.TypeOf(args[0]).(*types.Tuple); ok && c.simplifyCalls { - call := c.simplifyExpr2(stmts, args[0], true) - vars := make([]ast.Expr, tuple.Len()) - for i := range vars { - vars[i] = c.newIdent(tuple.At(i).Type()) - } - *stmts = append(*stmts, &ast.AssignStmt{ - Lhs: vars, - Tok: token.DEFINE, - Rhs: []ast.Expr{call}, - }) - return vars - } - } - return c.simplifyExprList(stmts, args) -} - -func (c *simplifyContext) simplifyExprList(stmts *[]ast.Stmt, exprs []ast.Expr) []ast.Expr { - if exprs == nil { - return nil - } - simplifiedExprs := make([]ast.Expr, len(exprs)) - for i, expr := range exprs { - simplifiedExprs[i] = c.simplifyExpr(stmts, expr) - } - return simplifiedExprs -} - -func (c *simplifyContext) newVar(stmts *[]ast.Stmt, x ast.Expr) ast.Expr { - id := c.newIdent(c.info.TypeOf(x)) - *stmts = append(*stmts, simpleAssign(id, token.DEFINE, x)) - return id -} - -func (c *simplifyContext) newIdent(t types.Type) *ast.Ident { - c.varCounter++ - id := ast.NewIdent(fmt.Sprintf("_%d", c.varCounter)) - c.info.Types[id] = types.TypeAndValue{Type: t} // TODO remove? - c.info.Uses[id] = types.NewVar(token.NoPos, nil, id.Name, t) - return id -} - -func (c *simplifyContext) setType(x ast.Expr, t types.Type) ast.Expr { - c.info.Types[x] = types.TypeAndValue{Type: t} - return x -} - -func simpleAssign(lhs ast.Expr, tok token.Token, rhs ast.Expr) *ast.AssignStmt { - return &ast.AssignStmt{ - Lhs: []ast.Expr{lhs}, - Tok: tok, - Rhs: []ast.Expr{rhs}, - } -} - -func ContainsCall(x ast.Expr) bool { - switch x := x.(type) { - case *ast.CallExpr: - return true - case *ast.CompositeLit: - for _, elt := range x.Elts { - if ContainsCall(elt) { - return true - } - } - return false - case *ast.KeyValueExpr: - return ContainsCall(x.Key) || ContainsCall(x.Value) - case *ast.ParenExpr: - return ContainsCall(x.X) - case *ast.SelectorExpr: - return ContainsCall(x.X) - case *ast.IndexExpr: - return ContainsCall(x.X) || ContainsCall(x.Index) - case *ast.SliceExpr: - return ContainsCall(x.X) || ContainsCall(x.Low) || ContainsCall(x.High) || ContainsCall(x.Max) - case *ast.TypeAssertExpr: - return ContainsCall(x.X) - case *ast.StarExpr: - return ContainsCall(x.X) - case *ast.UnaryExpr: - return ContainsCall(x.X) - case *ast.BinaryExpr: - return ContainsCall(x.X) || ContainsCall(x.Y) - default: - return false - } -} diff --git a/vendor/golang.org/x/crypto/acme/acme.go b/vendor/golang.org/x/crypto/acme/acme.go index 00ee95550..73b19ef35 100644 --- a/vendor/golang.org/x/crypto/acme/acme.go +++ b/vendor/golang.org/x/crypto/acme/acme.go @@ -4,7 +4,10 @@ // Package acme provides an implementation of the // Automatic Certificate Management Environment (ACME) spec. -// See https://tools.ietf.org/html/draft-ietf-acme-acme-02 for details. +// The initial implementation was based on ACME draft-02 and +// is now being extended to comply with RFC 8555. +// See https://tools.ietf.org/html/draft-ietf-acme-acme-02 +// and https://tools.ietf.org/html/rfc8555 for details. // // Most common scenarios will want to use autocert subdirectory instead, // which provides automatic access to certificates from Let's Encrypt @@ -41,7 +44,7 @@ import ( const ( // LetsEncryptURL is the Directory endpoint of Let's Encrypt CA. - LetsEncryptURL = "https://acme-v01.api.letsencrypt.org/directory" + LetsEncryptURL = "https://acme-v02.api.letsencrypt.org/directory" // ALPNProto is the ALPN protocol name used by a CA server when validating // tls-alpn-01 challenges. @@ -52,12 +55,16 @@ const ( ALPNProto = "acme-tls/1" ) -// idPeACMEIdentifierV1 is the OID for the ACME extension for the TLS-ALPN challenge. -var idPeACMEIdentifierV1 = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 1, 30, 1} +// idPeACMEIdentifier is the OID for the ACME extension for the TLS-ALPN challenge. +// https://tools.ietf.org/html/draft-ietf-acme-tls-alpn-05#section-5.1 +var idPeACMEIdentifier = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 1, 31} const ( maxChainLen = 5 // max depth and breadth of a certificate chain - maxCertSize = 1 << 20 // max size of a certificate, in bytes + maxCertSize = 1 << 20 // max size of a certificate, in DER bytes + // Used for decoding certs from application/pem-certificate-chain response, + // the default when in RFC mode. + maxCertChainSize = maxCertSize * maxChainLen // Max number of collected nonces kept in memory. // Expect usual peak of 1 or 2. @@ -109,21 +116,55 @@ type Client struct { // The jitter is a random value up to 1 second. RetryBackoff func(n int, r *http.Request, resp *http.Response) time.Duration - dirMu sync.Mutex // guards writes to dir - dir *Directory // cached result of Client's Discover method + // UserAgent is prepended to the User-Agent header sent to the ACME server, + // which by default is this package's name and version. + // + // Reusable libraries and tools in particular should set this value to be + // identifiable by the server, in case they are causing issues. + UserAgent string + + cacheMu sync.Mutex + dir *Directory // cached result of Client's Discover method + kid keyID // cached Account.URI obtained from registerRFC or getAccountRFC noncesMu sync.Mutex nonces map[string]struct{} // nonces collected from previous responses } +// accountKID returns a key ID associated with c.Key, the account identity +// provided by the CA during RFC based registration. +// It assumes c.Discover has already been called. +// +// accountKID requires at most one network roundtrip. +// It caches only successful result. +// +// When in pre-RFC mode or when c.getRegRFC responds with an error, accountKID +// returns noKeyID. +func (c *Client) accountKID(ctx context.Context) keyID { + c.cacheMu.Lock() + defer c.cacheMu.Unlock() + if !c.dir.rfcCompliant() { + return noKeyID + } + if c.kid != noKeyID { + return c.kid + } + a, err := c.getRegRFC(ctx) + if err != nil { + return noKeyID + } + c.kid = keyID(a.URI) + return c.kid +} + // Discover performs ACME server discovery using c.DirectoryURL. // // It caches successful result. So, subsequent calls will not result in // a network round-trip. This also means mutating c.DirectoryURL after successful call // of this method will have no effect. func (c *Client) Discover(ctx context.Context) (Directory, error) { - c.dirMu.Lock() - defer c.dirMu.Unlock() + c.cacheMu.Lock() + defer c.cacheMu.Unlock() if c.dir != nil { return *c.dir, nil } @@ -136,27 +177,53 @@ func (c *Client) Discover(ctx context.Context) (Directory, error) { c.addNonce(res.Header) var v struct { - Reg string `json:"new-reg"` - Authz string `json:"new-authz"` - Cert string `json:"new-cert"` - Revoke string `json:"revoke-cert"` - Meta struct { - Terms string `json:"terms-of-service"` - Website string `json:"website"` - CAA []string `json:"caa-identities"` + Reg string `json:"new-reg"` + RegRFC string `json:"newAccount"` + Authz string `json:"new-authz"` + AuthzRFC string `json:"newAuthz"` + OrderRFC string `json:"newOrder"` + Cert string `json:"new-cert"` + Revoke string `json:"revoke-cert"` + RevokeRFC string `json:"revokeCert"` + NonceRFC string `json:"newNonce"` + KeyChangeRFC string `json:"keyChange"` + Meta struct { + Terms string `json:"terms-of-service"` + TermsRFC string `json:"termsOfService"` + WebsiteRFC string `json:"website"` + CAA []string `json:"caa-identities"` + CAARFC []string `json:"caaIdentities"` + ExternalAcctRFC bool `json:"externalAccountRequired"` } } if err := json.NewDecoder(res.Body).Decode(&v); err != nil { return Directory{}, err } + if v.OrderRFC == "" { + // Non-RFC compliant ACME CA. + c.dir = &Directory{ + RegURL: v.Reg, + AuthzURL: v.Authz, + CertURL: v.Cert, + RevokeURL: v.Revoke, + Terms: v.Meta.Terms, + Website: v.Meta.WebsiteRFC, + CAA: v.Meta.CAA, + } + return *c.dir, nil + } + // RFC compliant ACME CA. c.dir = &Directory{ - RegURL: v.Reg, - AuthzURL: v.Authz, - CertURL: v.Cert, - RevokeURL: v.Revoke, - Terms: v.Meta.Terms, - Website: v.Meta.Website, - CAA: v.Meta.CAA, + RegURL: v.RegRFC, + AuthzURL: v.AuthzRFC, + OrderURL: v.OrderRFC, + RevokeURL: v.RevokeRFC, + NonceURL: v.NonceRFC, + KeyChangeURL: v.KeyChangeRFC, + Terms: v.Meta.TermsRFC, + Website: v.Meta.WebsiteRFC, + CAA: v.Meta.CAARFC, + ExternalAccountRequired: v.Meta.ExternalAcctRFC, } return *c.dir, nil } @@ -169,6 +236,9 @@ func (c *Client) directoryURL() string { } // CreateCert requests a new certificate using the Certificate Signing Request csr encoded in DER format. +// It is incompatible with RFC 8555. Callers should use CreateOrderCert when interfacing +// with an RFC-compliant CA. +// // The exp argument indicates the desired certificate validity duration. CA may issue a certificate // with a different duration. // If the bundle argument is true, the returned value will also contain the CA (issuer) certificate chain. @@ -199,7 +269,7 @@ func (c *Client) CreateCert(ctx context.Context, csr []byte, exp time.Duration, req.NotAfter = now.Add(exp).Format(time.RFC3339) } - res, err := c.post(ctx, c.Key, c.dir.CertURL, req, wantStatus(http.StatusCreated)) + res, err := c.post(ctx, nil, c.dir.CertURL, req, wantStatus(http.StatusCreated)) if err != nil { return nil, "", err } @@ -220,12 +290,22 @@ func (c *Client) CreateCert(ctx context.Context, csr []byte, exp time.Duration, // It retries the request until the certificate is successfully retrieved, // context is cancelled by the caller or an error response is received. // -// The returned value will also contain the CA (issuer) certificate if the bundle argument is true. +// If the bundle argument is true, the returned value also contains the CA (issuer) +// certificate chain. // // FetchCert returns an error if the CA's response or chain was unreasonably large. // Callers are encouraged to parse the returned value to ensure the certificate is valid // and has expected features. func (c *Client) FetchCert(ctx context.Context, url string, bundle bool) ([][]byte, error) { + dir, err := c.Discover(ctx) + if err != nil { + return nil, err + } + if dir.rfcCompliant() { + return c.fetchCertRFC(ctx, url, bundle) + } + + // Legacy non-authenticated GET request. res, err := c.get(ctx, url, wantStatus(http.StatusOK)) if err != nil { return nil, err @@ -240,10 +320,15 @@ func (c *Client) FetchCert(ctx context.Context, url string, bundle bool) ([][]by // For instance, the key pair of the certificate may be authorized. // If the key is nil, c.Key is used instead. func (c *Client) RevokeCert(ctx context.Context, key crypto.Signer, cert []byte, reason CRLReasonCode) error { - if _, err := c.Discover(ctx); err != nil { + dir, err := c.Discover(ctx) + if err != nil { return err } + if dir.rfcCompliant() { + return c.revokeCertRFC(ctx, key, cert, reason) + } + // Legacy CA. body := &struct { Resource string `json:"resource"` Cert string `json:"certificate"` @@ -253,10 +338,7 @@ func (c *Client) RevokeCert(ctx context.Context, key crypto.Signer, cert []byte, Cert: base64.RawURLEncoding.EncodeToString(cert), Reason: int(reason), } - if key == nil { - key = c.Key - } - res, err := c.post(ctx, key, c.dir.RevokeURL, body, wantStatus(http.StatusOK)) + res, err := c.post(ctx, key, dir.RevokeURL, body, wantStatus(http.StatusOK)) if err != nil { return err } @@ -268,20 +350,34 @@ func (c *Client) RevokeCert(ctx context.Context, key crypto.Signer, cert []byte, // during account registration. See Register method of Client for more details. func AcceptTOS(tosURL string) bool { return true } -// Register creates a new account registration by following the "new-reg" flow. -// It returns the registered account. The account is not modified. +// Register creates a new account with the CA using c.Key. +// It returns the registered account. The account acct is not modified. // // The registration may require the caller to agree to the CA's Terms of Service (TOS). // If so, and the account has not indicated the acceptance of the terms (see Account for details), // Register calls prompt with a TOS URL provided by the CA. Prompt should report // whether the caller agrees to the terms. To always accept the terms, the caller can use AcceptTOS. -func (c *Client) Register(ctx context.Context, a *Account, prompt func(tosURL string) bool) (*Account, error) { - if _, err := c.Discover(ctx); err != nil { +// +// When interfacing with an RFC-compliant CA, non-RFC 8555 fields of acct are ignored +// and prompt is called if Directory's Terms field is non-zero. +// Also see Error's Instance field for when a CA requires already registered accounts to agree +// to an updated Terms of Service. +func (c *Client) Register(ctx context.Context, acct *Account, prompt func(tosURL string) bool) (*Account, error) { + if c.Key == nil { + return nil, errors.New("acme: client.Key must be set to Register") + } + + dir, err := c.Discover(ctx) + if err != nil { return nil, err } + if dir.rfcCompliant() { + return c.registerRFC(ctx, acct, prompt) + } - var err error - if a, err = c.doReg(ctx, c.dir.RegURL, "new-reg", a); err != nil { + // Legacy ACME draft registration flow. + a, err := c.doReg(ctx, dir.RegURL, "new-reg", acct) + if err != nil { return nil, err } var accept bool @@ -295,9 +391,20 @@ func (c *Client) Register(ctx context.Context, a *Account, prompt func(tosURL st return a, err } -// GetReg retrieves an existing registration. -// The url argument is an Account URI. +// GetReg retrieves an existing account associated with c.Key. +// +// The url argument is an Account URI used with pre-RFC 8555 CAs. +// It is ignored when interfacing with an RFC-compliant CA. func (c *Client) GetReg(ctx context.Context, url string) (*Account, error) { + dir, err := c.Discover(ctx) + if err != nil { + return nil, err + } + if dir.rfcCompliant() { + return c.getRegRFC(ctx) + } + + // Legacy CA. a, err := c.doReg(ctx, url, "reg", nil) if err != nil { return nil, err @@ -308,9 +415,21 @@ func (c *Client) GetReg(ctx context.Context, url string) (*Account, error) { // UpdateReg updates an existing registration. // It returns an updated account copy. The provided account is not modified. -func (c *Client) UpdateReg(ctx context.Context, a *Account) (*Account, error) { - uri := a.URI - a, err := c.doReg(ctx, uri, "reg", a) +// +// When interfacing with RFC-compliant CAs, a.URI is ignored and the account URL +// associated with c.Key is used instead. +func (c *Client) UpdateReg(ctx context.Context, acct *Account) (*Account, error) { + dir, err := c.Discover(ctx) + if err != nil { + return nil, err + } + if dir.rfcCompliant() { + return c.updateRegRFC(ctx, acct) + } + + // Legacy CA. + uri := acct.URI + a, err := c.doReg(ctx, uri, "reg", acct) if err != nil { return nil, err } @@ -318,13 +437,21 @@ func (c *Client) UpdateReg(ctx context.Context, a *Account) (*Account, error) { return a, nil } -// Authorize performs the initial step in an authorization flow. +// Authorize performs the initial step in the pre-authorization flow, +// as opposed to order-based flow. // The caller will then need to choose from and perform a set of returned // challenges using c.Accept in order to successfully complete authorization. // +// Once complete, the caller can use AuthorizeOrder which the CA +// should provision with the already satisfied authorization. +// For pre-RFC CAs, the caller can proceed directly to requesting a certificate +// using CreateCert method. +// // If an authorization has been previously granted, the CA may return -// a valid authorization (Authorization.Status is StatusValid). If so, the caller -// need not fulfill any challenge and can proceed to requesting a certificate. +// a valid authorization which has its Status field set to StatusValid. +// +// More about pre-authorization can be found at +// https://tools.ietf.org/html/rfc8555#section-7.4.1. func (c *Client) Authorize(ctx context.Context, domain string) (*Authorization, error) { return c.authorize(ctx, "dns", domain) } @@ -355,7 +482,7 @@ func (c *Client) authorize(ctx context.Context, typ, val string) (*Authorization Resource: "new-authz", Identifier: authzID{Type: typ, Value: val}, } - res, err := c.post(ctx, c.Key, c.dir.AuthzURL, req, wantStatus(http.StatusCreated)) + res, err := c.post(ctx, nil, c.dir.AuthzURL, req, wantStatus(http.StatusCreated)) if err != nil { return nil, err } @@ -376,7 +503,17 @@ func (c *Client) authorize(ctx context.Context, typ, val string) (*Authorization // If a caller needs to poll an authorization until its status is final, // see the WaitAuthorization method. func (c *Client) GetAuthorization(ctx context.Context, url string) (*Authorization, error) { - res, err := c.get(ctx, url, wantStatus(http.StatusOK, http.StatusAccepted)) + dir, err := c.Discover(ctx) + if err != nil { + return nil, err + } + + var res *http.Response + if dir.rfcCompliant() { + res, err = c.postAsGet(ctx, url, wantStatus(http.StatusOK)) + } else { + res, err = c.get(ctx, url, wantStatus(http.StatusOK, http.StatusAccepted)) + } if err != nil { return nil, err } @@ -393,11 +530,16 @@ func (c *Client) GetAuthorization(ctx context.Context, url string) (*Authorizati // The url argument is an Authorization.URI value. // // If successful, the caller will be required to obtain a new authorization -// using the Authorize method before being able to request a new certificate -// for the domain associated with the authorization. +// using the Authorize or AuthorizeOrder methods before being able to request +// a new certificate for the domain associated with the authorization. // // It does not revoke existing certificates. func (c *Client) RevokeAuthorization(ctx context.Context, url string) error { + // Required for c.accountKID() when in RFC mode. + if _, err := c.Discover(ctx); err != nil { + return err + } + req := struct { Resource string `json:"resource"` Status string `json:"status"` @@ -407,7 +549,7 @@ func (c *Client) RevokeAuthorization(ctx context.Context, url string) error { Status: "deactivated", Delete: true, } - res, err := c.post(ctx, c.Key, url, req, wantStatus(http.StatusOK)) + res, err := c.post(ctx, nil, url, req, wantStatus(http.StatusOK)) if err != nil { return err } @@ -423,8 +565,18 @@ func (c *Client) RevokeAuthorization(ctx context.Context, url string) error { // In all other cases WaitAuthorization returns an error. // If the Status is StatusInvalid, the returned error is of type *AuthorizationError. func (c *Client) WaitAuthorization(ctx context.Context, url string) (*Authorization, error) { + // Required for c.accountKID() when in RFC mode. + dir, err := c.Discover(ctx) + if err != nil { + return nil, err + } + getfn := c.postAsGet + if !dir.rfcCompliant() { + getfn = c.get + } + for { - res, err := c.get(ctx, url, wantStatus(http.StatusOK, http.StatusAccepted)) + res, err := getfn(ctx, url, wantStatus(http.StatusOK, http.StatusAccepted)) if err != nil { return nil, err } @@ -467,10 +619,21 @@ func (c *Client) WaitAuthorization(ctx context.Context, url string) (*Authorizat // // A client typically polls a challenge status using this method. func (c *Client) GetChallenge(ctx context.Context, url string) (*Challenge, error) { - res, err := c.get(ctx, url, wantStatus(http.StatusOK, http.StatusAccepted)) + // Required for c.accountKID() when in RFC mode. + dir, err := c.Discover(ctx) if err != nil { return nil, err } + + getfn := c.postAsGet + if !dir.rfcCompliant() { + getfn = c.get + } + res, err := getfn(ctx, url, wantStatus(http.StatusOK, http.StatusAccepted)) + if err != nil { + return nil, err + } + defer res.Body.Close() v := wireChallenge{URI: url} if err := json.NewDecoder(res.Body).Decode(&v); err != nil { @@ -484,21 +647,29 @@ func (c *Client) GetChallenge(ctx context.Context, url string) (*Challenge, erro // // The server will then perform the validation asynchronously. func (c *Client) Accept(ctx context.Context, chal *Challenge) (*Challenge, error) { - auth, err := keyAuth(c.Key.Public(), chal.Token) + // Required for c.accountKID() when in RFC mode. + dir, err := c.Discover(ctx) if err != nil { return nil, err } - req := struct { - Resource string `json:"resource"` - Type string `json:"type"` - Auth string `json:"keyAuthorization"` - }{ - Resource: "challenge", - Type: chal.Type, - Auth: auth, + var req interface{} = json.RawMessage("{}") // RFC-compliant CA + if !dir.rfcCompliant() { + auth, err := keyAuth(c.Key.Public(), chal.Token) + if err != nil { + return nil, err + } + req = struct { + Resource string `json:"resource"` + Type string `json:"type"` + Auth string `json:"keyAuthorization"` + }{ + Resource: "challenge", + Type: chal.Type, + Auth: auth, + } } - res, err := c.post(ctx, c.Key, chal.URI, req, wantStatus( + res, err := c.post(ctx, nil, chal.URI, req, wantStatus( http.StatusOK, // according to the spec http.StatusAccepted, // Let's Encrypt: see https://goo.gl/WsJ7VT (acme-divergences.md) )) @@ -548,21 +719,8 @@ func (c *Client) HTTP01ChallengePath(token string) string { } // TLSSNI01ChallengeCert creates a certificate for TLS-SNI-01 challenge response. -// Servers can present the certificate to validate the challenge and prove control -// over a domain name. // -// The implementation is incomplete in that the returned value is a single certificate, -// computed only for Z0 of the key authorization. ACME CAs are expected to update -// their implementations to use the newer version, TLS-SNI-02. -// For more details on TLS-SNI-01 see https://tools.ietf.org/html/draft-ietf-acme-acme-01#section-7.3. -// -// The token argument is a Challenge.Token value. -// If a WithKey option is provided, its private part signs the returned cert, -// and the public part is used to specify the signee. -// If no WithKey option is provided, a new ECDSA key is generated using P-256 curve. -// -// The returned certificate is valid for the next 24 hours and must be presented only when -// the server name of the TLS ClientHello matches exactly the returned name value. +// Deprecated: This challenge type is unused in both draft-02 and RFC versions of ACME spec. func (c *Client) TLSSNI01ChallengeCert(token string, opt ...CertOption) (cert tls.Certificate, name string, err error) { ka, err := keyAuth(c.Key.Public(), token) if err != nil { @@ -579,17 +737,8 @@ func (c *Client) TLSSNI01ChallengeCert(token string, opt ...CertOption) (cert tl } // TLSSNI02ChallengeCert creates a certificate for TLS-SNI-02 challenge response. -// Servers can present the certificate to validate the challenge and prove control -// over a domain name. For more details on TLS-SNI-02 see -// https://tools.ietf.org/html/draft-ietf-acme-acme-03#section-7.3. -// -// The token argument is a Challenge.Token value. -// If a WithKey option is provided, its private part signs the returned cert, -// and the public part is used to specify the signee. -// If no WithKey option is provided, a new ECDSA key is generated using P-256 curve. // -// The returned certificate is valid for the next 24 hours and must be presented only when -// the server name in the TLS ClientHello matches exactly the returned name value. +// Deprecated: This challenge type is unused in both draft-02 and RFC versions of ACME spec. func (c *Client) TLSSNI02ChallengeCert(token string, opt ...CertOption) (cert tls.Certificate, name string, err error) { b := sha256.Sum256([]byte(token)) h := hex.EncodeToString(b[:]) @@ -634,7 +783,7 @@ func (c *Client) TLSALPN01ChallengeCert(token, domain string, opt ...CertOption) return tls.Certificate{}, err } acmeExtension := pkix.Extension{ - Id: idPeACMEIdentifierV1, + Id: idPeACMEIdentifier, Critical: true, Value: extValue, } @@ -656,7 +805,7 @@ func (c *Client) TLSALPN01ChallengeCert(token, domain string, opt ...CertOption) return tlsChallengeCert([]string{domain}, newOpt) } -// doReg sends all types of registration requests. +// doReg sends all types of registration requests the old way (pre-RFC world). // The type of request is identified by typ argument, which is a "resource" // in the ACME spec terms. // @@ -675,7 +824,7 @@ func (c *Client) doReg(ctx context.Context, url string, typ string, acct *Accoun req.Contact = acct.Contact req.Agreement = acct.AgreedTerms } - res, err := c.post(ctx, c.Key, url, req, wantStatus( + res, err := c.post(ctx, nil, url, req, wantStatus( http.StatusOK, // updates and deletes http.StatusCreated, // new account creation http.StatusAccepted, // Let's Encrypt divergent implementation @@ -714,12 +863,16 @@ func (c *Client) doReg(ctx context.Context, url string, typ string, acct *Accoun } // popNonce returns a nonce value previously stored with c.addNonce -// or fetches a fresh one from a URL by issuing a HEAD request. -// It first tries c.directoryURL() and then the provided url if the former fails. +// or fetches a fresh one from c.dir.NonceURL. +// If NonceURL is empty, it first tries c.directoryURL() and, failing that, +// the provided url. func (c *Client) popNonce(ctx context.Context, url string) (string, error) { c.noncesMu.Lock() defer c.noncesMu.Unlock() if len(c.nonces) == 0 { + if c.dir != nil && c.dir.NonceURL != "" { + return c.fetchNonce(ctx, c.dir.NonceURL) + } dirURL := c.directoryURL() v, err := c.fetchNonce(ctx, dirURL) if err != nil && url != dirURL { diff --git a/vendor/golang.org/x/crypto/acme/autocert/autocert.go b/vendor/golang.org/x/crypto/acme/autocert/autocert.go index e562609cc..c7fbc54c4 100644 --- a/vendor/golang.org/x/crypto/acme/autocert/autocert.go +++ b/vendor/golang.org/x/crypto/acme/autocert/autocert.go @@ -35,6 +35,9 @@ import ( "golang.org/x/net/idna" ) +// DefaultACMEDirectory is the default ACME Directory URL used when the Manager's Client is nil. +const DefaultACMEDirectory = "https://acme-v02.api.letsencrypt.org/directory" + // createCertRetryAfter is how much time to wait before removing a failed state // entry due to an unsuccessful createCert call. // This is a variable instead of a const for testing. @@ -88,9 +91,9 @@ func defaultHostPolicy(context.Context, string) error { } // Manager is a stateful certificate manager built on top of acme.Client. -// It obtains and refreshes certificates automatically using "tls-alpn-01", -// "tls-sni-01", "tls-sni-02" and "http-01" challenge types, -// as well as providing them to a TLS server via tls.Config. +// It obtains and refreshes certificates automatically using "tls-alpn-01" +// or "http-01" challenge types, as well as providing them to a TLS server +// via tls.Config. // // You must specify a cache implementation, such as DirCache, // to reuse obtained certificates across program restarts. @@ -135,9 +138,10 @@ type Manager struct { // Client is used to perform low-level operations, such as account registration // and requesting new certificates. // - // If Client is nil, a zero-value acme.Client is used with acme.LetsEncryptURL - // as directory endpoint. If the Client.Key is nil, a new ECDSA P-256 key is - // generated and, if Cache is not nil, stored in cache. + // If Client is nil, a zero-value acme.Client is used with DefaultACMEDirectory + // as the directory endpoint. + // If the Client.Key is nil, a new ECDSA P-256 key is generated and, + // if Cache is not nil, stored in cache. // // Mutating the field after the first call of GetCertificate method will have no effect. Client *acme.Client @@ -174,8 +178,8 @@ type Manager struct { renewalMu sync.Mutex renewal map[certKey]*domainRenewal - // tokensMu guards the rest of the fields: tryHTTP01, certTokens and httpTokens. - tokensMu sync.RWMutex + // challengeMu guards tryHTTP01, certTokens and httpTokens. + challengeMu sync.RWMutex // tryHTTP01 indicates whether the Manager should try "http-01" challenge type // during the authorization flow. tryHTTP01 bool @@ -184,12 +188,11 @@ type Manager struct { // to be provisioned. // The entries are stored for the duration of the authorization flow. httpTokens map[string][]byte - // certTokens contains temporary certificates for tls-sni and tls-alpn challenges - // and is keyed by token domain name, which matches server name of ClientHello. - // Keys always have ".acme.invalid" suffix for tls-sni. Otherwise, they are domain names - // for tls-alpn. + // certTokens contains temporary certificates for tls-alpn-01 challenges + // and is keyed by the domain name which matches the ClientHello server name. // The entries are stored for the duration of the authorization flow. certTokens map[string]*tls.Certificate + // nowFunc, if not nil, returns the current time. This may be set for // testing purposes. nowFunc func() time.Time @@ -226,7 +229,7 @@ func (m *Manager) TLSConfig() *tls.Config { // GetCertificate implements the tls.Config.GetCertificate hook. // It provides a TLS certificate for hello.ServerName host, including answering -// tls-alpn-01 and *.acme.invalid (tls-sni-01 and tls-sni-02) challenges. +// tls-alpn-01 challenges. // All other fields of hello are ignored. // // If m.HostPolicy is non-nil, GetCertificate calls the policy before requesting @@ -235,9 +238,7 @@ func (m *Manager) TLSConfig() *tls.Config { // This does not affect cached certs. See HostPolicy field description for more details. // // If GetCertificate is used directly, instead of via Manager.TLSConfig, package users will -// also have to add acme.ALPNProto to NextProtos for tls-alpn-01, or use HTTPHandler -// for http-01. (The tls-sni-* challenges have been deprecated by popular ACME providers -// due to security issues in the ecosystem.) +// also have to add acme.ALPNProto to NextProtos for tls-alpn-01, or use HTTPHandler for http-01. func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error) { if m.Prompt == nil { return nil, errors.New("acme/autocert: Manager.Prompt not set") @@ -269,13 +270,10 @@ func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) defer cancel() - // Check whether this is a token cert requested for TLS-SNI or TLS-ALPN challenge. + // Check whether this is a token cert requested for TLS-ALPN challenge. if wantsTokenCert(hello) { - m.tokensMu.RLock() - defer m.tokensMu.RUnlock() - // It's ok to use the same token cert key for both tls-sni and tls-alpn - // because there's always at most 1 token cert per on-going domain authorization. - // See m.verify for details. + m.challengeMu.RLock() + defer m.challengeMu.RUnlock() if cert := m.certTokens[name]; cert != nil { return cert, nil } @@ -318,8 +316,7 @@ func wantsTokenCert(hello *tls.ClientHelloInfo) bool { if len(hello.SupportedProtos) == 1 && hello.SupportedProtos[0] == acme.ALPNProto { return true } - // tls-sni-xx - return strings.HasSuffix(hello.ServerName, ".acme.invalid") + return false } func supportsECDSA(hello *tls.ClientHelloInfo) bool { @@ -384,8 +381,8 @@ func supportsECDSA(hello *tls.ClientHelloInfo) bool { // If HTTPHandler is never called, the Manager will only use the "tls-alpn-01" // challenge for domain verification. func (m *Manager) HTTPHandler(fallback http.Handler) http.Handler { - m.tokensMu.Lock() - defer m.tokensMu.Unlock() + m.challengeMu.Lock() + defer m.challengeMu.Unlock() m.tryHTTP01 = true if fallback == nil { @@ -648,71 +645,64 @@ func (m *Manager) certState(ck certKey) (*certState, error) { // authorizedCert starts the domain ownership verification process and requests a new cert upon success. // The key argument is the certificate private key. func (m *Manager) authorizedCert(ctx context.Context, key crypto.Signer, ck certKey) (der [][]byte, leaf *x509.Certificate, err error) { - client, err := m.acmeClient(ctx) - if err != nil { - return nil, nil, err - } - - if err := m.verify(ctx, client, ck.domain); err != nil { - return nil, nil, err - } csr, err := certRequest(key, ck.domain, m.ExtraExtensions) if err != nil { return nil, nil, err } - der, _, err = client.CreateCert(ctx, csr, 0, true) + + client, err := m.acmeClient(ctx) if err != nil { return nil, nil, err } - leaf, err = validCert(ck, der, key, m.now()) + dir, err := client.Discover(ctx) if err != nil { return nil, nil, err } - return der, leaf, nil -} -// revokePendingAuthz revokes all authorizations idenfied by the elements of uri slice. -// It ignores revocation errors. -func (m *Manager) revokePendingAuthz(ctx context.Context, uri []string) { - client, err := m.acmeClient(ctx) - if err != nil { - return + var chain [][]byte + switch { + // Pre-RFC legacy CA. + case dir.OrderURL == "": + if err := m.verify(ctx, client, ck.domain); err != nil { + return nil, nil, err + } + der, _, err := client.CreateCert(ctx, csr, 0, true) + if err != nil { + return nil, nil, err + } + chain = der + // RFC 8555 compliant CA. + default: + o, err := m.verifyRFC(ctx, client, ck.domain) + if err != nil { + return nil, nil, err + } + der, _, err := client.CreateOrderCert(ctx, o.FinalizeURL, csr, true) + if err != nil { + return nil, nil, err + } + chain = der } - for _, u := range uri { - client.RevokeAuthorization(ctx, u) + leaf, err = validCert(ck, chain, key, m.now()) + if err != nil { + return nil, nil, err } + return chain, leaf, nil } -// verify runs the identifier (domain) authorization flow +// verify runs the identifier (domain) pre-authorization flow for legacy CAs // using each applicable ACME challenge type. func (m *Manager) verify(ctx context.Context, client *acme.Client, domain string) error { - // The list of challenge types we'll try to fulfill - // in this specific order. - challengeTypes := []string{"tls-alpn-01", "tls-sni-02", "tls-sni-01"} - m.tokensMu.RLock() - if m.tryHTTP01 { - challengeTypes = append(challengeTypes, "http-01") - } - m.tokensMu.RUnlock() - - // Keep track of pending authzs and revoke the ones that did not validate. - pendingAuthzs := make(map[string]bool) + // Remove all hanging authorizations to reduce rate limit quotas + // after we're done. + var authzURLs []string defer func() { - var uri []string - for k, pending := range pendingAuthzs { - if pending { - uri = append(uri, k) - } - } - if len(uri) > 0 { - // Use "detached" background context. - // The revocations need not happen in the current verification flow. - go m.revokePendingAuthz(context.Background(), uri) - } + go m.deactivatePendingAuthz(authzURLs) }() // errs accumulates challenge failure errors, printed if all fail errs := make(map[*acme.Challenge]error) + challengeTypes := m.supportedChallengeTypes() var nextTyp int // challengeType index of the next challenge type to try for { // Start domain authorization and get the challenge. @@ -720,6 +710,7 @@ func (m *Manager) verify(ctx context.Context, client *acme.Client, domain string if err != nil { return err } + authzURLs = append(authzURLs, authz.URI) // No point in accepting challenges if the authorization status // is in a final state. switch authz.Status { @@ -729,8 +720,6 @@ func (m *Manager) verify(ctx context.Context, client *acme.Client, domain string return fmt.Errorf("acme/autocert: invalid authorization %q", authz.URI) } - pendingAuthzs[authz.URI] = true - // Pick the next preferred challenge. var chal *acme.Challenge for chal == nil && nextTyp < len(challengeTypes) { @@ -760,11 +749,126 @@ func (m *Manager) verify(ctx context.Context, client *acme.Client, domain string errs[chal] = err continue } - delete(pendingAuthzs, authz.URI) return nil } } +// verifyRFC runs the identifier (domain) order-based authorization flow for RFC compliant CAs +// using each applicable ACME challenge type. +func (m *Manager) verifyRFC(ctx context.Context, client *acme.Client, domain string) (*acme.Order, error) { + // Try each supported challenge type starting with a new order each time. + // The nextTyp index of the next challenge type to try is shared across + // all order authorizations: if we've tried a challenge type once and it didn't work, + // it will most likely not work on another order's authorization either. + challengeTypes := m.supportedChallengeTypes() + nextTyp := 0 // challengeTypes index +AuthorizeOrderLoop: + for { + o, err := client.AuthorizeOrder(ctx, acme.DomainIDs(domain)) + if err != nil { + return nil, err + } + // Remove all hanging authorizations to reduce rate limit quotas + // after we're done. + defer func(urls []string) { + go m.deactivatePendingAuthz(urls) + }(o.AuthzURLs) + + // Check if there's actually anything we need to do. + switch o.Status { + case acme.StatusReady: + // Already authorized. + return o, nil + case acme.StatusPending: + // Continue normal Order-based flow. + default: + return nil, fmt.Errorf("acme/autocert: invalid new order status %q; order URL: %q", o.Status, o.URI) + } + + // Satisfy all pending authorizations. + for _, zurl := range o.AuthzURLs { + z, err := client.GetAuthorization(ctx, zurl) + if err != nil { + return nil, err + } + if z.Status != acme.StatusPending { + // We are interested only in pending authorizations. + continue + } + // Pick the next preferred challenge. + var chal *acme.Challenge + for chal == nil && nextTyp < len(challengeTypes) { + chal = pickChallenge(challengeTypes[nextTyp], z.Challenges) + nextTyp++ + } + if chal == nil { + return nil, fmt.Errorf("acme/autocert: unable to satisfy %q for domain %q: no viable challenge type found", z.URI, domain) + } + // Respond to the challenge and wait for validation result. + cleanup, err := m.fulfill(ctx, client, chal, domain) + if err != nil { + continue AuthorizeOrderLoop + } + defer cleanup() + if _, err := client.Accept(ctx, chal); err != nil { + continue AuthorizeOrderLoop + } + if _, err := client.WaitAuthorization(ctx, z.URI); err != nil { + continue AuthorizeOrderLoop + } + } + + // All authorizations are satisfied. + // Wait for the CA to update the order status. + o, err = client.WaitOrder(ctx, o.URI) + if err != nil { + continue AuthorizeOrderLoop + } + return o, nil + } +} + +func pickChallenge(typ string, chal []*acme.Challenge) *acme.Challenge { + for _, c := range chal { + if c.Type == typ { + return c + } + } + return nil +} + +func (m *Manager) supportedChallengeTypes() []string { + m.challengeMu.RLock() + defer m.challengeMu.RUnlock() + typ := []string{"tls-alpn-01"} + if m.tryHTTP01 { + typ = append(typ, "http-01") + } + return typ +} + +// deactivatePendingAuthz relinquishes all authorizations identified by the elements +// of the provided uri slice which are in "pending" state. +// It ignores revocation errors. +// +// deactivatePendingAuthz takes no context argument and instead runs with its own +// "detached" context because deactivations are done in a goroutine separate from +// that of the main issuance or renewal flow. +func (m *Manager) deactivatePendingAuthz(uri []string) { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) + defer cancel() + client, err := m.acmeClient(ctx) + if err != nil { + return + } + for _, u := range uri { + z, err := client.GetAuthorization(ctx, u) + if err == nil && z.Status == acme.StatusPending { + client.RevokeAuthorization(ctx, u) + } + } +} + // fulfill provisions a response to the challenge chal. // The cleanup is non-nil only if provisioning succeeded. func (m *Manager) fulfill(ctx context.Context, client *acme.Client, chal *acme.Challenge, domain string) (cleanup func(), err error) { @@ -776,20 +880,6 @@ func (m *Manager) fulfill(ctx context.Context, client *acme.Client, chal *acme.C } m.putCertToken(ctx, domain, &cert) return func() { go m.deleteCertToken(domain) }, nil - case "tls-sni-01": - cert, name, err := client.TLSSNI01ChallengeCert(chal.Token) - if err != nil { - return nil, err - } - m.putCertToken(ctx, name, &cert) - return func() { go m.deleteCertToken(name) }, nil - case "tls-sni-02": - cert, name, err := client.TLSSNI02ChallengeCert(chal.Token) - if err != nil { - return nil, err - } - m.putCertToken(ctx, name, &cert) - return func() { go m.deleteCertToken(name) }, nil case "http-01": resp, err := client.HTTP01ChallengeResponse(chal.Token) if err != nil { @@ -802,20 +892,11 @@ func (m *Manager) fulfill(ctx context.Context, client *acme.Client, chal *acme.C return nil, fmt.Errorf("acme/autocert: unknown challenge type %q", chal.Type) } -func pickChallenge(typ string, chal []*acme.Challenge) *acme.Challenge { - for _, c := range chal { - if c.Type == typ { - return c - } - } - return nil -} - // putCertToken stores the token certificate with the specified name // in both m.certTokens map and m.Cache. func (m *Manager) putCertToken(ctx context.Context, name string, cert *tls.Certificate) { - m.tokensMu.Lock() - defer m.tokensMu.Unlock() + m.challengeMu.Lock() + defer m.challengeMu.Unlock() if m.certTokens == nil { m.certTokens = make(map[string]*tls.Certificate) } @@ -826,8 +907,8 @@ func (m *Manager) putCertToken(ctx context.Context, name string, cert *tls.Certi // deleteCertToken removes the token certificate with the specified name // from both m.certTokens map and m.Cache. func (m *Manager) deleteCertToken(name string) { - m.tokensMu.Lock() - defer m.tokensMu.Unlock() + m.challengeMu.Lock() + defer m.challengeMu.Unlock() delete(m.certTokens, name) if m.Cache != nil { ck := certKey{domain: name, isToken: true} @@ -838,8 +919,8 @@ func (m *Manager) deleteCertToken(name string) { // httpToken retrieves an existing http-01 token value from an in-memory map // or the optional cache. func (m *Manager) httpToken(ctx context.Context, tokenPath string) ([]byte, error) { - m.tokensMu.RLock() - defer m.tokensMu.RUnlock() + m.challengeMu.RLock() + defer m.challengeMu.RUnlock() if v, ok := m.httpTokens[tokenPath]; ok { return v, nil } @@ -854,8 +935,8 @@ func (m *Manager) httpToken(ctx context.Context, tokenPath string) ([]byte, erro // // It ignores any error returned from Cache.Put. func (m *Manager) putHTTPToken(ctx context.Context, tokenPath, val string) { - m.tokensMu.Lock() - defer m.tokensMu.Unlock() + m.challengeMu.Lock() + defer m.challengeMu.Unlock() if m.httpTokens == nil { m.httpTokens = make(map[string][]byte) } @@ -871,8 +952,8 @@ func (m *Manager) putHTTPToken(ctx context.Context, tokenPath, val string) { // // If m.Cache is non-nil, it blocks until Cache.Delete returns without a timeout. func (m *Manager) deleteHTTPToken(tokenPath string) { - m.tokensMu.Lock() - defer m.tokensMu.Unlock() + m.challengeMu.Lock() + defer m.challengeMu.Unlock() delete(m.httpTokens, tokenPath) if m.Cache != nil { m.Cache.Delete(context.Background(), httpTokenCacheKey(tokenPath)) @@ -971,7 +1052,7 @@ func (m *Manager) acmeClient(ctx context.Context) (*acme.Client, error) { client := m.Client if client == nil { - client = &acme.Client{DirectoryURL: acme.LetsEncryptURL} + client = &acme.Client{DirectoryURL: DefaultACMEDirectory} } if client.Key == nil { var err error @@ -980,20 +1061,32 @@ func (m *Manager) acmeClient(ctx context.Context) (*acme.Client, error) { return nil, err } } + if client.UserAgent == "" { + client.UserAgent = "autocert" + } var contact []string if m.Email != "" { contact = []string{"mailto:" + m.Email} } a := &acme.Account{Contact: contact} _, err := client.Register(ctx, a, m.Prompt) - if ae, ok := err.(*acme.Error); err == nil || ok && ae.StatusCode == http.StatusConflict { - // conflict indicates the key is already registered + if err == nil || isAccountAlreadyExist(err) { m.client = client err = nil } return m.client, err } +// isAccountAlreadyExist reports whether the err, as returned from acme.Client.Register, +// indicates the account has already been registered. +func isAccountAlreadyExist(err error) bool { + if err == acme.ErrAccountAlreadyExists { + return true + } + ae, ok := err.(*acme.Error) + return ok && ae.StatusCode == http.StatusConflict +} + func (m *Manager) hostPolicy() HostPolicy { if m.HostPolicy != nil { return m.HostPolicy @@ -1040,11 +1133,11 @@ func (s *certState) tlscert() (*tls.Certificate, error) { }, nil } -// certRequest generates a CSR for the given common name cn and optional SANs. -func certRequest(key crypto.Signer, cn string, ext []pkix.Extension, san ...string) ([]byte, error) { +// certRequest generates a CSR for the given common name. +func certRequest(key crypto.Signer, name string, ext []pkix.Extension) ([]byte, error) { req := &x509.CertificateRequest{ - Subject: pkix.Name{CommonName: cn}, - DNSNames: san, + Subject: pkix.Name{CommonName: name}, + DNSNames: []string{name}, ExtraExtensions: ext, } return x509.CreateCertificateRequest(rand.Reader, req, key) diff --git a/vendor/golang.org/x/crypto/acme/autocert/cache.go b/vendor/golang.org/x/crypto/acme/autocert/cache.go index aa9aa845c..03f63022f 100644 --- a/vendor/golang.org/x/crypto/acme/autocert/cache.go +++ b/vendor/golang.org/x/crypto/acme/autocert/cache.go @@ -77,6 +77,7 @@ func (d DirCache) Put(ctx context.Context, name string, data []byte) error { if tmp, err = d.writeTempFile(name, data); err != nil { return } + defer os.Remove(tmp) select { case <-ctx.Done(): // Don't overwrite the file if the context was canceled. @@ -116,12 +117,17 @@ func (d DirCache) Delete(ctx context.Context, name string) error { } // writeTempFile writes b to a temporary file, closes the file and returns its path. -func (d DirCache) writeTempFile(prefix string, b []byte) (string, error) { +func (d DirCache) writeTempFile(prefix string, b []byte) (name string, reterr error) { // TempFile uses 0600 permissions f, err := ioutil.TempFile(string(d), prefix) if err != nil { return "", err } + defer func() { + if reterr != nil { + os.Remove(f.Name()) + } + }() if _, err := f.Write(b); err != nil { f.Close() return "", err diff --git a/vendor/golang.org/x/crypto/acme/autocert/listener.go b/vendor/golang.org/x/crypto/acme/autocert/listener.go index 1e069818a..cb4860973 100644 --- a/vendor/golang.org/x/crypto/acme/autocert/listener.go +++ b/vendor/golang.org/x/crypto/acme/autocert/listener.go @@ -72,7 +72,6 @@ func NewListener(domains ...string) net.Listener { // the Manager m's Prompt, Cache, HostPolicy, and other desired options. func (m *Manager) Listener() net.Listener { ln := &listener{ - m: m, conf: m.TLSConfig(), } ln.tcpListener, ln.tcpListenErr = net.Listen("tcp", ":443") @@ -80,7 +79,6 @@ func (m *Manager) Listener() net.Listener { } type listener struct { - m *Manager conf *tls.Config tcpListener net.Listener diff --git a/vendor/golang.org/x/crypto/acme/http.go b/vendor/golang.org/x/crypto/acme/http.go index a43ce6a5f..2b4c1a10d 100644 --- a/vendor/golang.org/x/crypto/acme/http.go +++ b/vendor/golang.org/x/crypto/acme/http.go @@ -10,6 +10,7 @@ import ( "crypto" "crypto/rand" "encoding/json" + "errors" "fmt" "io/ioutil" "math/big" @@ -155,8 +156,16 @@ func (c *Client) get(ctx context.Context, url string, ok resOkay) (*http.Respons } } +// postAsGet is POST-as-GET, a replacement for GET in RFC8555 +// as described in https://tools.ietf.org/html/rfc8555#section-6.3. +// It makes a POST request in KID form with zero JWS payload. +// See nopayload doc comments in jws.go. +func (c *Client) postAsGet(ctx context.Context, url string, ok resOkay) (*http.Response, error) { + return c.post(ctx, nil, url, noPayload, ok) +} + // post issues a signed POST request in JWS format using the provided key -// to the specified URL. +// to the specified URL. If key is nil, c.Key is used instead. // It returns a non-error value only when ok reports true. // // post retries unsuccessful attempts according to c.RetryBackoff @@ -193,14 +202,31 @@ func (c *Client) post(ctx context.Context, key crypto.Signer, url string, body i } // postNoRetry signs the body with the given key and POSTs it to the provided url. -// The body argument must be JSON-serializable. // It is used by c.post to retry unsuccessful attempts. +// The body argument must be JSON-serializable. +// +// If key argument is nil, c.Key is used to sign the request. +// If key argument is nil and c.accountKID returns a non-zero keyID, +// the request is sent in KID form. Otherwise, JWK form is used. +// +// In practice, when interfacing with RFC-compliant CAs most requests are sent in KID form +// and JWK is used only when KID is unavailable: new account endpoint and certificate +// revocation requests authenticated by a cert key. +// See jwsEncodeJSON for other details. func (c *Client) postNoRetry(ctx context.Context, key crypto.Signer, url string, body interface{}) (*http.Response, *http.Request, error) { + kid := noKeyID + if key == nil { + if c.Key == nil { + return nil, nil, errors.New("acme: Client.Key must be populated to make POST requests") + } + key = c.Key + kid = c.accountKID(ctx) + } nonce, err := c.popNonce(ctx, url) if err != nil { return nil, nil, err } - b, err := jwsEncodeJSON(body, key, nonce) + b, err := jwsEncodeJSON(body, key, kid, nonce, url) if err != nil { return nil, nil, err } @@ -219,6 +245,7 @@ func (c *Client) postNoRetry(ctx context.Context, key crypto.Signer, url string, // doNoRetry issues a request req, replacing its context (if any) with ctx. func (c *Client) doNoRetry(ctx context.Context, req *http.Request) (*http.Response, error) { + req.Header.Set("User-Agent", c.userAgent()) res, err := c.httpClient().Do(req.WithContext(ctx)) if err != nil { select { @@ -243,6 +270,23 @@ func (c *Client) httpClient() *http.Client { return http.DefaultClient } +// packageVersion is the version of the module that contains this package, for +// sending as part of the User-Agent header. It's set in version_go112.go. +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" + if packageVersion != "" { + ua += "@" + packageVersion + } + if c.UserAgent != "" { + ua = c.UserAgent + " " + ua + } + return ua +} + // isBadNonce reports whether err is an ACME "badnonce" error. func isBadNonce(err error) bool { // According to the spec badNonce is urn:ietf:params:acme:error:badNonce. diff --git a/vendor/golang.org/x/crypto/acme/jws.go b/vendor/golang.org/x/crypto/acme/jws.go index 1093b5039..8c3ecceca 100644 --- a/vendor/golang.org/x/crypto/acme/jws.go +++ b/vendor/golang.org/x/crypto/acme/jws.go @@ -7,47 +7,81 @@ package acme import ( "crypto" "crypto/ecdsa" + "crypto/hmac" "crypto/rand" "crypto/rsa" "crypto/sha256" _ "crypto/sha512" // need for EC keys + "encoding/asn1" "encoding/base64" "encoding/json" + "errors" "fmt" "math/big" ) +// keyID is the account identity provided by a CA during registration. +type keyID string + +// noKeyID indicates that jwsEncodeJSON should compute and use JWK instead of a KID. +// See jwsEncodeJSON for details. +const noKeyID = keyID("") + +// noPayload indicates jwsEncodeJSON will encode zero-length octet string +// in a JWS request. This is called POST-as-GET in RFC 8555 and is used to make +// authenticated GET requests via POSTing with an empty payload. +// See https://tools.ietf.org/html/rfc8555#section-6.3 for more details. +const noPayload = "" + +// jsonWebSignature can be easily serialized into a JWS following +// https://tools.ietf.org/html/rfc7515#section-3.2. +type jsonWebSignature struct { + Protected string `json:"protected"` + Payload string `json:"payload"` + Sig string `json:"signature"` +} + // jwsEncodeJSON signs claimset using provided key and a nonce. -// The result is serialized in JSON format. +// The result is serialized in JSON format containing either kid or jwk +// fields based on the provided keyID value. +// +// If kid is non-empty, its quoted value is inserted in the protected head +// as "kid" field value. Otherwise, JWK is computed using jwkEncode and inserted +// as "jwk" field value. The "jwk" and "kid" fields are mutually exclusive. +// // See https://tools.ietf.org/html/rfc7515#section-7. -func jwsEncodeJSON(claimset interface{}, key crypto.Signer, nonce string) ([]byte, error) { - jwk, err := jwkEncode(key.Public()) - if err != nil { - return nil, err - } +func jwsEncodeJSON(claimset interface{}, key crypto.Signer, kid keyID, nonce, url string) ([]byte, error) { alg, sha := jwsHasher(key.Public()) if alg == "" || !sha.Available() { return nil, ErrUnsupportedKey } - phead := fmt.Sprintf(`{"alg":%q,"jwk":%s,"nonce":%q}`, alg, jwk, nonce) + var phead string + switch kid { + case noKeyID: + jwk, err := jwkEncode(key.Public()) + if err != nil { + return nil, err + } + phead = fmt.Sprintf(`{"alg":%q,"jwk":%s,"nonce":%q,"url":%q}`, alg, jwk, nonce, url) + default: + phead = fmt.Sprintf(`{"alg":%q,"kid":%q,"nonce":%q,"url":%q}`, alg, kid, nonce, url) + } phead = base64.RawURLEncoding.EncodeToString([]byte(phead)) - cs, err := json.Marshal(claimset) - if err != nil { - return nil, err + var payload string + if claimset != noPayload { + cs, err := json.Marshal(claimset) + if err != nil { + return nil, err + } + payload = base64.RawURLEncoding.EncodeToString(cs) } - payload := base64.RawURLEncoding.EncodeToString(cs) hash := sha.New() hash.Write([]byte(phead + "." + payload)) sig, err := jwsSign(key, sha, hash.Sum(nil)) if err != nil { return nil, err } - - enc := struct { - Protected string `json:"protected"` - Payload string `json:"payload"` - Sig string `json:"signature"` - }{ + enc := jsonWebSignature{ Protected: phead, Payload: payload, Sig: base64.RawURLEncoding.EncodeToString(sig), @@ -55,6 +89,43 @@ func jwsEncodeJSON(claimset interface{}, key crypto.Signer, nonce string) ([]byt return json.Marshal(&enc) } +// jwsWithMAC creates and signs a JWS using the given key and the HS256 +// algorithm. kid and url are included in the protected header. rawPayload +// should not be base64-URL-encoded. +func jwsWithMAC(key []byte, kid, url string, rawPayload []byte) (*jsonWebSignature, error) { + if len(key) == 0 { + return nil, errors.New("acme: cannot sign JWS with an empty MAC key") + } + header := struct { + Algorithm string `json:"alg"` + KID string `json:"kid"` + URL string `json:"url,omitempty"` + }{ + // Only HMAC-SHA256 is supported. + Algorithm: "HS256", + KID: kid, + URL: url, + } + rawProtected, err := json.Marshal(header) + if err != nil { + return nil, err + } + protected := base64.RawURLEncoding.EncodeToString(rawProtected) + payload := base64.RawURLEncoding.EncodeToString(rawPayload) + + h := hmac.New(sha256.New, key) + if _, err := h.Write([]byte(protected + "." + payload)); err != nil { + return nil, err + } + mac := h.Sum(nil) + + return &jsonWebSignature{ + Protected: protected, + Payload: payload, + Sig: base64.RawURLEncoding.EncodeToString(mac), + }, nil +} + // jwkEncode encodes public part of an RSA or ECDSA key into a JWK. // The result is also suitable for creating a JWK thumbprint. // https://tools.ietf.org/html/rfc7517 @@ -98,21 +169,23 @@ func jwkEncode(pub crypto.PublicKey) (string, error) { // jwsSign signs the digest using the given key. // The hash is unused for ECDSA keys. -// -// Note: non-stdlib crypto.Signer implementations are expected to return -// the signature in the format as specified in RFC7518. -// See https://tools.ietf.org/html/rfc7518 for more details. func jwsSign(key crypto.Signer, hash crypto.Hash, digest []byte) ([]byte, error) { - if key, ok := key.(*ecdsa.PrivateKey); ok { - // The key.Sign method of ecdsa returns ASN1-encoded signature. - // So, we use the package Sign function instead - // to get R and S values directly and format the result accordingly. - r, s, err := ecdsa.Sign(rand.Reader, key, digest) + switch pub := key.Public().(type) { + case *rsa.PublicKey: + return key.Sign(rand.Reader, digest, hash) + case *ecdsa.PublicKey: + sigASN1, err := key.Sign(rand.Reader, digest, hash) if err != nil { return nil, err } - rb, sb := r.Bytes(), s.Bytes() - size := key.Params().BitSize / 8 + + var rs struct{ R, S *big.Int } + if _, err := asn1.Unmarshal(sigASN1, &rs); err != nil { + return nil, err + } + + rb, sb := rs.R.Bytes(), rs.S.Bytes() + size := pub.Params().BitSize / 8 if size%8 > 0 { size++ } @@ -121,7 +194,7 @@ func jwsSign(key crypto.Signer, hash crypto.Hash, digest []byte) ([]byte, error) copy(sig[size*2-len(sb):], sb) return sig, nil } - return key.Sign(rand.Reader, digest, hash) + return nil, ErrUnsupportedKey } // jwsHasher indicates suitable JWS algorithm name and a hash function diff --git a/vendor/golang.org/x/crypto/acme/rfc8555.go b/vendor/golang.org/x/crypto/acme/rfc8555.go new file mode 100644 index 000000000..f9d3011ff --- /dev/null +++ b/vendor/golang.org/x/crypto/acme/rfc8555.go @@ -0,0 +1,438 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package acme + +import ( + "context" + "crypto" + "encoding/base64" + "encoding/json" + "encoding/pem" + "errors" + "fmt" + "io" + "io/ioutil" + "net/http" + "time" +) + +// DeactivateReg permanently disables an existing account associated with c.Key. +// A deactivated account can no longer request certificate issuance or access +// resources related to the account, such as orders or authorizations. +// +// It only works with CAs implementing RFC 8555. +func (c *Client) DeactivateReg(ctx context.Context) error { + url := string(c.accountKID(ctx)) + if url == "" { + return ErrNoAccount + } + req := json.RawMessage(`{"status": "deactivated"}`) + res, err := c.post(ctx, nil, url, req, wantStatus(http.StatusOK)) + if err != nil { + return err + } + res.Body.Close() + return nil +} + +// registerRFC is equivalent to c.Register but for CAs implementing RFC 8555. +// It expects c.Discover to have already been called. +func (c *Client) registerRFC(ctx context.Context, acct *Account, prompt func(tosURL string) bool) (*Account, error) { + c.cacheMu.Lock() // guard c.kid access + defer c.cacheMu.Unlock() + + req := struct { + TermsAgreed bool `json:"termsOfServiceAgreed,omitempty"` + Contact []string `json:"contact,omitempty"` + ExternalAccountBinding *jsonWebSignature `json:"externalAccountBinding,omitempty"` + }{ + Contact: acct.Contact, + } + if c.dir.Terms != "" { + req.TermsAgreed = prompt(c.dir.Terms) + } + + // set 'externalAccountBinding' field if requested + if acct.ExternalAccountBinding != nil { + eabJWS, err := c.encodeExternalAccountBinding(acct.ExternalAccountBinding) + if err != nil { + return nil, fmt.Errorf("acme: failed to encode external account binding: %v", err) + } + req.ExternalAccountBinding = eabJWS + } + + res, err := c.post(ctx, c.Key, c.dir.RegURL, req, wantStatus( + http.StatusOK, // account with this key already registered + http.StatusCreated, // new account created + )) + if err != nil { + return nil, err + } + + defer res.Body.Close() + a, err := responseAccount(res) + if err != nil { + return nil, err + } + // Cache Account URL even if we return an error to the caller. + // It is by all means a valid and usable "kid" value for future requests. + c.kid = keyID(a.URI) + if res.StatusCode == http.StatusOK { + return nil, ErrAccountAlreadyExists + } + return a, nil +} + +// encodeExternalAccountBinding will encode an external account binding stanza +// as described in https://tools.ietf.org/html/rfc8555#section-7.3.4. +func (c *Client) encodeExternalAccountBinding(eab *ExternalAccountBinding) (*jsonWebSignature, error) { + jwk, err := jwkEncode(c.Key.Public()) + if err != nil { + return nil, err + } + return jwsWithMAC(eab.Key, eab.KID, c.dir.RegURL, []byte(jwk)) +} + +// updateRegRFC is equivalent to c.UpdateReg but for CAs implementing RFC 8555. +// It expects c.Discover to have already been called. +func (c *Client) updateRegRFC(ctx context.Context, a *Account) (*Account, error) { + url := string(c.accountKID(ctx)) + if url == "" { + return nil, ErrNoAccount + } + req := struct { + Contact []string `json:"contact,omitempty"` + }{ + Contact: a.Contact, + } + res, err := c.post(ctx, nil, url, req, wantStatus(http.StatusOK)) + if err != nil { + return nil, err + } + defer res.Body.Close() + return responseAccount(res) +} + +// getGegRFC is equivalent to c.GetReg but for CAs implementing RFC 8555. +// It expects c.Discover to have already been called. +func (c *Client) getRegRFC(ctx context.Context) (*Account, error) { + req := json.RawMessage(`{"onlyReturnExisting": true}`) + res, err := c.post(ctx, c.Key, c.dir.RegURL, req, wantStatus(http.StatusOK)) + if e, ok := err.(*Error); ok && e.ProblemType == "urn:ietf:params:acme:error:accountDoesNotExist" { + return nil, ErrNoAccount + } + if err != nil { + return nil, err + } + + defer res.Body.Close() + return responseAccount(res) +} + +func responseAccount(res *http.Response) (*Account, error) { + var v struct { + Status string + Contact []string + Orders string + } + if err := json.NewDecoder(res.Body).Decode(&v); err != nil { + return nil, fmt.Errorf("acme: invalid account response: %v", err) + } + return &Account{ + URI: res.Header.Get("Location"), + Status: v.Status, + Contact: v.Contact, + OrdersURL: v.Orders, + }, nil +} + +// AuthorizeOrder initiates the order-based application for certificate issuance, +// as opposed to pre-authorization in Authorize. +// It is only supported by CAs implementing RFC 8555. +// +// The caller then needs to fetch each authorization with GetAuthorization, +// identify those with StatusPending status and fulfill a challenge using Accept. +// Once all authorizations are satisfied, the caller will typically want to poll +// order status using WaitOrder until it's in StatusReady state. +// To finalize the order and obtain a certificate, the caller submits a CSR with CreateOrderCert. +func (c *Client) AuthorizeOrder(ctx context.Context, id []AuthzID, opt ...OrderOption) (*Order, error) { + dir, err := c.Discover(ctx) + if err != nil { + return nil, err + } + + req := struct { + Identifiers []wireAuthzID `json:"identifiers"` + NotBefore string `json:"notBefore,omitempty"` + NotAfter string `json:"notAfter,omitempty"` + }{} + for _, v := range id { + req.Identifiers = append(req.Identifiers, wireAuthzID{ + Type: v.Type, + Value: v.Value, + }) + } + for _, o := range opt { + switch o := o.(type) { + case orderNotBeforeOpt: + req.NotBefore = time.Time(o).Format(time.RFC3339) + case orderNotAfterOpt: + req.NotAfter = time.Time(o).Format(time.RFC3339) + default: + // Package's fault if we let this happen. + panic(fmt.Sprintf("unsupported order option type %T", o)) + } + } + + res, err := c.post(ctx, nil, dir.OrderURL, req, wantStatus(http.StatusCreated)) + if err != nil { + return nil, err + } + defer res.Body.Close() + return responseOrder(res) +} + +// GetOrder retrives an order identified by the given URL. +// For orders created with AuthorizeOrder, the url value is Order.URI. +// +// If a caller needs to poll an order until its status is final, +// see the WaitOrder method. +func (c *Client) GetOrder(ctx context.Context, url string) (*Order, error) { + if _, err := c.Discover(ctx); err != nil { + return nil, err + } + + res, err := c.postAsGet(ctx, url, wantStatus(http.StatusOK)) + if err != nil { + return nil, err + } + defer res.Body.Close() + return responseOrder(res) +} + +// WaitOrder polls an order from the given URL until it is in one of the final states, +// StatusReady, StatusValid or StatusInvalid, the CA responded with a non-retryable error +// or the context is done. +// +// It returns a non-nil Order only if its Status is StatusReady or StatusValid. +// In all other cases WaitOrder returns an error. +// If the Status is StatusInvalid, the returned error is of type *OrderError. +func (c *Client) WaitOrder(ctx context.Context, url string) (*Order, error) { + if _, err := c.Discover(ctx); err != nil { + return nil, err + } + for { + res, err := c.postAsGet(ctx, url, wantStatus(http.StatusOK)) + if err != nil { + return nil, err + } + o, err := responseOrder(res) + res.Body.Close() + switch { + case err != nil: + // Skip and retry. + case o.Status == StatusInvalid: + return nil, &OrderError{OrderURL: o.URI, Status: o.Status} + case o.Status == StatusReady || o.Status == StatusValid: + return o, nil + } + + d := retryAfter(res.Header.Get("Retry-After")) + if d == 0 { + // Default retry-after. + // Same reasoning as in WaitAuthorization. + d = time.Second + } + t := time.NewTimer(d) + select { + case <-ctx.Done(): + t.Stop() + return nil, ctx.Err() + case <-t.C: + // Retry. + } + } +} + +func responseOrder(res *http.Response) (*Order, error) { + var v struct { + Status string + Expires time.Time + Identifiers []wireAuthzID + NotBefore time.Time + NotAfter time.Time + Error *wireError + Authorizations []string + Finalize string + Certificate string + } + if err := json.NewDecoder(res.Body).Decode(&v); err != nil { + return nil, fmt.Errorf("acme: error reading order: %v", err) + } + o := &Order{ + URI: res.Header.Get("Location"), + Status: v.Status, + Expires: v.Expires, + NotBefore: v.NotBefore, + NotAfter: v.NotAfter, + AuthzURLs: v.Authorizations, + FinalizeURL: v.Finalize, + CertURL: v.Certificate, + } + for _, id := range v.Identifiers { + o.Identifiers = append(o.Identifiers, AuthzID{Type: id.Type, Value: id.Value}) + } + if v.Error != nil { + o.Error = v.Error.error(nil /* headers */) + } + return o, nil +} + +// CreateOrderCert submits the CSR (Certificate Signing Request) to a CA at the specified URL. +// The URL is the FinalizeURL field of an Order created with AuthorizeOrder. +// +// If the bundle argument is true, the returned value also contain the CA (issuer) +// certificate chain. Otherwise, only a leaf certificate is returned. +// The returned URL can be used to re-fetch the certificate using FetchCert. +// +// This method is only supported by CAs implementing RFC 8555. See CreateCert for pre-RFC CAs. +// +// CreateOrderCert returns an error if the CA's response is unreasonably large. +// Callers are encouraged to parse the returned value to ensure the certificate is valid and has the expected features. +func (c *Client) CreateOrderCert(ctx context.Context, url string, csr []byte, bundle bool) (der [][]byte, certURL string, err error) { + if _, err := c.Discover(ctx); err != nil { // required by c.accountKID + return nil, "", err + } + + // RFC describes this as "finalize order" request. + req := struct { + CSR string `json:"csr"` + }{ + CSR: base64.RawURLEncoding.EncodeToString(csr), + } + res, err := c.post(ctx, nil, url, req, wantStatus(http.StatusOK)) + if err != nil { + return nil, "", err + } + defer res.Body.Close() + o, err := responseOrder(res) + if err != nil { + return nil, "", err + } + + // Wait for CA to issue the cert if they haven't. + if o.Status != StatusValid { + o, err = c.WaitOrder(ctx, o.URI) + } + if err != nil { + return nil, "", err + } + // The only acceptable status post finalize and WaitOrder is "valid". + if o.Status != StatusValid { + return nil, "", &OrderError{OrderURL: o.URI, Status: o.Status} + } + crt, err := c.fetchCertRFC(ctx, o.CertURL, bundle) + return crt, o.CertURL, err +} + +// fetchCertRFC downloads issued certificate from the given URL. +// It expects the CA to respond with PEM-encoded certificate chain. +// +// The URL argument is the CertURL field of Order. +func (c *Client) fetchCertRFC(ctx context.Context, url string, bundle bool) ([][]byte, error) { + res, err := c.postAsGet(ctx, url, wantStatus(http.StatusOK)) + if err != nil { + return nil, err + } + defer res.Body.Close() + + // Get all the bytes up to a sane maximum. + // Account very roughly for base64 overhead. + const max = maxCertChainSize + maxCertChainSize/33 + b, err := ioutil.ReadAll(io.LimitReader(res.Body, max+1)) + if err != nil { + return nil, fmt.Errorf("acme: fetch cert response stream: %v", err) + } + if len(b) > max { + return nil, errors.New("acme: certificate chain is too big") + } + + // Decode PEM chain. + var chain [][]byte + for { + var p *pem.Block + p, b = pem.Decode(b) + if p == nil { + break + } + if p.Type != "CERTIFICATE" { + return nil, fmt.Errorf("acme: invalid PEM cert type %q", p.Type) + } + + chain = append(chain, p.Bytes) + if !bundle { + return chain, nil + } + if len(chain) > maxChainLen { + return nil, errors.New("acme: certificate chain is too long") + } + } + if len(chain) == 0 { + return nil, errors.New("acme: certificate chain is empty") + } + return chain, nil +} + +// sends a cert revocation request in either JWK form when key is non-nil or KID form otherwise. +func (c *Client) revokeCertRFC(ctx context.Context, key crypto.Signer, cert []byte, reason CRLReasonCode) error { + req := &struct { + Cert string `json:"certificate"` + Reason int `json:"reason"` + }{ + Cert: base64.RawURLEncoding.EncodeToString(cert), + Reason: int(reason), + } + res, err := c.post(ctx, key, c.dir.RevokeURL, req, wantStatus(http.StatusOK)) + if err != nil { + if isAlreadyRevoked(err) { + // Assume it is not an error to revoke an already revoked cert. + return nil + } + return err + } + defer res.Body.Close() + return nil +} + +func isAlreadyRevoked(err error) bool { + e, ok := err.(*Error) + return ok && e.ProblemType == "urn:ietf:params:acme:error:alreadyRevoked" +} + +// ListCertAlternates retrieves any alternate certificate chain URLs for the +// given certificate chain URL. These alternate URLs can be passed to FetchCert +// in order to retrieve the alternate certificate chains. +// +// If there are no alternate issuer certificate chains, a nil slice will be +// returned. +func (c *Client) ListCertAlternates(ctx context.Context, url string) ([]string, error) { + if _, err := c.Discover(ctx); err != nil { // required by c.accountKID + return nil, err + } + + res, err := c.postAsGet(ctx, url, wantStatus(http.StatusOK)) + if err != nil { + return nil, err + } + defer res.Body.Close() + + // We don't need the body but we need to discard it so we don't end up + // preventing keep-alive + if _, err := io.Copy(ioutil.Discard, res.Body); err != nil { + return nil, fmt.Errorf("acme: cert alternates response stream: %v", err) + } + alts := linkHeader(res.Header, "alternate") + return alts, nil +} diff --git a/vendor/golang.org/x/crypto/acme/types.go b/vendor/golang.org/x/crypto/acme/types.go index 54792c065..eaae45290 100644 --- a/vendor/golang.org/x/crypto/acme/types.go +++ b/vendor/golang.org/x/crypto/acme/types.go @@ -14,14 +14,18 @@ import ( "time" ) -// ACME server response statuses used to describe Authorization and Challenge states. +// ACME status values of Account, Order, Authorization and Challenge objects. +// See https://tools.ietf.org/html/rfc8555#section-7.1.6 for details. const ( - StatusUnknown = "unknown" - StatusPending = "pending" - StatusProcessing = "processing" - StatusValid = "valid" - StatusInvalid = "invalid" - StatusRevoked = "revoked" + StatusDeactivated = "deactivated" + StatusExpired = "expired" + StatusInvalid = "invalid" + StatusPending = "pending" + StatusProcessing = "processing" + StatusReady = "ready" + StatusRevoked = "revoked" + StatusUnknown = "unknown" + StatusValid = "valid" ) // CRLReasonCode identifies the reason for a certificate revocation. @@ -41,8 +45,43 @@ const ( CRLReasonAACompromise CRLReasonCode = 10 ) -// ErrUnsupportedKey is returned when an unsupported key type is encountered. -var ErrUnsupportedKey = errors.New("acme: unknown key type; only RSA and ECDSA are supported") +var ( + // ErrUnsupportedKey is returned when an unsupported key type is encountered. + ErrUnsupportedKey = errors.New("acme: unknown key type; only RSA and ECDSA are supported") + + // ErrAccountAlreadyExists indicates that the Client's key has already been registered + // with the CA. It is returned by Register method. + ErrAccountAlreadyExists = errors.New("acme: account already exists") + + // ErrNoAccount indicates that the Client's key has not been registered with the CA. + ErrNoAccount = errors.New("acme: account does not exist") +) + +// A Subproblem describes an ACME subproblem as reported in an Error. +type Subproblem struct { + // Type is a URI reference that identifies the problem type, + // typically in a "urn:acme:error:xxx" form. + Type string + // Detail is a human-readable explanation specific to this occurrence of the problem. + Detail string + // Instance indicates a URL that the client should direct a human user to visit + // in order for instructions on how to agree to the updated Terms of Service. + // In such an event CA sets StatusCode to 403, Type to + // "urn:ietf:params:acme:error:userActionRequired", and adds a Link header with relation + // "terms-of-service" containing the latest TOS URL. + Instance string + // Identifier may contain the ACME identifier that the error is for. + Identifier *AuthzID +} + +func (sp Subproblem) String() string { + str := fmt.Sprintf("%s: ", sp.Type) + if sp.Identifier != nil { + str += fmt.Sprintf("[%s: %s] ", sp.Identifier.Type, sp.Identifier.Value) + } + str += sp.Detail + return str +} // Error is an ACME error, defined in Problem Details for HTTP APIs doc // http://tools.ietf.org/html/draft-ietf-appsawg-http-problem. @@ -54,13 +93,30 @@ type Error struct { ProblemType string // Detail is a human-readable explanation specific to this occurrence of the problem. Detail string + // Instance indicates a URL that the client should direct a human user to visit + // in order for instructions on how to agree to the updated Terms of Service. + // In such an event CA sets StatusCode to 403, ProblemType to + // "urn:ietf:params:acme:error:userActionRequired" and a Link header with relation + // "terms-of-service" containing the latest TOS URL. + Instance string // Header is the original server error response headers. // It may be nil. Header http.Header + // Subproblems may contain more detailed information about the individual problems + // that caused the error. This field is only sent by RFC 8555 compatible ACME + // servers. Defined in RFC 8555 Section 6.7.1. + Subproblems []Subproblem } func (e *Error) Error() string { - return fmt.Sprintf("%d %s: %s", e.StatusCode, e.ProblemType, e.Detail) + str := fmt.Sprintf("%d %s: %s", e.StatusCode, e.ProblemType, e.Detail) + if len(e.Subproblems) > 0 { + str += fmt.Sprintf("; subproblems:") + for _, sp := range e.Subproblems { + str += fmt.Sprintf("\n\t%s", sp) + } + } + return str } // AuthorizationError indicates that an authorization for an identifier @@ -83,7 +139,27 @@ func (a *AuthorizationError) Error() string { for i, err := range a.Errors { e[i] = err.Error() } - return fmt.Sprintf("acme: authorization error for %s: %s", a.Identifier, strings.Join(e, "; ")) + + if a.Identifier != "" { + return fmt.Sprintf("acme: authorization error for %s: %s", a.Identifier, strings.Join(e, "; ")) + } + + return fmt.Sprintf("acme: authorization error: %s", strings.Join(e, "; ")) +} + +// OrderError is returned from Client's order related methods. +// It indicates the order is unusable and the clients should start over with +// AuthorizeOrder. +// +// The clients can still fetch the order object from CA using GetOrder +// to inspect its state. +type OrderError struct { + OrderURL string + Status string +} + +func (oe *OrderError) Error() string { + return fmt.Sprintf("acme: order %s status: %s", oe.OrderURL, oe.Status) } // RateLimit reports whether err represents a rate limit error and @@ -108,49 +184,110 @@ func RateLimit(err error) (time.Duration, bool) { } // Account is a user account. It is associated with a private key. +// Non-RFC 8555 fields are empty when interfacing with a compliant CA. type Account struct { // URI is the account unique ID, which is also a URL used to retrieve // account data from the CA. + // When interfacing with RFC 8555-compliant CAs, URI is the "kid" field + // value in JWS signed requests. URI string // Contact is a slice of contact info used during registration. + // See https://tools.ietf.org/html/rfc8555#section-7.3 for supported + // formats. Contact []string + // Status indicates current account status as returned by the CA. + // Possible values are StatusValid, StatusDeactivated, and StatusRevoked. + Status string + + // OrdersURL is a URL from which a list of orders submitted by this account + // can be fetched. + OrdersURL string + // The terms user has agreed to. // A value not matching CurrentTerms indicates that the user hasn't agreed // to the actual Terms of Service of the CA. + // + // It is non-RFC 8555 compliant. Package users can store the ToS they agree to + // during Client's Register call in the prompt callback function. AgreedTerms string // Actual terms of a CA. + // + // It is non-RFC 8555 compliant. Use Directory's Terms field. + // When a CA updates their terms and requires an account agreement, + // a URL at which instructions to do so is available in Error's Instance field. CurrentTerms string // Authz is the authorization URL used to initiate a new authz flow. + // + // It is non-RFC 8555 compliant. Use Directory's AuthzURL or OrderURL. Authz string // Authorizations is a URI from which a list of authorizations // granted to this account can be fetched via a GET request. + // + // It is non-RFC 8555 compliant and is obsoleted by OrdersURL. Authorizations string // Certificates is a URI from which a list of certificates // issued for this account can be fetched via a GET request. + // + // It is non-RFC 8555 compliant and is obsoleted by OrdersURL. Certificates string + + // ExternalAccountBinding represents an arbitrary binding to an account of + // the CA which the ACME server is tied to. + // See https://tools.ietf.org/html/rfc8555#section-7.3.4 for more details. + ExternalAccountBinding *ExternalAccountBinding +} + +// ExternalAccountBinding contains the data needed to form a request with +// an external account binding. +// See https://tools.ietf.org/html/rfc8555#section-7.3.4 for more details. +type ExternalAccountBinding struct { + // KID is the Key ID of the symmetric MAC key that the CA provides to + // identify an external account from ACME. + KID string + + // Key is the bytes of the symmetric key that the CA provides to identify + // the account. Key must correspond to the KID. + Key []byte +} + +func (e *ExternalAccountBinding) String() string { + return fmt.Sprintf("&{KID: %q, Key: redacted}", e.KID) } // Directory is ACME server discovery data. +// See https://tools.ietf.org/html/rfc8555#section-7.1.1 for more details. type Directory struct { - // RegURL is an account endpoint URL, allowing for creating new - // and modifying existing accounts. + // NonceURL indicates an endpoint where to fetch fresh nonce values from. + NonceURL string + + // RegURL is an account endpoint URL, allowing for creating new accounts. + // Pre-RFC 8555 CAs also allow modifying existing accounts at this URL. RegURL string - // AuthzURL is used to initiate Identifier Authorization flow. + // OrderURL is used to initiate the certificate issuance flow + // as described in RFC 8555. + OrderURL string + + // AuthzURL is used to initiate identifier pre-authorization flow. + // Empty string indicates the flow is unsupported by the CA. AuthzURL string // CertURL is a new certificate issuance endpoint URL. + // It is non-RFC 8555 compliant and is obsoleted by OrderURL. CertURL string // RevokeURL is used to initiate a certificate revocation flow. RevokeURL string + // KeyChangeURL allows to perform account key rollover flow. + KeyChangeURL string + // Term is a URI identifying the current terms of service. Terms string @@ -162,44 +299,126 @@ type Directory struct { // recognises as referring to itself for the purposes of CAA record validation // as defined in RFC6844. CAA []string + + // ExternalAccountRequired indicates that the CA requires for all account-related + // requests to include external account binding information. + ExternalAccountRequired bool } -// Challenge encodes a returned CA challenge. -// Its Error field may be non-nil if the challenge is part of an Authorization -// with StatusInvalid. -type Challenge struct { - // Type is the challenge type, e.g. "http-01", "tls-sni-02", "dns-01". - Type string +// rfcCompliant reports whether the ACME server implements RFC 8555. +// Note that some servers may have incomplete RFC implementation +// even if the returned value is true. +// If rfcCompliant reports false, the server most likely implements draft-02. +func (d *Directory) rfcCompliant() bool { + return d.OrderURL != "" +} - // URI is where a challenge response can be posted to. +// Order represents a client's request for a certificate. +// It tracks the request flow progress through to issuance. +type Order struct { + // URI uniquely identifies an order. URI string - // Token is a random value that uniquely identifies the challenge. - Token string - - // Status identifies the status of this challenge. + // Status represents the current status of the order. + // It indicates which action the client should take. + // + // Possible values are StatusPending, StatusReady, StatusProcessing, StatusValid and StatusInvalid. + // Pending means the CA does not believe that the client has fulfilled the requirements. + // Ready indicates that the client has fulfilled all the requirements and can submit a CSR + // to obtain a certificate. This is done with Client's CreateOrderCert. + // Processing means the certificate is being issued. + // Valid indicates the CA has issued the certificate. It can be downloaded + // from the Order's CertURL. This is done with Client's FetchCert. + // Invalid means the certificate will not be issued. Users should consider this order + // abandoned. Status string - // Error indicates the reason for an authorization failure - // when this challenge was used. - // The type of a non-nil value is *Error. - Error error + // Expires is the timestamp after which CA considers this order invalid. + Expires time.Time + + // Identifiers contains all identifier objects which the order pertains to. + Identifiers []AuthzID + + // NotBefore is the requested value of the notBefore field in the certificate. + NotBefore time.Time + + // NotAfter is the requested value of the notAfter field in the certificate. + NotAfter time.Time + + // AuthzURLs represents authorizations to complete before a certificate + // for identifiers specified in the order can be issued. + // It also contains unexpired authorizations that the client has completed + // in the past. + // + // Authorization objects can be fetched using Client's GetAuthorization method. + // + // The required authorizations are dictated by CA policies. + // There may not be a 1:1 relationship between the identifiers and required authorizations. + // Required authorizations can be identified by their StatusPending status. + // + // For orders in the StatusValid or StatusInvalid state these are the authorizations + // which were completed. + AuthzURLs []string + + // FinalizeURL is the endpoint at which a CSR is submitted to obtain a certificate + // once all the authorizations are satisfied. + FinalizeURL string + + // CertURL points to the certificate that has been issued in response to this order. + CertURL string + + // The error that occurred while processing the order as received from a CA, if any. + Error *Error +} + +// OrderOption allows customizing Client.AuthorizeOrder call. +type OrderOption interface { + privateOrderOpt() } +// WithOrderNotBefore sets order's NotBefore field. +func WithOrderNotBefore(t time.Time) OrderOption { + return orderNotBeforeOpt(t) +} + +// WithOrderNotAfter sets order's NotAfter field. +func WithOrderNotAfter(t time.Time) OrderOption { + return orderNotAfterOpt(t) +} + +type orderNotBeforeOpt time.Time + +func (orderNotBeforeOpt) privateOrderOpt() {} + +type orderNotAfterOpt time.Time + +func (orderNotAfterOpt) privateOrderOpt() {} + // Authorization encodes an authorization response. type Authorization struct { // URI uniquely identifies a authorization. URI string - // Status identifies the status of an authorization. + // Status is the current status of an authorization. + // Possible values are StatusPending, StatusValid, StatusInvalid, StatusDeactivated, + // StatusExpired and StatusRevoked. Status string // Identifier is what the account is authorized to represent. Identifier AuthzID + // The timestamp after which the CA considers the authorization invalid. + Expires time.Time + + // Wildcard is true for authorizations of a wildcard domain name. + Wildcard bool + // Challenges that the client needs to fulfill in order to prove possession // of the identifier (for pending authorizations). - // For final authorizations, the challenges that were used. + // For valid authorizations, the challenge that was validated. + // For invalid authorizations, the challenge that was attempted and failed. + // + // RFC 8555 compatible CAs require users to fuflfill only one of the challenges. Challenges []*Challenge // A collection of sets of challenges, each of which would be sufficient @@ -207,24 +426,52 @@ type Authorization struct { // Clients must complete a set of challenges that covers at least one set. // Challenges are identified by their indices in the challenges array. // If this field is empty, the client needs to complete all challenges. + // + // This field is unused in RFC 8555. Combinations [][]int } // AuthzID is an identifier that an account is authorized to represent. type AuthzID struct { - Type string // The type of identifier, e.g. "dns". + Type string // The type of identifier, "dns" or "ip". Value string // The identifier itself, e.g. "example.org". } +// DomainIDs creates a slice of AuthzID with "dns" identifier type. +func DomainIDs(names ...string) []AuthzID { + a := make([]AuthzID, len(names)) + for i, v := range names { + a[i] = AuthzID{Type: "dns", Value: v} + } + return a +} + +// IPIDs creates a slice of AuthzID with "ip" identifier type. +// Each element of addr is textual form of an address as defined +// in RFC1123 Section 2.1 for IPv4 and in RFC5952 Section 4 for IPv6. +func IPIDs(addr ...string) []AuthzID { + a := make([]AuthzID, len(addr)) + for i, v := range addr { + a[i] = AuthzID{Type: "ip", Value: v} + } + return a +} + +// wireAuthzID is ACME JSON representation of authorization identifier objects. +type wireAuthzID struct { + Type string `json:"type"` + Value string `json:"value"` +} + // wireAuthz is ACME JSON representation of Authorization objects. type wireAuthz struct { + Identifier wireAuthzID Status string + Expires time.Time + Wildcard bool Challenges []wireChallenge Combinations [][]int - Identifier struct { - Type string - Value string - } + Error *wireError } func (z *wireAuthz) authorization(uri string) *Authorization { @@ -232,8 +479,10 @@ func (z *wireAuthz) authorization(uri string) *Authorization { URI: uri, Status: z.Status, Identifier: AuthzID{Type: z.Identifier.Type, Value: z.Identifier.Value}, - Combinations: z.Combinations, // shallow copy + Expires: z.Expires, + Wildcard: z.Wildcard, Challenges: make([]*Challenge, len(z.Challenges)), + Combinations: z.Combinations, // shallow copy } for i, v := range z.Challenges { a.Challenges[i] = v.challenge() @@ -246,30 +495,69 @@ func (z *wireAuthz) error(uri string) *AuthorizationError { URI: uri, Identifier: z.Identifier.Value, } + + if z.Error != nil { + err.Errors = append(err.Errors, z.Error.error(nil)) + } + for _, raw := range z.Challenges { if raw.Error != nil { err.Errors = append(err.Errors, raw.Error.error(nil)) } } + return err } +// Challenge encodes a returned CA challenge. +// Its Error field may be non-nil if the challenge is part of an Authorization +// with StatusInvalid. +type Challenge struct { + // Type is the challenge type, e.g. "http-01", "tls-alpn-01", "dns-01". + Type string + + // URI is where a challenge response can be posted to. + URI string + + // Token is a random value that uniquely identifies the challenge. + Token string + + // Status identifies the status of this challenge. + // In RFC 8555, possible values are StatusPending, StatusProcessing, StatusValid, + // and StatusInvalid. + Status string + + // Validated is the time at which the CA validated this challenge. + // Always zero value in pre-RFC 8555. + Validated time.Time + + // Error indicates the reason for an authorization failure + // when this challenge was used. + // The type of a non-nil value is *Error. + Error error +} + // wireChallenge is ACME JSON challenge representation. type wireChallenge struct { - URI string `json:"uri"` - Type string - Token string - Status string - Error *wireError + URL string `json:"url"` // RFC + URI string `json:"uri"` // pre-RFC + Type string + Token string + Status string + Validated time.Time + Error *wireError } func (c *wireChallenge) challenge() *Challenge { v := &Challenge{ - URI: c.URI, + URI: c.URL, Type: c.Type, Token: c.Token, Status: c.Status, } + if v.URI == "" { + v.URI = c.URI // c.URL was empty; use legacy + } if v.Status == "" { v.Status = StatusPending } @@ -282,18 +570,23 @@ func (c *wireChallenge) challenge() *Challenge { // wireError is a subset of fields of the Problem Details object // as described in https://tools.ietf.org/html/rfc7807#section-3.1. type wireError struct { - Status int - Type string - Detail string + Status int + Type string + Detail string + Instance string + Subproblems []Subproblem } func (e *wireError) error(h http.Header) *Error { - return &Error{ + err := &Error{ StatusCode: e.Status, ProblemType: e.Type, Detail: e.Detail, + Instance: e.Instance, Header: h, + Subproblems: e.Subproblems, } + return err } // CertOption is an optional argument type for the TLS ChallengeCert methods for diff --git a/vendor/golang.org/x/crypto/acme/version_go112.go b/vendor/golang.org/x/crypto/acme/version_go112.go new file mode 100644 index 000000000..b9efdb59e --- /dev/null +++ b/vendor/golang.org/x/crypto/acme/version_go112.go @@ -0,0 +1,28 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.12 +// +build go1.12 + +package acme + +import "runtime/debug" + +func init() { + // Set packageVersion if the binary was built in modules mode and x/crypto + // was not replaced with a different module. + info, ok := debug.ReadBuildInfo() + if !ok { + return + } + for _, m := range info.Deps { + if m.Path != "golang.org/x/crypto" { + continue + } + if m.Replace == nil { + packageVersion = m.Version + } + break + } +} diff --git a/vendor/golang.org/x/crypto/blowfish/block.go b/vendor/golang.org/x/crypto/blowfish/block.go new file mode 100644 index 000000000..9d80f1952 --- /dev/null +++ b/vendor/golang.org/x/crypto/blowfish/block.go @@ -0,0 +1,159 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package blowfish + +// getNextWord returns the next big-endian uint32 value from the byte slice +// at the given position in a circular manner, updating the position. +func getNextWord(b []byte, pos *int) uint32 { + var w uint32 + j := *pos + for i := 0; i < 4; i++ { + w = w<<8 | uint32(b[j]) + j++ + if j >= len(b) { + j = 0 + } + } + *pos = j + return w +} + +// ExpandKey performs a key expansion on the given *Cipher. Specifically, it +// performs the Blowfish algorithm's key schedule which sets up the *Cipher's +// pi and substitution tables for calls to Encrypt. This is used, primarily, +// by the bcrypt package to reuse the Blowfish key schedule during its +// set up. It's unlikely that you need to use this directly. +func ExpandKey(key []byte, c *Cipher) { + j := 0 + for i := 0; i < 18; i++ { + // Using inlined getNextWord for performance. + var d uint32 + for k := 0; k < 4; k++ { + d = d<<8 | uint32(key[j]) + j++ + if j >= len(key) { + j = 0 + } + } + c.p[i] ^= d + } + + var l, r uint32 + for i := 0; i < 18; i += 2 { + l, r = encryptBlock(l, r, c) + c.p[i], c.p[i+1] = l, r + } + + for i := 0; i < 256; i += 2 { + l, r = encryptBlock(l, r, c) + c.s0[i], c.s0[i+1] = l, r + } + for i := 0; i < 256; i += 2 { + l, r = encryptBlock(l, r, c) + c.s1[i], c.s1[i+1] = l, r + } + for i := 0; i < 256; i += 2 { + l, r = encryptBlock(l, r, c) + c.s2[i], c.s2[i+1] = l, r + } + for i := 0; i < 256; i += 2 { + l, r = encryptBlock(l, r, c) + c.s3[i], c.s3[i+1] = l, r + } +} + +// This is similar to ExpandKey, but folds the salt during the key +// schedule. While ExpandKey is essentially expandKeyWithSalt with an all-zero +// salt passed in, reusing ExpandKey turns out to be a place of inefficiency +// and specializing it here is useful. +func expandKeyWithSalt(key []byte, salt []byte, c *Cipher) { + j := 0 + for i := 0; i < 18; i++ { + c.p[i] ^= getNextWord(key, &j) + } + + j = 0 + var l, r uint32 + for i := 0; i < 18; i += 2 { + l ^= getNextWord(salt, &j) + r ^= getNextWord(salt, &j) + l, r = encryptBlock(l, r, c) + c.p[i], c.p[i+1] = l, r + } + + for i := 0; i < 256; i += 2 { + l ^= getNextWord(salt, &j) + r ^= getNextWord(salt, &j) + l, r = encryptBlock(l, r, c) + c.s0[i], c.s0[i+1] = l, r + } + + for i := 0; i < 256; i += 2 { + l ^= getNextWord(salt, &j) + r ^= getNextWord(salt, &j) + l, r = encryptBlock(l, r, c) + c.s1[i], c.s1[i+1] = l, r + } + + for i := 0; i < 256; i += 2 { + l ^= getNextWord(salt, &j) + r ^= getNextWord(salt, &j) + l, r = encryptBlock(l, r, c) + c.s2[i], c.s2[i+1] = l, r + } + + for i := 0; i < 256; i += 2 { + l ^= getNextWord(salt, &j) + r ^= getNextWord(salt, &j) + l, r = encryptBlock(l, r, c) + c.s3[i], c.s3[i+1] = l, r + } +} + +func encryptBlock(l, r uint32, c *Cipher) (uint32, uint32) { + xl, xr := l, r + xl ^= c.p[0] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[1] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[2] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[3] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[4] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[5] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[6] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[7] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[8] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[9] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[10] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[11] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[12] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[13] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[14] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[15] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[16] + xr ^= c.p[17] + return xr, xl +} + +func decryptBlock(l, r uint32, c *Cipher) (uint32, uint32) { + xl, xr := l, r + xl ^= c.p[17] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[16] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[15] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[14] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[13] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[12] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[11] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[10] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[9] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[8] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[7] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[6] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[5] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[4] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[3] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[2] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[1] + xr ^= c.p[0] + return xr, xl +} diff --git a/vendor/golang.org/x/crypto/blowfish/cipher.go b/vendor/golang.org/x/crypto/blowfish/cipher.go new file mode 100644 index 000000000..213bf204a --- /dev/null +++ b/vendor/golang.org/x/crypto/blowfish/cipher.go @@ -0,0 +1,99 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package blowfish implements Bruce Schneier's Blowfish encryption algorithm. +// +// Blowfish is a legacy cipher and its short block size makes it vulnerable to +// birthday bound attacks (see https://sweet32.info). It should only be used +// where compatibility with legacy systems, not security, is the goal. +// +// 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" + +// The code is a port of Bruce Schneier's C implementation. +// See https://www.schneier.com/blowfish.html. + +import "strconv" + +// The Blowfish block size in bytes. +const BlockSize = 8 + +// A Cipher is an instance of Blowfish encryption using a particular key. +type Cipher struct { + p [18]uint32 + s0, s1, s2, s3 [256]uint32 +} + +type KeySizeError int + +func (k KeySizeError) Error() string { + return "crypto/blowfish: invalid key size " + strconv.Itoa(int(k)) +} + +// NewCipher creates and returns a Cipher. +// The key argument should be the Blowfish key, from 1 to 56 bytes. +func NewCipher(key []byte) (*Cipher, error) { + var result Cipher + if k := len(key); k < 1 || k > 56 { + return nil, KeySizeError(k) + } + initCipher(&result) + ExpandKey(key, &result) + return &result, nil +} + +// NewSaltedCipher creates a returns a Cipher that folds a salt into its key +// schedule. For most purposes, NewCipher, instead of NewSaltedCipher, is +// sufficient and desirable. For bcrypt compatibility, the key can be over 56 +// bytes. +func NewSaltedCipher(key, salt []byte) (*Cipher, error) { + if len(salt) == 0 { + return NewCipher(key) + } + var result Cipher + if k := len(key); k < 1 { + return nil, KeySizeError(k) + } + initCipher(&result) + expandKeyWithSalt(key, salt, &result) + return &result, nil +} + +// BlockSize returns the Blowfish block size, 8 bytes. +// It is necessary to satisfy the Block interface in the +// package "crypto/cipher". +func (c *Cipher) BlockSize() int { return BlockSize } + +// Encrypt encrypts the 8-byte buffer src using the key k +// and stores the result in dst. +// Note that for amounts of data larger than a block, +// it is not safe to just call Encrypt on successive blocks; +// instead, use an encryption mode like CBC (see crypto/cipher/cbc.go). +func (c *Cipher) Encrypt(dst, src []byte) { + l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) + r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) + l, r = encryptBlock(l, r, c) + dst[0], dst[1], dst[2], dst[3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l) + dst[4], dst[5], dst[6], dst[7] = byte(r>>24), byte(r>>16), byte(r>>8), byte(r) +} + +// Decrypt decrypts the 8-byte buffer src using the key k +// and stores the result in dst. +func (c *Cipher) Decrypt(dst, src []byte) { + l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) + r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) + l, r = decryptBlock(l, r, c) + dst[0], dst[1], dst[2], dst[3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l) + dst[4], dst[5], dst[6], dst[7] = byte(r>>24), byte(r>>16), byte(r>>8), byte(r) +} + +func initCipher(c *Cipher) { + copy(c.p[0:], p[0:]) + copy(c.s0[0:], s0[0:]) + copy(c.s1[0:], s1[0:]) + copy(c.s2[0:], s2[0:]) + copy(c.s3[0:], s3[0:]) +} diff --git a/vendor/golang.org/x/crypto/blowfish/const.go b/vendor/golang.org/x/crypto/blowfish/const.go new file mode 100644 index 000000000..d04077595 --- /dev/null +++ b/vendor/golang.org/x/crypto/blowfish/const.go @@ -0,0 +1,199 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// The startup permutation array and substitution boxes. +// They are the hexadecimal digits of PI; see: +// https://www.schneier.com/code/constants.txt. + +package blowfish + +var s0 = [256]uint32{ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, + 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, + 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, + 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, + 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, + 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, + 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, + 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, + 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, + 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, + 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, + 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, + 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, + 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, + 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, + 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, + 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, + 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, + 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e, + 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, + 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, + 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, +} + +var s1 = [256]uint32{ + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, + 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, + 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, + 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, + 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, + 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, + 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, + 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, + 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, + 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, + 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, + 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, + 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, + 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, + 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, + 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, + 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, + 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, + 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, + 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, + 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, + 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7, +} + +var s2 = [256]uint32{ + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, + 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, + 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, + 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, + 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, + 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, + 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, + 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60, + 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, + 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, + 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, + 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, + 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, + 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, + 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, + 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, + 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, + 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe, + 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, + 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, + 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, + 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0, +} + +var s3 = [256]uint32{ + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, + 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, + 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, + 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, + 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, + 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, + 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, + 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5, + 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, + 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, + 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, + 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, + 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, + 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, + 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, + 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, + 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, + 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623, + 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, + 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, + 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, + 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6, +} + +var p = [18]uint32{ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, + 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b, +} diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go b/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go new file mode 100644 index 000000000..94c71ac1a --- /dev/null +++ b/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go @@ -0,0 +1,17 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.11 && gc && !purego +// +build go1.11,gc,!purego + +package chacha20 + +const bufSize = 256 + +//go:noescape +func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) + +func (c *Cipher) xorKeyStreamBlocks(dst, src []byte) { + xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter) +} diff --git a/vendor/golang.org/x/crypto/internal/chacha20/asm_arm64.s b/vendor/golang.org/x/crypto/chacha20/chacha_arm64.s similarity index 99% rename from vendor/golang.org/x/crypto/internal/chacha20/asm_arm64.s rename to vendor/golang.org/x/crypto/chacha20/chacha_arm64.s index b3a16ef75..63cae9e6f 100644 --- a/vendor/golang.org/x/crypto/internal/chacha20/asm_arm64.s +++ b/vendor/golang.org/x/crypto/chacha20/chacha_arm64.s @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build go1.11 -// +build !gccgo,!appengine +//go:build go1.11 && gc && !purego +// +build go1.11,gc,!purego #include "textflag.h" diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_generic.go b/vendor/golang.org/x/crypto/chacha20/chacha_generic.go new file mode 100644 index 000000000..a2ecf5c32 --- /dev/null +++ b/vendor/golang.org/x/crypto/chacha20/chacha_generic.go @@ -0,0 +1,398 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package chacha20 implements the ChaCha20 and XChaCha20 encryption algorithms +// as specified in RFC 8439 and draft-irtf-cfrg-xchacha-01. +package chacha20 + +import ( + "crypto/cipher" + "encoding/binary" + "errors" + "math/bits" + + "golang.org/x/crypto/internal/subtle" +) + +const ( + // KeySize is the size of the key used by this cipher, in bytes. + KeySize = 32 + + // NonceSize is the size of the nonce used with the standard variant of this + // cipher, in bytes. + // + // Note that this is too short to be safely generated at random if the same + // key is reused more than 2³² times. + NonceSize = 12 + + // NonceSizeX is the size of the nonce used with the XChaCha20 variant of + // this cipher, in bytes. + NonceSizeX = 24 +) + +// Cipher is a stateful instance of ChaCha20 or XChaCha20 using a particular key +// and nonce. A *Cipher implements the cipher.Stream interface. +type Cipher struct { + // The ChaCha20 state is 16 words: 4 constant, 8 of key, 1 of counter + // (incremented after each block), and 3 of nonce. + key [8]uint32 + counter uint32 + nonce [3]uint32 + + // The last len bytes of buf are leftover key stream bytes from the previous + // XORKeyStream invocation. The size of buf depends on how many blocks are + // computed at a time by xorKeyStreamBlocks. + buf [bufSize]byte + len int + + // overflow is set when the counter overflowed, no more blocks can be + // generated, and the next XORKeyStream call should panic. + overflow bool + + // The counter-independent results of the first round are cached after they + // are computed the first time. + precompDone bool + p1, p5, p9, p13 uint32 + p2, p6, p10, p14 uint32 + p3, p7, p11, p15 uint32 +} + +var _ cipher.Stream = (*Cipher)(nil) + +// NewUnauthenticatedCipher creates a new ChaCha20 stream cipher with the given +// 32 bytes key and a 12 or 24 bytes nonce. If a nonce of 24 bytes is provided, +// the XChaCha20 construction will be used. It returns an error if key or nonce +// have any other length. +// +// 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. +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 + // escape to the heap. + c := &Cipher{} + return newUnauthenticatedCipher(c, key, nonce) +} + +func newUnauthenticatedCipher(c *Cipher, key, nonce []byte) (*Cipher, error) { + if len(key) != KeySize { + return nil, errors.New("chacha20: wrong key size") + } + if len(nonce) == NonceSizeX { + // XChaCha20 uses the ChaCha20 core to mix 16 bytes of the nonce into a + // derived key, allowing it to operate on a nonce of 24 bytes. See + // draft-irtf-cfrg-xchacha-01, Section 2.3. + key, _ = HChaCha20(key, nonce[0:16]) + cNonce := make([]byte, NonceSize) + copy(cNonce[4:12], nonce[16:24]) + nonce = cNonce + } else if len(nonce) != NonceSize { + return nil, errors.New("chacha20: wrong nonce size") + } + + key, nonce = key[:KeySize], nonce[:NonceSize] // bounds check elimination hint + c.key = [8]uint32{ + binary.LittleEndian.Uint32(key[0:4]), + binary.LittleEndian.Uint32(key[4:8]), + binary.LittleEndian.Uint32(key[8:12]), + binary.LittleEndian.Uint32(key[12:16]), + binary.LittleEndian.Uint32(key[16:20]), + binary.LittleEndian.Uint32(key[20:24]), + binary.LittleEndian.Uint32(key[24:28]), + binary.LittleEndian.Uint32(key[28:32]), + } + c.nonce = [3]uint32{ + binary.LittleEndian.Uint32(nonce[0:4]), + binary.LittleEndian.Uint32(nonce[4:8]), + binary.LittleEndian.Uint32(nonce[8:12]), + } + return c, nil +} + +// The constant first 4 words of the ChaCha20 state. +const ( + j0 uint32 = 0x61707865 // expa + j1 uint32 = 0x3320646e // nd 3 + j2 uint32 = 0x79622d32 // 2-by + j3 uint32 = 0x6b206574 // te k +) + +const blockSize = 64 + +// quarterRound is the core of ChaCha20. It shuffles the bits of 4 state words. +// It's executed 4 times for each of the 20 ChaCha20 rounds, operating on all 16 +// words each round, in columnar or diagonal groups of 4 at a time. +func quarterRound(a, b, c, d uint32) (uint32, uint32, uint32, uint32) { + a += b + d ^= a + d = bits.RotateLeft32(d, 16) + c += d + b ^= c + b = bits.RotateLeft32(b, 12) + a += b + d ^= a + d = bits.RotateLeft32(d, 8) + c += d + b ^= c + b = bits.RotateLeft32(b, 7) + return a, b, c, d +} + +// SetCounter sets the Cipher counter. The next invocation of XORKeyStream will +// behave as if (64 * counter) bytes had been encrypted so far. +// +// To prevent accidental counter reuse, SetCounter panics if counter is less +// than the current value. +// +// Note that the execution time of XORKeyStream is not independent of the +// counter value. +func (s *Cipher) SetCounter(counter uint32) { + // Internally, s may buffer multiple blocks, which complicates this + // implementation slightly. When checking whether the counter has rolled + // back, we must use both s.counter and s.len to determine how many blocks + // we have already output. + outputCounter := s.counter - uint32(s.len)/blockSize + if s.overflow || counter < outputCounter { + panic("chacha20: SetCounter attempted to rollback counter") + } + + // In the general case, we set the new counter value and reset s.len to 0, + // causing the next call to XORKeyStream to refill the buffer. However, if + // we're advancing within the existing buffer, we can save work by simply + // setting s.len. + if counter < s.counter { + s.len = int(s.counter-counter) * blockSize + } else { + s.counter = counter + s.len = 0 + } +} + +// XORKeyStream XORs each byte in the given slice with a byte from the +// cipher's key stream. Dst and src must overlap entirely or not at all. +// +// If len(dst) < len(src), XORKeyStream will panic. It is acceptable +// to pass a dst bigger than src, and in that case, XORKeyStream will +// only update dst[:len(src)] and will not touch the rest of dst. +// +// Multiple calls to XORKeyStream behave as if the concatenation of +// the src buffers was passed in a single run. That is, Cipher +// maintains state and does not reset at each XORKeyStream call. +func (s *Cipher) XORKeyStream(dst, src []byte) { + if len(src) == 0 { + return + } + if len(dst) < len(src) { + panic("chacha20: output smaller than input") + } + dst = dst[:len(src)] + if subtle.InexactOverlap(dst, src) { + panic("chacha20: invalid buffer overlap") + } + + // First, drain any remaining key stream from a previous XORKeyStream. + if s.len != 0 { + keyStream := s.buf[bufSize-s.len:] + if len(src) < len(keyStream) { + keyStream = keyStream[:len(src)] + } + _ = src[len(keyStream)-1] // bounds check elimination hint + for i, b := range keyStream { + dst[i] = src[i] ^ b + } + s.len -= len(keyStream) + dst, src = dst[len(keyStream):], src[len(keyStream):] + } + if len(src) == 0 { + return + } + + // If we'd need to let the counter overflow and keep generating output, + // panic immediately. If instead we'd only reach the last block, remember + // not to generate any more output after the buffer is drained. + numBlocks := (uint64(len(src)) + blockSize - 1) / blockSize + if s.overflow || uint64(s.counter)+numBlocks > 1<<32 { + panic("chacha20: counter overflow") + } else if uint64(s.counter)+numBlocks == 1<<32 { + s.overflow = true + } + + // xorKeyStreamBlocks implementations expect input lengths that are a + // multiple of bufSize. Platform-specific ones process multiple blocks at a + // time, so have bufSizes that are a multiple of blockSize. + + full := len(src) - len(src)%bufSize + if full > 0 { + s.xorKeyStreamBlocks(dst[:full], src[:full]) + } + dst, src = dst[full:], src[full:] + + // If using a multi-block xorKeyStreamBlocks would overflow, use the generic + // one that does one block at a time. + const blocksPerBuf = bufSize / blockSize + if uint64(s.counter)+blocksPerBuf > 1<<32 { + s.buf = [bufSize]byte{} + numBlocks := (len(src) + blockSize - 1) / blockSize + buf := s.buf[bufSize-numBlocks*blockSize:] + copy(buf, src) + s.xorKeyStreamBlocksGeneric(buf, buf) + s.len = len(buf) - copy(dst, buf) + return + } + + // If we have a partial (multi-)block, pad it for xorKeyStreamBlocks, and + // keep the leftover keystream for the next XORKeyStream invocation. + if len(src) > 0 { + s.buf = [bufSize]byte{} + copy(s.buf[:], src) + s.xorKeyStreamBlocks(s.buf[:], s.buf[:]) + s.len = bufSize - copy(dst, s.buf[:]) + } +} + +func (s *Cipher) xorKeyStreamBlocksGeneric(dst, src []byte) { + if len(dst) != len(src) || len(dst)%blockSize != 0 { + panic("chacha20: internal error: wrong dst and/or src length") + } + + // To generate each block of key stream, the initial cipher state + // (represented below) is passed through 20 rounds of shuffling, + // alternatively applying quarterRounds by columns (like 1, 5, 9, 13) + // or by diagonals (like 1, 6, 11, 12). + // + // 0:cccccccc 1:cccccccc 2:cccccccc 3:cccccccc + // 4:kkkkkkkk 5:kkkkkkkk 6:kkkkkkkk 7:kkkkkkkk + // 8:kkkkkkkk 9:kkkkkkkk 10:kkkkkkkk 11:kkkkkkkk + // 12:bbbbbbbb 13:nnnnnnnn 14:nnnnnnnn 15:nnnnnnnn + // + // c=constant k=key b=blockcount n=nonce + var ( + c0, c1, c2, c3 = j0, j1, j2, j3 + c4, c5, c6, c7 = s.key[0], s.key[1], s.key[2], s.key[3] + c8, c9, c10, c11 = s.key[4], s.key[5], s.key[6], s.key[7] + _, c13, c14, c15 = s.counter, s.nonce[0], s.nonce[1], s.nonce[2] + ) + + // Three quarters of the first round don't depend on the counter, so we can + // calculate them here, and reuse them for multiple blocks in the loop, and + // for future XORKeyStream invocations. + if !s.precompDone { + s.p1, s.p5, s.p9, s.p13 = quarterRound(c1, c5, c9, c13) + s.p2, s.p6, s.p10, s.p14 = quarterRound(c2, c6, c10, c14) + s.p3, s.p7, s.p11, s.p15 = quarterRound(c3, c7, c11, c15) + s.precompDone = true + } + + // A condition of len(src) > 0 would be sufficient, but this also + // acts as a bounds check elimination hint. + for len(src) >= 64 && len(dst) >= 64 { + // The remainder of the first column round. + fcr0, fcr4, fcr8, fcr12 := quarterRound(c0, c4, c8, s.counter) + + // The second diagonal round. + x0, x5, x10, x15 := quarterRound(fcr0, s.p5, s.p10, s.p15) + x1, x6, x11, x12 := quarterRound(s.p1, s.p6, s.p11, fcr12) + x2, x7, x8, x13 := quarterRound(s.p2, s.p7, fcr8, s.p13) + x3, x4, x9, x14 := quarterRound(s.p3, fcr4, s.p9, s.p14) + + // The remaining 18 rounds. + for i := 0; i < 9; i++ { + // Column round. + x0, x4, x8, x12 = quarterRound(x0, x4, x8, x12) + x1, x5, x9, x13 = quarterRound(x1, x5, x9, x13) + x2, x6, x10, x14 = quarterRound(x2, x6, x10, x14) + x3, x7, x11, x15 = quarterRound(x3, x7, x11, x15) + + // Diagonal round. + x0, x5, x10, x15 = quarterRound(x0, x5, x10, x15) + x1, x6, x11, x12 = quarterRound(x1, x6, x11, x12) + x2, x7, x8, x13 = quarterRound(x2, x7, x8, x13) + x3, x4, x9, x14 = quarterRound(x3, x4, x9, x14) + } + + // Add back the initial state to generate the key stream, then + // XOR the key stream with the source and write out the result. + addXor(dst[0:4], src[0:4], x0, c0) + addXor(dst[4:8], src[4:8], x1, c1) + addXor(dst[8:12], src[8:12], x2, c2) + addXor(dst[12:16], src[12:16], x3, c3) + addXor(dst[16:20], src[16:20], x4, c4) + addXor(dst[20:24], src[20:24], x5, c5) + addXor(dst[24:28], src[24:28], x6, c6) + addXor(dst[28:32], src[28:32], x7, c7) + addXor(dst[32:36], src[32:36], x8, c8) + addXor(dst[36:40], src[36:40], x9, c9) + addXor(dst[40:44], src[40:44], x10, c10) + addXor(dst[44:48], src[44:48], x11, c11) + addXor(dst[48:52], src[48:52], x12, s.counter) + addXor(dst[52:56], src[52:56], x13, c13) + addXor(dst[56:60], src[56:60], x14, c14) + addXor(dst[60:64], src[60:64], x15, c15) + + s.counter += 1 + + src, dst = src[blockSize:], dst[blockSize:] + } +} + +// HChaCha20 uses the ChaCha20 core to generate a derived key from a 32 bytes +// key and a 16 bytes nonce. It returns an error if key or nonce have any other +// length. It is used as part of the XChaCha20 construction. +func HChaCha20(key, nonce []byte) ([]byte, error) { + // This function is split into a wrapper so that the slice allocation will + // be inlined, and depending on how the caller uses the return value, won't + // escape to the heap. + out := make([]byte, 32) + return hChaCha20(out, key, nonce) +} + +func hChaCha20(out, key, nonce []byte) ([]byte, error) { + if len(key) != KeySize { + return nil, errors.New("chacha20: wrong HChaCha20 key size") + } + if len(nonce) != 16 { + return nil, errors.New("chacha20: wrong HChaCha20 nonce size") + } + + x0, x1, x2, x3 := j0, j1, j2, j3 + x4 := binary.LittleEndian.Uint32(key[0:4]) + x5 := binary.LittleEndian.Uint32(key[4:8]) + x6 := binary.LittleEndian.Uint32(key[8:12]) + x7 := binary.LittleEndian.Uint32(key[12:16]) + x8 := binary.LittleEndian.Uint32(key[16:20]) + x9 := binary.LittleEndian.Uint32(key[20:24]) + x10 := binary.LittleEndian.Uint32(key[24:28]) + x11 := binary.LittleEndian.Uint32(key[28:32]) + x12 := binary.LittleEndian.Uint32(nonce[0:4]) + x13 := binary.LittleEndian.Uint32(nonce[4:8]) + x14 := binary.LittleEndian.Uint32(nonce[8:12]) + x15 := binary.LittleEndian.Uint32(nonce[12:16]) + + for i := 0; i < 10; i++ { + // Diagonal round. + x0, x4, x8, x12 = quarterRound(x0, x4, x8, x12) + x1, x5, x9, x13 = quarterRound(x1, x5, x9, x13) + x2, x6, x10, x14 = quarterRound(x2, x6, x10, x14) + x3, x7, x11, x15 = quarterRound(x3, x7, x11, x15) + + // Column round. + x0, x5, x10, x15 = quarterRound(x0, x5, x10, x15) + x1, x6, x11, x12 = quarterRound(x1, x6, x11, x12) + x2, x7, x8, x13 = quarterRound(x2, x7, x8, x13) + x3, x4, x9, x14 = quarterRound(x3, x4, x9, x14) + } + + _ = out[31] // bounds check elimination hint + binary.LittleEndian.PutUint32(out[0:4], x0) + binary.LittleEndian.PutUint32(out[4:8], x1) + binary.LittleEndian.PutUint32(out[8:12], x2) + binary.LittleEndian.PutUint32(out[12:16], x3) + binary.LittleEndian.PutUint32(out[16:20], x12) + binary.LittleEndian.PutUint32(out[20:24], x13) + binary.LittleEndian.PutUint32(out[24:28], x14) + binary.LittleEndian.PutUint32(out[28:32], x15) + return out, nil +} diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go b/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go new file mode 100644 index 000000000..025b49897 --- /dev/null +++ b/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go @@ -0,0 +1,14 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build (!arm64 && !s390x && !ppc64le) || (arm64 && !go1.11) || !gc || purego +// +build !arm64,!s390x,!ppc64le arm64,!go1.11 !gc purego + +package chacha20 + +const bufSize = blockSize + +func (s *Cipher) xorKeyStreamBlocks(dst, src []byte) { + s.xorKeyStreamBlocksGeneric(dst, src) +} diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go new file mode 100644 index 000000000..da420b2e9 --- /dev/null +++ b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go @@ -0,0 +1,17 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build gc && !purego +// +build gc,!purego + +package chacha20 + +const bufSize = 256 + +//go:noescape +func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32) + +func (c *Cipher) xorKeyStreamBlocks(dst, src []byte) { + chaCha20_ctr32_vsx(&dst[0], &src[0], len(src), &c.key, &c.counter) +} diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s new file mode 100644 index 000000000..5c0fed26f --- /dev/null +++ b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s @@ -0,0 +1,450 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Based on CRYPTOGAMS code with the following comment: +// # ==================================================================== +// # Written by Andy Polyakov for the OpenSSL +// # project. The module is, however, dual licensed under OpenSSL and +// # CRYPTOGAMS licenses depending on where you obtain it. For further +// # details see http://www.openssl.org/~appro/cryptogams/. +// # ==================================================================== + +// Code for the perl script that generates the ppc64 assembler +// can be found in the cryptogams repository at the link below. It is based on +// the original from openssl. + +// https://github.com/dot-asm/cryptogams/commit/a60f5b50ed908e91 + +// The differences in this and the original implementation are +// due to the calling conventions and initialization of constants. + +//go:build gc && !purego +// +build gc,!purego + +#include "textflag.h" + +#define OUT R3 +#define INP R4 +#define LEN R5 +#define KEY R6 +#define CNT R7 +#define TMP R15 + +#define CONSTBASE R16 +#define BLOCKS R17 + +DATA consts<>+0x00(SB)/8, $0x3320646e61707865 +DATA consts<>+0x08(SB)/8, $0x6b20657479622d32 +DATA consts<>+0x10(SB)/8, $0x0000000000000001 +DATA consts<>+0x18(SB)/8, $0x0000000000000000 +DATA consts<>+0x20(SB)/8, $0x0000000000000004 +DATA consts<>+0x28(SB)/8, $0x0000000000000000 +DATA consts<>+0x30(SB)/8, $0x0a0b08090e0f0c0d +DATA consts<>+0x38(SB)/8, $0x0203000106070405 +DATA consts<>+0x40(SB)/8, $0x090a0b080d0e0f0c +DATA consts<>+0x48(SB)/8, $0x0102030005060704 +DATA consts<>+0x50(SB)/8, $0x6170786561707865 +DATA consts<>+0x58(SB)/8, $0x6170786561707865 +DATA consts<>+0x60(SB)/8, $0x3320646e3320646e +DATA consts<>+0x68(SB)/8, $0x3320646e3320646e +DATA consts<>+0x70(SB)/8, $0x79622d3279622d32 +DATA consts<>+0x78(SB)/8, $0x79622d3279622d32 +DATA consts<>+0x80(SB)/8, $0x6b2065746b206574 +DATA consts<>+0x88(SB)/8, $0x6b2065746b206574 +DATA consts<>+0x90(SB)/8, $0x0000000100000000 +DATA consts<>+0x98(SB)/8, $0x0000000300000002 +GLOBL consts<>(SB), RODATA, $0xa0 + +//func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32) +TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40 + MOVD out+0(FP), OUT + MOVD inp+8(FP), INP + MOVD len+16(FP), LEN + MOVD key+24(FP), KEY + MOVD counter+32(FP), CNT + + // Addressing for constants + MOVD $consts<>+0x00(SB), CONSTBASE + MOVD $16, R8 + MOVD $32, R9 + MOVD $48, R10 + MOVD $64, R11 + SRD $6, LEN, BLOCKS + // V16 + LXVW4X (CONSTBASE)(R0), VS48 + ADD $80,CONSTBASE + + // Load key into V17,V18 + LXVW4X (KEY)(R0), VS49 + LXVW4X (KEY)(R8), VS50 + + // Load CNT, NONCE into V19 + LXVW4X (CNT)(R0), VS51 + + // Clear V27 + VXOR V27, V27, V27 + + // V28 + LXVW4X (CONSTBASE)(R11), VS60 + + // splat slot from V19 -> V26 + VSPLTW $0, V19, V26 + + VSLDOI $4, V19, V27, V19 + VSLDOI $12, V27, V19, V19 + + VADDUWM V26, V28, V26 + + MOVD $10, R14 + MOVD R14, CTR + +loop_outer_vsx: + // V0, V1, V2, V3 + LXVW4X (R0)(CONSTBASE), VS32 + LXVW4X (R8)(CONSTBASE), VS33 + LXVW4X (R9)(CONSTBASE), VS34 + LXVW4X (R10)(CONSTBASE), VS35 + + // splat values from V17, V18 into V4-V11 + VSPLTW $0, V17, V4 + VSPLTW $1, V17, V5 + VSPLTW $2, V17, V6 + VSPLTW $3, V17, V7 + VSPLTW $0, V18, V8 + VSPLTW $1, V18, V9 + VSPLTW $2, V18, V10 + VSPLTW $3, V18, V11 + + // VOR + VOR V26, V26, V12 + + // splat values from V19 -> V13, V14, V15 + VSPLTW $1, V19, V13 + VSPLTW $2, V19, V14 + VSPLTW $3, V19, V15 + + // splat const values + VSPLTISW $-16, V27 + VSPLTISW $12, V28 + VSPLTISW $8, V29 + VSPLTISW $7, V30 + +loop_vsx: + VADDUWM V0, V4, V0 + VADDUWM V1, V5, V1 + VADDUWM V2, V6, V2 + VADDUWM V3, V7, V3 + + VXOR V12, V0, V12 + VXOR V13, V1, V13 + VXOR V14, V2, V14 + VXOR V15, V3, V15 + + VRLW V12, V27, V12 + VRLW V13, V27, V13 + VRLW V14, V27, V14 + VRLW V15, V27, V15 + + VADDUWM V8, V12, V8 + VADDUWM V9, V13, V9 + VADDUWM V10, V14, V10 + VADDUWM V11, V15, V11 + + VXOR V4, V8, V4 + VXOR V5, V9, V5 + VXOR V6, V10, V6 + VXOR V7, V11, V7 + + VRLW V4, V28, V4 + VRLW V5, V28, V5 + VRLW V6, V28, V6 + VRLW V7, V28, V7 + + VADDUWM V0, V4, V0 + VADDUWM V1, V5, V1 + VADDUWM V2, V6, V2 + VADDUWM V3, V7, V3 + + VXOR V12, V0, V12 + VXOR V13, V1, V13 + VXOR V14, V2, V14 + VXOR V15, V3, V15 + + VRLW V12, V29, V12 + VRLW V13, V29, V13 + VRLW V14, V29, V14 + VRLW V15, V29, V15 + + VADDUWM V8, V12, V8 + VADDUWM V9, V13, V9 + VADDUWM V10, V14, V10 + VADDUWM V11, V15, V11 + + VXOR V4, V8, V4 + VXOR V5, V9, V5 + VXOR V6, V10, V6 + VXOR V7, V11, V7 + + VRLW V4, V30, V4 + VRLW V5, V30, V5 + VRLW V6, V30, V6 + VRLW V7, V30, V7 + + VADDUWM V0, V5, V0 + VADDUWM V1, V6, V1 + VADDUWM V2, V7, V2 + VADDUWM V3, V4, V3 + + VXOR V15, V0, V15 + VXOR V12, V1, V12 + VXOR V13, V2, V13 + VXOR V14, V3, V14 + + VRLW V15, V27, V15 + VRLW V12, V27, V12 + VRLW V13, V27, V13 + VRLW V14, V27, V14 + + VADDUWM V10, V15, V10 + VADDUWM V11, V12, V11 + VADDUWM V8, V13, V8 + VADDUWM V9, V14, V9 + + VXOR V5, V10, V5 + VXOR V6, V11, V6 + VXOR V7, V8, V7 + VXOR V4, V9, V4 + + VRLW V5, V28, V5 + VRLW V6, V28, V6 + VRLW V7, V28, V7 + VRLW V4, V28, V4 + + VADDUWM V0, V5, V0 + VADDUWM V1, V6, V1 + VADDUWM V2, V7, V2 + VADDUWM V3, V4, V3 + + VXOR V15, V0, V15 + VXOR V12, V1, V12 + VXOR V13, V2, V13 + VXOR V14, V3, V14 + + VRLW V15, V29, V15 + VRLW V12, V29, V12 + VRLW V13, V29, V13 + VRLW V14, V29, V14 + + VADDUWM V10, V15, V10 + VADDUWM V11, V12, V11 + VADDUWM V8, V13, V8 + VADDUWM V9, V14, V9 + + VXOR V5, V10, V5 + VXOR V6, V11, V6 + VXOR V7, V8, V7 + VXOR V4, V9, V4 + + VRLW V5, V30, V5 + VRLW V6, V30, V6 + VRLW V7, V30, V7 + VRLW V4, V30, V4 + BC 16, LT, loop_vsx + + VADDUWM V12, V26, V12 + + WORD $0x13600F8C // VMRGEW V0, V1, V27 + WORD $0x13821F8C // VMRGEW V2, V3, V28 + + WORD $0x10000E8C // VMRGOW V0, V1, V0 + WORD $0x10421E8C // VMRGOW V2, V3, V2 + + WORD $0x13A42F8C // VMRGEW V4, V5, V29 + WORD $0x13C63F8C // VMRGEW V6, V7, V30 + + XXPERMDI VS32, VS34, $0, VS33 + XXPERMDI VS32, VS34, $3, VS35 + XXPERMDI VS59, VS60, $0, VS32 + XXPERMDI VS59, VS60, $3, VS34 + + WORD $0x10842E8C // VMRGOW V4, V5, V4 + WORD $0x10C63E8C // VMRGOW V6, V7, V6 + + WORD $0x13684F8C // VMRGEW V8, V9, V27 + WORD $0x138A5F8C // VMRGEW V10, V11, V28 + + XXPERMDI VS36, VS38, $0, VS37 + XXPERMDI VS36, VS38, $3, VS39 + XXPERMDI VS61, VS62, $0, VS36 + XXPERMDI VS61, VS62, $3, VS38 + + WORD $0x11084E8C // VMRGOW V8, V9, V8 + WORD $0x114A5E8C // VMRGOW V10, V11, V10 + + WORD $0x13AC6F8C // VMRGEW V12, V13, V29 + WORD $0x13CE7F8C // VMRGEW V14, V15, V30 + + XXPERMDI VS40, VS42, $0, VS41 + XXPERMDI VS40, VS42, $3, VS43 + XXPERMDI VS59, VS60, $0, VS40 + XXPERMDI VS59, VS60, $3, VS42 + + WORD $0x118C6E8C // VMRGOW V12, V13, V12 + WORD $0x11CE7E8C // VMRGOW V14, V15, V14 + + VSPLTISW $4, V27 + VADDUWM V26, V27, V26 + + XXPERMDI VS44, VS46, $0, VS45 + XXPERMDI VS44, VS46, $3, VS47 + XXPERMDI VS61, VS62, $0, VS44 + XXPERMDI VS61, VS62, $3, VS46 + + VADDUWM V0, V16, V0 + VADDUWM V4, V17, V4 + VADDUWM V8, V18, V8 + VADDUWM V12, V19, V12 + + CMPU LEN, $64 + BLT tail_vsx + + // Bottom of loop + LXVW4X (INP)(R0), VS59 + LXVW4X (INP)(R8), VS60 + LXVW4X (INP)(R9), VS61 + LXVW4X (INP)(R10), VS62 + + VXOR V27, V0, V27 + VXOR V28, V4, V28 + VXOR V29, V8, V29 + VXOR V30, V12, V30 + + STXVW4X VS59, (OUT)(R0) + STXVW4X VS60, (OUT)(R8) + ADD $64, INP + STXVW4X VS61, (OUT)(R9) + ADD $-64, LEN + STXVW4X VS62, (OUT)(R10) + ADD $64, OUT + BEQ done_vsx + + VADDUWM V1, V16, V0 + VADDUWM V5, V17, V4 + VADDUWM V9, V18, V8 + VADDUWM V13, V19, V12 + + CMPU LEN, $64 + BLT tail_vsx + + LXVW4X (INP)(R0), VS59 + LXVW4X (INP)(R8), VS60 + LXVW4X (INP)(R9), VS61 + LXVW4X (INP)(R10), VS62 + VXOR V27, V0, V27 + + VXOR V28, V4, V28 + VXOR V29, V8, V29 + VXOR V30, V12, V30 + + STXVW4X VS59, (OUT)(R0) + STXVW4X VS60, (OUT)(R8) + ADD $64, INP + STXVW4X VS61, (OUT)(R9) + ADD $-64, LEN + STXVW4X VS62, (OUT)(V10) + ADD $64, OUT + BEQ done_vsx + + VADDUWM V2, V16, V0 + VADDUWM V6, V17, V4 + VADDUWM V10, V18, V8 + VADDUWM V14, V19, V12 + + CMPU LEN, $64 + BLT tail_vsx + + LXVW4X (INP)(R0), VS59 + LXVW4X (INP)(R8), VS60 + LXVW4X (INP)(R9), VS61 + LXVW4X (INP)(R10), VS62 + + VXOR V27, V0, V27 + VXOR V28, V4, V28 + VXOR V29, V8, V29 + VXOR V30, V12, V30 + + STXVW4X VS59, (OUT)(R0) + STXVW4X VS60, (OUT)(R8) + ADD $64, INP + STXVW4X VS61, (OUT)(R9) + ADD $-64, LEN + STXVW4X VS62, (OUT)(R10) + ADD $64, OUT + BEQ done_vsx + + VADDUWM V3, V16, V0 + VADDUWM V7, V17, V4 + VADDUWM V11, V18, V8 + VADDUWM V15, V19, V12 + + CMPU LEN, $64 + BLT tail_vsx + + LXVW4X (INP)(R0), VS59 + LXVW4X (INP)(R8), VS60 + LXVW4X (INP)(R9), VS61 + LXVW4X (INP)(R10), VS62 + + VXOR V27, V0, V27 + VXOR V28, V4, V28 + VXOR V29, V8, V29 + VXOR V30, V12, V30 + + STXVW4X VS59, (OUT)(R0) + STXVW4X VS60, (OUT)(R8) + ADD $64, INP + STXVW4X VS61, (OUT)(R9) + ADD $-64, LEN + STXVW4X VS62, (OUT)(R10) + ADD $64, OUT + + MOVD $10, R14 + MOVD R14, CTR + BNE loop_outer_vsx + +done_vsx: + // Increment counter by number of 64 byte blocks + MOVD (CNT), R14 + ADD BLOCKS, R14 + MOVD R14, (CNT) + RET + +tail_vsx: + ADD $32, R1, R11 + MOVD LEN, CTR + + // Save values on stack to copy from + STXVW4X VS32, (R11)(R0) + STXVW4X VS36, (R11)(R8) + STXVW4X VS40, (R11)(R9) + STXVW4X VS44, (R11)(R10) + ADD $-1, R11, R12 + ADD $-1, INP + ADD $-1, OUT + +looptail_vsx: + // Copying the result to OUT + // in bytes. + MOVBZU 1(R12), KEY + MOVBZU 1(INP), TMP + XOR KEY, TMP, KEY + MOVBU KEY, 1(OUT) + BC 16, LT, looptail_vsx + + // Clear the stack values + STXVW4X VS48, (R11)(R0) + STXVW4X VS48, (R11)(R8) + STXVW4X VS48, (R11)(R9) + STXVW4X VS48, (R11)(R10) + BR done_vsx diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go b/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go new file mode 100644 index 000000000..c5898db46 --- /dev/null +++ b/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go @@ -0,0 +1,27 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build gc && !purego +// +build gc,!purego + +package chacha20 + +import "golang.org/x/sys/cpu" + +var haveAsm = cpu.S390X.HasVX + +const bufSize = 256 + +// xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only +// be called when the vector facility is available. Implementation in asm_s390x.s. +//go:noescape +func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) + +func (c *Cipher) xorKeyStreamBlocks(dst, src []byte) { + if cpu.S390X.HasVX { + xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter) + } else { + c.xorKeyStreamBlocksGeneric(dst, src) + } +} diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s b/vendor/golang.org/x/crypto/chacha20/chacha_s390x.s similarity index 87% rename from vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s rename to vendor/golang.org/x/crypto/chacha20/chacha_s390x.s index 57df40446..f3ef5a019 100644 --- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s +++ b/vendor/golang.org/x/crypto/chacha20/chacha_s390x.s @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build s390x,!gccgo,!appengine +//go:build gc && !purego +// +build gc,!purego #include "go_asm.h" #include "textflag.h" @@ -24,15 +25,6 @@ DATA ·constants<>+0x14(SB)/4, $0x3320646e DATA ·constants<>+0x18(SB)/4, $0x79622d32 DATA ·constants<>+0x1c(SB)/4, $0x6b206574 -// EXRL targets: -TEXT ·mvcSrcToBuf(SB), NOFRAME|NOSPLIT, $0 - MVC $1, (R1), (R8) - RET - -TEXT ·mvcBufToDst(SB), NOFRAME|NOSPLIT, $0 - MVC $1, (R8), (R9) - RET - #define BSWAP V5 #define J0 V6 #define KEY0 V7 @@ -144,7 +136,7 @@ TEXT ·mvcBufToDst(SB), NOFRAME|NOSPLIT, $0 VMRHF v, w, c \ // c = {a[2], b[2], c[2], d[2]} VMRLF v, w, d // d = {a[3], b[3], c[3], d[3]} -// func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32, buf *[256]byte, len *int) +// func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) TEXT ·xorKeyStreamVX(SB), NOSPLIT, $0 MOVD $·constants<>(SB), R1 MOVD dst+0(FP), R2 // R2=&dst[0] @@ -152,25 +144,10 @@ TEXT ·xorKeyStreamVX(SB), NOSPLIT, $0 MOVD key+48(FP), R5 // R5=key MOVD nonce+56(FP), R6 // R6=nonce MOVD counter+64(FP), R7 // R7=counter - MOVD buf+72(FP), R8 // R8=buf - MOVD len+80(FP), R9 // R9=len // load BSWAP and J0 VLM (R1), BSWAP, J0 - // set up tail buffer - ADD $-1, R4, R12 - MOVBZ R12, R12 - CMPUBEQ R12, $255, aligned - MOVD R4, R1 - AND $~255, R1 - MOVD $(R3)(R1*1), R1 - EXRL $·mvcSrcToBuf(SB), R12 - MOVD $255, R0 - SUB R12, R0 - MOVD R0, (R9) // update len - -aligned: // setup MOVD $95, R0 VLM (R5), KEY0, KEY1 @@ -217,9 +194,7 @@ loop: // decrement length ADD $-256, R4 - BLT tail -continue: // rearrange vectors SHUFFLE(X0, X1, X2, X3, M0, M1, M2, M3) ADDV(J0, X0, X1, X2, X3) @@ -245,16 +220,6 @@ continue: MOVD $256(R3), R3 CMPBNE R4, $0, chacha - CMPUBEQ R12, $255, return - EXRL $·mvcBufToDst(SB), R12 // len was updated during setup -return: VSTEF $0, CTR, (R7) RET - -tail: - MOVD R2, R9 - MOVD R8, R2 - MOVD R8, R3 - MOVD $0, R4 - JMP continue diff --git a/vendor/golang.org/x/crypto/internal/chacha20/xor.go b/vendor/golang.org/x/crypto/chacha20/xor.go similarity index 73% rename from vendor/golang.org/x/crypto/internal/chacha20/xor.go rename to vendor/golang.org/x/crypto/chacha20/xor.go index 9c5ba0b33..c2d04851e 100644 --- a/vendor/golang.org/x/crypto/internal/chacha20/xor.go +++ b/vendor/golang.org/x/crypto/chacha20/xor.go @@ -4,9 +4,7 @@ package chacha20 -import ( - "runtime" -) +import "runtime" // Platforms that have fast unaligned 32-bit little endian accesses. const unaligned = runtime.GOARCH == "386" || @@ -15,10 +13,10 @@ const unaligned = runtime.GOARCH == "386" || runtime.GOARCH == "ppc64le" || runtime.GOARCH == "s390x" -// xor reads a little endian uint32 from src, XORs it with u and +// addXor reads a little endian uint32 from src, XORs it with (a + b) and // places the result in little endian byte order in dst. -func xor(dst, src []byte, u uint32) { - _, _ = src[3], dst[3] // eliminate bounds checks +func addXor(dst, src []byte, a, b uint32) { + _, _ = src[3], dst[3] // bounds check elimination hint if unaligned { // The compiler should optimize this code into // 32-bit unaligned little endian loads and stores. @@ -29,15 +27,16 @@ func xor(dst, src []byte, u uint32) { v |= uint32(src[1]) << 8 v |= uint32(src[2]) << 16 v |= uint32(src[3]) << 24 - v ^= u + v ^= a + b dst[0] = byte(v) dst[1] = byte(v >> 8) dst[2] = byte(v >> 16) dst[3] = byte(v >> 24) } else { - dst[0] = src[0] ^ byte(u) - dst[1] = src[1] ^ byte(u>>8) - dst[2] = src[2] ^ byte(u>>16) - dst[3] = src[3] ^ byte(u>>24) + a += b + dst[0] = src[0] ^ byte(a) + dst[1] = src[1] ^ byte(a>>8) + dst[2] = src[2] ^ byte(a>>16) + dst[3] = src[3] ^ byte(a>>24) } } diff --git a/vendor/golang.org/x/crypto/curve25519/const_amd64.h b/vendor/golang.org/x/crypto/curve25519/const_amd64.h deleted file mode 100644 index b3f74162f..000000000 --- a/vendor/golang.org/x/crypto/curve25519/const_amd64.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html - -#define REDMASK51 0x0007FFFFFFFFFFFF diff --git a/vendor/golang.org/x/crypto/curve25519/const_amd64.s b/vendor/golang.org/x/crypto/curve25519/const_amd64.s deleted file mode 100644 index ee7b4bd5f..000000000 --- a/vendor/golang.org/x/crypto/curve25519/const_amd64.s +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -// These constants cannot be encoded in non-MOVQ immediates. -// We access them directly from memory instead. - -DATA ·_121666_213(SB)/8, $996687872 -GLOBL ·_121666_213(SB), 8, $8 - -DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA -GLOBL ·_2P0(SB), 8, $8 - -DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE -GLOBL ·_2P1234(SB), 8, $8 diff --git a/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s b/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s deleted file mode 100644 index cd793a5b5..000000000 --- a/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build amd64,!gccgo,!appengine - -// func cswap(inout *[4][5]uint64, v uint64) -TEXT ·cswap(SB),7,$0 - MOVQ inout+0(FP),DI - MOVQ v+8(FP),SI - - SUBQ $1, SI - NOTQ SI - MOVQ SI, X15 - PSHUFD $0x44, X15, X15 - - MOVOU 0(DI), X0 - MOVOU 16(DI), X2 - MOVOU 32(DI), X4 - MOVOU 48(DI), X6 - MOVOU 64(DI), X8 - MOVOU 80(DI), X1 - MOVOU 96(DI), X3 - MOVOU 112(DI), X5 - MOVOU 128(DI), X7 - MOVOU 144(DI), X9 - - MOVO X1, X10 - MOVO X3, X11 - MOVO X5, X12 - MOVO X7, X13 - MOVO X9, X14 - - PXOR X0, X10 - PXOR X2, X11 - PXOR X4, X12 - PXOR X6, X13 - PXOR X8, X14 - PAND X15, X10 - PAND X15, X11 - PAND X15, X12 - PAND X15, X13 - PAND X15, X14 - PXOR X10, X0 - PXOR X10, X1 - PXOR X11, X2 - PXOR X11, X3 - PXOR X12, X4 - PXOR X12, X5 - PXOR X13, X6 - PXOR X13, X7 - PXOR X14, X8 - PXOR X14, X9 - - MOVOU X0, 0(DI) - MOVOU X2, 16(DI) - MOVOU X4, 32(DI) - MOVOU X6, 48(DI) - MOVOU X8, 64(DI) - MOVOU X1, 80(DI) - MOVOU X3, 96(DI) - MOVOU X5, 112(DI) - MOVOU X7, 128(DI) - MOVOU X9, 144(DI) - RET diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519.go b/vendor/golang.org/x/crypto/curve25519/curve25519.go index 75f24babb..cda3fdd35 100644 --- a/vendor/golang.org/x/crypto/curve25519/curve25519.go +++ b/vendor/golang.org/x/crypto/curve25519/curve25519.go @@ -1,834 +1,145 @@ -// Copyright 2013 The Go Authors. All rights reserved. +// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// We have an implementation in amd64 assembly so this code is only run on -// non-amd64 platforms. The amd64 assembly does not support gccgo. -// +build !amd64 gccgo appengine - -package curve25519 +// 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" import ( - "encoding/binary" -) - -// This code is a port of the public domain, "ref10" implementation of -// curve25519 from SUPERCOP 20130419 by D. J. Bernstein. - -// fieldElement represents an element of the field GF(2^255 - 19). An element -// t, entries t[0]...t[9], represents the integer t[0]+2^26 t[1]+2^51 t[2]+2^77 -// t[3]+2^102 t[4]+...+2^230 t[9]. Bounds on each t[i] vary depending on -// context. -type fieldElement [10]int32 - -func feZero(fe *fieldElement) { - for i := range fe { - fe[i] = 0 - } -} - -func feOne(fe *fieldElement) { - feZero(fe) - fe[0] = 1 -} - -func feAdd(dst, a, b *fieldElement) { - for i := range dst { - dst[i] = a[i] + b[i] - } -} - -func feSub(dst, a, b *fieldElement) { - for i := range dst { - dst[i] = a[i] - b[i] - } -} - -func feCopy(dst, src *fieldElement) { - for i := range dst { - dst[i] = src[i] - } -} - -// feCSwap replaces (f,g) with (g,f) if b == 1; replaces (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -func feCSwap(f, g *fieldElement, b int32) { - b = -b - for i := range f { - t := b & (f[i] ^ g[i]) - f[i] ^= t - g[i] ^= t - } -} - -// load3 reads a 24-bit, little-endian value from in. -func load3(in []byte) int64 { - var r int64 - r = int64(in[0]) - r |= int64(in[1]) << 8 - r |= int64(in[2]) << 16 - return r -} - -// load4 reads a 32-bit, little-endian value from in. -func load4(in []byte) int64 { - return int64(binary.LittleEndian.Uint32(in)) -} - -func feFromBytes(dst *fieldElement, src *[32]byte) { - h0 := load4(src[:]) - h1 := load3(src[4:]) << 6 - h2 := load3(src[7:]) << 5 - h3 := load3(src[10:]) << 3 - h4 := load3(src[13:]) << 2 - h5 := load4(src[16:]) - h6 := load3(src[20:]) << 7 - h7 := load3(src[23:]) << 5 - h8 := load3(src[26:]) << 4 - h9 := (load3(src[29:]) & 0x7fffff) << 2 - - var carry [10]int64 - carry[9] = (h9 + 1<<24) >> 25 - h0 += carry[9] * 19 - h9 -= carry[9] << 25 - carry[1] = (h1 + 1<<24) >> 25 - h2 += carry[1] - h1 -= carry[1] << 25 - carry[3] = (h3 + 1<<24) >> 25 - h4 += carry[3] - h3 -= carry[3] << 25 - carry[5] = (h5 + 1<<24) >> 25 - h6 += carry[5] - h5 -= carry[5] << 25 - carry[7] = (h7 + 1<<24) >> 25 - h8 += carry[7] - h7 -= carry[7] << 25 - - carry[0] = (h0 + 1<<25) >> 26 - h1 += carry[0] - h0 -= carry[0] << 26 - carry[2] = (h2 + 1<<25) >> 26 - h3 += carry[2] - h2 -= carry[2] << 26 - carry[4] = (h4 + 1<<25) >> 26 - h5 += carry[4] - h4 -= carry[4] << 26 - carry[6] = (h6 + 1<<25) >> 26 - h7 += carry[6] - h6 -= carry[6] << 26 - carry[8] = (h8 + 1<<25) >> 26 - h9 += carry[8] - h8 -= carry[8] << 26 + "crypto/subtle" + "fmt" - dst[0] = int32(h0) - dst[1] = int32(h1) - dst[2] = int32(h2) - dst[3] = int32(h3) - dst[4] = int32(h4) - dst[5] = int32(h5) - dst[6] = int32(h6) - dst[7] = int32(h7) - dst[8] = int32(h8) - dst[9] = int32(h9) -} + "golang.org/x/crypto/curve25519/internal/field" +) -// feToBytes marshals h to s. -// Preconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Write p=2^255-19; q=floor(h/p). -// Basic claim: q = floor(2^(-255)(h + 19 2^(-25)h9 + 2^(-1))). +// ScalarMult sets dst to the product scalar * point. // -// Proof: -// Have |h|<=p so |q|<=1 so |19^2 2^(-255) q|<1/4. -// Also have |h-2^230 h9|<2^230 so |19 2^(-255)(h-2^230 h9)|<1/4. -// -// Write y=2^(-1)-19^2 2^(-255)q-19 2^(-255)(h-2^230 h9). -// Then 0> 25 - q = (h[0] + q) >> 26 - q = (h[1] + q) >> 25 - q = (h[2] + q) >> 26 - q = (h[3] + q) >> 25 - q = (h[4] + q) >> 26 - q = (h[5] + q) >> 25 - q = (h[6] + q) >> 26 - q = (h[7] + q) >> 25 - q = (h[8] + q) >> 26 - q = (h[9] + q) >> 25 - - // Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20. - h[0] += 19 * q - // Goal: Output h-2^255 q, which is between 0 and 2^255-20. +// Deprecated: when provided a low-order point, ScalarMult will set dst to all +// zeroes, irrespective of the scalar. Instead, use the X25519 function, which +// will return an error. +func ScalarMult(dst, scalar, point *[32]byte) { + var e [32]byte - carry[0] = h[0] >> 26 - h[1] += carry[0] - h[0] -= carry[0] << 26 - carry[1] = h[1] >> 25 - h[2] += carry[1] - h[1] -= carry[1] << 25 - carry[2] = h[2] >> 26 - h[3] += carry[2] - h[2] -= carry[2] << 26 - carry[3] = h[3] >> 25 - h[4] += carry[3] - h[3] -= carry[3] << 25 - carry[4] = h[4] >> 26 - h[5] += carry[4] - h[4] -= carry[4] << 26 - carry[5] = h[5] >> 25 - h[6] += carry[5] - h[5] -= carry[5] << 25 - carry[6] = h[6] >> 26 - h[7] += carry[6] - h[6] -= carry[6] << 26 - carry[7] = h[7] >> 25 - h[8] += carry[7] - h[7] -= carry[7] << 25 - carry[8] = h[8] >> 26 - h[9] += carry[8] - h[8] -= carry[8] << 26 - carry[9] = h[9] >> 25 - h[9] -= carry[9] << 25 - // h10 = carry9 + copy(e[:], scalar[:]) + e[0] &= 248 + e[31] &= 127 + e[31] |= 64 - // Goal: Output h[0]+...+2^255 h10-2^255 q, which is between 0 and 2^255-20. - // Have h[0]+...+2^230 h[9] between 0 and 2^255-1; - // evidently 2^255 h10-2^255 q = 0. - // Goal: Output h[0]+...+2^230 h[9]. + var x1, x2, z2, x3, z3, tmp0, tmp1 field.Element + x1.SetBytes(point[:]) + x2.One() + x3.Set(&x1) + z3.One() - s[0] = byte(h[0] >> 0) - s[1] = byte(h[0] >> 8) - s[2] = byte(h[0] >> 16) - s[3] = byte((h[0] >> 24) | (h[1] << 2)) - s[4] = byte(h[1] >> 6) - s[5] = byte(h[1] >> 14) - s[6] = byte((h[1] >> 22) | (h[2] << 3)) - s[7] = byte(h[2] >> 5) - s[8] = byte(h[2] >> 13) - s[9] = byte((h[2] >> 21) | (h[3] << 5)) - s[10] = byte(h[3] >> 3) - s[11] = byte(h[3] >> 11) - s[12] = byte((h[3] >> 19) | (h[4] << 6)) - s[13] = byte(h[4] >> 2) - s[14] = byte(h[4] >> 10) - s[15] = byte(h[4] >> 18) - s[16] = byte(h[5] >> 0) - s[17] = byte(h[5] >> 8) - s[18] = byte(h[5] >> 16) - s[19] = byte((h[5] >> 24) | (h[6] << 1)) - s[20] = byte(h[6] >> 7) - s[21] = byte(h[6] >> 15) - s[22] = byte((h[6] >> 23) | (h[7] << 3)) - s[23] = byte(h[7] >> 5) - s[24] = byte(h[7] >> 13) - s[25] = byte((h[7] >> 21) | (h[8] << 4)) - s[26] = byte(h[8] >> 4) - s[27] = byte(h[8] >> 12) - s[28] = byte((h[8] >> 20) | (h[9] << 6)) - s[29] = byte(h[9] >> 2) - s[30] = byte(h[9] >> 10) - s[31] = byte(h[9] >> 18) + swap := 0 + for pos := 254; pos >= 0; pos-- { + b := e[pos/8] >> uint(pos&7) + b &= 1 + swap ^= int(b) + x2.Swap(&x3, swap) + z2.Swap(&z3, swap) + swap = int(b) + + tmp0.Subtract(&x3, &z3) + tmp1.Subtract(&x2, &z2) + x2.Add(&x2, &z2) + z2.Add(&x3, &z3) + z3.Multiply(&tmp0, &x2) + z2.Multiply(&z2, &tmp1) + tmp0.Square(&tmp1) + tmp1.Square(&x2) + x3.Add(&z3, &z2) + z2.Subtract(&z3, &z2) + x2.Multiply(&tmp1, &tmp0) + tmp1.Subtract(&tmp1, &tmp0) + z2.Square(&z2) + + z3.Mult32(&tmp1, 121666) + x3.Square(&x3) + tmp0.Add(&tmp0, &z3) + z3.Multiply(&x1, &z2) + z2.Multiply(&tmp1, &tmp0) + } + + x2.Swap(&x3, swap) + z2.Swap(&z3, swap) + + z2.Invert(&z2) + x2.Multiply(&x2, &z2) + copy(dst[:], x2.Bytes()) } -// feMul calculates h = f * g -// Can overlap h with f or g. -// -// Preconditions: -// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// |g| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Notes on implementation strategy: -// -// Using schoolbook multiplication. -// Karatsuba would save a little in some cost models. -// -// Most multiplications by 2 and 19 are 32-bit precomputations; -// cheaper than 64-bit postcomputations. +// ScalarBaseMult sets dst to the product scalar * base where base is the +// standard generator. // -// There is one remaining multiplication by 19 in the carry chain; -// one *19 precomputation can be merged into this, -// but the resulting data flow is considerably less clean. -// -// There are 12 carries below. -// 10 of them are 2-way parallelizable and vectorizable. -// Can get away with 11 carries, but then data flow is much deeper. -// -// With tighter constraints on inputs can squeeze carries into int32. -func feMul(h, f, g *fieldElement) { - f0 := f[0] - f1 := f[1] - f2 := f[2] - f3 := f[3] - f4 := f[4] - f5 := f[5] - f6 := f[6] - f7 := f[7] - f8 := f[8] - f9 := f[9] - g0 := g[0] - g1 := g[1] - g2 := g[2] - g3 := g[3] - g4 := g[4] - g5 := g[5] - g6 := g[6] - g7 := g[7] - g8 := g[8] - g9 := g[9] - g1_19 := 19 * g1 // 1.4*2^29 - g2_19 := 19 * g2 // 1.4*2^30; still ok - g3_19 := 19 * g3 - g4_19 := 19 * g4 - g5_19 := 19 * g5 - g6_19 := 19 * g6 - g7_19 := 19 * g7 - g8_19 := 19 * g8 - g9_19 := 19 * g9 - f1_2 := 2 * f1 - f3_2 := 2 * f3 - f5_2 := 2 * f5 - f7_2 := 2 * f7 - f9_2 := 2 * f9 - f0g0 := int64(f0) * int64(g0) - f0g1 := int64(f0) * int64(g1) - f0g2 := int64(f0) * int64(g2) - f0g3 := int64(f0) * int64(g3) - f0g4 := int64(f0) * int64(g4) - f0g5 := int64(f0) * int64(g5) - f0g6 := int64(f0) * int64(g6) - f0g7 := int64(f0) * int64(g7) - f0g8 := int64(f0) * int64(g8) - f0g9 := int64(f0) * int64(g9) - f1g0 := int64(f1) * int64(g0) - f1g1_2 := int64(f1_2) * int64(g1) - f1g2 := int64(f1) * int64(g2) - f1g3_2 := int64(f1_2) * int64(g3) - f1g4 := int64(f1) * int64(g4) - f1g5_2 := int64(f1_2) * int64(g5) - f1g6 := int64(f1) * int64(g6) - f1g7_2 := int64(f1_2) * int64(g7) - f1g8 := int64(f1) * int64(g8) - f1g9_38 := int64(f1_2) * int64(g9_19) - f2g0 := int64(f2) * int64(g0) - f2g1 := int64(f2) * int64(g1) - f2g2 := int64(f2) * int64(g2) - f2g3 := int64(f2) * int64(g3) - f2g4 := int64(f2) * int64(g4) - f2g5 := int64(f2) * int64(g5) - f2g6 := int64(f2) * int64(g6) - f2g7 := int64(f2) * int64(g7) - f2g8_19 := int64(f2) * int64(g8_19) - f2g9_19 := int64(f2) * int64(g9_19) - f3g0 := int64(f3) * int64(g0) - f3g1_2 := int64(f3_2) * int64(g1) - f3g2 := int64(f3) * int64(g2) - f3g3_2 := int64(f3_2) * int64(g3) - f3g4 := int64(f3) * int64(g4) - f3g5_2 := int64(f3_2) * int64(g5) - f3g6 := int64(f3) * int64(g6) - f3g7_38 := int64(f3_2) * int64(g7_19) - f3g8_19 := int64(f3) * int64(g8_19) - f3g9_38 := int64(f3_2) * int64(g9_19) - f4g0 := int64(f4) * int64(g0) - f4g1 := int64(f4) * int64(g1) - f4g2 := int64(f4) * int64(g2) - f4g3 := int64(f4) * int64(g3) - f4g4 := int64(f4) * int64(g4) - f4g5 := int64(f4) * int64(g5) - f4g6_19 := int64(f4) * int64(g6_19) - f4g7_19 := int64(f4) * int64(g7_19) - f4g8_19 := int64(f4) * int64(g8_19) - f4g9_19 := int64(f4) * int64(g9_19) - f5g0 := int64(f5) * int64(g0) - f5g1_2 := int64(f5_2) * int64(g1) - f5g2 := int64(f5) * int64(g2) - f5g3_2 := int64(f5_2) * int64(g3) - f5g4 := int64(f5) * int64(g4) - f5g5_38 := int64(f5_2) * int64(g5_19) - f5g6_19 := int64(f5) * int64(g6_19) - f5g7_38 := int64(f5_2) * int64(g7_19) - f5g8_19 := int64(f5) * int64(g8_19) - f5g9_38 := int64(f5_2) * int64(g9_19) - f6g0 := int64(f6) * int64(g0) - f6g1 := int64(f6) * int64(g1) - f6g2 := int64(f6) * int64(g2) - f6g3 := int64(f6) * int64(g3) - f6g4_19 := int64(f6) * int64(g4_19) - f6g5_19 := int64(f6) * int64(g5_19) - f6g6_19 := int64(f6) * int64(g6_19) - f6g7_19 := int64(f6) * int64(g7_19) - f6g8_19 := int64(f6) * int64(g8_19) - f6g9_19 := int64(f6) * int64(g9_19) - f7g0 := int64(f7) * int64(g0) - f7g1_2 := int64(f7_2) * int64(g1) - f7g2 := int64(f7) * int64(g2) - f7g3_38 := int64(f7_2) * int64(g3_19) - f7g4_19 := int64(f7) * int64(g4_19) - f7g5_38 := int64(f7_2) * int64(g5_19) - f7g6_19 := int64(f7) * int64(g6_19) - f7g7_38 := int64(f7_2) * int64(g7_19) - f7g8_19 := int64(f7) * int64(g8_19) - f7g9_38 := int64(f7_2) * int64(g9_19) - f8g0 := int64(f8) * int64(g0) - f8g1 := int64(f8) * int64(g1) - f8g2_19 := int64(f8) * int64(g2_19) - f8g3_19 := int64(f8) * int64(g3_19) - f8g4_19 := int64(f8) * int64(g4_19) - f8g5_19 := int64(f8) * int64(g5_19) - f8g6_19 := int64(f8) * int64(g6_19) - f8g7_19 := int64(f8) * int64(g7_19) - f8g8_19 := int64(f8) * int64(g8_19) - f8g9_19 := int64(f8) * int64(g9_19) - f9g0 := int64(f9) * int64(g0) - f9g1_38 := int64(f9_2) * int64(g1_19) - f9g2_19 := int64(f9) * int64(g2_19) - f9g3_38 := int64(f9_2) * int64(g3_19) - f9g4_19 := int64(f9) * int64(g4_19) - f9g5_38 := int64(f9_2) * int64(g5_19) - f9g6_19 := int64(f9) * int64(g6_19) - f9g7_38 := int64(f9_2) * int64(g7_19) - f9g8_19 := int64(f9) * int64(g8_19) - f9g9_38 := int64(f9_2) * int64(g9_19) - h0 := f0g0 + f1g9_38 + f2g8_19 + f3g7_38 + f4g6_19 + f5g5_38 + f6g4_19 + f7g3_38 + f8g2_19 + f9g1_38 - h1 := f0g1 + f1g0 + f2g9_19 + f3g8_19 + f4g7_19 + f5g6_19 + f6g5_19 + f7g4_19 + f8g3_19 + f9g2_19 - h2 := f0g2 + f1g1_2 + f2g0 + f3g9_38 + f4g8_19 + f5g7_38 + f6g6_19 + f7g5_38 + f8g4_19 + f9g3_38 - h3 := f0g3 + f1g2 + f2g1 + f3g0 + f4g9_19 + f5g8_19 + f6g7_19 + f7g6_19 + f8g5_19 + f9g4_19 - h4 := f0g4 + f1g3_2 + f2g2 + f3g1_2 + f4g0 + f5g9_38 + f6g8_19 + f7g7_38 + f8g6_19 + f9g5_38 - h5 := f0g5 + f1g4 + f2g3 + f3g2 + f4g1 + f5g0 + f6g9_19 + f7g8_19 + f8g7_19 + f9g6_19 - h6 := f0g6 + f1g5_2 + f2g4 + f3g3_2 + f4g2 + f5g1_2 + f6g0 + f7g9_38 + f8g8_19 + f9g7_38 - h7 := f0g7 + f1g6 + f2g5 + f3g4 + f4g3 + f5g2 + f6g1 + f7g0 + f8g9_19 + f9g8_19 - h8 := f0g8 + f1g7_2 + f2g6 + f3g5_2 + f4g4 + f5g3_2 + f6g2 + f7g1_2 + f8g0 + f9g9_38 - h9 := f0g9 + f1g8 + f2g7 + f3g6 + f4g5 + f5g4 + f6g3 + f7g2 + f8g1 + f9g0 - var carry [10]int64 - - // |h0| <= (1.1*1.1*2^52*(1+19+19+19+19)+1.1*1.1*2^50*(38+38+38+38+38)) - // i.e. |h0| <= 1.2*2^59; narrower ranges for h2, h4, h6, h8 - // |h1| <= (1.1*1.1*2^51*(1+1+19+19+19+19+19+19+19+19)) - // i.e. |h1| <= 1.5*2^58; narrower ranges for h3, h5, h7, h9 - - carry[0] = (h0 + (1 << 25)) >> 26 - h1 += carry[0] - h0 -= carry[0] << 26 - carry[4] = (h4 + (1 << 25)) >> 26 - h5 += carry[4] - h4 -= carry[4] << 26 - // |h0| <= 2^25 - // |h4| <= 2^25 - // |h1| <= 1.51*2^58 - // |h5| <= 1.51*2^58 - - carry[1] = (h1 + (1 << 24)) >> 25 - h2 += carry[1] - h1 -= carry[1] << 25 - carry[5] = (h5 + (1 << 24)) >> 25 - h6 += carry[5] - h5 -= carry[5] << 25 - // |h1| <= 2^24; from now on fits into int32 - // |h5| <= 2^24; from now on fits into int32 - // |h2| <= 1.21*2^59 - // |h6| <= 1.21*2^59 - - carry[2] = (h2 + (1 << 25)) >> 26 - h3 += carry[2] - h2 -= carry[2] << 26 - carry[6] = (h6 + (1 << 25)) >> 26 - h7 += carry[6] - h6 -= carry[6] << 26 - // |h2| <= 2^25; from now on fits into int32 unchanged - // |h6| <= 2^25; from now on fits into int32 unchanged - // |h3| <= 1.51*2^58 - // |h7| <= 1.51*2^58 - - carry[3] = (h3 + (1 << 24)) >> 25 - h4 += carry[3] - h3 -= carry[3] << 25 - carry[7] = (h7 + (1 << 24)) >> 25 - h8 += carry[7] - h7 -= carry[7] << 25 - // |h3| <= 2^24; from now on fits into int32 unchanged - // |h7| <= 2^24; from now on fits into int32 unchanged - // |h4| <= 1.52*2^33 - // |h8| <= 1.52*2^33 - - carry[4] = (h4 + (1 << 25)) >> 26 - h5 += carry[4] - h4 -= carry[4] << 26 - carry[8] = (h8 + (1 << 25)) >> 26 - h9 += carry[8] - h8 -= carry[8] << 26 - // |h4| <= 2^25; from now on fits into int32 unchanged - // |h8| <= 2^25; from now on fits into int32 unchanged - // |h5| <= 1.01*2^24 - // |h9| <= 1.51*2^58 - - carry[9] = (h9 + (1 << 24)) >> 25 - h0 += carry[9] * 19 - h9 -= carry[9] << 25 - // |h9| <= 2^24; from now on fits into int32 unchanged - // |h0| <= 1.8*2^37 - - carry[0] = (h0 + (1 << 25)) >> 26 - h1 += carry[0] - h0 -= carry[0] << 26 - // |h0| <= 2^25; from now on fits into int32 unchanged - // |h1| <= 1.01*2^24 - - h[0] = int32(h0) - h[1] = int32(h1) - h[2] = int32(h2) - h[3] = int32(h3) - h[4] = int32(h4) - h[5] = int32(h5) - h[6] = int32(h6) - h[7] = int32(h7) - h[8] = int32(h8) - h[9] = int32(h9) +// It is recommended to use the X25519 function with Basepoint instead, as +// copying into fixed size arrays can lead to unexpected bugs. +func ScalarBaseMult(dst, scalar *[32]byte) { + ScalarMult(dst, scalar, &basePoint) } -// feSquare calculates h = f*f. Can overlap h with f. -// -// Preconditions: -// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -func feSquare(h, f *fieldElement) { - f0 := f[0] - f1 := f[1] - f2 := f[2] - f3 := f[3] - f4 := f[4] - f5 := f[5] - f6 := f[6] - f7 := f[7] - f8 := f[8] - f9 := f[9] - f0_2 := 2 * f0 - f1_2 := 2 * f1 - f2_2 := 2 * f2 - f3_2 := 2 * f3 - f4_2 := 2 * f4 - f5_2 := 2 * f5 - f6_2 := 2 * f6 - f7_2 := 2 * f7 - f5_38 := 38 * f5 // 1.31*2^30 - f6_19 := 19 * f6 // 1.31*2^30 - f7_38 := 38 * f7 // 1.31*2^30 - f8_19 := 19 * f8 // 1.31*2^30 - f9_38 := 38 * f9 // 1.31*2^30 - f0f0 := int64(f0) * int64(f0) - f0f1_2 := int64(f0_2) * int64(f1) - f0f2_2 := int64(f0_2) * int64(f2) - f0f3_2 := int64(f0_2) * int64(f3) - f0f4_2 := int64(f0_2) * int64(f4) - f0f5_2 := int64(f0_2) * int64(f5) - f0f6_2 := int64(f0_2) * int64(f6) - f0f7_2 := int64(f0_2) * int64(f7) - f0f8_2 := int64(f0_2) * int64(f8) - f0f9_2 := int64(f0_2) * int64(f9) - f1f1_2 := int64(f1_2) * int64(f1) - f1f2_2 := int64(f1_2) * int64(f2) - f1f3_4 := int64(f1_2) * int64(f3_2) - f1f4_2 := int64(f1_2) * int64(f4) - f1f5_4 := int64(f1_2) * int64(f5_2) - f1f6_2 := int64(f1_2) * int64(f6) - f1f7_4 := int64(f1_2) * int64(f7_2) - f1f8_2 := int64(f1_2) * int64(f8) - f1f9_76 := int64(f1_2) * int64(f9_38) - f2f2 := int64(f2) * int64(f2) - f2f3_2 := int64(f2_2) * int64(f3) - f2f4_2 := int64(f2_2) * int64(f4) - f2f5_2 := int64(f2_2) * int64(f5) - f2f6_2 := int64(f2_2) * int64(f6) - f2f7_2 := int64(f2_2) * int64(f7) - f2f8_38 := int64(f2_2) * int64(f8_19) - f2f9_38 := int64(f2) * int64(f9_38) - f3f3_2 := int64(f3_2) * int64(f3) - f3f4_2 := int64(f3_2) * int64(f4) - f3f5_4 := int64(f3_2) * int64(f5_2) - f3f6_2 := int64(f3_2) * int64(f6) - f3f7_76 := int64(f3_2) * int64(f7_38) - f3f8_38 := int64(f3_2) * int64(f8_19) - f3f9_76 := int64(f3_2) * int64(f9_38) - f4f4 := int64(f4) * int64(f4) - f4f5_2 := int64(f4_2) * int64(f5) - f4f6_38 := int64(f4_2) * int64(f6_19) - f4f7_38 := int64(f4) * int64(f7_38) - f4f8_38 := int64(f4_2) * int64(f8_19) - f4f9_38 := int64(f4) * int64(f9_38) - f5f5_38 := int64(f5) * int64(f5_38) - f5f6_38 := int64(f5_2) * int64(f6_19) - f5f7_76 := int64(f5_2) * int64(f7_38) - f5f8_38 := int64(f5_2) * int64(f8_19) - f5f9_76 := int64(f5_2) * int64(f9_38) - f6f6_19 := int64(f6) * int64(f6_19) - f6f7_38 := int64(f6) * int64(f7_38) - f6f8_38 := int64(f6_2) * int64(f8_19) - f6f9_38 := int64(f6) * int64(f9_38) - f7f7_38 := int64(f7) * int64(f7_38) - f7f8_38 := int64(f7_2) * int64(f8_19) - f7f9_76 := int64(f7_2) * int64(f9_38) - f8f8_19 := int64(f8) * int64(f8_19) - f8f9_38 := int64(f8) * int64(f9_38) - f9f9_38 := int64(f9) * int64(f9_38) - h0 := f0f0 + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38 - h1 := f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38 - h2 := f0f2_2 + f1f1_2 + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19 - h3 := f0f3_2 + f1f2_2 + f4f9_38 + f5f8_38 + f6f7_38 - h4 := f0f4_2 + f1f3_4 + f2f2 + f5f9_76 + f6f8_38 + f7f7_38 - h5 := f0f5_2 + f1f4_2 + f2f3_2 + f6f9_38 + f7f8_38 - h6 := f0f6_2 + f1f5_4 + f2f4_2 + f3f3_2 + f7f9_76 + f8f8_19 - h7 := f0f7_2 + f1f6_2 + f2f5_2 + f3f4_2 + f8f9_38 - h8 := f0f8_2 + f1f7_4 + f2f6_2 + f3f5_4 + f4f4 + f9f9_38 - h9 := f0f9_2 + f1f8_2 + f2f7_2 + f3f6_2 + f4f5_2 - var carry [10]int64 - - carry[0] = (h0 + (1 << 25)) >> 26 - h1 += carry[0] - h0 -= carry[0] << 26 - carry[4] = (h4 + (1 << 25)) >> 26 - h5 += carry[4] - h4 -= carry[4] << 26 - - carry[1] = (h1 + (1 << 24)) >> 25 - h2 += carry[1] - h1 -= carry[1] << 25 - carry[5] = (h5 + (1 << 24)) >> 25 - h6 += carry[5] - h5 -= carry[5] << 25 - - carry[2] = (h2 + (1 << 25)) >> 26 - h3 += carry[2] - h2 -= carry[2] << 26 - carry[6] = (h6 + (1 << 25)) >> 26 - h7 += carry[6] - h6 -= carry[6] << 26 - - carry[3] = (h3 + (1 << 24)) >> 25 - h4 += carry[3] - h3 -= carry[3] << 25 - carry[7] = (h7 + (1 << 24)) >> 25 - h8 += carry[7] - h7 -= carry[7] << 25 +const ( + // ScalarSize is the size of the scalar input to X25519. + ScalarSize = 32 + // PointSize is the size of the point input to X25519. + PointSize = 32 +) - carry[4] = (h4 + (1 << 25)) >> 26 - h5 += carry[4] - h4 -= carry[4] << 26 - carry[8] = (h8 + (1 << 25)) >> 26 - h9 += carry[8] - h8 -= carry[8] << 26 +// Basepoint is the canonical Curve25519 generator. +var Basepoint []byte - carry[9] = (h9 + (1 << 24)) >> 25 - h0 += carry[9] * 19 - h9 -= carry[9] << 25 +var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - carry[0] = (h0 + (1 << 25)) >> 26 - h1 += carry[0] - h0 -= carry[0] << 26 +func init() { Basepoint = basePoint[:] } - h[0] = int32(h0) - h[1] = int32(h1) - h[2] = int32(h2) - h[3] = int32(h3) - h[4] = int32(h4) - h[5] = int32(h5) - h[6] = int32(h6) - h[7] = int32(h7) - h[8] = int32(h8) - h[9] = int32(h9) +func checkBasepoint() { + if subtle.ConstantTimeCompare(Basepoint, []byte{ + 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }) != 1 { + panic("curve25519: global Basepoint value was modified") + } } -// feMul121666 calculates h = f * 121666. Can overlap h with f. +// X25519 returns the result of the scalar multiplication (scalar * point), +// according to RFC 7748, Section 5. scalar, point and the return value are +// slices of 32 bytes. // -// Preconditions: -// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. +// scalar can be generated at random, for example with crypto/rand. point should +// be either Basepoint or the output of another X25519 call. // -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -func feMul121666(h, f *fieldElement) { - h0 := int64(f[0]) * 121666 - h1 := int64(f[1]) * 121666 - h2 := int64(f[2]) * 121666 - h3 := int64(f[3]) * 121666 - h4 := int64(f[4]) * 121666 - h5 := int64(f[5]) * 121666 - h6 := int64(f[6]) * 121666 - h7 := int64(f[7]) * 121666 - h8 := int64(f[8]) * 121666 - h9 := int64(f[9]) * 121666 - var carry [10]int64 - - carry[9] = (h9 + (1 << 24)) >> 25 - h0 += carry[9] * 19 - h9 -= carry[9] << 25 - carry[1] = (h1 + (1 << 24)) >> 25 - h2 += carry[1] - h1 -= carry[1] << 25 - carry[3] = (h3 + (1 << 24)) >> 25 - h4 += carry[3] - h3 -= carry[3] << 25 - carry[5] = (h5 + (1 << 24)) >> 25 - h6 += carry[5] - h5 -= carry[5] << 25 - carry[7] = (h7 + (1 << 24)) >> 25 - h8 += carry[7] - h7 -= carry[7] << 25 - - carry[0] = (h0 + (1 << 25)) >> 26 - h1 += carry[0] - h0 -= carry[0] << 26 - carry[2] = (h2 + (1 << 25)) >> 26 - h3 += carry[2] - h2 -= carry[2] << 26 - carry[4] = (h4 + (1 << 25)) >> 26 - h5 += carry[4] - h4 -= carry[4] << 26 - carry[6] = (h6 + (1 << 25)) >> 26 - h7 += carry[6] - h6 -= carry[6] << 26 - carry[8] = (h8 + (1 << 25)) >> 26 - h9 += carry[8] - h8 -= carry[8] << 26 - - h[0] = int32(h0) - h[1] = int32(h1) - h[2] = int32(h2) - h[3] = int32(h3) - h[4] = int32(h4) - h[5] = int32(h5) - h[6] = int32(h6) - h[7] = int32(h7) - h[8] = int32(h8) - h[9] = int32(h9) -} - -// feInvert sets out = z^-1. -func feInvert(out, z *fieldElement) { - var t0, t1, t2, t3 fieldElement - var i int - - feSquare(&t0, z) - for i = 1; i < 1; i++ { - feSquare(&t0, &t0) - } - feSquare(&t1, &t0) - for i = 1; i < 2; i++ { - feSquare(&t1, &t1) - } - feMul(&t1, z, &t1) - feMul(&t0, &t0, &t1) - feSquare(&t2, &t0) - for i = 1; i < 1; i++ { - feSquare(&t2, &t2) - } - feMul(&t1, &t1, &t2) - feSquare(&t2, &t1) - for i = 1; i < 5; i++ { - feSquare(&t2, &t2) - } - feMul(&t1, &t2, &t1) - feSquare(&t2, &t1) - for i = 1; i < 10; i++ { - feSquare(&t2, &t2) - } - feMul(&t2, &t2, &t1) - feSquare(&t3, &t2) - for i = 1; i < 20; i++ { - feSquare(&t3, &t3) - } - feMul(&t2, &t3, &t2) - feSquare(&t2, &t2) - for i = 1; i < 10; i++ { - feSquare(&t2, &t2) - } - feMul(&t1, &t2, &t1) - feSquare(&t2, &t1) - for i = 1; i < 50; i++ { - feSquare(&t2, &t2) - } - feMul(&t2, &t2, &t1) - feSquare(&t3, &t2) - for i = 1; i < 100; i++ { - feSquare(&t3, &t3) - } - feMul(&t2, &t3, &t2) - feSquare(&t2, &t2) - for i = 1; i < 50; i++ { - feSquare(&t2, &t2) - } - feMul(&t1, &t2, &t1) - feSquare(&t1, &t1) - for i = 1; i < 5; i++ { - feSquare(&t1, &t1) - } - feMul(out, &t1, &t0) +// If point is Basepoint (but not if it's a different slice with the same +// contents) a precomputed implementation might be used for performance. +func X25519(scalar, point []byte) ([]byte, error) { + // Outline the body of function, to let the allocation be inlined in the + // caller, and possibly avoid escaping to the heap. + var dst [32]byte + return x25519(&dst, scalar, point) } -func scalarMult(out, in, base *[32]byte) { - var e [32]byte - - copy(e[:], in[:]) - e[0] &= 248 - e[31] &= 127 - e[31] |= 64 - - var x1, x2, z2, x3, z3, tmp0, tmp1 fieldElement - feFromBytes(&x1, base) - feOne(&x2) - feCopy(&x3, &x1) - feOne(&z3) - - swap := int32(0) - for pos := 254; pos >= 0; pos-- { - b := e[pos/8] >> uint(pos&7) - b &= 1 - swap ^= int32(b) - feCSwap(&x2, &x3, swap) - feCSwap(&z2, &z3, swap) - swap = int32(b) - - feSub(&tmp0, &x3, &z3) - feSub(&tmp1, &x2, &z2) - feAdd(&x2, &x2, &z2) - feAdd(&z2, &x3, &z3) - feMul(&z3, &tmp0, &x2) - feMul(&z2, &z2, &tmp1) - feSquare(&tmp0, &tmp1) - feSquare(&tmp1, &x2) - feAdd(&x3, &z3, &z2) - feSub(&z2, &z3, &z2) - feMul(&x2, &tmp1, &tmp0) - feSub(&tmp1, &tmp1, &tmp0) - feSquare(&z2, &z2) - feMul121666(&z3, &tmp1) - feSquare(&x3, &x3) - feAdd(&tmp0, &tmp0, &z3) - feMul(&z3, &x1, &z2) - feMul(&z2, &tmp1, &tmp0) - } - - feCSwap(&x2, &x3, swap) - feCSwap(&z2, &z3, swap) - - feInvert(&z2, &z2) - feMul(&x2, &x2, &z2) - feToBytes(out, &x2) +func x25519(dst *[32]byte, scalar, point []byte) ([]byte, error) { + var in [32]byte + if l := len(scalar); l != 32 { + return nil, fmt.Errorf("bad scalar length: %d, expected %d", l, 32) + } + if l := len(point); l != 32 { + return nil, fmt.Errorf("bad point length: %d, expected %d", l, 32) + } + copy(in[:], scalar) + if &point[0] == &Basepoint[0] { + checkBasepoint() + ScalarBaseMult(dst, &in) + } else { + var base, zero [32]byte + copy(base[:], point) + ScalarMult(dst, &in, &base) + if subtle.ConstantTimeCompare(dst[:], zero[:]) == 1 { + return nil, fmt.Errorf("bad input point: low order point") + } + } + return dst[:], nil } diff --git a/vendor/golang.org/x/crypto/curve25519/doc.go b/vendor/golang.org/x/crypto/curve25519/doc.go deleted file mode 100644 index da9b10d9c..000000000 --- a/vendor/golang.org/x/crypto/curve25519/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package curve25519 provides an implementation of scalar multiplication on -// the elliptic curve known as curve25519. See https://cr.yp.to/ecdh.html -package curve25519 // import "golang.org/x/crypto/curve25519" - -// basePoint is the x coordinate of the generator of the curve. -var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - -// ScalarMult sets dst to the product in*base where dst and base are the x -// coordinates of group points and all values are in little-endian form. -func ScalarMult(dst, in, base *[32]byte) { - scalarMult(dst, in, base) -} - -// ScalarBaseMult sets dst to the product in*base where dst and base are the x -// coordinates of group points, base is the standard generator and all values -// are in little-endian form. -func ScalarBaseMult(dst, in *[32]byte) { - ScalarMult(dst, in, &basePoint) -} diff --git a/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s b/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s deleted file mode 100644 index 390816106..000000000 --- a/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -#include "const_amd64.h" - -// func freeze(inout *[5]uint64) -TEXT ·freeze(SB),7,$0-8 - MOVQ inout+0(FP), DI - - MOVQ 0(DI),SI - MOVQ 8(DI),DX - MOVQ 16(DI),CX - MOVQ 24(DI),R8 - MOVQ 32(DI),R9 - MOVQ $REDMASK51,AX - MOVQ AX,R10 - SUBQ $18,R10 - MOVQ $3,R11 -REDUCELOOP: - MOVQ SI,R12 - SHRQ $51,R12 - ANDQ AX,SI - ADDQ R12,DX - MOVQ DX,R12 - SHRQ $51,R12 - ANDQ AX,DX - ADDQ R12,CX - MOVQ CX,R12 - SHRQ $51,R12 - ANDQ AX,CX - ADDQ R12,R8 - MOVQ R8,R12 - SHRQ $51,R12 - ANDQ AX,R8 - ADDQ R12,R9 - MOVQ R9,R12 - SHRQ $51,R12 - ANDQ AX,R9 - IMUL3Q $19,R12,R12 - ADDQ R12,SI - SUBQ $1,R11 - JA REDUCELOOP - MOVQ $1,R12 - CMPQ R10,SI - CMOVQLT R11,R12 - CMPQ AX,DX - CMOVQNE R11,R12 - CMPQ AX,CX - CMOVQNE R11,R12 - CMPQ AX,R8 - CMOVQNE R11,R12 - CMPQ AX,R9 - CMOVQNE R11,R12 - NEGQ R12 - ANDQ R12,AX - ANDQ R12,R10 - SUBQ R10,SI - SUBQ AX,DX - SUBQ AX,CX - SUBQ AX,R8 - SUBQ AX,R9 - MOVQ SI,0(DI) - MOVQ DX,8(DI) - MOVQ CX,16(DI) - MOVQ R8,24(DI) - MOVQ R9,32(DI) - RET diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/README b/vendor/golang.org/x/crypto/curve25519/internal/field/README new file mode 100644 index 000000000..e25bca7dc --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/internal/field/README @@ -0,0 +1,7 @@ +This package is kept in sync with crypto/ed25519/internal/edwards25519/field in +the standard library. + +If there are any changes in the standard library that need to be synced to this +package, run sync.sh. It will not overwrite any local changes made since the +previous sync, so it's ok to land changes in this package first, and then sync +to the standard library later. diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe.go b/vendor/golang.org/x/crypto/curve25519/internal/field/fe.go new file mode 100644 index 000000000..ca841ad99 --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/internal/field/fe.go @@ -0,0 +1,416 @@ +// Copyright (c) 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package field implements fast arithmetic modulo 2^255-19. +package field + +import ( + "crypto/subtle" + "encoding/binary" + "math/bits" +) + +// Element represents an element of the field GF(2^255-19). Note that this +// is not a cryptographically secure group, and should only be used to interact +// with edwards25519.Point coordinates. +// +// This type works similarly to math/big.Int, and all arguments and receivers +// are allowed to alias. +// +// The zero value is a valid zero element. +type Element struct { + // An element t represents the integer + // t.l0 + t.l1*2^51 + t.l2*2^102 + t.l3*2^153 + t.l4*2^204 + // + // Between operations, all limbs are expected to be lower than 2^52. + l0 uint64 + l1 uint64 + l2 uint64 + l3 uint64 + l4 uint64 +} + +const maskLow51Bits uint64 = (1 << 51) - 1 + +var feZero = &Element{0, 0, 0, 0, 0} + +// Zero sets v = 0, and returns v. +func (v *Element) Zero() *Element { + *v = *feZero + return v +} + +var feOne = &Element{1, 0, 0, 0, 0} + +// One sets v = 1, and returns v. +func (v *Element) One() *Element { + *v = *feOne + return v +} + +// reduce reduces v modulo 2^255 - 19 and returns it. +func (v *Element) reduce() *Element { + v.carryPropagate() + + // After the light reduction we now have a field element representation + // v < 2^255 + 2^13 * 19, but need v < 2^255 - 19. + + // If v >= 2^255 - 19, then v + 19 >= 2^255, which would overflow 2^255 - 1, + // generating a carry. That is, c will be 0 if v < 2^255 - 19, and 1 otherwise. + c := (v.l0 + 19) >> 51 + c = (v.l1 + c) >> 51 + c = (v.l2 + c) >> 51 + c = (v.l3 + c) >> 51 + c = (v.l4 + c) >> 51 + + // If v < 2^255 - 19 and c = 0, this will be a no-op. Otherwise, it's + // effectively applying the reduction identity to the carry. + v.l0 += 19 * c + + v.l1 += v.l0 >> 51 + v.l0 = v.l0 & maskLow51Bits + v.l2 += v.l1 >> 51 + v.l1 = v.l1 & maskLow51Bits + v.l3 += v.l2 >> 51 + v.l2 = v.l2 & maskLow51Bits + v.l4 += v.l3 >> 51 + v.l3 = v.l3 & maskLow51Bits + // no additional carry + v.l4 = v.l4 & maskLow51Bits + + return v +} + +// Add sets v = a + b, and returns v. +func (v *Element) Add(a, b *Element) *Element { + v.l0 = a.l0 + b.l0 + v.l1 = a.l1 + b.l1 + v.l2 = a.l2 + b.l2 + v.l3 = a.l3 + b.l3 + v.l4 = a.l4 + b.l4 + // Using the generic implementation here is actually faster than the + // assembly. Probably because the body of this function is so simple that + // the compiler can figure out better optimizations by inlining the carry + // propagation. TODO + return v.carryPropagateGeneric() +} + +// Subtract sets v = a - b, and returns v. +func (v *Element) Subtract(a, b *Element) *Element { + // We first add 2 * p, to guarantee the subtraction won't underflow, and + // then subtract b (which can be up to 2^255 + 2^13 * 19). + v.l0 = (a.l0 + 0xFFFFFFFFFFFDA) - b.l0 + v.l1 = (a.l1 + 0xFFFFFFFFFFFFE) - b.l1 + v.l2 = (a.l2 + 0xFFFFFFFFFFFFE) - b.l2 + v.l3 = (a.l3 + 0xFFFFFFFFFFFFE) - b.l3 + v.l4 = (a.l4 + 0xFFFFFFFFFFFFE) - b.l4 + return v.carryPropagate() +} + +// Negate sets v = -a, and returns v. +func (v *Element) Negate(a *Element) *Element { + return v.Subtract(feZero, a) +} + +// Invert sets v = 1/z mod p, and returns v. +// +// If z == 0, Invert returns v = 0. +func (v *Element) Invert(z *Element) *Element { + // Inversion is implemented as exponentiation with exponent p − 2. It uses the + // same sequence of 255 squarings and 11 multiplications as [Curve25519]. + var z2, z9, z11, z2_5_0, z2_10_0, z2_20_0, z2_50_0, z2_100_0, t Element + + z2.Square(z) // 2 + t.Square(&z2) // 4 + t.Square(&t) // 8 + z9.Multiply(&t, z) // 9 + z11.Multiply(&z9, &z2) // 11 + t.Square(&z11) // 22 + z2_5_0.Multiply(&t, &z9) // 31 = 2^5 - 2^0 + + t.Square(&z2_5_0) // 2^6 - 2^1 + for i := 0; i < 4; i++ { + t.Square(&t) // 2^10 - 2^5 + } + z2_10_0.Multiply(&t, &z2_5_0) // 2^10 - 2^0 + + t.Square(&z2_10_0) // 2^11 - 2^1 + for i := 0; i < 9; i++ { + t.Square(&t) // 2^20 - 2^10 + } + z2_20_0.Multiply(&t, &z2_10_0) // 2^20 - 2^0 + + t.Square(&z2_20_0) // 2^21 - 2^1 + for i := 0; i < 19; i++ { + t.Square(&t) // 2^40 - 2^20 + } + t.Multiply(&t, &z2_20_0) // 2^40 - 2^0 + + t.Square(&t) // 2^41 - 2^1 + for i := 0; i < 9; i++ { + t.Square(&t) // 2^50 - 2^10 + } + z2_50_0.Multiply(&t, &z2_10_0) // 2^50 - 2^0 + + t.Square(&z2_50_0) // 2^51 - 2^1 + for i := 0; i < 49; i++ { + t.Square(&t) // 2^100 - 2^50 + } + z2_100_0.Multiply(&t, &z2_50_0) // 2^100 - 2^0 + + t.Square(&z2_100_0) // 2^101 - 2^1 + for i := 0; i < 99; i++ { + t.Square(&t) // 2^200 - 2^100 + } + t.Multiply(&t, &z2_100_0) // 2^200 - 2^0 + + t.Square(&t) // 2^201 - 2^1 + for i := 0; i < 49; i++ { + t.Square(&t) // 2^250 - 2^50 + } + t.Multiply(&t, &z2_50_0) // 2^250 - 2^0 + + t.Square(&t) // 2^251 - 2^1 + t.Square(&t) // 2^252 - 2^2 + t.Square(&t) // 2^253 - 2^3 + t.Square(&t) // 2^254 - 2^4 + t.Square(&t) // 2^255 - 2^5 + + return v.Multiply(&t, &z11) // 2^255 - 21 +} + +// Set sets v = a, and returns v. +func (v *Element) Set(a *Element) *Element { + *v = *a + return v +} + +// SetBytes sets v to x, which must be a 32-byte little-endian encoding. +// +// Consistent with RFC 7748, the most significant bit (the high bit of the +// last byte) is ignored, and non-canonical values (2^255-19 through 2^255-1) +// are accepted. Note that this is laxer than specified by RFC 8032. +func (v *Element) SetBytes(x []byte) *Element { + if len(x) != 32 { + panic("edwards25519: invalid field element input size") + } + + // Bits 0:51 (bytes 0:8, bits 0:64, shift 0, mask 51). + v.l0 = binary.LittleEndian.Uint64(x[0:8]) + v.l0 &= maskLow51Bits + // Bits 51:102 (bytes 6:14, bits 48:112, shift 3, mask 51). + v.l1 = binary.LittleEndian.Uint64(x[6:14]) >> 3 + v.l1 &= maskLow51Bits + // Bits 102:153 (bytes 12:20, bits 96:160, shift 6, mask 51). + v.l2 = binary.LittleEndian.Uint64(x[12:20]) >> 6 + v.l2 &= maskLow51Bits + // Bits 153:204 (bytes 19:27, bits 152:216, shift 1, mask 51). + v.l3 = binary.LittleEndian.Uint64(x[19:27]) >> 1 + v.l3 &= maskLow51Bits + // Bits 204:251 (bytes 24:32, bits 192:256, shift 12, mask 51). + // Note: not bytes 25:33, shift 4, to avoid overread. + v.l4 = binary.LittleEndian.Uint64(x[24:32]) >> 12 + v.l4 &= maskLow51Bits + + return v +} + +// Bytes returns the canonical 32-byte little-endian encoding of v. +func (v *Element) Bytes() []byte { + // This function is outlined to make the allocations inline in the caller + // rather than happen on the heap. + var out [32]byte + return v.bytes(&out) +} + +func (v *Element) bytes(out *[32]byte) []byte { + t := *v + t.reduce() + + var buf [8]byte + for i, l := range [5]uint64{t.l0, t.l1, t.l2, t.l3, t.l4} { + bitsOffset := i * 51 + binary.LittleEndian.PutUint64(buf[:], l<= len(out) { + break + } + out[off] |= bb + } + } + + return out[:] +} + +// Equal returns 1 if v and u are equal, and 0 otherwise. +func (v *Element) Equal(u *Element) int { + sa, sv := u.Bytes(), v.Bytes() + return subtle.ConstantTimeCompare(sa, sv) +} + +// mask64Bits returns 0xffffffff if cond is 1, and 0 otherwise. +func mask64Bits(cond int) uint64 { return ^(uint64(cond) - 1) } + +// Select sets v to a if cond == 1, and to b if cond == 0. +func (v *Element) Select(a, b *Element, cond int) *Element { + m := mask64Bits(cond) + v.l0 = (m & a.l0) | (^m & b.l0) + v.l1 = (m & a.l1) | (^m & b.l1) + v.l2 = (m & a.l2) | (^m & b.l2) + v.l3 = (m & a.l3) | (^m & b.l3) + v.l4 = (m & a.l4) | (^m & b.l4) + return v +} + +// Swap swaps v and u if cond == 1 or leaves them unchanged if cond == 0, and returns v. +func (v *Element) Swap(u *Element, cond int) { + m := mask64Bits(cond) + t := m & (v.l0 ^ u.l0) + v.l0 ^= t + u.l0 ^= t + t = m & (v.l1 ^ u.l1) + v.l1 ^= t + u.l1 ^= t + t = m & (v.l2 ^ u.l2) + v.l2 ^= t + u.l2 ^= t + t = m & (v.l3 ^ u.l3) + v.l3 ^= t + u.l3 ^= t + t = m & (v.l4 ^ u.l4) + v.l4 ^= t + u.l4 ^= t +} + +// IsNegative returns 1 if v is negative, and 0 otherwise. +func (v *Element) IsNegative() int { + return int(v.Bytes()[0] & 1) +} + +// Absolute sets v to |u|, and returns v. +func (v *Element) Absolute(u *Element) *Element { + return v.Select(new(Element).Negate(u), u, u.IsNegative()) +} + +// Multiply sets v = x * y, and returns v. +func (v *Element) Multiply(x, y *Element) *Element { + feMul(v, x, y) + return v +} + +// Square sets v = x * x, and returns v. +func (v *Element) Square(x *Element) *Element { + feSquare(v, x) + return v +} + +// Mult32 sets v = x * y, and returns v. +func (v *Element) Mult32(x *Element, y uint32) *Element { + x0lo, x0hi := mul51(x.l0, y) + x1lo, x1hi := mul51(x.l1, y) + x2lo, x2hi := mul51(x.l2, y) + x3lo, x3hi := mul51(x.l3, y) + x4lo, x4hi := mul51(x.l4, y) + v.l0 = x0lo + 19*x4hi // carried over per the reduction identity + v.l1 = x1lo + x0hi + v.l2 = x2lo + x1hi + v.l3 = x3lo + x2hi + v.l4 = x4lo + x3hi + // The hi portions are going to be only 32 bits, plus any previous excess, + // so we can skip the carry propagation. + return v +} + +// mul51 returns lo + hi * 2⁵¹ = a * b. +func mul51(a uint64, b uint32) (lo uint64, hi uint64) { + mh, ml := bits.Mul64(a, uint64(b)) + lo = ml & maskLow51Bits + hi = (mh << 13) | (ml >> 51) + return +} + +// Pow22523 set v = x^((p-5)/8), and returns v. (p-5)/8 is 2^252-3. +func (v *Element) Pow22523(x *Element) *Element { + var t0, t1, t2 Element + + t0.Square(x) // x^2 + t1.Square(&t0) // x^4 + t1.Square(&t1) // x^8 + t1.Multiply(x, &t1) // x^9 + t0.Multiply(&t0, &t1) // x^11 + t0.Square(&t0) // x^22 + t0.Multiply(&t1, &t0) // x^31 + t1.Square(&t0) // x^62 + for i := 1; i < 5; i++ { // x^992 + t1.Square(&t1) + } + t0.Multiply(&t1, &t0) // x^1023 -> 1023 = 2^10 - 1 + t1.Square(&t0) // 2^11 - 2 + for i := 1; i < 10; i++ { // 2^20 - 2^10 + t1.Square(&t1) + } + t1.Multiply(&t1, &t0) // 2^20 - 1 + t2.Square(&t1) // 2^21 - 2 + for i := 1; i < 20; i++ { // 2^40 - 2^20 + t2.Square(&t2) + } + t1.Multiply(&t2, &t1) // 2^40 - 1 + t1.Square(&t1) // 2^41 - 2 + for i := 1; i < 10; i++ { // 2^50 - 2^10 + t1.Square(&t1) + } + t0.Multiply(&t1, &t0) // 2^50 - 1 + t1.Square(&t0) // 2^51 - 2 + for i := 1; i < 50; i++ { // 2^100 - 2^50 + t1.Square(&t1) + } + t1.Multiply(&t1, &t0) // 2^100 - 1 + t2.Square(&t1) // 2^101 - 2 + for i := 1; i < 100; i++ { // 2^200 - 2^100 + t2.Square(&t2) + } + t1.Multiply(&t2, &t1) // 2^200 - 1 + t1.Square(&t1) // 2^201 - 2 + for i := 1; i < 50; i++ { // 2^250 - 2^50 + t1.Square(&t1) + } + t0.Multiply(&t1, &t0) // 2^250 - 1 + t0.Square(&t0) // 2^251 - 2 + t0.Square(&t0) // 2^252 - 4 + return v.Multiply(&t0, x) // 2^252 - 3 -> x^(2^252-3) +} + +// sqrtM1 is 2^((p-1)/4), which squared is equal to -1 by Euler's Criterion. +var sqrtM1 = &Element{1718705420411056, 234908883556509, + 2233514472574048, 2117202627021982, 765476049583133} + +// SqrtRatio sets r to the non-negative square root of the ratio of u and v. +// +// If u/v is square, SqrtRatio returns r and 1. If u/v is not square, SqrtRatio +// sets r according to Section 4.3 of draft-irtf-cfrg-ristretto255-decaf448-00, +// and returns r and 0. +func (r *Element) SqrtRatio(u, v *Element) (rr *Element, wasSquare int) { + var a, b Element + + // r = (u * v3) * (u * v7)^((p-5)/8) + v2 := a.Square(v) + uv3 := b.Multiply(u, b.Multiply(v2, v)) + uv7 := a.Multiply(uv3, a.Square(v2)) + r.Multiply(uv3, r.Pow22523(uv7)) + + check := a.Multiply(v, a.Square(r)) // check = v * r^2 + + uNeg := b.Negate(u) + correctSignSqrt := check.Equal(u) + flippedSignSqrt := check.Equal(uNeg) + flippedSignSqrtI := check.Equal(uNeg.Multiply(uNeg, sqrtM1)) + + rPrime := b.Multiply(r, sqrtM1) // r_prime = SQRT_M1 * r + // r = CT_SELECT(r_prime IF flipped_sign_sqrt | flipped_sign_sqrt_i ELSE r) + r.Select(rPrime, r, flippedSignSqrt|flippedSignSqrtI) + + r.Absolute(r) // Choose the nonnegative square root. + return r, correctSignSqrt | flippedSignSqrt +} diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go new file mode 100644 index 000000000..44dc8e8ca --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go @@ -0,0 +1,13 @@ +// Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. + +// +build amd64,gc,!purego + +package field + +// feMul sets out = a * b. It works like feMulGeneric. +//go:noescape +func feMul(out *Element, a *Element, b *Element) + +// feSquare sets out = a * a. It works like feSquareGeneric. +//go:noescape +func feSquare(out *Element, a *Element) diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.s b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.s new file mode 100644 index 000000000..293f013c9 --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.s @@ -0,0 +1,379 @@ +// Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. + +//go:build amd64 && gc && !purego +// +build amd64,gc,!purego + +#include "textflag.h" + +// func feMul(out *Element, a *Element, b *Element) +TEXT ·feMul(SB), NOSPLIT, $0-24 + MOVQ a+8(FP), CX + MOVQ b+16(FP), BX + + // r0 = a0×b0 + MOVQ (CX), AX + MULQ (BX) + MOVQ AX, DI + MOVQ DX, SI + + // r0 += 19×a1×b4 + MOVQ 8(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(BX) + ADDQ AX, DI + ADCQ DX, SI + + // r0 += 19×a2×b3 + MOVQ 16(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 24(BX) + ADDQ AX, DI + ADCQ DX, SI + + // r0 += 19×a3×b2 + MOVQ 24(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 16(BX) + ADDQ AX, DI + ADCQ DX, SI + + // r0 += 19×a4×b1 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 8(BX) + ADDQ AX, DI + ADCQ DX, SI + + // r1 = a0×b1 + MOVQ (CX), AX + MULQ 8(BX) + MOVQ AX, R9 + MOVQ DX, R8 + + // r1 += a1×b0 + MOVQ 8(CX), AX + MULQ (BX) + ADDQ AX, R9 + ADCQ DX, R8 + + // r1 += 19×a2×b4 + MOVQ 16(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(BX) + ADDQ AX, R9 + ADCQ DX, R8 + + // r1 += 19×a3×b3 + MOVQ 24(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 24(BX) + ADDQ AX, R9 + ADCQ DX, R8 + + // r1 += 19×a4×b2 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 16(BX) + ADDQ AX, R9 + ADCQ DX, R8 + + // r2 = a0×b2 + MOVQ (CX), AX + MULQ 16(BX) + MOVQ AX, R11 + MOVQ DX, R10 + + // r2 += a1×b1 + MOVQ 8(CX), AX + MULQ 8(BX) + ADDQ AX, R11 + ADCQ DX, R10 + + // r2 += a2×b0 + MOVQ 16(CX), AX + MULQ (BX) + ADDQ AX, R11 + ADCQ DX, R10 + + // r2 += 19×a3×b4 + MOVQ 24(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(BX) + ADDQ AX, R11 + ADCQ DX, R10 + + // r2 += 19×a4×b3 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 24(BX) + ADDQ AX, R11 + ADCQ DX, R10 + + // r3 = a0×b3 + MOVQ (CX), AX + MULQ 24(BX) + MOVQ AX, R13 + MOVQ DX, R12 + + // r3 += a1×b2 + MOVQ 8(CX), AX + MULQ 16(BX) + ADDQ AX, R13 + ADCQ DX, R12 + + // r3 += a2×b1 + MOVQ 16(CX), AX + MULQ 8(BX) + ADDQ AX, R13 + ADCQ DX, R12 + + // r3 += a3×b0 + MOVQ 24(CX), AX + MULQ (BX) + ADDQ AX, R13 + ADCQ DX, R12 + + // r3 += 19×a4×b4 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(BX) + ADDQ AX, R13 + ADCQ DX, R12 + + // r4 = a0×b4 + MOVQ (CX), AX + MULQ 32(BX) + MOVQ AX, R15 + MOVQ DX, R14 + + // r4 += a1×b3 + MOVQ 8(CX), AX + MULQ 24(BX) + ADDQ AX, R15 + ADCQ DX, R14 + + // r4 += a2×b2 + MOVQ 16(CX), AX + MULQ 16(BX) + ADDQ AX, R15 + ADCQ DX, R14 + + // r4 += a3×b1 + MOVQ 24(CX), AX + MULQ 8(BX) + ADDQ AX, R15 + ADCQ DX, R14 + + // r4 += a4×b0 + MOVQ 32(CX), AX + MULQ (BX) + ADDQ AX, R15 + ADCQ DX, R14 + + // First reduction chain + MOVQ $0x0007ffffffffffff, AX + SHLQ $0x0d, DI, SI + SHLQ $0x0d, R9, R8 + SHLQ $0x0d, R11, R10 + SHLQ $0x0d, R13, R12 + SHLQ $0x0d, R15, R14 + ANDQ AX, DI + IMUL3Q $0x13, R14, R14 + ADDQ R14, DI + ANDQ AX, R9 + ADDQ SI, R9 + ANDQ AX, R11 + ADDQ R8, R11 + ANDQ AX, R13 + ADDQ R10, R13 + ANDQ AX, R15 + ADDQ R12, R15 + + // Second reduction chain (carryPropagate) + MOVQ DI, SI + SHRQ $0x33, SI + MOVQ R9, R8 + SHRQ $0x33, R8 + MOVQ R11, R10 + SHRQ $0x33, R10 + MOVQ R13, R12 + SHRQ $0x33, R12 + MOVQ R15, R14 + SHRQ $0x33, R14 + ANDQ AX, DI + IMUL3Q $0x13, R14, R14 + ADDQ R14, DI + ANDQ AX, R9 + ADDQ SI, R9 + ANDQ AX, R11 + ADDQ R8, R11 + ANDQ AX, R13 + ADDQ R10, R13 + ANDQ AX, R15 + ADDQ R12, R15 + + // Store output + MOVQ out+0(FP), AX + MOVQ DI, (AX) + MOVQ R9, 8(AX) + MOVQ R11, 16(AX) + MOVQ R13, 24(AX) + MOVQ R15, 32(AX) + RET + +// func feSquare(out *Element, a *Element) +TEXT ·feSquare(SB), NOSPLIT, $0-16 + MOVQ a+8(FP), CX + + // r0 = l0×l0 + MOVQ (CX), AX + MULQ (CX) + MOVQ AX, SI + MOVQ DX, BX + + // r0 += 38×l1×l4 + MOVQ 8(CX), AX + IMUL3Q $0x26, AX, AX + MULQ 32(CX) + ADDQ AX, SI + ADCQ DX, BX + + // r0 += 38×l2×l3 + MOVQ 16(CX), AX + IMUL3Q $0x26, AX, AX + MULQ 24(CX) + ADDQ AX, SI + ADCQ DX, BX + + // r1 = 2×l0×l1 + MOVQ (CX), AX + SHLQ $0x01, AX + MULQ 8(CX) + MOVQ AX, R8 + MOVQ DX, DI + + // r1 += 38×l2×l4 + MOVQ 16(CX), AX + IMUL3Q $0x26, AX, AX + MULQ 32(CX) + ADDQ AX, R8 + ADCQ DX, DI + + // r1 += 19×l3×l3 + MOVQ 24(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 24(CX) + ADDQ AX, R8 + ADCQ DX, DI + + // r2 = 2×l0×l2 + MOVQ (CX), AX + SHLQ $0x01, AX + MULQ 16(CX) + MOVQ AX, R10 + MOVQ DX, R9 + + // r2 += l1×l1 + MOVQ 8(CX), AX + MULQ 8(CX) + ADDQ AX, R10 + ADCQ DX, R9 + + // r2 += 38×l3×l4 + MOVQ 24(CX), AX + IMUL3Q $0x26, AX, AX + MULQ 32(CX) + ADDQ AX, R10 + ADCQ DX, R9 + + // r3 = 2×l0×l3 + MOVQ (CX), AX + SHLQ $0x01, AX + MULQ 24(CX) + MOVQ AX, R12 + MOVQ DX, R11 + + // r3 += 2×l1×l2 + MOVQ 8(CX), AX + IMUL3Q $0x02, AX, AX + MULQ 16(CX) + ADDQ AX, R12 + ADCQ DX, R11 + + // r3 += 19×l4×l4 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(CX) + ADDQ AX, R12 + ADCQ DX, R11 + + // r4 = 2×l0×l4 + MOVQ (CX), AX + SHLQ $0x01, AX + MULQ 32(CX) + MOVQ AX, R14 + MOVQ DX, R13 + + // r4 += 2×l1×l3 + MOVQ 8(CX), AX + IMUL3Q $0x02, AX, AX + MULQ 24(CX) + ADDQ AX, R14 + ADCQ DX, R13 + + // r4 += l2×l2 + MOVQ 16(CX), AX + MULQ 16(CX) + ADDQ AX, R14 + ADCQ DX, R13 + + // First reduction chain + MOVQ $0x0007ffffffffffff, AX + SHLQ $0x0d, SI, BX + SHLQ $0x0d, R8, DI + SHLQ $0x0d, R10, R9 + SHLQ $0x0d, R12, R11 + SHLQ $0x0d, R14, R13 + ANDQ AX, SI + IMUL3Q $0x13, R13, R13 + ADDQ R13, SI + ANDQ AX, R8 + ADDQ BX, R8 + ANDQ AX, R10 + ADDQ DI, R10 + ANDQ AX, R12 + ADDQ R9, R12 + ANDQ AX, R14 + ADDQ R11, R14 + + // Second reduction chain (carryPropagate) + MOVQ SI, BX + SHRQ $0x33, BX + MOVQ R8, DI + SHRQ $0x33, DI + MOVQ R10, R9 + SHRQ $0x33, R9 + MOVQ R12, R11 + SHRQ $0x33, R11 + MOVQ R14, R13 + SHRQ $0x33, R13 + ANDQ AX, SI + IMUL3Q $0x13, R13, R13 + ADDQ R13, SI + ANDQ AX, R8 + ADDQ BX, R8 + ANDQ AX, R10 + ADDQ DI, R10 + ANDQ AX, R12 + ADDQ R9, R12 + ANDQ AX, R14 + ADDQ R11, R14 + + // Store output + MOVQ out+0(FP), AX + MOVQ SI, (AX) + MOVQ R8, 8(AX) + MOVQ R10, 16(AX) + MOVQ R12, 24(AX) + MOVQ R14, 32(AX) + RET diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64_noasm.go b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64_noasm.go new file mode 100644 index 000000000..ddb6c9b8f --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64_noasm.go @@ -0,0 +1,12 @@ +// Copyright (c) 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !amd64 || !gc || purego +// +build !amd64 !gc purego + +package field + +func feMul(v, x, y *Element) { feMulGeneric(v, x, y) } + +func feSquare(v, x *Element) { feSquareGeneric(v, x) } diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.go b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.go new file mode 100644 index 000000000..af459ef51 --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.go @@ -0,0 +1,16 @@ +// Copyright (c) 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build arm64 && gc && !purego +// +build arm64,gc,!purego + +package field + +//go:noescape +func carryPropagate(v *Element) + +func (v *Element) carryPropagate() *Element { + carryPropagate(v) + return v +} diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.s b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.s new file mode 100644 index 000000000..5c91e4589 --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.s @@ -0,0 +1,43 @@ +// Copyright (c) 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build arm64 && gc && !purego +// +build arm64,gc,!purego + +#include "textflag.h" + +// carryPropagate works exactly like carryPropagateGeneric and uses the +// same AND, ADD, and LSR+MADD instructions emitted by the compiler, but +// avoids loading R0-R4 twice and uses LDP and STP. +// +// See https://golang.org/issues/43145 for the main compiler issue. +// +// func carryPropagate(v *Element) +TEXT ·carryPropagate(SB),NOFRAME|NOSPLIT,$0-8 + MOVD v+0(FP), R20 + + LDP 0(R20), (R0, R1) + LDP 16(R20), (R2, R3) + MOVD 32(R20), R4 + + AND $0x7ffffffffffff, R0, R10 + AND $0x7ffffffffffff, R1, R11 + AND $0x7ffffffffffff, R2, R12 + AND $0x7ffffffffffff, R3, R13 + AND $0x7ffffffffffff, R4, R14 + + ADD R0>>51, R11, R11 + ADD R1>>51, R12, R12 + ADD R2>>51, R13, R13 + ADD R3>>51, R14, R14 + // R4>>51 * 19 + R10 -> R10 + LSR $51, R4, R21 + MOVD $19, R22 + MADD R22, R10, R21, R10 + + STP (R10, R11), 0(R20) + STP (R12, R13), 16(R20) + MOVD R14, 32(R20) + + RET diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64_noasm.go b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64_noasm.go new file mode 100644 index 000000000..234a5b2e5 --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64_noasm.go @@ -0,0 +1,12 @@ +// Copyright (c) 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !arm64 || !gc || purego +// +build !arm64 !gc purego + +package field + +func (v *Element) carryPropagate() *Element { + return v.carryPropagateGeneric() +} diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_generic.go b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_generic.go new file mode 100644 index 000000000..7b5b78cbd --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_generic.go @@ -0,0 +1,264 @@ +// Copyright (c) 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package field + +import "math/bits" + +// uint128 holds a 128-bit number as two 64-bit limbs, for use with the +// bits.Mul64 and bits.Add64 intrinsics. +type uint128 struct { + lo, hi uint64 +} + +// mul64 returns a * b. +func mul64(a, b uint64) uint128 { + hi, lo := bits.Mul64(a, b) + return uint128{lo, hi} +} + +// addMul64 returns v + a * b. +func addMul64(v uint128, a, b uint64) uint128 { + hi, lo := bits.Mul64(a, b) + lo, c := bits.Add64(lo, v.lo, 0) + hi, _ = bits.Add64(hi, v.hi, c) + return uint128{lo, hi} +} + +// shiftRightBy51 returns a >> 51. a is assumed to be at most 115 bits. +func shiftRightBy51(a uint128) uint64 { + return (a.hi << (64 - 51)) | (a.lo >> 51) +} + +func feMulGeneric(v, a, b *Element) { + a0 := a.l0 + a1 := a.l1 + a2 := a.l2 + a3 := a.l3 + a4 := a.l4 + + b0 := b.l0 + b1 := b.l1 + b2 := b.l2 + b3 := b.l3 + b4 := b.l4 + + // Limb multiplication works like pen-and-paper columnar multiplication, but + // with 51-bit limbs instead of digits. + // + // a4 a3 a2 a1 a0 x + // b4 b3 b2 b1 b0 = + // ------------------------ + // a4b0 a3b0 a2b0 a1b0 a0b0 + + // a4b1 a3b1 a2b1 a1b1 a0b1 + + // a4b2 a3b2 a2b2 a1b2 a0b2 + + // a4b3 a3b3 a2b3 a1b3 a0b3 + + // a4b4 a3b4 a2b4 a1b4 a0b4 = + // ---------------------------------------------- + // r8 r7 r6 r5 r4 r3 r2 r1 r0 + // + // We can then use the reduction identity (a * 2²⁵⁵ + b = a * 19 + b) to + // reduce the limbs that would overflow 255 bits. r5 * 2²⁵⁵ becomes 19 * r5, + // r6 * 2³⁰⁶ becomes 19 * r6 * 2⁵¹, etc. + // + // Reduction can be carried out simultaneously to multiplication. For + // example, we do not compute r5: whenever the result of a multiplication + // belongs to r5, like a1b4, we multiply it by 19 and add the result to r0. + // + // a4b0 a3b0 a2b0 a1b0 a0b0 + + // a3b1 a2b1 a1b1 a0b1 19×a4b1 + + // a2b2 a1b2 a0b2 19×a4b2 19×a3b2 + + // a1b3 a0b3 19×a4b3 19×a3b3 19×a2b3 + + // a0b4 19×a4b4 19×a3b4 19×a2b4 19×a1b4 = + // -------------------------------------- + // r4 r3 r2 r1 r0 + // + // Finally we add up the columns into wide, overlapping limbs. + + a1_19 := a1 * 19 + a2_19 := a2 * 19 + a3_19 := a3 * 19 + a4_19 := a4 * 19 + + // r0 = a0×b0 + 19×(a1×b4 + a2×b3 + a3×b2 + a4×b1) + r0 := mul64(a0, b0) + r0 = addMul64(r0, a1_19, b4) + r0 = addMul64(r0, a2_19, b3) + r0 = addMul64(r0, a3_19, b2) + r0 = addMul64(r0, a4_19, b1) + + // r1 = a0×b1 + a1×b0 + 19×(a2×b4 + a3×b3 + a4×b2) + r1 := mul64(a0, b1) + r1 = addMul64(r1, a1, b0) + r1 = addMul64(r1, a2_19, b4) + r1 = addMul64(r1, a3_19, b3) + r1 = addMul64(r1, a4_19, b2) + + // r2 = a0×b2 + a1×b1 + a2×b0 + 19×(a3×b4 + a4×b3) + r2 := mul64(a0, b2) + r2 = addMul64(r2, a1, b1) + r2 = addMul64(r2, a2, b0) + r2 = addMul64(r2, a3_19, b4) + r2 = addMul64(r2, a4_19, b3) + + // r3 = a0×b3 + a1×b2 + a2×b1 + a3×b0 + 19×a4×b4 + r3 := mul64(a0, b3) + r3 = addMul64(r3, a1, b2) + r3 = addMul64(r3, a2, b1) + r3 = addMul64(r3, a3, b0) + r3 = addMul64(r3, a4_19, b4) + + // r4 = a0×b4 + a1×b3 + a2×b2 + a3×b1 + a4×b0 + r4 := mul64(a0, b4) + r4 = addMul64(r4, a1, b3) + r4 = addMul64(r4, a2, b2) + r4 = addMul64(r4, a3, b1) + r4 = addMul64(r4, a4, b0) + + // After the multiplication, we need to reduce (carry) the five coefficients + // to obtain a result with limbs that are at most slightly larger than 2⁵¹, + // to respect the Element invariant. + // + // Overall, the reduction works the same as carryPropagate, except with + // wider inputs: we take the carry for each coefficient by shifting it right + // by 51, and add it to the limb above it. The top carry is multiplied by 19 + // according to the reduction identity and added to the lowest limb. + // + // The largest coefficient (r0) will be at most 111 bits, which guarantees + // that all carries are at most 111 - 51 = 60 bits, which fits in a uint64. + // + // r0 = a0×b0 + 19×(a1×b4 + a2×b3 + a3×b2 + a4×b1) + // r0 < 2⁵²×2⁵² + 19×(2⁵²×2⁵² + 2⁵²×2⁵² + 2⁵²×2⁵² + 2⁵²×2⁵²) + // r0 < (1 + 19 × 4) × 2⁵² × 2⁵² + // r0 < 2⁷ × 2⁵² × 2⁵² + // r0 < 2¹¹¹ + // + // Moreover, the top coefficient (r4) is at most 107 bits, so c4 is at most + // 56 bits, and c4 * 19 is at most 61 bits, which again fits in a uint64 and + // allows us to easily apply the reduction identity. + // + // r4 = a0×b4 + a1×b3 + a2×b2 + a3×b1 + a4×b0 + // r4 < 5 × 2⁵² × 2⁵² + // r4 < 2¹⁰⁷ + // + + c0 := shiftRightBy51(r0) + c1 := shiftRightBy51(r1) + c2 := shiftRightBy51(r2) + c3 := shiftRightBy51(r3) + c4 := shiftRightBy51(r4) + + rr0 := r0.lo&maskLow51Bits + c4*19 + rr1 := r1.lo&maskLow51Bits + c0 + rr2 := r2.lo&maskLow51Bits + c1 + rr3 := r3.lo&maskLow51Bits + c2 + rr4 := r4.lo&maskLow51Bits + c3 + + // Now all coefficients fit into 64-bit registers but are still too large to + // be passed around as a Element. We therefore do one last carry chain, + // where the carries will be small enough to fit in the wiggle room above 2⁵¹. + *v = Element{rr0, rr1, rr2, rr3, rr4} + v.carryPropagate() +} + +func feSquareGeneric(v, a *Element) { + l0 := a.l0 + l1 := a.l1 + l2 := a.l2 + l3 := a.l3 + l4 := a.l4 + + // Squaring works precisely like multiplication above, but thanks to its + // symmetry we get to group a few terms together. + // + // l4 l3 l2 l1 l0 x + // l4 l3 l2 l1 l0 = + // ------------------------ + // l4l0 l3l0 l2l0 l1l0 l0l0 + + // l4l1 l3l1 l2l1 l1l1 l0l1 + + // l4l2 l3l2 l2l2 l1l2 l0l2 + + // l4l3 l3l3 l2l3 l1l3 l0l3 + + // l4l4 l3l4 l2l4 l1l4 l0l4 = + // ---------------------------------------------- + // r8 r7 r6 r5 r4 r3 r2 r1 r0 + // + // l4l0 l3l0 l2l0 l1l0 l0l0 + + // l3l1 l2l1 l1l1 l0l1 19×l4l1 + + // l2l2 l1l2 l0l2 19×l4l2 19×l3l2 + + // l1l3 l0l3 19×l4l3 19×l3l3 19×l2l3 + + // l0l4 19×l4l4 19×l3l4 19×l2l4 19×l1l4 = + // -------------------------------------- + // r4 r3 r2 r1 r0 + // + // With precomputed 2×, 19×, and 2×19× terms, we can compute each limb with + // only three Mul64 and four Add64, instead of five and eight. + + l0_2 := l0 * 2 + l1_2 := l1 * 2 + + l1_38 := l1 * 38 + l2_38 := l2 * 38 + l3_38 := l3 * 38 + + l3_19 := l3 * 19 + l4_19 := l4 * 19 + + // r0 = l0×l0 + 19×(l1×l4 + l2×l3 + l3×l2 + l4×l1) = l0×l0 + 19×2×(l1×l4 + l2×l3) + r0 := mul64(l0, l0) + r0 = addMul64(r0, l1_38, l4) + r0 = addMul64(r0, l2_38, l3) + + // r1 = l0×l1 + l1×l0 + 19×(l2×l4 + l3×l3 + l4×l2) = 2×l0×l1 + 19×2×l2×l4 + 19×l3×l3 + r1 := mul64(l0_2, l1) + r1 = addMul64(r1, l2_38, l4) + r1 = addMul64(r1, l3_19, l3) + + // r2 = l0×l2 + l1×l1 + l2×l0 + 19×(l3×l4 + l4×l3) = 2×l0×l2 + l1×l1 + 19×2×l3×l4 + r2 := mul64(l0_2, l2) + r2 = addMul64(r2, l1, l1) + r2 = addMul64(r2, l3_38, l4) + + // r3 = l0×l3 + l1×l2 + l2×l1 + l3×l0 + 19×l4×l4 = 2×l0×l3 + 2×l1×l2 + 19×l4×l4 + r3 := mul64(l0_2, l3) + r3 = addMul64(r3, l1_2, l2) + r3 = addMul64(r3, l4_19, l4) + + // r4 = l0×l4 + l1×l3 + l2×l2 + l3×l1 + l4×l0 = 2×l0×l4 + 2×l1×l3 + l2×l2 + r4 := mul64(l0_2, l4) + r4 = addMul64(r4, l1_2, l3) + r4 = addMul64(r4, l2, l2) + + c0 := shiftRightBy51(r0) + c1 := shiftRightBy51(r1) + c2 := shiftRightBy51(r2) + c3 := shiftRightBy51(r3) + c4 := shiftRightBy51(r4) + + rr0 := r0.lo&maskLow51Bits + c4*19 + rr1 := r1.lo&maskLow51Bits + c0 + rr2 := r2.lo&maskLow51Bits + c1 + rr3 := r3.lo&maskLow51Bits + c2 + rr4 := r4.lo&maskLow51Bits + c3 + + *v = Element{rr0, rr1, rr2, rr3, rr4} + v.carryPropagate() +} + +// carryPropagate brings the limbs below 52 bits by applying the reduction +// identity (a * 2²⁵⁵ + b = a * 19 + b) to the l4 carry. TODO inline +func (v *Element) carryPropagateGeneric() *Element { + c0 := v.l0 >> 51 + c1 := v.l1 >> 51 + c2 := v.l2 >> 51 + c3 := v.l3 >> 51 + c4 := v.l4 >> 51 + + v.l0 = v.l0&maskLow51Bits + c4*19 + v.l1 = v.l1&maskLow51Bits + c0 + v.l2 = v.l2&maskLow51Bits + c1 + v.l3 = v.l3&maskLow51Bits + c2 + v.l4 = v.l4&maskLow51Bits + c3 + + return v +} diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/sync.checkpoint b/vendor/golang.org/x/crypto/curve25519/internal/field/sync.checkpoint new file mode 100644 index 000000000..e3685f95c --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/internal/field/sync.checkpoint @@ -0,0 +1 @@ +b0c49ae9f59d233526f8934262c5bbbe14d4358d diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh b/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh new file mode 100644 index 000000000..1ba22a8b4 --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh @@ -0,0 +1,19 @@ +#! /bin/bash +set -euo pipefail + +cd "$(git rev-parse --show-toplevel)" + +STD_PATH=src/crypto/ed25519/internal/edwards25519/field +LOCAL_PATH=curve25519/internal/field +LAST_SYNC_REF=$(cat $LOCAL_PATH/sync.checkpoint) + +git fetch https://go.googlesource.com/go master + +if git diff --quiet $LAST_SYNC_REF:$STD_PATH FETCH_HEAD:$STD_PATH; then + echo "No changes." +else + NEW_REF=$(git rev-parse FETCH_HEAD | tee $LOCAL_PATH/sync.checkpoint) + echo "Applying changes from $LAST_SYNC_REF to $NEW_REF..." + git diff $LAST_SYNC_REF:$STD_PATH FETCH_HEAD:$STD_PATH | \ + git apply -3 --directory=$LOCAL_PATH +fi diff --git a/vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s b/vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s deleted file mode 100644 index e0ac30c70..000000000 --- a/vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s +++ /dev/null @@ -1,1377 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -#include "const_amd64.h" - -// func ladderstep(inout *[5][5]uint64) -TEXT ·ladderstep(SB),0,$296-8 - MOVQ inout+0(FP),DI - - MOVQ 40(DI),SI - MOVQ 48(DI),DX - MOVQ 56(DI),CX - MOVQ 64(DI),R8 - MOVQ 72(DI),R9 - MOVQ SI,AX - MOVQ DX,R10 - MOVQ CX,R11 - MOVQ R8,R12 - MOVQ R9,R13 - ADDQ ·_2P0(SB),AX - ADDQ ·_2P1234(SB),R10 - ADDQ ·_2P1234(SB),R11 - ADDQ ·_2P1234(SB),R12 - ADDQ ·_2P1234(SB),R13 - ADDQ 80(DI),SI - ADDQ 88(DI),DX - ADDQ 96(DI),CX - ADDQ 104(DI),R8 - ADDQ 112(DI),R9 - SUBQ 80(DI),AX - SUBQ 88(DI),R10 - SUBQ 96(DI),R11 - SUBQ 104(DI),R12 - SUBQ 112(DI),R13 - MOVQ SI,0(SP) - MOVQ DX,8(SP) - MOVQ CX,16(SP) - MOVQ R8,24(SP) - MOVQ R9,32(SP) - MOVQ AX,40(SP) - MOVQ R10,48(SP) - MOVQ R11,56(SP) - MOVQ R12,64(SP) - MOVQ R13,72(SP) - MOVQ 40(SP),AX - MULQ 40(SP) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 40(SP),AX - SHLQ $1,AX - MULQ 48(SP) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 40(SP),AX - SHLQ $1,AX - MULQ 56(SP) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 40(SP),AX - SHLQ $1,AX - MULQ 64(SP) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 40(SP),AX - SHLQ $1,AX - MULQ 72(SP) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 48(SP),AX - MULQ 48(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 48(SP),AX - SHLQ $1,AX - MULQ 56(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 48(SP),AX - SHLQ $1,AX - MULQ 64(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 48(SP),DX - IMUL3Q $38,DX,AX - MULQ 72(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 56(SP),AX - MULQ 56(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 56(SP),DX - IMUL3Q $38,DX,AX - MULQ 64(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 56(SP),DX - IMUL3Q $38,DX,AX - MULQ 72(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 64(SP),DX - IMUL3Q $19,DX,AX - MULQ 64(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 64(SP),DX - IMUL3Q $38,DX,AX - MULQ 72(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 72(SP),DX - IMUL3Q $19,DX,AX - MULQ 72(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ $REDMASK51,DX - SHLQ $13,SI,CX - ANDQ DX,SI - SHLQ $13,R8,R9 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R10,R11 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R12,R13 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R14,R15 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - ANDQ DX,SI - MOVQ CX,R8 - SHRQ $51,CX - ADDQ R10,CX - ANDQ DX,R8 - MOVQ CX,R9 - SHRQ $51,CX - ADDQ R12,CX - ANDQ DX,R9 - MOVQ CX,AX - SHRQ $51,CX - ADDQ R14,CX - ANDQ DX,AX - MOVQ CX,R10 - SHRQ $51,CX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,80(SP) - MOVQ R8,88(SP) - MOVQ R9,96(SP) - MOVQ AX,104(SP) - MOVQ R10,112(SP) - MOVQ 0(SP),AX - MULQ 0(SP) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 0(SP),AX - SHLQ $1,AX - MULQ 8(SP) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 0(SP),AX - SHLQ $1,AX - MULQ 16(SP) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 0(SP),AX - SHLQ $1,AX - MULQ 24(SP) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 0(SP),AX - SHLQ $1,AX - MULQ 32(SP) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 8(SP),AX - MULQ 8(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SP),AX - SHLQ $1,AX - MULQ 16(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 8(SP),AX - SHLQ $1,AX - MULQ 24(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 8(SP),DX - IMUL3Q $38,DX,AX - MULQ 32(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 16(SP),AX - MULQ 16(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 16(SP),DX - IMUL3Q $38,DX,AX - MULQ 24(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 16(SP),DX - IMUL3Q $38,DX,AX - MULQ 32(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 24(SP),DX - IMUL3Q $19,DX,AX - MULQ 24(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 24(SP),DX - IMUL3Q $38,DX,AX - MULQ 32(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 32(SP),DX - IMUL3Q $19,DX,AX - MULQ 32(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ $REDMASK51,DX - SHLQ $13,SI,CX - ANDQ DX,SI - SHLQ $13,R8,R9 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R10,R11 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R12,R13 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R14,R15 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - ANDQ DX,SI - MOVQ CX,R8 - SHRQ $51,CX - ADDQ R10,CX - ANDQ DX,R8 - MOVQ CX,R9 - SHRQ $51,CX - ADDQ R12,CX - ANDQ DX,R9 - MOVQ CX,AX - SHRQ $51,CX - ADDQ R14,CX - ANDQ DX,AX - MOVQ CX,R10 - SHRQ $51,CX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,120(SP) - MOVQ R8,128(SP) - MOVQ R9,136(SP) - MOVQ AX,144(SP) - MOVQ R10,152(SP) - MOVQ SI,SI - MOVQ R8,DX - MOVQ R9,CX - MOVQ AX,R8 - MOVQ R10,R9 - ADDQ ·_2P0(SB),SI - ADDQ ·_2P1234(SB),DX - ADDQ ·_2P1234(SB),CX - ADDQ ·_2P1234(SB),R8 - ADDQ ·_2P1234(SB),R9 - SUBQ 80(SP),SI - SUBQ 88(SP),DX - SUBQ 96(SP),CX - SUBQ 104(SP),R8 - SUBQ 112(SP),R9 - MOVQ SI,160(SP) - MOVQ DX,168(SP) - MOVQ CX,176(SP) - MOVQ R8,184(SP) - MOVQ R9,192(SP) - MOVQ 120(DI),SI - MOVQ 128(DI),DX - MOVQ 136(DI),CX - MOVQ 144(DI),R8 - MOVQ 152(DI),R9 - MOVQ SI,AX - MOVQ DX,R10 - MOVQ CX,R11 - MOVQ R8,R12 - MOVQ R9,R13 - ADDQ ·_2P0(SB),AX - ADDQ ·_2P1234(SB),R10 - ADDQ ·_2P1234(SB),R11 - ADDQ ·_2P1234(SB),R12 - ADDQ ·_2P1234(SB),R13 - ADDQ 160(DI),SI - ADDQ 168(DI),DX - ADDQ 176(DI),CX - ADDQ 184(DI),R8 - ADDQ 192(DI),R9 - SUBQ 160(DI),AX - SUBQ 168(DI),R10 - SUBQ 176(DI),R11 - SUBQ 184(DI),R12 - SUBQ 192(DI),R13 - MOVQ SI,200(SP) - MOVQ DX,208(SP) - MOVQ CX,216(SP) - MOVQ R8,224(SP) - MOVQ R9,232(SP) - MOVQ AX,240(SP) - MOVQ R10,248(SP) - MOVQ R11,256(SP) - MOVQ R12,264(SP) - MOVQ R13,272(SP) - MOVQ 224(SP),SI - IMUL3Q $19,SI,AX - MOVQ AX,280(SP) - MULQ 56(SP) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 232(SP),DX - IMUL3Q $19,DX,AX - MOVQ AX,288(SP) - MULQ 48(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 200(SP),AX - MULQ 40(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 200(SP),AX - MULQ 48(SP) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 200(SP),AX - MULQ 56(SP) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 200(SP),AX - MULQ 64(SP) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 200(SP),AX - MULQ 72(SP) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 208(SP),AX - MULQ 40(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 208(SP),AX - MULQ 48(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 208(SP),AX - MULQ 56(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 208(SP),AX - MULQ 64(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 208(SP),DX - IMUL3Q $19,DX,AX - MULQ 72(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 216(SP),AX - MULQ 40(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 216(SP),AX - MULQ 48(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 216(SP),AX - MULQ 56(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 216(SP),DX - IMUL3Q $19,DX,AX - MULQ 64(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 216(SP),DX - IMUL3Q $19,DX,AX - MULQ 72(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 224(SP),AX - MULQ 40(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 224(SP),AX - MULQ 48(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 280(SP),AX - MULQ 64(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 280(SP),AX - MULQ 72(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 232(SP),AX - MULQ 40(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 288(SP),AX - MULQ 56(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 288(SP),AX - MULQ 64(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 288(SP),AX - MULQ 72(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ $REDMASK51,DX - SHLQ $13,SI,CX - ANDQ DX,SI - SHLQ $13,R8,R9 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R10,R11 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R12,R13 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R14,R15 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - MOVQ CX,R8 - SHRQ $51,CX - ANDQ DX,SI - ADDQ R10,CX - MOVQ CX,R9 - SHRQ $51,CX - ANDQ DX,R8 - ADDQ R12,CX - MOVQ CX,AX - SHRQ $51,CX - ANDQ DX,R9 - ADDQ R14,CX - MOVQ CX,R10 - SHRQ $51,CX - ANDQ DX,AX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,40(SP) - MOVQ R8,48(SP) - MOVQ R9,56(SP) - MOVQ AX,64(SP) - MOVQ R10,72(SP) - MOVQ 264(SP),SI - IMUL3Q $19,SI,AX - MOVQ AX,200(SP) - MULQ 16(SP) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 272(SP),DX - IMUL3Q $19,DX,AX - MOVQ AX,208(SP) - MULQ 8(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 240(SP),AX - MULQ 0(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 240(SP),AX - MULQ 8(SP) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 240(SP),AX - MULQ 16(SP) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 240(SP),AX - MULQ 24(SP) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 240(SP),AX - MULQ 32(SP) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 248(SP),AX - MULQ 0(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 248(SP),AX - MULQ 8(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 248(SP),AX - MULQ 16(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 248(SP),AX - MULQ 24(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 248(SP),DX - IMUL3Q $19,DX,AX - MULQ 32(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 256(SP),AX - MULQ 0(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 256(SP),AX - MULQ 8(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 256(SP),AX - MULQ 16(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 256(SP),DX - IMUL3Q $19,DX,AX - MULQ 24(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 256(SP),DX - IMUL3Q $19,DX,AX - MULQ 32(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 264(SP),AX - MULQ 0(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 264(SP),AX - MULQ 8(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 200(SP),AX - MULQ 24(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 200(SP),AX - MULQ 32(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 272(SP),AX - MULQ 0(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 208(SP),AX - MULQ 16(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 208(SP),AX - MULQ 24(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 208(SP),AX - MULQ 32(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ $REDMASK51,DX - SHLQ $13,SI,CX - ANDQ DX,SI - SHLQ $13,R8,R9 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R10,R11 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R12,R13 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R14,R15 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - MOVQ CX,R8 - SHRQ $51,CX - ANDQ DX,SI - ADDQ R10,CX - MOVQ CX,R9 - SHRQ $51,CX - ANDQ DX,R8 - ADDQ R12,CX - MOVQ CX,AX - SHRQ $51,CX - ANDQ DX,R9 - ADDQ R14,CX - MOVQ CX,R10 - SHRQ $51,CX - ANDQ DX,AX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,DX - MOVQ R8,CX - MOVQ R9,R11 - MOVQ AX,R12 - MOVQ R10,R13 - ADDQ ·_2P0(SB),DX - ADDQ ·_2P1234(SB),CX - ADDQ ·_2P1234(SB),R11 - ADDQ ·_2P1234(SB),R12 - ADDQ ·_2P1234(SB),R13 - ADDQ 40(SP),SI - ADDQ 48(SP),R8 - ADDQ 56(SP),R9 - ADDQ 64(SP),AX - ADDQ 72(SP),R10 - SUBQ 40(SP),DX - SUBQ 48(SP),CX - SUBQ 56(SP),R11 - SUBQ 64(SP),R12 - SUBQ 72(SP),R13 - MOVQ SI,120(DI) - MOVQ R8,128(DI) - MOVQ R9,136(DI) - MOVQ AX,144(DI) - MOVQ R10,152(DI) - MOVQ DX,160(DI) - MOVQ CX,168(DI) - MOVQ R11,176(DI) - MOVQ R12,184(DI) - MOVQ R13,192(DI) - MOVQ 120(DI),AX - MULQ 120(DI) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 120(DI),AX - SHLQ $1,AX - MULQ 128(DI) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 120(DI),AX - SHLQ $1,AX - MULQ 136(DI) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 120(DI),AX - SHLQ $1,AX - MULQ 144(DI) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 120(DI),AX - SHLQ $1,AX - MULQ 152(DI) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 128(DI),AX - MULQ 128(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 128(DI),AX - SHLQ $1,AX - MULQ 136(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 128(DI),AX - SHLQ $1,AX - MULQ 144(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 128(DI),DX - IMUL3Q $38,DX,AX - MULQ 152(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 136(DI),AX - MULQ 136(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 136(DI),DX - IMUL3Q $38,DX,AX - MULQ 144(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 136(DI),DX - IMUL3Q $38,DX,AX - MULQ 152(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 144(DI),DX - IMUL3Q $19,DX,AX - MULQ 144(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 144(DI),DX - IMUL3Q $38,DX,AX - MULQ 152(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 152(DI),DX - IMUL3Q $19,DX,AX - MULQ 152(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ $REDMASK51,DX - SHLQ $13,SI,CX - ANDQ DX,SI - SHLQ $13,R8,R9 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R10,R11 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R12,R13 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R14,R15 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - ANDQ DX,SI - MOVQ CX,R8 - SHRQ $51,CX - ADDQ R10,CX - ANDQ DX,R8 - MOVQ CX,R9 - SHRQ $51,CX - ADDQ R12,CX - ANDQ DX,R9 - MOVQ CX,AX - SHRQ $51,CX - ADDQ R14,CX - ANDQ DX,AX - MOVQ CX,R10 - SHRQ $51,CX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,120(DI) - MOVQ R8,128(DI) - MOVQ R9,136(DI) - MOVQ AX,144(DI) - MOVQ R10,152(DI) - MOVQ 160(DI),AX - MULQ 160(DI) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 160(DI),AX - SHLQ $1,AX - MULQ 168(DI) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 160(DI),AX - SHLQ $1,AX - MULQ 176(DI) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 160(DI),AX - SHLQ $1,AX - MULQ 184(DI) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 160(DI),AX - SHLQ $1,AX - MULQ 192(DI) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 168(DI),AX - MULQ 168(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 168(DI),AX - SHLQ $1,AX - MULQ 176(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 168(DI),AX - SHLQ $1,AX - MULQ 184(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 168(DI),DX - IMUL3Q $38,DX,AX - MULQ 192(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 176(DI),AX - MULQ 176(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 176(DI),DX - IMUL3Q $38,DX,AX - MULQ 184(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 176(DI),DX - IMUL3Q $38,DX,AX - MULQ 192(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 184(DI),DX - IMUL3Q $19,DX,AX - MULQ 184(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 184(DI),DX - IMUL3Q $38,DX,AX - MULQ 192(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 192(DI),DX - IMUL3Q $19,DX,AX - MULQ 192(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ $REDMASK51,DX - SHLQ $13,SI,CX - ANDQ DX,SI - SHLQ $13,R8,R9 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R10,R11 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R12,R13 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R14,R15 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - ANDQ DX,SI - MOVQ CX,R8 - SHRQ $51,CX - ADDQ R10,CX - ANDQ DX,R8 - MOVQ CX,R9 - SHRQ $51,CX - ADDQ R12,CX - ANDQ DX,R9 - MOVQ CX,AX - SHRQ $51,CX - ADDQ R14,CX - ANDQ DX,AX - MOVQ CX,R10 - SHRQ $51,CX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,160(DI) - MOVQ R8,168(DI) - MOVQ R9,176(DI) - MOVQ AX,184(DI) - MOVQ R10,192(DI) - MOVQ 184(DI),SI - IMUL3Q $19,SI,AX - MOVQ AX,0(SP) - MULQ 16(DI) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 192(DI),DX - IMUL3Q $19,DX,AX - MOVQ AX,8(SP) - MULQ 8(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 160(DI),AX - MULQ 0(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 160(DI),AX - MULQ 8(DI) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 160(DI),AX - MULQ 16(DI) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 160(DI),AX - MULQ 24(DI) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 160(DI),AX - MULQ 32(DI) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 168(DI),AX - MULQ 0(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 168(DI),AX - MULQ 8(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 168(DI),AX - MULQ 16(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 168(DI),AX - MULQ 24(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 168(DI),DX - IMUL3Q $19,DX,AX - MULQ 32(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 176(DI),AX - MULQ 0(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 176(DI),AX - MULQ 8(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 176(DI),AX - MULQ 16(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 176(DI),DX - IMUL3Q $19,DX,AX - MULQ 24(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 176(DI),DX - IMUL3Q $19,DX,AX - MULQ 32(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 184(DI),AX - MULQ 0(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 184(DI),AX - MULQ 8(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 0(SP),AX - MULQ 24(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 0(SP),AX - MULQ 32(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 192(DI),AX - MULQ 0(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 8(SP),AX - MULQ 16(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 8(SP),AX - MULQ 24(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SP),AX - MULQ 32(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ $REDMASK51,DX - SHLQ $13,SI,CX - ANDQ DX,SI - SHLQ $13,R8,R9 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R10,R11 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R12,R13 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R14,R15 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - MOVQ CX,R8 - SHRQ $51,CX - ANDQ DX,SI - ADDQ R10,CX - MOVQ CX,R9 - SHRQ $51,CX - ANDQ DX,R8 - ADDQ R12,CX - MOVQ CX,AX - SHRQ $51,CX - ANDQ DX,R9 - ADDQ R14,CX - MOVQ CX,R10 - SHRQ $51,CX - ANDQ DX,AX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,160(DI) - MOVQ R8,168(DI) - MOVQ R9,176(DI) - MOVQ AX,184(DI) - MOVQ R10,192(DI) - MOVQ 144(SP),SI - IMUL3Q $19,SI,AX - MOVQ AX,0(SP) - MULQ 96(SP) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 152(SP),DX - IMUL3Q $19,DX,AX - MOVQ AX,8(SP) - MULQ 88(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 120(SP),AX - MULQ 80(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 120(SP),AX - MULQ 88(SP) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 120(SP),AX - MULQ 96(SP) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 120(SP),AX - MULQ 104(SP) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 120(SP),AX - MULQ 112(SP) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 128(SP),AX - MULQ 80(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 128(SP),AX - MULQ 88(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 128(SP),AX - MULQ 96(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 128(SP),AX - MULQ 104(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 128(SP),DX - IMUL3Q $19,DX,AX - MULQ 112(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 136(SP),AX - MULQ 80(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 136(SP),AX - MULQ 88(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 136(SP),AX - MULQ 96(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 136(SP),DX - IMUL3Q $19,DX,AX - MULQ 104(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 136(SP),DX - IMUL3Q $19,DX,AX - MULQ 112(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 144(SP),AX - MULQ 80(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 144(SP),AX - MULQ 88(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 0(SP),AX - MULQ 104(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 0(SP),AX - MULQ 112(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 152(SP),AX - MULQ 80(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 8(SP),AX - MULQ 96(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 8(SP),AX - MULQ 104(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SP),AX - MULQ 112(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ $REDMASK51,DX - SHLQ $13,SI,CX - ANDQ DX,SI - SHLQ $13,R8,R9 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R10,R11 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R12,R13 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R14,R15 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - MOVQ CX,R8 - SHRQ $51,CX - ANDQ DX,SI - ADDQ R10,CX - MOVQ CX,R9 - SHRQ $51,CX - ANDQ DX,R8 - ADDQ R12,CX - MOVQ CX,AX - SHRQ $51,CX - ANDQ DX,R9 - ADDQ R14,CX - MOVQ CX,R10 - SHRQ $51,CX - ANDQ DX,AX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,40(DI) - MOVQ R8,48(DI) - MOVQ R9,56(DI) - MOVQ AX,64(DI) - MOVQ R10,72(DI) - MOVQ 160(SP),AX - MULQ ·_121666_213(SB) - SHRQ $13,AX - MOVQ AX,SI - MOVQ DX,CX - MOVQ 168(SP),AX - MULQ ·_121666_213(SB) - SHRQ $13,AX - ADDQ AX,CX - MOVQ DX,R8 - MOVQ 176(SP),AX - MULQ ·_121666_213(SB) - SHRQ $13,AX - ADDQ AX,R8 - MOVQ DX,R9 - MOVQ 184(SP),AX - MULQ ·_121666_213(SB) - SHRQ $13,AX - ADDQ AX,R9 - MOVQ DX,R10 - MOVQ 192(SP),AX - MULQ ·_121666_213(SB) - SHRQ $13,AX - ADDQ AX,R10 - IMUL3Q $19,DX,DX - ADDQ DX,SI - ADDQ 80(SP),SI - ADDQ 88(SP),CX - ADDQ 96(SP),R8 - ADDQ 104(SP),R9 - ADDQ 112(SP),R10 - MOVQ SI,80(DI) - MOVQ CX,88(DI) - MOVQ R8,96(DI) - MOVQ R9,104(DI) - MOVQ R10,112(DI) - MOVQ 104(DI),SI - IMUL3Q $19,SI,AX - MOVQ AX,0(SP) - MULQ 176(SP) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 112(DI),DX - IMUL3Q $19,DX,AX - MOVQ AX,8(SP) - MULQ 168(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 80(DI),AX - MULQ 160(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 80(DI),AX - MULQ 168(SP) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 80(DI),AX - MULQ 176(SP) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 80(DI),AX - MULQ 184(SP) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 80(DI),AX - MULQ 192(SP) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 88(DI),AX - MULQ 160(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 88(DI),AX - MULQ 168(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 88(DI),AX - MULQ 176(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 88(DI),AX - MULQ 184(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 88(DI),DX - IMUL3Q $19,DX,AX - MULQ 192(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 96(DI),AX - MULQ 160(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 96(DI),AX - MULQ 168(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 96(DI),AX - MULQ 176(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 96(DI),DX - IMUL3Q $19,DX,AX - MULQ 184(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 96(DI),DX - IMUL3Q $19,DX,AX - MULQ 192(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 104(DI),AX - MULQ 160(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 104(DI),AX - MULQ 168(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 0(SP),AX - MULQ 184(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 0(SP),AX - MULQ 192(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 112(DI),AX - MULQ 160(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 8(SP),AX - MULQ 176(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 8(SP),AX - MULQ 184(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SP),AX - MULQ 192(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ $REDMASK51,DX - SHLQ $13,SI,CX - ANDQ DX,SI - SHLQ $13,R8,R9 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R10,R11 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R12,R13 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R14,R15 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - MOVQ CX,R8 - SHRQ $51,CX - ANDQ DX,SI - ADDQ R10,CX - MOVQ CX,R9 - SHRQ $51,CX - ANDQ DX,R8 - ADDQ R12,CX - MOVQ CX,AX - SHRQ $51,CX - ANDQ DX,R9 - ADDQ R14,CX - MOVQ CX,R10 - SHRQ $51,CX - ANDQ DX,AX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,80(DI) - MOVQ R8,88(DI) - MOVQ R9,96(DI) - MOVQ AX,104(DI) - MOVQ R10,112(DI) - RET diff --git a/vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go b/vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go deleted file mode 100644 index 5822bd533..000000000 --- a/vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build amd64,!gccgo,!appengine - -package curve25519 - -// These functions are implemented in the .s files. The names of the functions -// in the rest of the file are also taken from the SUPERCOP sources to help -// people following along. - -//go:noescape - -func cswap(inout *[5]uint64, v uint64) - -//go:noescape - -func ladderstep(inout *[5][5]uint64) - -//go:noescape - -func freeze(inout *[5]uint64) - -//go:noescape - -func mul(dest, a, b *[5]uint64) - -//go:noescape - -func square(out, in *[5]uint64) - -// mladder uses a Montgomery ladder to calculate (xr/zr) *= s. -func mladder(xr, zr *[5]uint64, s *[32]byte) { - var work [5][5]uint64 - - work[0] = *xr - setint(&work[1], 1) - setint(&work[2], 0) - work[3] = *xr - setint(&work[4], 1) - - j := uint(6) - var prevbit byte - - for i := 31; i >= 0; i-- { - for j < 8 { - bit := ((*s)[i] >> j) & 1 - swap := bit ^ prevbit - prevbit = bit - cswap(&work[1], uint64(swap)) - ladderstep(&work) - j-- - } - j = 7 - } - - *xr = work[1] - *zr = work[2] -} - -func scalarMult(out, in, base *[32]byte) { - var e [32]byte - copy(e[:], (*in)[:]) - e[0] &= 248 - e[31] &= 127 - e[31] |= 64 - - var t, z [5]uint64 - unpack(&t, base) - mladder(&t, &z, &e) - invert(&z, &z) - mul(&t, &t, &z) - pack(out, &t) -} - -func setint(r *[5]uint64, v uint64) { - r[0] = v - r[1] = 0 - r[2] = 0 - r[3] = 0 - r[4] = 0 -} - -// unpack sets r = x where r consists of 5, 51-bit limbs in little-endian -// order. -func unpack(r *[5]uint64, x *[32]byte) { - r[0] = uint64(x[0]) | - uint64(x[1])<<8 | - uint64(x[2])<<16 | - uint64(x[3])<<24 | - uint64(x[4])<<32 | - uint64(x[5])<<40 | - uint64(x[6]&7)<<48 - - r[1] = uint64(x[6])>>3 | - uint64(x[7])<<5 | - uint64(x[8])<<13 | - uint64(x[9])<<21 | - uint64(x[10])<<29 | - uint64(x[11])<<37 | - uint64(x[12]&63)<<45 - - r[2] = uint64(x[12])>>6 | - uint64(x[13])<<2 | - uint64(x[14])<<10 | - uint64(x[15])<<18 | - uint64(x[16])<<26 | - uint64(x[17])<<34 | - uint64(x[18])<<42 | - uint64(x[19]&1)<<50 - - r[3] = uint64(x[19])>>1 | - uint64(x[20])<<7 | - uint64(x[21])<<15 | - uint64(x[22])<<23 | - uint64(x[23])<<31 | - uint64(x[24])<<39 | - uint64(x[25]&15)<<47 - - r[4] = uint64(x[25])>>4 | - uint64(x[26])<<4 | - uint64(x[27])<<12 | - uint64(x[28])<<20 | - uint64(x[29])<<28 | - uint64(x[30])<<36 | - uint64(x[31]&127)<<44 -} - -// pack sets out = x where out is the usual, little-endian form of the 5, -// 51-bit limbs in x. -func pack(out *[32]byte, x *[5]uint64) { - t := *x - freeze(&t) - - out[0] = byte(t[0]) - out[1] = byte(t[0] >> 8) - out[2] = byte(t[0] >> 16) - out[3] = byte(t[0] >> 24) - out[4] = byte(t[0] >> 32) - out[5] = byte(t[0] >> 40) - out[6] = byte(t[0] >> 48) - - out[6] ^= byte(t[1]<<3) & 0xf8 - out[7] = byte(t[1] >> 5) - out[8] = byte(t[1] >> 13) - out[9] = byte(t[1] >> 21) - out[10] = byte(t[1] >> 29) - out[11] = byte(t[1] >> 37) - out[12] = byte(t[1] >> 45) - - out[12] ^= byte(t[2]<<6) & 0xc0 - out[13] = byte(t[2] >> 2) - out[14] = byte(t[2] >> 10) - out[15] = byte(t[2] >> 18) - out[16] = byte(t[2] >> 26) - out[17] = byte(t[2] >> 34) - out[18] = byte(t[2] >> 42) - out[19] = byte(t[2] >> 50) - - out[19] ^= byte(t[3]<<1) & 0xfe - out[20] = byte(t[3] >> 7) - out[21] = byte(t[3] >> 15) - out[22] = byte(t[3] >> 23) - out[23] = byte(t[3] >> 31) - out[24] = byte(t[3] >> 39) - out[25] = byte(t[3] >> 47) - - out[25] ^= byte(t[4]<<4) & 0xf0 - out[26] = byte(t[4] >> 4) - out[27] = byte(t[4] >> 12) - out[28] = byte(t[4] >> 20) - out[29] = byte(t[4] >> 28) - out[30] = byte(t[4] >> 36) - out[31] = byte(t[4] >> 44) -} - -// invert calculates r = x^-1 mod p using Fermat's little theorem. -func invert(r *[5]uint64, x *[5]uint64) { - var z2, z9, z11, z2_5_0, z2_10_0, z2_20_0, z2_50_0, z2_100_0, t [5]uint64 - - square(&z2, x) /* 2 */ - square(&t, &z2) /* 4 */ - square(&t, &t) /* 8 */ - mul(&z9, &t, x) /* 9 */ - mul(&z11, &z9, &z2) /* 11 */ - square(&t, &z11) /* 22 */ - mul(&z2_5_0, &t, &z9) /* 2^5 - 2^0 = 31 */ - - square(&t, &z2_5_0) /* 2^6 - 2^1 */ - for i := 1; i < 5; i++ { /* 2^20 - 2^10 */ - square(&t, &t) - } - mul(&z2_10_0, &t, &z2_5_0) /* 2^10 - 2^0 */ - - square(&t, &z2_10_0) /* 2^11 - 2^1 */ - for i := 1; i < 10; i++ { /* 2^20 - 2^10 */ - square(&t, &t) - } - mul(&z2_20_0, &t, &z2_10_0) /* 2^20 - 2^0 */ - - square(&t, &z2_20_0) /* 2^21 - 2^1 */ - for i := 1; i < 20; i++ { /* 2^40 - 2^20 */ - square(&t, &t) - } - mul(&t, &t, &z2_20_0) /* 2^40 - 2^0 */ - - square(&t, &t) /* 2^41 - 2^1 */ - for i := 1; i < 10; i++ { /* 2^50 - 2^10 */ - square(&t, &t) - } - mul(&z2_50_0, &t, &z2_10_0) /* 2^50 - 2^0 */ - - square(&t, &z2_50_0) /* 2^51 - 2^1 */ - for i := 1; i < 50; i++ { /* 2^100 - 2^50 */ - square(&t, &t) - } - mul(&z2_100_0, &t, &z2_50_0) /* 2^100 - 2^0 */ - - square(&t, &z2_100_0) /* 2^101 - 2^1 */ - for i := 1; i < 100; i++ { /* 2^200 - 2^100 */ - square(&t, &t) - } - mul(&t, &t, &z2_100_0) /* 2^200 - 2^0 */ - - square(&t, &t) /* 2^201 - 2^1 */ - for i := 1; i < 50; i++ { /* 2^250 - 2^50 */ - square(&t, &t) - } - mul(&t, &t, &z2_50_0) /* 2^250 - 2^0 */ - - square(&t, &t) /* 2^251 - 2^1 */ - square(&t, &t) /* 2^252 - 2^2 */ - square(&t, &t) /* 2^253 - 2^3 */ - - square(&t, &t) /* 2^254 - 2^4 */ - - square(&t, &t) /* 2^255 - 2^5 */ - mul(r, &t, &z11) /* 2^255 - 21 */ -} diff --git a/vendor/golang.org/x/crypto/curve25519/mul_amd64.s b/vendor/golang.org/x/crypto/curve25519/mul_amd64.s deleted file mode 100644 index 1f76d1a3f..000000000 --- a/vendor/golang.org/x/crypto/curve25519/mul_amd64.s +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -#include "const_amd64.h" - -// func mul(dest, a, b *[5]uint64) -TEXT ·mul(SB),0,$16-24 - MOVQ dest+0(FP), DI - MOVQ a+8(FP), SI - MOVQ b+16(FP), DX - - MOVQ DX,CX - MOVQ 24(SI),DX - IMUL3Q $19,DX,AX - MOVQ AX,0(SP) - MULQ 16(CX) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 32(SI),DX - IMUL3Q $19,DX,AX - MOVQ AX,8(SP) - MULQ 8(CX) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 0(SI),AX - MULQ 0(CX) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 0(SI),AX - MULQ 8(CX) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 0(SI),AX - MULQ 16(CX) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 0(SI),AX - MULQ 24(CX) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 0(SI),AX - MULQ 32(CX) - MOVQ AX,BX - MOVQ DX,BP - MOVQ 8(SI),AX - MULQ 0(CX) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SI),AX - MULQ 8(CX) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 8(SI),AX - MULQ 16(CX) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 8(SI),AX - MULQ 24(CX) - ADDQ AX,BX - ADCQ DX,BP - MOVQ 8(SI),DX - IMUL3Q $19,DX,AX - MULQ 32(CX) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 16(SI),AX - MULQ 0(CX) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 16(SI),AX - MULQ 8(CX) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 16(SI),AX - MULQ 16(CX) - ADDQ AX,BX - ADCQ DX,BP - MOVQ 16(SI),DX - IMUL3Q $19,DX,AX - MULQ 24(CX) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 16(SI),DX - IMUL3Q $19,DX,AX - MULQ 32(CX) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 24(SI),AX - MULQ 0(CX) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 24(SI),AX - MULQ 8(CX) - ADDQ AX,BX - ADCQ DX,BP - MOVQ 0(SP),AX - MULQ 24(CX) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 0(SP),AX - MULQ 32(CX) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 32(SI),AX - MULQ 0(CX) - ADDQ AX,BX - ADCQ DX,BP - MOVQ 8(SP),AX - MULQ 16(CX) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SP),AX - MULQ 24(CX) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 8(SP),AX - MULQ 32(CX) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ $REDMASK51,SI - SHLQ $13,R8,R9 - ANDQ SI,R8 - SHLQ $13,R10,R11 - ANDQ SI,R10 - ADDQ R9,R10 - SHLQ $13,R12,R13 - ANDQ SI,R12 - ADDQ R11,R12 - SHLQ $13,R14,R15 - ANDQ SI,R14 - ADDQ R13,R14 - SHLQ $13,BX,BP - ANDQ SI,BX - ADDQ R15,BX - IMUL3Q $19,BP,DX - ADDQ DX,R8 - MOVQ R8,DX - SHRQ $51,DX - ADDQ R10,DX - MOVQ DX,CX - SHRQ $51,DX - ANDQ SI,R8 - ADDQ R12,DX - MOVQ DX,R9 - SHRQ $51,DX - ANDQ SI,CX - ADDQ R14,DX - MOVQ DX,AX - SHRQ $51,DX - ANDQ SI,R9 - ADDQ BX,DX - MOVQ DX,R10 - SHRQ $51,DX - ANDQ SI,AX - IMUL3Q $19,DX,DX - ADDQ DX,R8 - ANDQ SI,R10 - MOVQ R8,0(DI) - MOVQ CX,8(DI) - MOVQ R9,16(DI) - MOVQ AX,24(DI) - MOVQ R10,32(DI) - RET diff --git a/vendor/golang.org/x/crypto/curve25519/square_amd64.s b/vendor/golang.org/x/crypto/curve25519/square_amd64.s deleted file mode 100644 index 07511a45a..000000000 --- a/vendor/golang.org/x/crypto/curve25519/square_amd64.s +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -#include "const_amd64.h" - -// func square(out, in *[5]uint64) -TEXT ·square(SB),7,$0-16 - MOVQ out+0(FP), DI - MOVQ in+8(FP), SI - - MOVQ 0(SI),AX - MULQ 0(SI) - MOVQ AX,CX - MOVQ DX,R8 - MOVQ 0(SI),AX - SHLQ $1,AX - MULQ 8(SI) - MOVQ AX,R9 - MOVQ DX,R10 - MOVQ 0(SI),AX - SHLQ $1,AX - MULQ 16(SI) - MOVQ AX,R11 - MOVQ DX,R12 - MOVQ 0(SI),AX - SHLQ $1,AX - MULQ 24(SI) - MOVQ AX,R13 - MOVQ DX,R14 - MOVQ 0(SI),AX - SHLQ $1,AX - MULQ 32(SI) - MOVQ AX,R15 - MOVQ DX,BX - MOVQ 8(SI),AX - MULQ 8(SI) - ADDQ AX,R11 - ADCQ DX,R12 - MOVQ 8(SI),AX - SHLQ $1,AX - MULQ 16(SI) - ADDQ AX,R13 - ADCQ DX,R14 - MOVQ 8(SI),AX - SHLQ $1,AX - MULQ 24(SI) - ADDQ AX,R15 - ADCQ DX,BX - MOVQ 8(SI),DX - IMUL3Q $38,DX,AX - MULQ 32(SI) - ADDQ AX,CX - ADCQ DX,R8 - MOVQ 16(SI),AX - MULQ 16(SI) - ADDQ AX,R15 - ADCQ DX,BX - MOVQ 16(SI),DX - IMUL3Q $38,DX,AX - MULQ 24(SI) - ADDQ AX,CX - ADCQ DX,R8 - MOVQ 16(SI),DX - IMUL3Q $38,DX,AX - MULQ 32(SI) - ADDQ AX,R9 - ADCQ DX,R10 - MOVQ 24(SI),DX - IMUL3Q $19,DX,AX - MULQ 24(SI) - ADDQ AX,R9 - ADCQ DX,R10 - MOVQ 24(SI),DX - IMUL3Q $38,DX,AX - MULQ 32(SI) - ADDQ AX,R11 - ADCQ DX,R12 - MOVQ 32(SI),DX - IMUL3Q $19,DX,AX - MULQ 32(SI) - ADDQ AX,R13 - ADCQ DX,R14 - MOVQ $REDMASK51,SI - SHLQ $13,CX,R8 - ANDQ SI,CX - SHLQ $13,R9,R10 - ANDQ SI,R9 - ADDQ R8,R9 - SHLQ $13,R11,R12 - ANDQ SI,R11 - ADDQ R10,R11 - SHLQ $13,R13,R14 - ANDQ SI,R13 - ADDQ R12,R13 - SHLQ $13,R15,BX - ANDQ SI,R15 - ADDQ R14,R15 - IMUL3Q $19,BX,DX - ADDQ DX,CX - MOVQ CX,DX - SHRQ $51,DX - ADDQ R9,DX - ANDQ SI,CX - MOVQ DX,R8 - SHRQ $51,DX - ADDQ R11,DX - ANDQ SI,R8 - MOVQ DX,R9 - SHRQ $51,DX - ADDQ R13,DX - ANDQ SI,R9 - MOVQ DX,AX - SHRQ $51,DX - ADDQ R15,DX - ANDQ SI,AX - MOVQ DX,R10 - SHRQ $51,DX - IMUL3Q $19,DX,DX - ADDQ DX,CX - ANDQ SI,R10 - MOVQ CX,0(DI) - MOVQ R8,8(DI) - MOVQ R9,16(DI) - MOVQ AX,24(DI) - MOVQ R10,32(DI) - RET diff --git a/vendor/golang.org/x/crypto/ed25519/ed25519.go b/vendor/golang.org/x/crypto/ed25519/ed25519.go index d6f683ba3..71ad917da 100644 --- a/vendor/golang.org/x/crypto/ed25519/ed25519.go +++ b/vendor/golang.org/x/crypto/ed25519/ed25519.go @@ -2,6 +2,12 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// In Go 1.13, the ed25519 package was promoted to the standard library as +// crypto/ed25519, and this package became a wrapper for the standard library one. +// +//go:build !go1.13 +// +build !go1.13 + // Package ed25519 implements the Ed25519 signature algorithm. See // https://ed25519.cr.yp.to/. // diff --git a/vendor/golang.org/x/crypto/ed25519/ed25519_go113.go b/vendor/golang.org/x/crypto/ed25519/ed25519_go113.go new file mode 100644 index 000000000..b5974dc8b --- /dev/null +++ b/vendor/golang.org/x/crypto/ed25519/ed25519_go113.go @@ -0,0 +1,74 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.13 +// +build go1.13 + +// Package ed25519 implements the Ed25519 signature algorithm. See +// https://ed25519.cr.yp.to/. +// +// These functions are also compatible with the “Ed25519” function defined in +// RFC 8032. However, unlike RFC 8032's formulation, this package's private key +// representation includes a public key suffix to make multiple signing +// operations with the same key more efficient. This package refers to the RFC +// 8032 private key as the “seed”. +// +// Beginning with Go 1.13, the functionality of this package was moved to the +// standard library as crypto/ed25519. This package only acts as a compatibility +// wrapper. +package ed25519 + +import ( + "crypto/ed25519" + "io" +) + +const ( + // PublicKeySize is the size, in bytes, of public keys as used in this package. + PublicKeySize = 32 + // PrivateKeySize is the size, in bytes, of private keys as used in this package. + PrivateKeySize = 64 + // SignatureSize is the size, in bytes, of signatures generated and verified by this package. + SignatureSize = 64 + // SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032. + SeedSize = 32 +) + +// PublicKey is the type of Ed25519 public keys. +// +// This type is an alias for crypto/ed25519's PublicKey type. +// See the crypto/ed25519 package for the methods on this type. +type PublicKey = ed25519.PublicKey + +// PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer. +// +// This type is an alias for crypto/ed25519's PrivateKey type. +// See the crypto/ed25519 package for the methods on this type. +type PrivateKey = ed25519.PrivateKey + +// GenerateKey generates a public/private key pair using entropy from rand. +// If rand is nil, crypto/rand.Reader will be used. +func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) { + return ed25519.GenerateKey(rand) +} + +// NewKeyFromSeed calculates a private key from a seed. It will panic if +// len(seed) is not SeedSize. This function is provided for interoperability +// with RFC 8032. RFC 8032's private keys correspond to seeds in this +// package. +func NewKeyFromSeed(seed []byte) PrivateKey { + return ed25519.NewKeyFromSeed(seed) +} + +// Sign signs the message with privateKey and returns a signature. It will +// panic if len(privateKey) is not PrivateKeySize. +func Sign(privateKey PrivateKey, message []byte) []byte { + return ed25519.Sign(privateKey, message) +} + +// Verify reports whether sig is a valid signature of message by publicKey. It +// will panic if len(publicKey) is not PublicKeySize. +func Verify(publicKey PublicKey, message, sig []byte) bool { + return ed25519.Verify(publicKey, message, sig) +} diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_arm64.go b/vendor/golang.org/x/crypto/internal/chacha20/chacha_arm64.go deleted file mode 100644 index ad74e23ae..000000000 --- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_arm64.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.11 -// +build !gccgo - -package chacha20 - -const ( - haveAsm = true - bufSize = 256 -) - -//go:noescape -func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) - -func (c *Cipher) xorKeyStreamAsm(dst, src []byte) { - - if len(src) >= bufSize { - xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter) - } - - if len(src)%bufSize != 0 { - i := len(src) - len(src)%bufSize - c.buf = [bufSize]byte{} - copy(c.buf[:], src[i:]) - xorKeyStreamVX(c.buf[:], c.buf[:], &c.key, &c.nonce, &c.counter) - c.len = bufSize - copy(dst[i:], c.buf[:len(src)%bufSize]) - } -} diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go b/vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go deleted file mode 100644 index 6570847f5..000000000 --- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ChaCha20 implements the core ChaCha20 function as specified -// in https://tools.ietf.org/html/rfc7539#section-2.3. -package chacha20 - -import ( - "crypto/cipher" - "encoding/binary" - - "golang.org/x/crypto/internal/subtle" -) - -// assert that *Cipher implements cipher.Stream -var _ cipher.Stream = (*Cipher)(nil) - -// Cipher is a stateful instance of ChaCha20 using a particular key -// and nonce. A *Cipher implements the cipher.Stream interface. -type Cipher struct { - key [8]uint32 - counter uint32 // incremented after each block - nonce [3]uint32 - buf [bufSize]byte // buffer for unused keystream bytes - len int // number of unused keystream bytes at end of buf -} - -// New creates a new ChaCha20 stream cipher with the given key and nonce. -// The initial counter value is set to 0. -func New(key [8]uint32, nonce [3]uint32) *Cipher { - return &Cipher{key: key, nonce: nonce} -} - -// ChaCha20 constants spelling "expand 32-byte k" -const ( - j0 uint32 = 0x61707865 - j1 uint32 = 0x3320646e - j2 uint32 = 0x79622d32 - j3 uint32 = 0x6b206574 -) - -func quarterRound(a, b, c, d uint32) (uint32, uint32, uint32, uint32) { - a += b - d ^= a - d = (d << 16) | (d >> 16) - c += d - b ^= c - b = (b << 12) | (b >> 20) - a += b - d ^= a - d = (d << 8) | (d >> 24) - c += d - b ^= c - b = (b << 7) | (b >> 25) - return a, b, c, d -} - -// XORKeyStream XORs each byte in the given slice with a byte from the -// cipher's key stream. Dst and src must overlap entirely or not at all. -// -// If len(dst) < len(src), XORKeyStream will panic. It is acceptable -// to pass a dst bigger than src, and in that case, XORKeyStream will -// only update dst[:len(src)] and will not touch the rest of dst. -// -// Multiple calls to XORKeyStream behave as if the concatenation of -// the src buffers was passed in a single run. That is, Cipher -// maintains state and does not reset at each XORKeyStream call. -func (s *Cipher) XORKeyStream(dst, src []byte) { - if len(dst) < len(src) { - panic("chacha20: output smaller than input") - } - if subtle.InexactOverlap(dst[:len(src)], src) { - panic("chacha20: invalid buffer overlap") - } - - // xor src with buffered keystream first - if s.len != 0 { - buf := s.buf[len(s.buf)-s.len:] - if len(src) < len(buf) { - buf = buf[:len(src)] - } - td, ts := dst[:len(buf)], src[:len(buf)] // BCE hint - for i, b := range buf { - td[i] = ts[i] ^ b - } - s.len -= len(buf) - if s.len != 0 { - return - } - s.buf = [len(s.buf)]byte{} // zero the empty buffer - src = src[len(buf):] - dst = dst[len(buf):] - } - - if len(src) == 0 { - return - } - if haveAsm { - if uint64(len(src))+uint64(s.counter)*64 > (1<<38)-64 { - panic("chacha20: counter overflow") - } - s.xorKeyStreamAsm(dst, src) - return - } - - // set up a 64-byte buffer to pad out the final block if needed - // (hoisted out of the main loop to avoid spills) - rem := len(src) % 64 // length of final block - fin := len(src) - rem // index of final block - if rem > 0 { - copy(s.buf[len(s.buf)-64:], src[fin:]) - } - - // pre-calculate most of the first round - s1, s5, s9, s13 := quarterRound(j1, s.key[1], s.key[5], s.nonce[0]) - s2, s6, s10, s14 := quarterRound(j2, s.key[2], s.key[6], s.nonce[1]) - s3, s7, s11, s15 := quarterRound(j3, s.key[3], s.key[7], s.nonce[2]) - - n := len(src) - src, dst = src[:n:n], dst[:n:n] // BCE hint - for i := 0; i < n; i += 64 { - // calculate the remainder of the first round - s0, s4, s8, s12 := quarterRound(j0, s.key[0], s.key[4], s.counter) - - // execute the second round - x0, x5, x10, x15 := quarterRound(s0, s5, s10, s15) - x1, x6, x11, x12 := quarterRound(s1, s6, s11, s12) - x2, x7, x8, x13 := quarterRound(s2, s7, s8, s13) - x3, x4, x9, x14 := quarterRound(s3, s4, s9, s14) - - // execute the remaining 18 rounds - for i := 0; i < 9; i++ { - x0, x4, x8, x12 = quarterRound(x0, x4, x8, x12) - x1, x5, x9, x13 = quarterRound(x1, x5, x9, x13) - x2, x6, x10, x14 = quarterRound(x2, x6, x10, x14) - x3, x7, x11, x15 = quarterRound(x3, x7, x11, x15) - - x0, x5, x10, x15 = quarterRound(x0, x5, x10, x15) - x1, x6, x11, x12 = quarterRound(x1, x6, x11, x12) - x2, x7, x8, x13 = quarterRound(x2, x7, x8, x13) - x3, x4, x9, x14 = quarterRound(x3, x4, x9, x14) - } - - x0 += j0 - x1 += j1 - x2 += j2 - x3 += j3 - - x4 += s.key[0] - x5 += s.key[1] - x6 += s.key[2] - x7 += s.key[3] - x8 += s.key[4] - x9 += s.key[5] - x10 += s.key[6] - x11 += s.key[7] - - x12 += s.counter - x13 += s.nonce[0] - x14 += s.nonce[1] - x15 += s.nonce[2] - - // increment the counter - s.counter += 1 - if s.counter == 0 { - panic("chacha20: counter overflow") - } - - // pad to 64 bytes if needed - in, out := src[i:], dst[i:] - if i == fin { - // src[fin:] has already been copied into s.buf before - // the main loop - in, out = s.buf[len(s.buf)-64:], s.buf[len(s.buf)-64:] - } - in, out = in[:64], out[:64] // BCE hint - - // XOR the key stream with the source and write out the result - xor(out[0:], in[0:], x0) - xor(out[4:], in[4:], x1) - xor(out[8:], in[8:], x2) - xor(out[12:], in[12:], x3) - xor(out[16:], in[16:], x4) - xor(out[20:], in[20:], x5) - xor(out[24:], in[24:], x6) - xor(out[28:], in[28:], x7) - xor(out[32:], in[32:], x8) - xor(out[36:], in[36:], x9) - xor(out[40:], in[40:], x10) - xor(out[44:], in[44:], x11) - xor(out[48:], in[48:], x12) - xor(out[52:], in[52:], x13) - xor(out[56:], in[56:], x14) - xor(out[60:], in[60:], x15) - } - // copy any trailing bytes out of the buffer and into dst - if rem != 0 { - s.len = 64 - rem - copy(dst[fin:], s.buf[len(s.buf)-64:]) - } -} - -// Advance discards bytes in the key stream until the next 64 byte block -// boundary is reached and updates the counter accordingly. If the key -// stream is already at a block boundary no bytes will be discarded and -// the counter will be unchanged. -func (s *Cipher) Advance() { - s.len -= s.len % 64 - if s.len == 0 { - s.buf = [len(s.buf)]byte{} - } -} - -// XORKeyStream crypts bytes from in to out using the given key and counters. -// In and out must overlap entirely or not at all. Counter contains the raw -// ChaCha20 counter bytes (i.e. block counter followed by nonce). -func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { - s := Cipher{ - key: [8]uint32{ - binary.LittleEndian.Uint32(key[0:4]), - binary.LittleEndian.Uint32(key[4:8]), - binary.LittleEndian.Uint32(key[8:12]), - binary.LittleEndian.Uint32(key[12:16]), - binary.LittleEndian.Uint32(key[16:20]), - binary.LittleEndian.Uint32(key[20:24]), - binary.LittleEndian.Uint32(key[24:28]), - binary.LittleEndian.Uint32(key[28:32]), - }, - nonce: [3]uint32{ - binary.LittleEndian.Uint32(counter[4:8]), - binary.LittleEndian.Uint32(counter[8:12]), - binary.LittleEndian.Uint32(counter[12:16]), - }, - counter: binary.LittleEndian.Uint32(counter[0:4]), - } - s.XORKeyStream(out, in) -} - -// HChaCha20 uses the ChaCha20 core to generate a derived key from a key and a -// nonce. It should only be used as part of the XChaCha20 construction. -func HChaCha20(key *[8]uint32, nonce *[4]uint32) [8]uint32 { - x0, x1, x2, x3 := j0, j1, j2, j3 - x4, x5, x6, x7 := key[0], key[1], key[2], key[3] - x8, x9, x10, x11 := key[4], key[5], key[6], key[7] - x12, x13, x14, x15 := nonce[0], nonce[1], nonce[2], nonce[3] - - for i := 0; i < 10; i++ { - x0, x4, x8, x12 = quarterRound(x0, x4, x8, x12) - x1, x5, x9, x13 = quarterRound(x1, x5, x9, x13) - x2, x6, x10, x14 = quarterRound(x2, x6, x10, x14) - x3, x7, x11, x15 = quarterRound(x3, x7, x11, x15) - - x0, x5, x10, x15 = quarterRound(x0, x5, x10, x15) - x1, x6, x11, x12 = quarterRound(x1, x6, x11, x12) - x2, x7, x8, x13 = quarterRound(x2, x7, x8, x13) - x3, x4, x9, x14 = quarterRound(x3, x4, x9, x14) - } - - var out [8]uint32 - out[0], out[1], out[2], out[3] = x0, x1, x2, x3 - out[4], out[5], out[6], out[7] = x12, x13, x14, x15 - return out -} diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_noasm.go b/vendor/golang.org/x/crypto/internal/chacha20/chacha_noasm.go deleted file mode 100644 index 47eac0314..000000000 --- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_noasm.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !arm64,!s390x arm64,!go1.11 gccgo appengine - -package chacha20 - -const ( - bufSize = 64 - haveAsm = false -) - -func (*Cipher) xorKeyStreamAsm(dst, src []byte) { - panic("not implemented") -} diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go deleted file mode 100644 index aad645b44..000000000 --- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build s390x,!gccgo,!appengine - -package chacha20 - -import ( - "golang.org/x/sys/cpu" -) - -var haveAsm = cpu.S390X.HasVX - -const bufSize = 256 - -// xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only -// be called when the vector facility is available. -// Implementation in asm_s390x.s. -//go:noescape -func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32, buf *[256]byte, len *int) - -func (c *Cipher) xorKeyStreamAsm(dst, src []byte) { - xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter, &c.buf, &c.len) -} - -// EXRL targets, DO NOT CALL! -func mvcSrcToBuf() -func mvcBufToDst() diff --git a/vendor/golang.org/x/crypto/internal/poly1305/bits_compat.go b/vendor/golang.org/x/crypto/internal/poly1305/bits_compat.go new file mode 100644 index 000000000..45b5c966b --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/poly1305/bits_compat.go @@ -0,0 +1,40 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !go1.13 +// +build !go1.13 + +package poly1305 + +// Generic fallbacks for the math/bits intrinsics, copied from +// src/math/bits/bits.go. They were added in Go 1.12, but Add64 and Sum64 had +// variable time fallbacks until Go 1.13. + +func bitsAdd64(x, y, carry uint64) (sum, carryOut uint64) { + sum = x + y + carry + carryOut = ((x & y) | ((x | y) &^ sum)) >> 63 + return +} + +func bitsSub64(x, y, borrow uint64) (diff, borrowOut uint64) { + diff = x - y - borrow + borrowOut = ((^x & y) | (^(x ^ y) & diff)) >> 63 + return +} + +func bitsMul64(x, y uint64) (hi, lo uint64) { + const mask32 = 1<<32 - 1 + x0 := x & mask32 + x1 := x >> 32 + y0 := y & mask32 + y1 := y >> 32 + w0 := x0 * y0 + t := x1*y0 + w0>>32 + w1 := t & mask32 + w2 := t >> 32 + w1 += x0 * y1 + hi = x1*y1 + w2 + w1>>32 + lo = x * y + return +} diff --git a/vendor/golang.org/x/crypto/internal/poly1305/bits_go1.13.go b/vendor/golang.org/x/crypto/internal/poly1305/bits_go1.13.go new file mode 100644 index 000000000..ed52b3418 --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/poly1305/bits_go1.13.go @@ -0,0 +1,22 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.13 +// +build go1.13 + +package poly1305 + +import "math/bits" + +func bitsAdd64(x, y, carry uint64) (sum, carryOut uint64) { + return bits.Add64(x, y, carry) +} + +func bitsSub64(x, y, borrow uint64) (diff, borrowOut uint64) { + return bits.Sub64(x, y, borrow) +} + +func bitsMul64(x, y uint64) (hi, lo uint64) { + return bits.Mul64(x, y) +} diff --git a/vendor/golang.org/x/crypto/poly1305/mac_noasm.go b/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go similarity index 66% rename from vendor/golang.org/x/crypto/poly1305/mac_noasm.go rename to vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go index 8387d2999..f184b67d9 100644 --- a/vendor/golang.org/x/crypto/poly1305/mac_noasm.go +++ b/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go @@ -2,10 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !amd64 gccgo appengine +//go:build (!amd64 && !ppc64le && !s390x) || !gc || purego +// +build !amd64,!ppc64le,!s390x !gc purego package poly1305 type mac struct{ macGeneric } - -func newMAC(key *[32]byte) mac { return mac{newMACGeneric(key)} } diff --git a/vendor/golang.org/x/crypto/poly1305/poly1305.go b/vendor/golang.org/x/crypto/internal/poly1305/poly1305.go similarity index 75% rename from vendor/golang.org/x/crypto/poly1305/poly1305.go rename to vendor/golang.org/x/crypto/internal/poly1305/poly1305.go index d076a5623..4aaea810a 100644 --- a/vendor/golang.org/x/crypto/poly1305/poly1305.go +++ b/vendor/golang.org/x/crypto/internal/poly1305/poly1305.go @@ -15,15 +15,23 @@ // used with a fixed key in order to generate one-time keys from an nonce. // However, in this package AES isn't used and the one-time key is specified // directly. -package poly1305 // import "golang.org/x/crypto/poly1305" +package poly1305 import "crypto/subtle" // TagSize is the size, in bytes, of a poly1305 authenticator. const TagSize = 16 -// Verify returns true if mac is a valid authenticator for m with the given -// key. +// Sum generates an authenticator for msg using a one-time key and puts the +// 16-byte result into out. Authenticating two different messages with the same +// key allows an attacker to forge messages at will. +func Sum(out *[16]byte, m []byte, key *[32]byte) { + h := New(key) + h.Write(m) + h.Sum(out[:0]) +} + +// Verify returns true if mac is a valid authenticator for m with the given key. func Verify(mac *[16]byte, m []byte, key *[32]byte) bool { var tmp [16]byte Sum(&tmp, m, key) @@ -40,10 +48,9 @@ func Verify(mac *[16]byte, m []byte, key *[32]byte) bool { // two different messages with the same key allows an attacker // to forge messages at will. func New(key *[32]byte) *MAC { - return &MAC{ - mac: newMAC(key), - finalized: false, - } + m := &MAC{} + initialize(key, &m.macState) + return m } // MAC is an io.Writer computing an authentication tag @@ -52,7 +59,7 @@ func New(key *[32]byte) *MAC { // MAC cannot be used like common hash.Hash implementations, // because using a poly1305 key twice breaks its security. // Therefore writing data to a running MAC after calling -// Sum causes it to panic. +// Sum or Verify causes it to panic. type MAC struct { mac // platform-dependent implementation @@ -65,10 +72,10 @@ func (h *MAC) Size() int { return TagSize } // Write adds more data to the running message authentication code. // It never returns an error. // -// It must not be called after the first call of Sum. +// It must not be called after the first call of Sum or Verify. func (h *MAC) Write(p []byte) (n int, err error) { if h.finalized { - panic("poly1305: write to MAC after Sum") + panic("poly1305: write to MAC after Sum or Verify") } return h.mac.Write(p) } @@ -81,3 +88,12 @@ func (h *MAC) Sum(b []byte) []byte { h.finalized = true return append(b, mac[:]...) } + +// Verify returns whether the authenticator of all data written to +// the message authentication code matches the expected value. +func (h *MAC) Verify(expected []byte) bool { + var mac [TagSize]byte + h.mac.Sum(&mac) + h.finalized = true + return subtle.ConstantTimeCompare(expected, mac[:]) == 1 +} diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.go new file mode 100644 index 000000000..6d522333f --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.go @@ -0,0 +1,48 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build gc && !purego +// +build gc,!purego + +package poly1305 + +//go:noescape +func update(state *macState, msg []byte) + +// mac is a wrapper for macGeneric that redirects calls that would have gone to +// updateGeneric to update. +// +// Its Write and Sum methods are otherwise identical to the macGeneric ones, but +// using function pointers would carry a major performance cost. +type mac struct{ macGeneric } + +func (h *mac) Write(p []byte) (int, error) { + nn := len(p) + if h.offset > 0 { + n := copy(h.buffer[h.offset:], p) + if h.offset+n < TagSize { + h.offset += n + return nn, nil + } + p = p[n:] + h.offset = 0 + update(&h.macState, h.buffer[:]) + } + if n := len(p) - (len(p) % TagSize); n > 0 { + update(&h.macState, p[:n]) + p = p[n:] + } + if len(p) > 0 { + h.offset += copy(h.buffer[h.offset:], p) + } + return nn, nil +} + +func (h *mac) Sum(out *[16]byte) { + state := h.macState + if h.offset > 0 { + update(&state, h.buffer[:h.offset]) + } + finalize(out, &state.h, &state.s) +} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_amd64.s b/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s similarity index 74% rename from vendor/golang.org/x/crypto/poly1305/sum_amd64.s rename to vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s index 7d600f13c..1d74f0f88 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_amd64.s +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build amd64,!gccgo,!appengine +//go:build gc && !purego +// +build gc,!purego #include "textflag.h" @@ -54,10 +55,6 @@ ADCQ t3, h1; \ ADCQ $0, h2 -DATA ·poly1305Mask<>+0x00(SB)/8, $0x0FFFFFFC0FFFFFFF -DATA ·poly1305Mask<>+0x08(SB)/8, $0x0FFFFFFC0FFFFFFC -GLOBL ·poly1305Mask<>(SB), RODATA, $16 - // func update(state *[7]uint64, msg []byte) TEXT ·update(SB), $0-32 MOVQ state+0(FP), DI @@ -110,39 +107,3 @@ done: MOVQ R9, 8(DI) MOVQ R10, 16(DI) RET - -// func initialize(state *[7]uint64, key *[32]byte) -TEXT ·initialize(SB), $0-16 - MOVQ state+0(FP), DI - MOVQ key+8(FP), SI - - // state[0...7] is initialized with zero - MOVOU 0(SI), X0 - MOVOU 16(SI), X1 - MOVOU ·poly1305Mask<>(SB), X2 - PAND X2, X0 - MOVOU X0, 24(DI) - MOVOU X1, 40(DI) - RET - -// func finalize(tag *[TagSize]byte, state *[7]uint64) -TEXT ·finalize(SB), $0-16 - MOVQ tag+0(FP), DI - MOVQ state+8(FP), SI - - MOVQ 0(SI), AX - MOVQ 8(SI), BX - MOVQ 16(SI), CX - MOVQ AX, R8 - MOVQ BX, R9 - SUBQ $0xFFFFFFFFFFFFFFFB, AX - SBBQ $0xFFFFFFFFFFFFFFFF, BX - SBBQ $3, CX - CMOVQCS R8, AX - CMOVQCS R9, BX - ADDQ 40(SI), AX - ADCQ 48(SI), BX - - MOVQ AX, 0(DI) - MOVQ BX, 8(DI) - RET diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go new file mode 100644 index 000000000..c942a6590 --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go @@ -0,0 +1,310 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file provides the generic implementation of Sum and MAC. Other files +// might provide optimized assembly implementations of some of this code. + +package poly1305 + +import "encoding/binary" + +// Poly1305 [RFC 7539] is a relatively simple algorithm: the authentication tag +// for a 64 bytes message is approximately +// +// s + m[0:16] * r⁴ + m[16:32] * r³ + m[32:48] * r² + m[48:64] * r mod 2¹³⁰ - 5 +// +// for some secret r and s. It can be computed sequentially like +// +// for len(msg) > 0: +// h += read(msg, 16) +// h *= r +// h %= 2¹³⁰ - 5 +// return h + s +// +// All the complexity is about doing performant constant-time math on numbers +// larger than any available numeric type. + +func sumGeneric(out *[TagSize]byte, msg []byte, key *[32]byte) { + h := newMACGeneric(key) + h.Write(msg) + h.Sum(out) +} + +func newMACGeneric(key *[32]byte) macGeneric { + m := macGeneric{} + initialize(key, &m.macState) + return m +} + +// macState holds numbers in saturated 64-bit little-endian limbs. That is, +// the value of [x0, x1, x2] is x[0] + x[1] * 2⁶⁴ + x[2] * 2¹²⁸. +type macState struct { + // h is the main accumulator. It is to be interpreted modulo 2¹³⁰ - 5, but + // can grow larger during and after rounds. It must, however, remain below + // 2 * (2¹³⁰ - 5). + h [3]uint64 + // r and s are the private key components. + r [2]uint64 + s [2]uint64 +} + +type macGeneric struct { + macState + + buffer [TagSize]byte + offset int +} + +// Write splits the incoming message into TagSize chunks, and passes them to +// update. It buffers incomplete chunks. +func (h *macGeneric) Write(p []byte) (int, error) { + nn := len(p) + if h.offset > 0 { + n := copy(h.buffer[h.offset:], p) + if h.offset+n < TagSize { + h.offset += n + return nn, nil + } + p = p[n:] + h.offset = 0 + updateGeneric(&h.macState, h.buffer[:]) + } + if n := len(p) - (len(p) % TagSize); n > 0 { + updateGeneric(&h.macState, p[:n]) + p = p[n:] + } + if len(p) > 0 { + h.offset += copy(h.buffer[h.offset:], p) + } + return nn, nil +} + +// Sum flushes the last incomplete chunk from the buffer, if any, and generates +// the MAC output. It does not modify its state, in order to allow for multiple +// calls to Sum, even if no Write is allowed after Sum. +func (h *macGeneric) Sum(out *[TagSize]byte) { + state := h.macState + if h.offset > 0 { + updateGeneric(&state, h.buffer[:h.offset]) + } + finalize(out, &state.h, &state.s) +} + +// [rMask0, rMask1] is the specified Poly1305 clamping mask in little-endian. It +// clears some bits of the secret coefficient to make it possible to implement +// multiplication more efficiently. +const ( + rMask0 = 0x0FFFFFFC0FFFFFFF + rMask1 = 0x0FFFFFFC0FFFFFFC +) + +// initialize loads the 256-bit key into the two 128-bit secret values r and s. +func initialize(key *[32]byte, m *macState) { + m.r[0] = binary.LittleEndian.Uint64(key[0:8]) & rMask0 + m.r[1] = binary.LittleEndian.Uint64(key[8:16]) & rMask1 + m.s[0] = binary.LittleEndian.Uint64(key[16:24]) + m.s[1] = binary.LittleEndian.Uint64(key[24:32]) +} + +// uint128 holds a 128-bit number as two 64-bit limbs, for use with the +// bits.Mul64 and bits.Add64 intrinsics. +type uint128 struct { + lo, hi uint64 +} + +func mul64(a, b uint64) uint128 { + hi, lo := bitsMul64(a, b) + return uint128{lo, hi} +} + +func add128(a, b uint128) uint128 { + lo, c := bitsAdd64(a.lo, b.lo, 0) + hi, c := bitsAdd64(a.hi, b.hi, c) + if c != 0 { + panic("poly1305: unexpected overflow") + } + return uint128{lo, hi} +} + +func shiftRightBy2(a uint128) uint128 { + a.lo = a.lo>>2 | (a.hi&3)<<62 + a.hi = a.hi >> 2 + return a +} + +// updateGeneric absorbs msg into the state.h accumulator. For each chunk m of +// 128 bits of message, it computes +// +// h₊ = (h + m) * r mod 2¹³⁰ - 5 +// +// If the msg length is not a multiple of TagSize, it assumes the last +// incomplete chunk is the final one. +func updateGeneric(state *macState, msg []byte) { + h0, h1, h2 := state.h[0], state.h[1], state.h[2] + r0, r1 := state.r[0], state.r[1] + + for len(msg) > 0 { + var c uint64 + + // For the first step, h + m, we use a chain of bits.Add64 intrinsics. + // The resulting value of h might exceed 2¹³⁰ - 5, but will be partially + // reduced at the end of the multiplication below. + // + // The spec requires us to set a bit just above the message size, not to + // hide leading zeroes. For full chunks, that's 1 << 128, so we can just + // add 1 to the most significant (2¹²⁸) limb, h2. + if len(msg) >= TagSize { + h0, c = bitsAdd64(h0, binary.LittleEndian.Uint64(msg[0:8]), 0) + h1, c = bitsAdd64(h1, binary.LittleEndian.Uint64(msg[8:16]), c) + h2 += c + 1 + + msg = msg[TagSize:] + } else { + var buf [TagSize]byte + copy(buf[:], msg) + buf[len(msg)] = 1 + + h0, c = bitsAdd64(h0, binary.LittleEndian.Uint64(buf[0:8]), 0) + h1, c = bitsAdd64(h1, binary.LittleEndian.Uint64(buf[8:16]), c) + h2 += c + + msg = nil + } + + // Multiplication of big number limbs is similar to elementary school + // columnar multiplication. Instead of digits, there are 64-bit limbs. + // + // We are multiplying a 3 limbs number, h, by a 2 limbs number, r. + // + // h2 h1 h0 x + // r1 r0 = + // ---------------- + // h2r0 h1r0 h0r0 <-- individual 128-bit products + // + h2r1 h1r1 h0r1 + // ------------------------ + // m3 m2 m1 m0 <-- result in 128-bit overlapping limbs + // ------------------------ + // m3.hi m2.hi m1.hi m0.hi <-- carry propagation + // + m3.lo m2.lo m1.lo m0.lo + // ------------------------------- + // t4 t3 t2 t1 t0 <-- final result in 64-bit limbs + // + // The main difference from pen-and-paper multiplication is that we do + // carry propagation in a separate step, as if we wrote two digit sums + // at first (the 128-bit limbs), and then carried the tens all at once. + + h0r0 := mul64(h0, r0) + h1r0 := mul64(h1, r0) + h2r0 := mul64(h2, r0) + h0r1 := mul64(h0, r1) + h1r1 := mul64(h1, r1) + h2r1 := mul64(h2, r1) + + // Since h2 is known to be at most 7 (5 + 1 + 1), and r0 and r1 have their + // top 4 bits cleared by rMask{0,1}, we know that their product is not going + // to overflow 64 bits, so we can ignore the high part of the products. + // + // This also means that the product doesn't have a fifth limb (t4). + if h2r0.hi != 0 { + panic("poly1305: unexpected overflow") + } + if h2r1.hi != 0 { + panic("poly1305: unexpected overflow") + } + + m0 := h0r0 + m1 := add128(h1r0, h0r1) // These two additions don't overflow thanks again + m2 := add128(h2r0, h1r1) // to the 4 masked bits at the top of r0 and r1. + m3 := h2r1 + + t0 := m0.lo + t1, c := bitsAdd64(m1.lo, m0.hi, 0) + t2, c := bitsAdd64(m2.lo, m1.hi, c) + t3, _ := bitsAdd64(m3.lo, m2.hi, c) + + // Now we have the result as 4 64-bit limbs, and we need to reduce it + // modulo 2¹³⁰ - 5. The special shape of this Crandall prime lets us do + // a cheap partial reduction according to the reduction identity + // + // c * 2¹³⁰ + n = c * 5 + n mod 2¹³⁰ - 5 + // + // because 2¹³⁰ = 5 mod 2¹³⁰ - 5. Partial reduction since the result is + // likely to be larger than 2¹³⁰ - 5, but still small enough to fit the + // assumptions we make about h in the rest of the code. + // + // See also https://speakerdeck.com/gtank/engineering-prime-numbers?slide=23 + + // We split the final result at the 2¹³⁰ mark into h and cc, the carry. + // Note that the carry bits are effectively shifted left by 2, in other + // words, cc = c * 4 for the c in the reduction identity. + h0, h1, h2 = t0, t1, t2&maskLow2Bits + cc := uint128{t2 & maskNotLow2Bits, t3} + + // To add c * 5 to h, we first add cc = c * 4, and then add (cc >> 2) = c. + + h0, c = bitsAdd64(h0, cc.lo, 0) + h1, c = bitsAdd64(h1, cc.hi, c) + h2 += c + + cc = shiftRightBy2(cc) + + h0, c = bitsAdd64(h0, cc.lo, 0) + h1, c = bitsAdd64(h1, cc.hi, c) + h2 += c + + // h2 is at most 3 + 1 + 1 = 5, making the whole of h at most + // + // 5 * 2¹²⁸ + (2¹²⁸ - 1) = 6 * 2¹²⁸ - 1 + } + + state.h[0], state.h[1], state.h[2] = h0, h1, h2 +} + +const ( + maskLow2Bits uint64 = 0x0000000000000003 + maskNotLow2Bits uint64 = ^maskLow2Bits +) + +// select64 returns x if v == 1 and y if v == 0, in constant time. +func select64(v, x, y uint64) uint64 { return ^(v-1)&x | (v-1)&y } + +// [p0, p1, p2] is 2¹³⁰ - 5 in little endian order. +const ( + p0 = 0xFFFFFFFFFFFFFFFB + p1 = 0xFFFFFFFFFFFFFFFF + p2 = 0x0000000000000003 +) + +// finalize completes the modular reduction of h and computes +// +// out = h + s mod 2¹²⁸ +// +func finalize(out *[TagSize]byte, h *[3]uint64, s *[2]uint64) { + h0, h1, h2 := h[0], h[1], h[2] + + // After the partial reduction in updateGeneric, h might be more than + // 2¹³⁰ - 5, but will be less than 2 * (2¹³⁰ - 5). To complete the reduction + // in constant time, we compute t = h - (2¹³⁰ - 5), and select h as the + // result if the subtraction underflows, and t otherwise. + + hMinusP0, b := bitsSub64(h0, p0, 0) + hMinusP1, b := bitsSub64(h1, p1, b) + _, b = bitsSub64(h2, p2, b) + + // h = h if h < p else h - p + h0 = select64(b, h0, hMinusP0) + h1 = select64(b, h1, hMinusP1) + + // Finally, we compute the last Poly1305 step + // + // tag = h + s mod 2¹²⁸ + // + // by just doing a wide addition with the 128 low bits of h and discarding + // the overflow. + h0, c := bitsAdd64(h0, s[0], 0) + h1, _ = bitsAdd64(h1, s[1], c) + + binary.LittleEndian.PutUint64(out[0:8], h0) + binary.LittleEndian.PutUint64(out[8:16], h1) +} diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.go new file mode 100644 index 000000000..4a069941a --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.go @@ -0,0 +1,48 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build gc && !purego +// +build gc,!purego + +package poly1305 + +//go:noescape +func update(state *macState, msg []byte) + +// mac is a wrapper for macGeneric that redirects calls that would have gone to +// updateGeneric to update. +// +// Its Write and Sum methods are otherwise identical to the macGeneric ones, but +// using function pointers would carry a major performance cost. +type mac struct{ macGeneric } + +func (h *mac) Write(p []byte) (int, error) { + nn := len(p) + if h.offset > 0 { + n := copy(h.buffer[h.offset:], p) + if h.offset+n < TagSize { + h.offset += n + return nn, nil + } + p = p[n:] + h.offset = 0 + update(&h.macState, h.buffer[:]) + } + if n := len(p) - (len(p) % TagSize); n > 0 { + update(&h.macState, p[:n]) + p = p[n:] + } + if len(p) > 0 { + h.offset += copy(h.buffer[h.offset:], p) + } + return nn, nil +} + +func (h *mac) Sum(out *[16]byte) { + state := h.macState + if h.offset > 0 { + update(&state, h.buffer[:h.offset]) + } + finalize(out, &state.h, &state.s) +} diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s new file mode 100644 index 000000000..58422aad2 --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s @@ -0,0 +1,182 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build gc && !purego +// +build gc,!purego + +#include "textflag.h" + +// This was ported from the amd64 implementation. + +#define POLY1305_ADD(msg, h0, h1, h2, t0, t1, t2) \ + MOVD (msg), t0; \ + MOVD 8(msg), t1; \ + MOVD $1, t2; \ + ADDC t0, h0, h0; \ + ADDE t1, h1, h1; \ + ADDE t2, h2; \ + ADD $16, msg + +#define POLY1305_MUL(h0, h1, h2, r0, r1, t0, t1, t2, t3, t4, t5) \ + MULLD r0, h0, t0; \ + MULLD r0, h1, t4; \ + MULHDU r0, h0, t1; \ + MULHDU r0, h1, t5; \ + ADDC t4, t1, t1; \ + MULLD r0, h2, t2; \ + ADDZE t5; \ + MULHDU r1, h0, t4; \ + MULLD r1, h0, h0; \ + ADD t5, t2, t2; \ + ADDC h0, t1, t1; \ + MULLD h2, r1, t3; \ + ADDZE t4, h0; \ + MULHDU r1, h1, t5; \ + MULLD r1, h1, t4; \ + ADDC t4, t2, t2; \ + ADDE t5, t3, t3; \ + ADDC h0, t2, t2; \ + MOVD $-4, t4; \ + MOVD t0, h0; \ + MOVD t1, h1; \ + ADDZE t3; \ + ANDCC $3, t2, h2; \ + AND t2, t4, t0; \ + ADDC t0, h0, h0; \ + ADDE t3, h1, h1; \ + SLD $62, t3, t4; \ + SRD $2, t2; \ + ADDZE h2; \ + OR t4, t2, t2; \ + SRD $2, t3; \ + ADDC t2, h0, h0; \ + ADDE t3, h1, h1; \ + ADDZE h2 + +DATA ·poly1305Mask<>+0x00(SB)/8, $0x0FFFFFFC0FFFFFFF +DATA ·poly1305Mask<>+0x08(SB)/8, $0x0FFFFFFC0FFFFFFC +GLOBL ·poly1305Mask<>(SB), RODATA, $16 + +// func update(state *[7]uint64, msg []byte) +TEXT ·update(SB), $0-32 + MOVD state+0(FP), R3 + MOVD msg_base+8(FP), R4 + MOVD msg_len+16(FP), R5 + + MOVD 0(R3), R8 // h0 + MOVD 8(R3), R9 // h1 + MOVD 16(R3), R10 // h2 + MOVD 24(R3), R11 // r0 + MOVD 32(R3), R12 // r1 + + CMP R5, $16 + BLT bytes_between_0_and_15 + +loop: + POLY1305_ADD(R4, R8, R9, R10, R20, R21, R22) + +multiply: + POLY1305_MUL(R8, R9, R10, R11, R12, R16, R17, R18, R14, R20, R21) + ADD $-16, R5 + CMP R5, $16 + BGE loop + +bytes_between_0_and_15: + CMP R5, $0 + BEQ done + MOVD $0, R16 // h0 + MOVD $0, R17 // h1 + +flush_buffer: + CMP R5, $8 + BLE just1 + + MOVD $8, R21 + SUB R21, R5, R21 + + // Greater than 8 -- load the rightmost remaining bytes in msg + // and put into R17 (h1) + MOVD (R4)(R21), R17 + MOVD $16, R22 + + // Find the offset to those bytes + SUB R5, R22, R22 + SLD $3, R22 + + // Shift to get only the bytes in msg + SRD R22, R17, R17 + + // Put 1 at high end + MOVD $1, R23 + SLD $3, R21 + SLD R21, R23, R23 + OR R23, R17, R17 + + // Remainder is 8 + MOVD $8, R5 + +just1: + CMP R5, $8 + BLT less8 + + // Exactly 8 + MOVD (R4), R16 + + CMP R17, $0 + + // Check if we've already set R17; if not + // set 1 to indicate end of msg. + BNE carry + MOVD $1, R17 + BR carry + +less8: + MOVD $0, R16 // h0 + MOVD $0, R22 // shift count + CMP R5, $4 + BLT less4 + MOVWZ (R4), R16 + ADD $4, R4 + ADD $-4, R5 + MOVD $32, R22 + +less4: + CMP R5, $2 + BLT less2 + MOVHZ (R4), R21 + SLD R22, R21, R21 + OR R16, R21, R16 + ADD $16, R22 + ADD $-2, R5 + ADD $2, R4 + +less2: + CMP R5, $0 + BEQ insert1 + MOVBZ (R4), R21 + SLD R22, R21, R21 + OR R16, R21, R16 + ADD $8, R22 + +insert1: + // Insert 1 at end of msg + MOVD $1, R21 + SLD R22, R21, R21 + OR R16, R21, R16 + +carry: + // Add new values to h0, h1, h2 + ADDC R16, R8 + ADDE R17, R9 + ADDZE R10, R10 + MOVD $16, R5 + ADD R5, R4 + BR multiply + +done: + // Save h0, h1, h2 in state + MOVD R8, 0(R3) + MOVD R9, 8(R3) + MOVD R10, 16(R3) + RET diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.go new file mode 100644 index 000000000..62cc9f847 --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.go @@ -0,0 +1,76 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build gc && !purego +// +build gc,!purego + +package poly1305 + +import ( + "golang.org/x/sys/cpu" +) + +// updateVX is an assembly implementation of Poly1305 that uses vector +// instructions. It must only be called if the vector facility (vx) is +// available. +//go:noescape +func updateVX(state *macState, msg []byte) + +// mac is a replacement for macGeneric that uses a larger buffer and redirects +// calls that would have gone to updateGeneric to updateVX if the vector +// facility is installed. +// +// A larger buffer is required for good performance because the vector +// implementation has a higher fixed cost per call than the generic +// implementation. +type mac struct { + macState + + buffer [16 * TagSize]byte // size must be a multiple of block size (16) + offset int +} + +func (h *mac) Write(p []byte) (int, error) { + nn := len(p) + if h.offset > 0 { + n := copy(h.buffer[h.offset:], p) + if h.offset+n < len(h.buffer) { + h.offset += n + return nn, nil + } + p = p[n:] + h.offset = 0 + if cpu.S390X.HasVX { + updateVX(&h.macState, h.buffer[:]) + } else { + updateGeneric(&h.macState, h.buffer[:]) + } + } + + tail := len(p) % len(h.buffer) // number of bytes to copy into buffer + body := len(p) - tail // number of bytes to process now + if body > 0 { + if cpu.S390X.HasVX { + updateVX(&h.macState, p[:body]) + } else { + updateGeneric(&h.macState, p[:body]) + } + } + h.offset = copy(h.buffer[:], p[body:]) // copy tail bytes - can be 0 + return nn, nil +} + +func (h *mac) Sum(out *[TagSize]byte) { + state := h.macState + remainder := h.buffer[:h.offset] + + // Use the generic implementation if we have 2 or fewer blocks left + // to sum. The vector implementation has a higher startup time. + if cpu.S390X.HasVX && len(remainder) > 2*TagSize { + updateVX(&state, remainder) + } else if len(remainder) > 0 { + updateGeneric(&state, remainder) + } + finalize(out, &state.h, &state.s) +} diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.s b/vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.s new file mode 100644 index 000000000..aa9e0494c --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.s @@ -0,0 +1,504 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build gc && !purego +// +build gc,!purego + +#include "textflag.h" + +// This implementation of Poly1305 uses the vector facility (vx) +// to process up to 2 blocks (32 bytes) per iteration using an +// algorithm based on the one described in: +// +// NEON crypto, Daniel J. Bernstein & Peter Schwabe +// https://cryptojedi.org/papers/neoncrypto-20120320.pdf +// +// This algorithm uses 5 26-bit limbs to represent a 130-bit +// value. These limbs are, for the most part, zero extended and +// placed into 64-bit vector register elements. Each vector +// register is 128-bits wide and so holds 2 of these elements. +// Using 26-bit limbs allows us plenty of headroom to accommodate +// accumulations before and after multiplication without +// overflowing either 32-bits (before multiplication) or 64-bits +// (after multiplication). +// +// In order to parallelise the operations required to calculate +// the sum we use two separate accumulators and then sum those +// in an extra final step. For compatibility with the generic +// implementation we perform this summation at the end of every +// updateVX call. +// +// To use two accumulators we must multiply the message blocks +// by r² rather than r. Only the final message block should be +// multiplied by r. +// +// Example: +// +// We want to calculate the sum (h) for a 64 byte message (m): +// +// h = m[0:16]r⁴ + m[16:32]r³ + m[32:48]r² + m[48:64]r +// +// To do this we split the calculation into the even indices +// and odd indices of the message. These form our SIMD 'lanes': +// +// h = m[ 0:16]r⁴ + m[32:48]r² + <- lane 0 +// m[16:32]r³ + m[48:64]r <- lane 1 +// +// To calculate this iteratively we refactor so that both lanes +// are written in terms of r² and r: +// +// h = (m[ 0:16]r² + m[32:48])r² + <- lane 0 +// (m[16:32]r² + m[48:64])r <- lane 1 +// ^ ^ +// | coefficients for second iteration +// coefficients for first iteration +// +// So in this case we would have two iterations. In the first +// both lanes are multiplied by r². In the second only the +// first lane is multiplied by r² and the second lane is +// instead multiplied by r. This gives use the odd and even +// powers of r that we need from the original equation. +// +// Notation: +// +// h - accumulator +// r - key +// m - message +// +// [a, b] - SIMD register holding two 64-bit values +// [a, b, c, d] - SIMD register holding four 32-bit values +// xᵢ[n] - limb n of variable x with bit width i +// +// Limbs are expressed in little endian order, so for 26-bit +// limbs x₂₆[4] will be the most significant limb and x₂₆[0] +// will be the least significant limb. + +// masking constants +#define MOD24 V0 // [0x0000000000ffffff, 0x0000000000ffffff] - mask low 24-bits +#define MOD26 V1 // [0x0000000003ffffff, 0x0000000003ffffff] - mask low 26-bits + +// expansion constants (see EXPAND macro) +#define EX0 V2 +#define EX1 V3 +#define EX2 V4 + +// key (r², r or 1 depending on context) +#define R_0 V5 +#define R_1 V6 +#define R_2 V7 +#define R_3 V8 +#define R_4 V9 + +// precalculated coefficients (5r², 5r or 0 depending on context) +#define R5_1 V10 +#define R5_2 V11 +#define R5_3 V12 +#define R5_4 V13 + +// message block (m) +#define M_0 V14 +#define M_1 V15 +#define M_2 V16 +#define M_3 V17 +#define M_4 V18 + +// accumulator (h) +#define H_0 V19 +#define H_1 V20 +#define H_2 V21 +#define H_3 V22 +#define H_4 V23 + +// temporary registers (for short-lived values) +#define T_0 V24 +#define T_1 V25 +#define T_2 V26 +#define T_3 V27 +#define T_4 V28 + +GLOBL ·constants<>(SB), RODATA, $0x30 +// EX0 +DATA ·constants<>+0x00(SB)/8, $0x0006050403020100 +DATA ·constants<>+0x08(SB)/8, $0x1016151413121110 +// EX1 +DATA ·constants<>+0x10(SB)/8, $0x060c0b0a09080706 +DATA ·constants<>+0x18(SB)/8, $0x161c1b1a19181716 +// EX2 +DATA ·constants<>+0x20(SB)/8, $0x0d0d0d0d0d0f0e0d +DATA ·constants<>+0x28(SB)/8, $0x1d1d1d1d1d1f1e1d + +// MULTIPLY multiplies each lane of f and g, partially reduced +// modulo 2¹³⁰ - 5. The result, h, consists of partial products +// in each lane that need to be reduced further to produce the +// final result. +// +// h₁₃₀ = (f₁₃₀g₁₃₀) % 2¹³⁰ + (5f₁₃₀g₁₃₀) / 2¹³⁰ +// +// Note that the multiplication by 5 of the high bits is +// achieved by precalculating the multiplication of four of the +// g coefficients by 5. These are g51-g54. +#define MULTIPLY(f0, f1, f2, f3, f4, g0, g1, g2, g3, g4, g51, g52, g53, g54, h0, h1, h2, h3, h4) \ + VMLOF f0, g0, h0 \ + VMLOF f0, g3, h3 \ + VMLOF f0, g1, h1 \ + VMLOF f0, g4, h4 \ + VMLOF f0, g2, h2 \ + VMLOF f1, g54, T_0 \ + VMLOF f1, g2, T_3 \ + VMLOF f1, g0, T_1 \ + VMLOF f1, g3, T_4 \ + VMLOF f1, g1, T_2 \ + VMALOF f2, g53, h0, h0 \ + VMALOF f2, g1, h3, h3 \ + VMALOF f2, g54, h1, h1 \ + VMALOF f2, g2, h4, h4 \ + VMALOF f2, g0, h2, h2 \ + VMALOF f3, g52, T_0, T_0 \ + VMALOF f3, g0, T_3, T_3 \ + VMALOF f3, g53, T_1, T_1 \ + VMALOF f3, g1, T_4, T_4 \ + VMALOF f3, g54, T_2, T_2 \ + VMALOF f4, g51, h0, h0 \ + VMALOF f4, g54, h3, h3 \ + VMALOF f4, g52, h1, h1 \ + VMALOF f4, g0, h4, h4 \ + VMALOF f4, g53, h2, h2 \ + VAG T_0, h0, h0 \ + VAG T_3, h3, h3 \ + VAG T_1, h1, h1 \ + VAG T_4, h4, h4 \ + VAG T_2, h2, h2 + +// REDUCE performs the following carry operations in four +// stages, as specified in Bernstein & Schwabe: +// +// 1: h₂₆[0]->h₂₆[1] h₂₆[3]->h₂₆[4] +// 2: h₂₆[1]->h₂₆[2] h₂₆[4]->h₂₆[0] +// 3: h₂₆[0]->h₂₆[1] h₂₆[2]->h₂₆[3] +// 4: h₂₆[3]->h₂₆[4] +// +// The result is that all of the limbs are limited to 26-bits +// except for h₂₆[1] and h₂₆[4] which are limited to 27-bits. +// +// Note that although each limb is aligned at 26-bit intervals +// they may contain values that exceed 2²⁶ - 1, hence the need +// to carry the excess bits in each limb. +#define REDUCE(h0, h1, h2, h3, h4) \ + VESRLG $26, h0, T_0 \ + VESRLG $26, h3, T_1 \ + VN MOD26, h0, h0 \ + VN MOD26, h3, h3 \ + VAG T_0, h1, h1 \ + VAG T_1, h4, h4 \ + VESRLG $26, h1, T_2 \ + VESRLG $26, h4, T_3 \ + VN MOD26, h1, h1 \ + VN MOD26, h4, h4 \ + VESLG $2, T_3, T_4 \ + VAG T_3, T_4, T_4 \ + VAG T_2, h2, h2 \ + VAG T_4, h0, h0 \ + VESRLG $26, h2, T_0 \ + VESRLG $26, h0, T_1 \ + VN MOD26, h2, h2 \ + VN MOD26, h0, h0 \ + VAG T_0, h3, h3 \ + VAG T_1, h1, h1 \ + VESRLG $26, h3, T_2 \ + VN MOD26, h3, h3 \ + VAG T_2, h4, h4 + +// EXPAND splits the 128-bit little-endian values in0 and in1 +// into 26-bit big-endian limbs and places the results into +// the first and second lane of d₂₆[0:4] respectively. +// +// The EX0, EX1 and EX2 constants are arrays of byte indices +// for permutation. The permutation both reverses the bytes +// in the input and ensures the bytes are copied into the +// destination limb ready to be shifted into their final +// position. +#define EXPAND(in0, in1, d0, d1, d2, d3, d4) \ + VPERM in0, in1, EX0, d0 \ + VPERM in0, in1, EX1, d2 \ + VPERM in0, in1, EX2, d4 \ + VESRLG $26, d0, d1 \ + VESRLG $30, d2, d3 \ + VESRLG $4, d2, d2 \ + VN MOD26, d0, d0 \ // [in0₂₆[0], in1₂₆[0]] + VN MOD26, d3, d3 \ // [in0₂₆[3], in1₂₆[3]] + VN MOD26, d1, d1 \ // [in0₂₆[1], in1₂₆[1]] + VN MOD24, d4, d4 \ // [in0₂₆[4], in1₂₆[4]] + VN MOD26, d2, d2 // [in0₂₆[2], in1₂₆[2]] + +// func updateVX(state *macState, msg []byte) +TEXT ·updateVX(SB), NOSPLIT, $0 + MOVD state+0(FP), R1 + LMG msg+8(FP), R2, R3 // R2=msg_base, R3=msg_len + + // load EX0, EX1 and EX2 + MOVD $·constants<>(SB), R5 + VLM (R5), EX0, EX2 + + // generate masks + VGMG $(64-24), $63, MOD24 // [0x00ffffff, 0x00ffffff] + VGMG $(64-26), $63, MOD26 // [0x03ffffff, 0x03ffffff] + + // load h (accumulator) and r (key) from state + VZERO T_1 // [0, 0] + VL 0(R1), T_0 // [h₆₄[0], h₆₄[1]] + VLEG $0, 16(R1), T_1 // [h₆₄[2], 0] + VL 24(R1), T_2 // [r₆₄[0], r₆₄[1]] + VPDI $0, T_0, T_2, T_3 // [h₆₄[0], r₆₄[0]] + VPDI $5, T_0, T_2, T_4 // [h₆₄[1], r₆₄[1]] + + // unpack h and r into 26-bit limbs + // note: h₆₄[2] may have the low 3 bits set, so h₂₆[4] is a 27-bit value + VN MOD26, T_3, H_0 // [h₂₆[0], r₂₆[0]] + VZERO H_1 // [0, 0] + VZERO H_3 // [0, 0] + VGMG $(64-12-14), $(63-12), T_0 // [0x03fff000, 0x03fff000] - 26-bit mask with low 12 bits masked out + VESLG $24, T_1, T_1 // [h₆₄[2]<<24, 0] + VERIMG $-26&63, T_3, MOD26, H_1 // [h₂₆[1], r₂₆[1]] + VESRLG $+52&63, T_3, H_2 // [h₂₆[2], r₂₆[2]] - low 12 bits only + VERIMG $-14&63, T_4, MOD26, H_3 // [h₂₆[1], r₂₆[1]] + VESRLG $40, T_4, H_4 // [h₂₆[4], r₂₆[4]] - low 24 bits only + VERIMG $+12&63, T_4, T_0, H_2 // [h₂₆[2], r₂₆[2]] - complete + VO T_1, H_4, H_4 // [h₂₆[4], r₂₆[4]] - complete + + // replicate r across all 4 vector elements + VREPF $3, H_0, R_0 // [r₂₆[0], r₂₆[0], r₂₆[0], r₂₆[0]] + VREPF $3, H_1, R_1 // [r₂₆[1], r₂₆[1], r₂₆[1], r₂₆[1]] + VREPF $3, H_2, R_2 // [r₂₆[2], r₂₆[2], r₂₆[2], r₂₆[2]] + VREPF $3, H_3, R_3 // [r₂₆[3], r₂₆[3], r₂₆[3], r₂₆[3]] + VREPF $3, H_4, R_4 // [r₂₆[4], r₂₆[4], r₂₆[4], r₂₆[4]] + + // zero out lane 1 of h + VLEIG $1, $0, H_0 // [h₂₆[0], 0] + VLEIG $1, $0, H_1 // [h₂₆[1], 0] + VLEIG $1, $0, H_2 // [h₂₆[2], 0] + VLEIG $1, $0, H_3 // [h₂₆[3], 0] + VLEIG $1, $0, H_4 // [h₂₆[4], 0] + + // calculate 5r (ignore least significant limb) + VREPIF $5, T_0 + VMLF T_0, R_1, R5_1 // [5r₂₆[1], 5r₂₆[1], 5r₂₆[1], 5r₂₆[1]] + VMLF T_0, R_2, R5_2 // [5r₂₆[2], 5r₂₆[2], 5r₂₆[2], 5r₂₆[2]] + VMLF T_0, R_3, R5_3 // [5r₂₆[3], 5r₂₆[3], 5r₂₆[3], 5r₂₆[3]] + VMLF T_0, R_4, R5_4 // [5r₂₆[4], 5r₂₆[4], 5r₂₆[4], 5r₂₆[4]] + + // skip r² calculation if we are only calculating one block + CMPBLE R3, $16, skip + + // calculate r² + MULTIPLY(R_0, R_1, R_2, R_3, R_4, R_0, R_1, R_2, R_3, R_4, R5_1, R5_2, R5_3, R5_4, M_0, M_1, M_2, M_3, M_4) + REDUCE(M_0, M_1, M_2, M_3, M_4) + VGBM $0x0f0f, T_0 + VERIMG $0, M_0, T_0, R_0 // [r₂₆[0], r²₂₆[0], r₂₆[0], r²₂₆[0]] + VERIMG $0, M_1, T_0, R_1 // [r₂₆[1], r²₂₆[1], r₂₆[1], r²₂₆[1]] + VERIMG $0, M_2, T_0, R_2 // [r₂₆[2], r²₂₆[2], r₂₆[2], r²₂₆[2]] + VERIMG $0, M_3, T_0, R_3 // [r₂₆[3], r²₂₆[3], r₂₆[3], r²₂₆[3]] + VERIMG $0, M_4, T_0, R_4 // [r₂₆[4], r²₂₆[4], r₂₆[4], r²₂₆[4]] + + // calculate 5r² (ignore least significant limb) + VREPIF $5, T_0 + VMLF T_0, R_1, R5_1 // [5r₂₆[1], 5r²₂₆[1], 5r₂₆[1], 5r²₂₆[1]] + VMLF T_0, R_2, R5_2 // [5r₂₆[2], 5r²₂₆[2], 5r₂₆[2], 5r²₂₆[2]] + VMLF T_0, R_3, R5_3 // [5r₂₆[3], 5r²₂₆[3], 5r₂₆[3], 5r²₂₆[3]] + VMLF T_0, R_4, R5_4 // [5r₂₆[4], 5r²₂₆[4], 5r₂₆[4], 5r²₂₆[4]] + +loop: + CMPBLE R3, $32, b2 // 2 or fewer blocks remaining, need to change key coefficients + + // load next 2 blocks from message + VLM (R2), T_0, T_1 + + // update message slice + SUB $32, R3 + MOVD $32(R2), R2 + + // unpack message blocks into 26-bit big-endian limbs + EXPAND(T_0, T_1, M_0, M_1, M_2, M_3, M_4) + + // add 2¹²⁸ to each message block value + VLEIB $4, $1, M_4 + VLEIB $12, $1, M_4 + +multiply: + // accumulate the incoming message + VAG H_0, M_0, M_0 + VAG H_3, M_3, M_3 + VAG H_1, M_1, M_1 + VAG H_4, M_4, M_4 + VAG H_2, M_2, M_2 + + // multiply the accumulator by the key coefficient + MULTIPLY(M_0, M_1, M_2, M_3, M_4, R_0, R_1, R_2, R_3, R_4, R5_1, R5_2, R5_3, R5_4, H_0, H_1, H_2, H_3, H_4) + + // carry and partially reduce the partial products + REDUCE(H_0, H_1, H_2, H_3, H_4) + + CMPBNE R3, $0, loop + +finish: + // sum lane 0 and lane 1 and put the result in lane 1 + VZERO T_0 + VSUMQG H_0, T_0, H_0 + VSUMQG H_3, T_0, H_3 + VSUMQG H_1, T_0, H_1 + VSUMQG H_4, T_0, H_4 + VSUMQG H_2, T_0, H_2 + + // reduce again after summation + // TODO(mundaym): there might be a more efficient way to do this + // now that we only have 1 active lane. For example, we could + // simultaneously pack the values as we reduce them. + REDUCE(H_0, H_1, H_2, H_3, H_4) + + // carry h[1] through to h[4] so that only h[4] can exceed 2²⁶ - 1 + // TODO(mundaym): in testing this final carry was unnecessary. + // Needs a proof before it can be removed though. + VESRLG $26, H_1, T_1 + VN MOD26, H_1, H_1 + VAQ T_1, H_2, H_2 + VESRLG $26, H_2, T_2 + VN MOD26, H_2, H_2 + VAQ T_2, H_3, H_3 + VESRLG $26, H_3, T_3 + VN MOD26, H_3, H_3 + VAQ T_3, H_4, H_4 + + // h is now < 2(2¹³⁰ - 5) + // Pack each lane in h₂₆[0:4] into h₁₂₈[0:1]. + VESLG $26, H_1, H_1 + VESLG $26, H_3, H_3 + VO H_0, H_1, H_0 + VO H_2, H_3, H_2 + VESLG $4, H_2, H_2 + VLEIB $7, $48, H_1 + VSLB H_1, H_2, H_2 + VO H_0, H_2, H_0 + VLEIB $7, $104, H_1 + VSLB H_1, H_4, H_3 + VO H_3, H_0, H_0 + VLEIB $7, $24, H_1 + VSRLB H_1, H_4, H_1 + + // update state + VSTEG $1, H_0, 0(R1) + VSTEG $0, H_0, 8(R1) + VSTEG $1, H_1, 16(R1) + RET + +b2: // 2 or fewer blocks remaining + CMPBLE R3, $16, b1 + + // Load the 2 remaining blocks (17-32 bytes remaining). + MOVD $-17(R3), R0 // index of final byte to load modulo 16 + VL (R2), T_0 // load full 16 byte block + VLL R0, 16(R2), T_1 // load final (possibly partial) block and pad with zeros to 16 bytes + + // The Poly1305 algorithm requires that a 1 bit be appended to + // each message block. If the final block is less than 16 bytes + // long then it is easiest to insert the 1 before the message + // block is split into 26-bit limbs. If, on the other hand, the + // final message block is 16 bytes long then we append the 1 bit + // after expansion as normal. + MOVBZ $1, R0 + MOVD $-16(R3), R3 // index of byte in last block to insert 1 at (could be 16) + CMPBEQ R3, $16, 2(PC) // skip the insertion if the final block is 16 bytes long + VLVGB R3, R0, T_1 // insert 1 into the byte at index R3 + + // Split both blocks into 26-bit limbs in the appropriate lanes. + EXPAND(T_0, T_1, M_0, M_1, M_2, M_3, M_4) + + // Append a 1 byte to the end of the second to last block. + VLEIB $4, $1, M_4 + + // Append a 1 byte to the end of the last block only if it is a + // full 16 byte block. + CMPBNE R3, $16, 2(PC) + VLEIB $12, $1, M_4 + + // Finally, set up the coefficients for the final multiplication. + // We have previously saved r and 5r in the 32-bit even indexes + // of the R_[0-4] and R5_[1-4] coefficient registers. + // + // We want lane 0 to be multiplied by r² so that can be kept the + // same. We want lane 1 to be multiplied by r so we need to move + // the saved r value into the 32-bit odd index in lane 1 by + // rotating the 64-bit lane by 32. + VGBM $0x00ff, T_0 // [0, 0xffffffffffffffff] - mask lane 1 only + VERIMG $32, R_0, T_0, R_0 // [_, r²₂₆[0], _, r₂₆[0]] + VERIMG $32, R_1, T_0, R_1 // [_, r²₂₆[1], _, r₂₆[1]] + VERIMG $32, R_2, T_0, R_2 // [_, r²₂₆[2], _, r₂₆[2]] + VERIMG $32, R_3, T_0, R_3 // [_, r²₂₆[3], _, r₂₆[3]] + VERIMG $32, R_4, T_0, R_4 // [_, r²₂₆[4], _, r₂₆[4]] + VERIMG $32, R5_1, T_0, R5_1 // [_, 5r²₂₆[1], _, 5r₂₆[1]] + VERIMG $32, R5_2, T_0, R5_2 // [_, 5r²₂₆[2], _, 5r₂₆[2]] + VERIMG $32, R5_3, T_0, R5_3 // [_, 5r²₂₆[3], _, 5r₂₆[3]] + VERIMG $32, R5_4, T_0, R5_4 // [_, 5r²₂₆[4], _, 5r₂₆[4]] + + MOVD $0, R3 + BR multiply + +skip: + CMPBEQ R3, $0, finish + +b1: // 1 block remaining + + // Load the final block (1-16 bytes). This will be placed into + // lane 0. + MOVD $-1(R3), R0 + VLL R0, (R2), T_0 // pad to 16 bytes with zeros + + // The Poly1305 algorithm requires that a 1 bit be appended to + // each message block. If the final block is less than 16 bytes + // long then it is easiest to insert the 1 before the message + // block is split into 26-bit limbs. If, on the other hand, the + // final message block is 16 bytes long then we append the 1 bit + // after expansion as normal. + MOVBZ $1, R0 + CMPBEQ R3, $16, 2(PC) + VLVGB R3, R0, T_0 + + // Set the message block in lane 1 to the value 0 so that it + // can be accumulated without affecting the final result. + VZERO T_1 + + // Split the final message block into 26-bit limbs in lane 0. + // Lane 1 will be contain 0. + EXPAND(T_0, T_1, M_0, M_1, M_2, M_3, M_4) + + // Append a 1 byte to the end of the last block only if it is a + // full 16 byte block. + CMPBNE R3, $16, 2(PC) + VLEIB $4, $1, M_4 + + // We have previously saved r and 5r in the 32-bit even indexes + // of the R_[0-4] and R5_[1-4] coefficient registers. + // + // We want lane 0 to be multiplied by r so we need to move the + // saved r value into the 32-bit odd index in lane 0. We want + // lane 1 to be set to the value 1. This makes multiplication + // a no-op. We do this by setting lane 1 in every register to 0 + // and then just setting the 32-bit index 3 in R_0 to 1. + VZERO T_0 + MOVD $0, R0 + MOVD $0x10111213, R12 + VLVGP R12, R0, T_1 // [_, 0x10111213, _, 0x00000000] + VPERM T_0, R_0, T_1, R_0 // [_, r₂₆[0], _, 0] + VPERM T_0, R_1, T_1, R_1 // [_, r₂₆[1], _, 0] + VPERM T_0, R_2, T_1, R_2 // [_, r₂₆[2], _, 0] + VPERM T_0, R_3, T_1, R_3 // [_, r₂₆[3], _, 0] + VPERM T_0, R_4, T_1, R_4 // [_, r₂₆[4], _, 0] + VPERM T_0, R5_1, T_1, R5_1 // [_, 5r₂₆[1], _, 0] + VPERM T_0, R5_2, T_1, R5_2 // [_, 5r₂₆[2], _, 0] + VPERM T_0, R5_3, T_1, R5_3 // [_, 5r₂₆[3], _, 0] + VPERM T_0, R5_4, T_1, R5_4 // [_, 5r₂₆[4], _, 0] + + // Set the value of lane 1 to be 1. + VLEIF $3, $1, R_0 // [_, r₂₆[0], _, 1] + + MOVD $0, R3 + BR multiply diff --git a/vendor/golang.org/x/crypto/internal/subtle/aliasing.go b/vendor/golang.org/x/crypto/internal/subtle/aliasing.go index f38797bfa..4fad24f8d 100644 --- a/vendor/golang.org/x/crypto/internal/subtle/aliasing.go +++ b/vendor/golang.org/x/crypto/internal/subtle/aliasing.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !appengine +//go:build !purego +// +build !purego // Package subtle implements functions that are often useful in cryptographic // code but require careful thought to use correctly. diff --git a/vendor/golang.org/x/crypto/internal/subtle/aliasing_appengine.go b/vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go similarity index 97% rename from vendor/golang.org/x/crypto/internal/subtle/aliasing_appengine.go rename to vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go index 0cc4a8a64..80ccbed2c 100644 --- a/vendor/golang.org/x/crypto/internal/subtle/aliasing_appengine.go +++ b/vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build appengine +//go:build purego +// +build purego // Package subtle implements functions that are often useful in cryptographic // code but require careful thought to use correctly. diff --git a/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go b/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go index a98d1bd45..a2973e626 100644 --- a/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go +++ b/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go @@ -35,8 +35,8 @@ This package is interoperable with NaCl: https://nacl.cr.yp.to/secretbox.html. package secretbox // import "golang.org/x/crypto/nacl/secretbox" import ( + "golang.org/x/crypto/internal/poly1305" "golang.org/x/crypto/internal/subtle" - "golang.org/x/crypto/poly1305" "golang.org/x/crypto/salsa20/salsa" ) diff --git a/vendor/golang.org/x/crypto/openpgp/armor/armor.go b/vendor/golang.org/x/crypto/openpgp/armor/armor.go index 592d18643..ebc87876e 100644 --- a/vendor/golang.org/x/crypto/openpgp/armor/armor.go +++ b/vendor/golang.org/x/crypto/openpgp/armor/armor.go @@ -4,6 +4,12 @@ // Package armor implements OpenPGP ASCII Armor, see RFC 4880. OpenPGP Armor is // very similar to PEM except that it has an additional CRC checksum. +// +// Deprecated: this package is unmaintained except for security fixes. New +// applications should consider a more focused, modern alternative to OpenPGP +// for their specific task. If you are required to interoperate with OpenPGP +// systems and need a maintained package, consider a community fork. +// See https://golang.org/issue/44226. package armor // import "golang.org/x/crypto/openpgp/armor" import ( @@ -62,10 +68,11 @@ var armorEndOfLine = []byte("-----") // lineReader wraps a line based reader. It watches for the end of an armor // block and records the expected CRC value. type lineReader struct { - in *bufio.Reader - buf []byte - eof bool - crc uint32 + in *bufio.Reader + buf []byte + eof bool + crc uint32 + crcSet bool } func (l *lineReader) Read(p []byte) (n int, err error) { @@ -87,6 +94,11 @@ func (l *lineReader) Read(p []byte) (n int, err error) { return 0, ArmorCorrupt } + if bytes.HasPrefix(line, armorEnd) { + l.eof = true + return 0, io.EOF + } + if len(line) == 5 && line[0] == '=' { // This is the checksum line var expectedBytes [3]byte @@ -108,6 +120,7 @@ func (l *lineReader) Read(p []byte) (n int, err error) { } l.eof = true + l.crcSet = true return 0, io.EOF } @@ -141,10 +154,8 @@ func (r *openpgpReader) Read(p []byte) (n int, err error) { n, err = r.b64Reader.Read(p) r.currentCRC = crc24(r.currentCRC, p[:n]) - if err == io.EOF { - if r.lReader.crc != uint32(r.currentCRC&crc24Mask) { - return 0, ArmorCorrupt - } + if err == io.EOF && r.lReader.crcSet && r.lReader.crc != uint32(r.currentCRC&crc24Mask) { + return 0, ArmorCorrupt } return diff --git a/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go b/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go index 73f4fe378..84396a089 100644 --- a/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go +++ b/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go @@ -10,6 +10,12 @@ // This form of ElGamal embeds PKCS#1 v1.5 padding, which may make it // unsuitable for other protocols. RSA should be used in preference in any // case. +// +// Deprecated: this package was only provided to support ElGamal encryption in +// OpenPGP. The golang.org/x/crypto/openpgp package is now deprecated (see +// https://golang.org/issue/44226), and ElGamal in the OpenPGP ecosystem has +// compatibility and security issues (see https://eprint.iacr.org/2021/923). +// Moreover, this package doesn't protect against side-channel attacks. package elgamal // import "golang.org/x/crypto/openpgp/elgamal" import ( @@ -76,7 +82,9 @@ func Encrypt(random io.Reader, pub *PublicKey, msg []byte) (c1, c2 *big.Int, err // Bleichenbacher, Advances in Cryptology (Crypto '98), func Decrypt(priv *PrivateKey, c1, c2 *big.Int) (msg []byte, err error) { s := new(big.Int).Exp(c1, priv.X, priv.P) - s.ModInverse(s, priv.P) + if s.ModInverse(s, priv.P) == nil { + return nil, errors.New("elgamal: invalid private key") + } s.Mul(s, c2) s.Mod(s, priv.P) em := s.Bytes() diff --git a/vendor/golang.org/x/crypto/openpgp/errors/errors.go b/vendor/golang.org/x/crypto/openpgp/errors/errors.go index eb0550b2d..1d7a0ea05 100644 --- a/vendor/golang.org/x/crypto/openpgp/errors/errors.go +++ b/vendor/golang.org/x/crypto/openpgp/errors/errors.go @@ -3,6 +3,12 @@ // license that can be found in the LICENSE file. // Package errors contains common error types for the OpenPGP packages. +// +// Deprecated: this package is unmaintained except for security fixes. New +// applications should consider a more focused, modern alternative to OpenPGP +// for their specific task. If you are required to interoperate with OpenPGP +// systems and need a maintained package, consider a community fork. +// See https://golang.org/issue/44226. package errors // import "golang.org/x/crypto/openpgp/errors" import ( diff --git a/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go b/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go index 02b372cf3..6d7639722 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go @@ -5,6 +5,7 @@ package packet import ( + "crypto" "crypto/rsa" "encoding/binary" "io" @@ -78,8 +79,9 @@ func (e *EncryptedKey) Decrypt(priv *PrivateKey, config *Config) error { // padding oracle attacks. switch priv.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: - k := priv.PrivateKey.(*rsa.PrivateKey) - b, err = rsa.DecryptPKCS1v15(config.Random(), k, padToKeySize(&k.PublicKey, e.encryptedMPI1.bytes)) + // Supports both *rsa.PrivateKey and crypto.Decrypter + k := priv.PrivateKey.(crypto.Decrypter) + b, err = k.Decrypt(config.Random(), padToKeySize(k.Public().(*rsa.PublicKey), e.encryptedMPI1.bytes), nil) case PubKeyAlgoElGamal: c1 := new(big.Int).SetBytes(e.encryptedMPI1.bytes) c2 := new(big.Int).SetBytes(e.encryptedMPI2.bytes) diff --git a/vendor/golang.org/x/crypto/openpgp/packet/packet.go b/vendor/golang.org/x/crypto/openpgp/packet/packet.go index 5af64c542..0a19794a8 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/packet.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/packet.go @@ -4,6 +4,12 @@ // Package packet implements parsing and serialization of OpenPGP packets, as // specified in RFC 4880. +// +// Deprecated: this package is unmaintained except for security fixes. New +// applications should consider a more focused, modern alternative to OpenPGP +// for their specific task. If you are required to interoperate with OpenPGP +// systems and need a maintained package, consider a community fork. +// See https://golang.org/issue/44226. package packet // import "golang.org/x/crypto/openpgp/packet" import ( @@ -14,6 +20,7 @@ import ( "crypto/rsa" "io" "math/big" + "math/bits" "golang.org/x/crypto/cast5" "golang.org/x/crypto/openpgp/errors" @@ -100,33 +107,65 @@ func (r *partialLengthReader) Read(p []byte) (n int, err error) { type partialLengthWriter struct { w io.WriteCloser lengthByte [1]byte + sentFirst bool + buf []byte } +// RFC 4880 4.2.2.4: the first partial length MUST be at least 512 octets long. +const minFirstPartialWrite = 512 + func (w *partialLengthWriter) Write(p []byte) (n int, err error) { + off := 0 + if !w.sentFirst { + if len(w.buf) > 0 || len(p) < minFirstPartialWrite { + off = len(w.buf) + w.buf = append(w.buf, p...) + if len(w.buf) < minFirstPartialWrite { + return len(p), nil + } + p = w.buf + w.buf = nil + } + w.sentFirst = true + } + + power := uint8(30) for len(p) > 0 { - for power := uint(14); power < 32; power-- { - l := 1 << power - if len(p) >= l { - w.lengthByte[0] = 224 + uint8(power) - _, err = w.w.Write(w.lengthByte[:]) - if err != nil { - return - } - var m int - m, err = w.w.Write(p[:l]) - n += m - if err != nil { - return - } - p = p[l:] - break + l := 1 << power + if len(p) < l { + power = uint8(bits.Len32(uint32(len(p)))) - 1 + l = 1 << power + } + w.lengthByte[0] = 224 + power + _, err = w.w.Write(w.lengthByte[:]) + if err == nil { + var m int + m, err = w.w.Write(p[:l]) + n += m + } + if err != nil { + if n < off { + return 0, err } + return n - off, err } + p = p[l:] } - return + return n - off, nil } func (w *partialLengthWriter) Close() error { + if len(w.buf) > 0 { + // In this case we can't send a 512 byte packet. + // Just send what we have. + p := w.buf + w.sentFirst = true + w.buf = nil + if _, err := w.Write(p); err != nil { + return err + } + } + w.lengthByte[0] = 0 _, err := w.w.Write(w.lengthByte[:]) if err != nil { diff --git a/vendor/golang.org/x/crypto/openpgp/packet/private_key.go b/vendor/golang.org/x/crypto/openpgp/packet/private_key.go index 6f8ec0938..81abb7cef 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/private_key.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/private_key.go @@ -31,7 +31,7 @@ type PrivateKey struct { encryptedData []byte cipher CipherFunction s2k func(out, in []byte) - PrivateKey interface{} // An *{rsa|dsa|ecdsa}.PrivateKey or a crypto.Signer. + PrivateKey interface{} // An *{rsa|dsa|ecdsa}.PrivateKey or crypto.Signer/crypto.Decrypter (Decryptor RSA only). sha1Checksum bool iv []byte } diff --git a/vendor/golang.org/x/crypto/openpgp/read.go b/vendor/golang.org/x/crypto/openpgp/read.go index 6ec664f44..48a893146 100644 --- a/vendor/golang.org/x/crypto/openpgp/read.go +++ b/vendor/golang.org/x/crypto/openpgp/read.go @@ -3,6 +3,12 @@ // license that can be found in the LICENSE file. // Package openpgp implements high level operations on OpenPGP messages. +// +// Deprecated: this package is unmaintained except for security fixes. New +// applications should consider a more focused, modern alternative to OpenPGP +// for their specific task. If you are required to interoperate with OpenPGP +// systems and need a maintained package, consider a community fork. +// See https://golang.org/issue/44226. package openpgp // import "golang.org/x/crypto/openpgp" import ( diff --git a/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go b/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go index 4b9a44ca2..9de04958e 100644 --- a/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go +++ b/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go @@ -4,6 +4,12 @@ // Package s2k implements the various OpenPGP string-to-key transforms as // specified in RFC 4800 section 3.7.1. +// +// Deprecated: this package is unmaintained except for security fixes. New +// applications should consider a more focused, modern alternative to OpenPGP +// for their specific task. If you are required to interoperate with OpenPGP +// systems and need a maintained package, consider a community fork. +// See https://golang.org/issue/44226. package s2k // import "golang.org/x/crypto/openpgp/s2k" import ( diff --git a/vendor/golang.org/x/crypto/poly1305/sum_amd64.go b/vendor/golang.org/x/crypto/poly1305/sum_amd64.go deleted file mode 100644 index 2dbf42aa5..000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_amd64.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build amd64,!gccgo,!appengine - -package poly1305 - -//go:noescape -func initialize(state *[7]uint64, key *[32]byte) - -//go:noescape -func update(state *[7]uint64, msg []byte) - -//go:noescape -func finalize(tag *[TagSize]byte, state *[7]uint64) - -// Sum generates an authenticator for m using a one-time key and puts the -// 16-byte result into out. Authenticating two different messages with the same -// key allows an attacker to forge messages at will. -func Sum(out *[16]byte, m []byte, key *[32]byte) { - h := newMAC(key) - h.Write(m) - h.Sum(out) -} - -func newMAC(key *[32]byte) (h mac) { - initialize(&h.state, key) - return -} - -type mac struct { - state [7]uint64 // := uint64{ h0, h1, h2, r0, r1, pad0, pad1 } - - buffer [TagSize]byte - offset int -} - -func (h *mac) Write(p []byte) (n int, err error) { - n = len(p) - if h.offset > 0 { - remaining := TagSize - h.offset - if n < remaining { - h.offset += copy(h.buffer[h.offset:], p) - return n, nil - } - copy(h.buffer[h.offset:], p[:remaining]) - p = p[remaining:] - h.offset = 0 - update(&h.state, h.buffer[:]) - } - if nn := len(p) - (len(p) % TagSize); nn > 0 { - update(&h.state, p[:nn]) - p = p[nn:] - } - if len(p) > 0 { - h.offset += copy(h.buffer[h.offset:], p) - } - return n, nil -} - -func (h *mac) Sum(out *[16]byte) { - state := h.state - if h.offset > 0 { - update(&state, h.buffer[:h.offset]) - } - finalize(out, &state) -} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_arm.go b/vendor/golang.org/x/crypto/poly1305/sum_arm.go deleted file mode 100644 index 5dc321c2f..000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_arm.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build arm,!gccgo,!appengine,!nacl - -package poly1305 - -// This function is implemented in sum_arm.s -//go:noescape -func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]byte) - -// Sum generates an authenticator for m using a one-time key and puts the -// 16-byte result into out. Authenticating two different messages with the same -// key allows an attacker to forge messages at will. -func Sum(out *[16]byte, m []byte, key *[32]byte) { - var mPtr *byte - if len(m) > 0 { - mPtr = &m[0] - } - poly1305_auth_armv6(out, mPtr, uint32(len(m)), key) -} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_arm.s b/vendor/golang.org/x/crypto/poly1305/sum_arm.s deleted file mode 100644 index f70b4ac48..000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_arm.s +++ /dev/null @@ -1,427 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build arm,!gccgo,!appengine,!nacl - -#include "textflag.h" - -// This code was translated into a form compatible with 5a from the public -// domain source by Andrew Moon: github.com/floodyberry/poly1305-opt/blob/master/app/extensions/poly1305. - -DATA ·poly1305_init_constants_armv6<>+0x00(SB)/4, $0x3ffffff -DATA ·poly1305_init_constants_armv6<>+0x04(SB)/4, $0x3ffff03 -DATA ·poly1305_init_constants_armv6<>+0x08(SB)/4, $0x3ffc0ff -DATA ·poly1305_init_constants_armv6<>+0x0c(SB)/4, $0x3f03fff -DATA ·poly1305_init_constants_armv6<>+0x10(SB)/4, $0x00fffff -GLOBL ·poly1305_init_constants_armv6<>(SB), 8, $20 - -// Warning: the linker may use R11 to synthesize certain instructions. Please -// take care and verify that no synthetic instructions use it. - -TEXT poly1305_init_ext_armv6<>(SB), NOSPLIT, $0 - // Needs 16 bytes of stack and 64 bytes of space pointed to by R0. (It - // might look like it's only 60 bytes of space but the final four bytes - // will be written by another function.) We need to skip over four - // bytes of stack because that's saving the value of 'g'. - ADD $4, R13, R8 - MOVM.IB [R4-R7], (R8) - MOVM.IA.W (R1), [R2-R5] - MOVW $·poly1305_init_constants_armv6<>(SB), R7 - MOVW R2, R8 - MOVW R2>>26, R9 - MOVW R3>>20, g - MOVW R4>>14, R11 - MOVW R5>>8, R12 - ORR R3<<6, R9, R9 - ORR R4<<12, g, g - ORR R5<<18, R11, R11 - MOVM.IA (R7), [R2-R6] - AND R8, R2, R2 - AND R9, R3, R3 - AND g, R4, R4 - AND R11, R5, R5 - AND R12, R6, R6 - MOVM.IA.W [R2-R6], (R0) - EOR R2, R2, R2 - EOR R3, R3, R3 - EOR R4, R4, R4 - EOR R5, R5, R5 - EOR R6, R6, R6 - MOVM.IA.W [R2-R6], (R0) - MOVM.IA.W (R1), [R2-R5] - MOVM.IA [R2-R6], (R0) - ADD $20, R13, R0 - MOVM.DA (R0), [R4-R7] - RET - -#define MOVW_UNALIGNED(Rsrc, Rdst, Rtmp, offset) \ - MOVBU (offset+0)(Rsrc), Rtmp; \ - MOVBU Rtmp, (offset+0)(Rdst); \ - MOVBU (offset+1)(Rsrc), Rtmp; \ - MOVBU Rtmp, (offset+1)(Rdst); \ - MOVBU (offset+2)(Rsrc), Rtmp; \ - MOVBU Rtmp, (offset+2)(Rdst); \ - MOVBU (offset+3)(Rsrc), Rtmp; \ - MOVBU Rtmp, (offset+3)(Rdst) - -TEXT poly1305_blocks_armv6<>(SB), NOSPLIT, $0 - // Needs 24 bytes of stack for saved registers and then 88 bytes of - // scratch space after that. We assume that 24 bytes at (R13) have - // already been used: four bytes for the link register saved in the - // prelude of poly1305_auth_armv6, four bytes for saving the value of g - // in that function and 16 bytes of scratch space used around - // poly1305_finish_ext_armv6_skip1. - ADD $24, R13, R12 - MOVM.IB [R4-R8, R14], (R12) - MOVW R0, 88(R13) - MOVW R1, 92(R13) - MOVW R2, 96(R13) - MOVW R1, R14 - MOVW R2, R12 - MOVW 56(R0), R8 - WORD $0xe1180008 // TST R8, R8 not working see issue 5921 - EOR R6, R6, R6 - MOVW.EQ $(1<<24), R6 - MOVW R6, 84(R13) - ADD $116, R13, g - MOVM.IA (R0), [R0-R9] - MOVM.IA [R0-R4], (g) - CMP $16, R12 - BLO poly1305_blocks_armv6_done - -poly1305_blocks_armv6_mainloop: - WORD $0xe31e0003 // TST R14, #3 not working see issue 5921 - BEQ poly1305_blocks_armv6_mainloop_aligned - ADD $100, R13, g - MOVW_UNALIGNED(R14, g, R0, 0) - MOVW_UNALIGNED(R14, g, R0, 4) - MOVW_UNALIGNED(R14, g, R0, 8) - MOVW_UNALIGNED(R14, g, R0, 12) - MOVM.IA (g), [R0-R3] - ADD $16, R14 - B poly1305_blocks_armv6_mainloop_loaded - -poly1305_blocks_armv6_mainloop_aligned: - MOVM.IA.W (R14), [R0-R3] - -poly1305_blocks_armv6_mainloop_loaded: - MOVW R0>>26, g - MOVW R1>>20, R11 - MOVW R2>>14, R12 - MOVW R14, 92(R13) - MOVW R3>>8, R4 - ORR R1<<6, g, g - ORR R2<<12, R11, R11 - ORR R3<<18, R12, R12 - BIC $0xfc000000, R0, R0 - BIC $0xfc000000, g, g - MOVW 84(R13), R3 - BIC $0xfc000000, R11, R11 - BIC $0xfc000000, R12, R12 - ADD R0, R5, R5 - ADD g, R6, R6 - ORR R3, R4, R4 - ADD R11, R7, R7 - ADD $116, R13, R14 - ADD R12, R8, R8 - ADD R4, R9, R9 - MOVM.IA (R14), [R0-R4] - MULLU R4, R5, (R11, g) - MULLU R3, R5, (R14, R12) - MULALU R3, R6, (R11, g) - MULALU R2, R6, (R14, R12) - MULALU R2, R7, (R11, g) - MULALU R1, R7, (R14, R12) - ADD R4<<2, R4, R4 - ADD R3<<2, R3, R3 - MULALU R1, R8, (R11, g) - MULALU R0, R8, (R14, R12) - MULALU R0, R9, (R11, g) - MULALU R4, R9, (R14, R12) - MOVW g, 76(R13) - MOVW R11, 80(R13) - MOVW R12, 68(R13) - MOVW R14, 72(R13) - MULLU R2, R5, (R11, g) - MULLU R1, R5, (R14, R12) - MULALU R1, R6, (R11, g) - MULALU R0, R6, (R14, R12) - MULALU R0, R7, (R11, g) - MULALU R4, R7, (R14, R12) - ADD R2<<2, R2, R2 - ADD R1<<2, R1, R1 - MULALU R4, R8, (R11, g) - MULALU R3, R8, (R14, R12) - MULALU R3, R9, (R11, g) - MULALU R2, R9, (R14, R12) - MOVW g, 60(R13) - MOVW R11, 64(R13) - MOVW R12, 52(R13) - MOVW R14, 56(R13) - MULLU R0, R5, (R11, g) - MULALU R4, R6, (R11, g) - MULALU R3, R7, (R11, g) - MULALU R2, R8, (R11, g) - MULALU R1, R9, (R11, g) - ADD $52, R13, R0 - MOVM.IA (R0), [R0-R7] - MOVW g>>26, R12 - MOVW R4>>26, R14 - ORR R11<<6, R12, R12 - ORR R5<<6, R14, R14 - BIC $0xfc000000, g, g - BIC $0xfc000000, R4, R4 - ADD.S R12, R0, R0 - ADC $0, R1, R1 - ADD.S R14, R6, R6 - ADC $0, R7, R7 - MOVW R0>>26, R12 - MOVW R6>>26, R14 - ORR R1<<6, R12, R12 - ORR R7<<6, R14, R14 - BIC $0xfc000000, R0, R0 - BIC $0xfc000000, R6, R6 - ADD R14<<2, R14, R14 - ADD.S R12, R2, R2 - ADC $0, R3, R3 - ADD R14, g, g - MOVW R2>>26, R12 - MOVW g>>26, R14 - ORR R3<<6, R12, R12 - BIC $0xfc000000, g, R5 - BIC $0xfc000000, R2, R7 - ADD R12, R4, R4 - ADD R14, R0, R0 - MOVW R4>>26, R12 - BIC $0xfc000000, R4, R8 - ADD R12, R6, R9 - MOVW 96(R13), R12 - MOVW 92(R13), R14 - MOVW R0, R6 - CMP $32, R12 - SUB $16, R12, R12 - MOVW R12, 96(R13) - BHS poly1305_blocks_armv6_mainloop - -poly1305_blocks_armv6_done: - MOVW 88(R13), R12 - MOVW R5, 20(R12) - MOVW R6, 24(R12) - MOVW R7, 28(R12) - MOVW R8, 32(R12) - MOVW R9, 36(R12) - ADD $48, R13, R0 - MOVM.DA (R0), [R4-R8, R14] - RET - -#define MOVHUP_UNALIGNED(Rsrc, Rdst, Rtmp) \ - MOVBU.P 1(Rsrc), Rtmp; \ - MOVBU.P Rtmp, 1(Rdst); \ - MOVBU.P 1(Rsrc), Rtmp; \ - MOVBU.P Rtmp, 1(Rdst) - -#define MOVWP_UNALIGNED(Rsrc, Rdst, Rtmp) \ - MOVHUP_UNALIGNED(Rsrc, Rdst, Rtmp); \ - MOVHUP_UNALIGNED(Rsrc, Rdst, Rtmp) - -// func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]key) -TEXT ·poly1305_auth_armv6(SB), $196-16 - // The value 196, just above, is the sum of 64 (the size of the context - // structure) and 132 (the amount of stack needed). - // - // At this point, the stack pointer (R13) has been moved down. It - // points to the saved link register and there's 196 bytes of free - // space above it. - // - // The stack for this function looks like: - // - // +--------------------- - // | - // | 64 bytes of context structure - // | - // +--------------------- - // | - // | 112 bytes for poly1305_blocks_armv6 - // | - // +--------------------- - // | 16 bytes of final block, constructed at - // | poly1305_finish_ext_armv6_skip8 - // +--------------------- - // | four bytes of saved 'g' - // +--------------------- - // | lr, saved by prelude <- R13 points here - // +--------------------- - MOVW g, 4(R13) - - MOVW out+0(FP), R4 - MOVW m+4(FP), R5 - MOVW mlen+8(FP), R6 - MOVW key+12(FP), R7 - - ADD $136, R13, R0 // 136 = 4 + 4 + 16 + 112 - MOVW R7, R1 - - // poly1305_init_ext_armv6 will write to the stack from R13+4, but - // that's ok because none of the other values have been written yet. - BL poly1305_init_ext_armv6<>(SB) - BIC.S $15, R6, R2 - BEQ poly1305_auth_armv6_noblocks - ADD $136, R13, R0 - MOVW R5, R1 - ADD R2, R5, R5 - SUB R2, R6, R6 - BL poly1305_blocks_armv6<>(SB) - -poly1305_auth_armv6_noblocks: - ADD $136, R13, R0 - MOVW R5, R1 - MOVW R6, R2 - MOVW R4, R3 - - MOVW R0, R5 - MOVW R1, R6 - MOVW R2, R7 - MOVW R3, R8 - AND.S R2, R2, R2 - BEQ poly1305_finish_ext_armv6_noremaining - EOR R0, R0 - ADD $8, R13, R9 // 8 = offset to 16 byte scratch space - MOVW R0, (R9) - MOVW R0, 4(R9) - MOVW R0, 8(R9) - MOVW R0, 12(R9) - WORD $0xe3110003 // TST R1, #3 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_aligned - WORD $0xe3120008 // TST R2, #8 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip8 - MOVWP_UNALIGNED(R1, R9, g) - MOVWP_UNALIGNED(R1, R9, g) - -poly1305_finish_ext_armv6_skip8: - WORD $0xe3120004 // TST $4, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip4 - MOVWP_UNALIGNED(R1, R9, g) - -poly1305_finish_ext_armv6_skip4: - WORD $0xe3120002 // TST $2, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip2 - MOVHUP_UNALIGNED(R1, R9, g) - B poly1305_finish_ext_armv6_skip2 - -poly1305_finish_ext_armv6_aligned: - WORD $0xe3120008 // TST R2, #8 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip8_aligned - MOVM.IA.W (R1), [g-R11] - MOVM.IA.W [g-R11], (R9) - -poly1305_finish_ext_armv6_skip8_aligned: - WORD $0xe3120004 // TST $4, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip4_aligned - MOVW.P 4(R1), g - MOVW.P g, 4(R9) - -poly1305_finish_ext_armv6_skip4_aligned: - WORD $0xe3120002 // TST $2, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip2 - MOVHU.P 2(R1), g - MOVH.P g, 2(R9) - -poly1305_finish_ext_armv6_skip2: - WORD $0xe3120001 // TST $1, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip1 - MOVBU.P 1(R1), g - MOVBU.P g, 1(R9) - -poly1305_finish_ext_armv6_skip1: - MOVW $1, R11 - MOVBU R11, 0(R9) - MOVW R11, 56(R5) - MOVW R5, R0 - ADD $8, R13, R1 - MOVW $16, R2 - BL poly1305_blocks_armv6<>(SB) - -poly1305_finish_ext_armv6_noremaining: - MOVW 20(R5), R0 - MOVW 24(R5), R1 - MOVW 28(R5), R2 - MOVW 32(R5), R3 - MOVW 36(R5), R4 - MOVW R4>>26, R12 - BIC $0xfc000000, R4, R4 - ADD R12<<2, R12, R12 - ADD R12, R0, R0 - MOVW R0>>26, R12 - BIC $0xfc000000, R0, R0 - ADD R12, R1, R1 - MOVW R1>>26, R12 - BIC $0xfc000000, R1, R1 - ADD R12, R2, R2 - MOVW R2>>26, R12 - BIC $0xfc000000, R2, R2 - ADD R12, R3, R3 - MOVW R3>>26, R12 - BIC $0xfc000000, R3, R3 - ADD R12, R4, R4 - ADD $5, R0, R6 - MOVW R6>>26, R12 - BIC $0xfc000000, R6, R6 - ADD R12, R1, R7 - MOVW R7>>26, R12 - BIC $0xfc000000, R7, R7 - ADD R12, R2, g - MOVW g>>26, R12 - BIC $0xfc000000, g, g - ADD R12, R3, R11 - MOVW $-(1<<26), R12 - ADD R11>>26, R12, R12 - BIC $0xfc000000, R11, R11 - ADD R12, R4, R9 - MOVW R9>>31, R12 - SUB $1, R12 - AND R12, R6, R6 - AND R12, R7, R7 - AND R12, g, g - AND R12, R11, R11 - AND R12, R9, R9 - MVN R12, R12 - AND R12, R0, R0 - AND R12, R1, R1 - AND R12, R2, R2 - AND R12, R3, R3 - AND R12, R4, R4 - ORR R6, R0, R0 - ORR R7, R1, R1 - ORR g, R2, R2 - ORR R11, R3, R3 - ORR R9, R4, R4 - ORR R1<<26, R0, R0 - MOVW R1>>6, R1 - ORR R2<<20, R1, R1 - MOVW R2>>12, R2 - ORR R3<<14, R2, R2 - MOVW R3>>18, R3 - ORR R4<<8, R3, R3 - MOVW 40(R5), R6 - MOVW 44(R5), R7 - MOVW 48(R5), g - MOVW 52(R5), R11 - ADD.S R6, R0, R0 - ADC.S R7, R1, R1 - ADC.S g, R2, R2 - ADC.S R11, R3, R3 - MOVM.IA [R0-R3], (R8) - MOVW R5, R12 - EOR R0, R0, R0 - EOR R1, R1, R1 - EOR R2, R2, R2 - EOR R3, R3, R3 - EOR R4, R4, R4 - EOR R5, R5, R5 - EOR R6, R6, R6 - EOR R7, R7, R7 - MOVM.IA.W [R0-R7], (R12) - MOVM.IA [R0-R7], (R12) - MOVW 4(R13), g - RET diff --git a/vendor/golang.org/x/crypto/poly1305/sum_generic.go b/vendor/golang.org/x/crypto/poly1305/sum_generic.go deleted file mode 100644 index bab76ef0d..000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_generic.go +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package poly1305 - -import "encoding/binary" - -const ( - msgBlock = uint32(1 << 24) - finalBlock = uint32(0) -) - -// sumGeneric generates an authenticator for msg using a one-time key and -// puts the 16-byte result into out. This is the generic implementation of -// Sum and should be called if no assembly implementation is available. -func sumGeneric(out *[TagSize]byte, msg []byte, key *[32]byte) { - h := newMACGeneric(key) - h.Write(msg) - h.Sum(out) -} - -func newMACGeneric(key *[32]byte) (h macGeneric) { - h.r[0] = binary.LittleEndian.Uint32(key[0:]) & 0x3ffffff - h.r[1] = (binary.LittleEndian.Uint32(key[3:]) >> 2) & 0x3ffff03 - h.r[2] = (binary.LittleEndian.Uint32(key[6:]) >> 4) & 0x3ffc0ff - h.r[3] = (binary.LittleEndian.Uint32(key[9:]) >> 6) & 0x3f03fff - h.r[4] = (binary.LittleEndian.Uint32(key[12:]) >> 8) & 0x00fffff - - h.s[0] = binary.LittleEndian.Uint32(key[16:]) - h.s[1] = binary.LittleEndian.Uint32(key[20:]) - h.s[2] = binary.LittleEndian.Uint32(key[24:]) - h.s[3] = binary.LittleEndian.Uint32(key[28:]) - return -} - -type macGeneric struct { - h, r [5]uint32 - s [4]uint32 - - buffer [TagSize]byte - offset int -} - -func (h *macGeneric) Write(p []byte) (n int, err error) { - n = len(p) - if h.offset > 0 { - remaining := TagSize - h.offset - if n < remaining { - h.offset += copy(h.buffer[h.offset:], p) - return n, nil - } - copy(h.buffer[h.offset:], p[:remaining]) - p = p[remaining:] - h.offset = 0 - updateGeneric(h.buffer[:], msgBlock, &(h.h), &(h.r)) - } - if nn := len(p) - (len(p) % TagSize); nn > 0 { - updateGeneric(p, msgBlock, &(h.h), &(h.r)) - p = p[nn:] - } - if len(p) > 0 { - h.offset += copy(h.buffer[h.offset:], p) - } - return n, nil -} - -func (h *macGeneric) Sum(out *[16]byte) { - H, R := h.h, h.r - if h.offset > 0 { - var buffer [TagSize]byte - copy(buffer[:], h.buffer[:h.offset]) - buffer[h.offset] = 1 // invariant: h.offset < TagSize - updateGeneric(buffer[:], finalBlock, &H, &R) - } - finalizeGeneric(out, &H, &(h.s)) -} - -func updateGeneric(msg []byte, flag uint32, h, r *[5]uint32) { - h0, h1, h2, h3, h4 := h[0], h[1], h[2], h[3], h[4] - r0, r1, r2, r3, r4 := uint64(r[0]), uint64(r[1]), uint64(r[2]), uint64(r[3]), uint64(r[4]) - R1, R2, R3, R4 := r1*5, r2*5, r3*5, r4*5 - - for len(msg) >= TagSize { - // h += msg - h0 += binary.LittleEndian.Uint32(msg[0:]) & 0x3ffffff - h1 += (binary.LittleEndian.Uint32(msg[3:]) >> 2) & 0x3ffffff - h2 += (binary.LittleEndian.Uint32(msg[6:]) >> 4) & 0x3ffffff - h3 += (binary.LittleEndian.Uint32(msg[9:]) >> 6) & 0x3ffffff - h4 += (binary.LittleEndian.Uint32(msg[12:]) >> 8) | flag - - // h *= r - d0 := (uint64(h0) * r0) + (uint64(h1) * R4) + (uint64(h2) * R3) + (uint64(h3) * R2) + (uint64(h4) * R1) - d1 := (d0 >> 26) + (uint64(h0) * r1) + (uint64(h1) * r0) + (uint64(h2) * R4) + (uint64(h3) * R3) + (uint64(h4) * R2) - d2 := (d1 >> 26) + (uint64(h0) * r2) + (uint64(h1) * r1) + (uint64(h2) * r0) + (uint64(h3) * R4) + (uint64(h4) * R3) - d3 := (d2 >> 26) + (uint64(h0) * r3) + (uint64(h1) * r2) + (uint64(h2) * r1) + (uint64(h3) * r0) + (uint64(h4) * R4) - d4 := (d3 >> 26) + (uint64(h0) * r4) + (uint64(h1) * r3) + (uint64(h2) * r2) + (uint64(h3) * r1) + (uint64(h4) * r0) - - // h %= p - h0 = uint32(d0) & 0x3ffffff - h1 = uint32(d1) & 0x3ffffff - h2 = uint32(d2) & 0x3ffffff - h3 = uint32(d3) & 0x3ffffff - h4 = uint32(d4) & 0x3ffffff - - h0 += uint32(d4>>26) * 5 - h1 += h0 >> 26 - h0 = h0 & 0x3ffffff - - msg = msg[TagSize:] - } - - h[0], h[1], h[2], h[3], h[4] = h0, h1, h2, h3, h4 -} - -func finalizeGeneric(out *[TagSize]byte, h *[5]uint32, s *[4]uint32) { - h0, h1, h2, h3, h4 := h[0], h[1], h[2], h[3], h[4] - - // h %= p reduction - h2 += h1 >> 26 - h1 &= 0x3ffffff - h3 += h2 >> 26 - h2 &= 0x3ffffff - h4 += h3 >> 26 - h3 &= 0x3ffffff - h0 += 5 * (h4 >> 26) - h4 &= 0x3ffffff - h1 += h0 >> 26 - h0 &= 0x3ffffff - - // h - p - t0 := h0 + 5 - t1 := h1 + (t0 >> 26) - t2 := h2 + (t1 >> 26) - t3 := h3 + (t2 >> 26) - t4 := h4 + (t3 >> 26) - (1 << 26) - t0 &= 0x3ffffff - t1 &= 0x3ffffff - t2 &= 0x3ffffff - t3 &= 0x3ffffff - - // select h if h < p else h - p - t_mask := (t4 >> 31) - 1 - h_mask := ^t_mask - h0 = (h0 & h_mask) | (t0 & t_mask) - h1 = (h1 & h_mask) | (t1 & t_mask) - h2 = (h2 & h_mask) | (t2 & t_mask) - h3 = (h3 & h_mask) | (t3 & t_mask) - h4 = (h4 & h_mask) | (t4 & t_mask) - - // h %= 2^128 - h0 |= h1 << 26 - h1 = ((h1 >> 6) | (h2 << 20)) - h2 = ((h2 >> 12) | (h3 << 14)) - h3 = ((h3 >> 18) | (h4 << 8)) - - // s: the s part of the key - // tag = (h + s) % (2^128) - t := uint64(h0) + uint64(s[0]) - h0 = uint32(t) - t = uint64(h1) + uint64(s[1]) + (t >> 32) - h1 = uint32(t) - t = uint64(h2) + uint64(s[2]) + (t >> 32) - h2 = uint32(t) - t = uint64(h3) + uint64(s[3]) + (t >> 32) - h3 = uint32(t) - - binary.LittleEndian.PutUint32(out[0:], h0) - binary.LittleEndian.PutUint32(out[4:], h1) - binary.LittleEndian.PutUint32(out[8:], h2) - binary.LittleEndian.PutUint32(out[12:], h3) -} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_noasm.go b/vendor/golang.org/x/crypto/poly1305/sum_noasm.go deleted file mode 100644 index fcdef46ab..000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_noasm.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build s390x,!go1.11 !arm,!amd64,!s390x gccgo appengine nacl - -package poly1305 - -// Sum generates an authenticator for msg using a one-time key and puts the -// 16-byte result into out. Authenticating two different messages with the same -// key allows an attacker to forge messages at will. -func Sum(out *[TagSize]byte, msg []byte, key *[32]byte) { - h := newMAC(key) - h.Write(msg) - h.Sum(out) -} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_s390x.go b/vendor/golang.org/x/crypto/poly1305/sum_s390x.go deleted file mode 100644 index ec99e07e9..000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_s390x.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build s390x,go1.11,!gccgo,!appengine - -package poly1305 - -import ( - "golang.org/x/sys/cpu" -) - -// poly1305vx is an assembly implementation of Poly1305 that uses vector -// instructions. It must only be called if the vector facility (vx) is -// available. -//go:noescape -func poly1305vx(out *[16]byte, m *byte, mlen uint64, key *[32]byte) - -// poly1305vmsl is an assembly implementation of Poly1305 that uses vector -// instructions, including VMSL. It must only be called if the vector facility (vx) is -// available and if VMSL is supported. -//go:noescape -func poly1305vmsl(out *[16]byte, m *byte, mlen uint64, key *[32]byte) - -// Sum generates an authenticator for m using a one-time key and puts the -// 16-byte result into out. Authenticating two different messages with the same -// key allows an attacker to forge messages at will. -func Sum(out *[16]byte, m []byte, key *[32]byte) { - if cpu.S390X.HasVX { - var mPtr *byte - if len(m) > 0 { - mPtr = &m[0] - } - if cpu.S390X.HasVXE && len(m) > 256 { - poly1305vmsl(out, mPtr, uint64(len(m)), key) - } else { - poly1305vx(out, mPtr, uint64(len(m)), key) - } - } else { - sumGeneric(out, m, key) - } -} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_s390x.s b/vendor/golang.org/x/crypto/poly1305/sum_s390x.s deleted file mode 100644 index ca5a309d8..000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_s390x.s +++ /dev/null @@ -1,378 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build s390x,go1.11,!gccgo,!appengine - -#include "textflag.h" - -// Implementation of Poly1305 using the vector facility (vx). - -// constants -#define MOD26 V0 -#define EX0 V1 -#define EX1 V2 -#define EX2 V3 - -// temporaries -#define T_0 V4 -#define T_1 V5 -#define T_2 V6 -#define T_3 V7 -#define T_4 V8 - -// key (r) -#define R_0 V9 -#define R_1 V10 -#define R_2 V11 -#define R_3 V12 -#define R_4 V13 -#define R5_1 V14 -#define R5_2 V15 -#define R5_3 V16 -#define R5_4 V17 -#define RSAVE_0 R5 -#define RSAVE_1 R6 -#define RSAVE_2 R7 -#define RSAVE_3 R8 -#define RSAVE_4 R9 -#define R5SAVE_1 V28 -#define R5SAVE_2 V29 -#define R5SAVE_3 V30 -#define R5SAVE_4 V31 - -// message block -#define F_0 V18 -#define F_1 V19 -#define F_2 V20 -#define F_3 V21 -#define F_4 V22 - -// accumulator -#define H_0 V23 -#define H_1 V24 -#define H_2 V25 -#define H_3 V26 -#define H_4 V27 - -GLOBL ·keyMask<>(SB), RODATA, $16 -DATA ·keyMask<>+0(SB)/8, $0xffffff0ffcffff0f -DATA ·keyMask<>+8(SB)/8, $0xfcffff0ffcffff0f - -GLOBL ·bswapMask<>(SB), RODATA, $16 -DATA ·bswapMask<>+0(SB)/8, $0x0f0e0d0c0b0a0908 -DATA ·bswapMask<>+8(SB)/8, $0x0706050403020100 - -GLOBL ·constants<>(SB), RODATA, $64 -// MOD26 -DATA ·constants<>+0(SB)/8, $0x3ffffff -DATA ·constants<>+8(SB)/8, $0x3ffffff -// EX0 -DATA ·constants<>+16(SB)/8, $0x0006050403020100 -DATA ·constants<>+24(SB)/8, $0x1016151413121110 -// EX1 -DATA ·constants<>+32(SB)/8, $0x060c0b0a09080706 -DATA ·constants<>+40(SB)/8, $0x161c1b1a19181716 -// EX2 -DATA ·constants<>+48(SB)/8, $0x0d0d0d0d0d0f0e0d -DATA ·constants<>+56(SB)/8, $0x1d1d1d1d1d1f1e1d - -// h = (f*g) % (2**130-5) [partial reduction] -#define MULTIPLY(f0, f1, f2, f3, f4, g0, g1, g2, g3, g4, g51, g52, g53, g54, h0, h1, h2, h3, h4) \ - VMLOF f0, g0, h0 \ - VMLOF f0, g1, h1 \ - VMLOF f0, g2, h2 \ - VMLOF f0, g3, h3 \ - VMLOF f0, g4, h4 \ - VMLOF f1, g54, T_0 \ - VMLOF f1, g0, T_1 \ - VMLOF f1, g1, T_2 \ - VMLOF f1, g2, T_3 \ - VMLOF f1, g3, T_4 \ - VMALOF f2, g53, h0, h0 \ - VMALOF f2, g54, h1, h1 \ - VMALOF f2, g0, h2, h2 \ - VMALOF f2, g1, h3, h3 \ - VMALOF f2, g2, h4, h4 \ - VMALOF f3, g52, T_0, T_0 \ - VMALOF f3, g53, T_1, T_1 \ - VMALOF f3, g54, T_2, T_2 \ - VMALOF f3, g0, T_3, T_3 \ - VMALOF f3, g1, T_4, T_4 \ - VMALOF f4, g51, h0, h0 \ - VMALOF f4, g52, h1, h1 \ - VMALOF f4, g53, h2, h2 \ - VMALOF f4, g54, h3, h3 \ - VMALOF f4, g0, h4, h4 \ - VAG T_0, h0, h0 \ - VAG T_1, h1, h1 \ - VAG T_2, h2, h2 \ - VAG T_3, h3, h3 \ - VAG T_4, h4, h4 - -// carry h0->h1 h3->h4, h1->h2 h4->h0, h0->h1 h2->h3, h3->h4 -#define REDUCE(h0, h1, h2, h3, h4) \ - VESRLG $26, h0, T_0 \ - VESRLG $26, h3, T_1 \ - VN MOD26, h0, h0 \ - VN MOD26, h3, h3 \ - VAG T_0, h1, h1 \ - VAG T_1, h4, h4 \ - VESRLG $26, h1, T_2 \ - VESRLG $26, h4, T_3 \ - VN MOD26, h1, h1 \ - VN MOD26, h4, h4 \ - VESLG $2, T_3, T_4 \ - VAG T_3, T_4, T_4 \ - VAG T_2, h2, h2 \ - VAG T_4, h0, h0 \ - VESRLG $26, h2, T_0 \ - VESRLG $26, h0, T_1 \ - VN MOD26, h2, h2 \ - VN MOD26, h0, h0 \ - VAG T_0, h3, h3 \ - VAG T_1, h1, h1 \ - VESRLG $26, h3, T_2 \ - VN MOD26, h3, h3 \ - VAG T_2, h4, h4 - -// expand in0 into d[0] and in1 into d[1] -#define EXPAND(in0, in1, d0, d1, d2, d3, d4) \ - VGBM $0x0707, d1 \ // d1=tmp - VPERM in0, in1, EX2, d4 \ - VPERM in0, in1, EX0, d0 \ - VPERM in0, in1, EX1, d2 \ - VN d1, d4, d4 \ - VESRLG $26, d0, d1 \ - VESRLG $30, d2, d3 \ - VESRLG $4, d2, d2 \ - VN MOD26, d0, d0 \ - VN MOD26, d1, d1 \ - VN MOD26, d2, d2 \ - VN MOD26, d3, d3 - -// pack h4:h0 into h1:h0 (no carry) -#define PACK(h0, h1, h2, h3, h4) \ - VESLG $26, h1, h1 \ - VESLG $26, h3, h3 \ - VO h0, h1, h0 \ - VO h2, h3, h2 \ - VESLG $4, h2, h2 \ - VLEIB $7, $48, h1 \ - VSLB h1, h2, h2 \ - VO h0, h2, h0 \ - VLEIB $7, $104, h1 \ - VSLB h1, h4, h3 \ - VO h3, h0, h0 \ - VLEIB $7, $24, h1 \ - VSRLB h1, h4, h1 - -// if h > 2**130-5 then h -= 2**130-5 -#define MOD(h0, h1, t0, t1, t2) \ - VZERO t0 \ - VLEIG $1, $5, t0 \ - VACCQ h0, t0, t1 \ - VAQ h0, t0, t0 \ - VONE t2 \ - VLEIG $1, $-4, t2 \ - VAQ t2, t1, t1 \ - VACCQ h1, t1, t1 \ - VONE t2 \ - VAQ t2, t1, t1 \ - VN h0, t1, t2 \ - VNC t0, t1, t1 \ - VO t1, t2, h0 - -// func poly1305vx(out *[16]byte, m *byte, mlen uint64, key *[32]key) -TEXT ·poly1305vx(SB), $0-32 - // This code processes up to 2 blocks (32 bytes) per iteration - // using the algorithm described in: - // NEON crypto, Daniel J. Bernstein & Peter Schwabe - // https://cryptojedi.org/papers/neoncrypto-20120320.pdf - LMG out+0(FP), R1, R4 // R1=out, R2=m, R3=mlen, R4=key - - // load MOD26, EX0, EX1 and EX2 - MOVD $·constants<>(SB), R5 - VLM (R5), MOD26, EX2 - - // setup r - VL (R4), T_0 - MOVD $·keyMask<>(SB), R6 - VL (R6), T_1 - VN T_0, T_1, T_0 - EXPAND(T_0, T_0, R_0, R_1, R_2, R_3, R_4) - - // setup r*5 - VLEIG $0, $5, T_0 - VLEIG $1, $5, T_0 - - // store r (for final block) - VMLOF T_0, R_1, R5SAVE_1 - VMLOF T_0, R_2, R5SAVE_2 - VMLOF T_0, R_3, R5SAVE_3 - VMLOF T_0, R_4, R5SAVE_4 - VLGVG $0, R_0, RSAVE_0 - VLGVG $0, R_1, RSAVE_1 - VLGVG $0, R_2, RSAVE_2 - VLGVG $0, R_3, RSAVE_3 - VLGVG $0, R_4, RSAVE_4 - - // skip r**2 calculation - CMPBLE R3, $16, skip - - // calculate r**2 - MULTIPLY(R_0, R_1, R_2, R_3, R_4, R_0, R_1, R_2, R_3, R_4, R5SAVE_1, R5SAVE_2, R5SAVE_3, R5SAVE_4, H_0, H_1, H_2, H_3, H_4) - REDUCE(H_0, H_1, H_2, H_3, H_4) - VLEIG $0, $5, T_0 - VLEIG $1, $5, T_0 - VMLOF T_0, H_1, R5_1 - VMLOF T_0, H_2, R5_2 - VMLOF T_0, H_3, R5_3 - VMLOF T_0, H_4, R5_4 - VLR H_0, R_0 - VLR H_1, R_1 - VLR H_2, R_2 - VLR H_3, R_3 - VLR H_4, R_4 - - // initialize h - VZERO H_0 - VZERO H_1 - VZERO H_2 - VZERO H_3 - VZERO H_4 - -loop: - CMPBLE R3, $32, b2 - VLM (R2), T_0, T_1 - SUB $32, R3 - MOVD $32(R2), R2 - EXPAND(T_0, T_1, F_0, F_1, F_2, F_3, F_4) - VLEIB $4, $1, F_4 - VLEIB $12, $1, F_4 - -multiply: - VAG H_0, F_0, F_0 - VAG H_1, F_1, F_1 - VAG H_2, F_2, F_2 - VAG H_3, F_3, F_3 - VAG H_4, F_4, F_4 - MULTIPLY(F_0, F_1, F_2, F_3, F_4, R_0, R_1, R_2, R_3, R_4, R5_1, R5_2, R5_3, R5_4, H_0, H_1, H_2, H_3, H_4) - REDUCE(H_0, H_1, H_2, H_3, H_4) - CMPBNE R3, $0, loop - -finish: - // sum vectors - VZERO T_0 - VSUMQG H_0, T_0, H_0 - VSUMQG H_1, T_0, H_1 - VSUMQG H_2, T_0, H_2 - VSUMQG H_3, T_0, H_3 - VSUMQG H_4, T_0, H_4 - - // h may be >= 2*(2**130-5) so we need to reduce it again - REDUCE(H_0, H_1, H_2, H_3, H_4) - - // carry h1->h4 - VESRLG $26, H_1, T_1 - VN MOD26, H_1, H_1 - VAQ T_1, H_2, H_2 - VESRLG $26, H_2, T_2 - VN MOD26, H_2, H_2 - VAQ T_2, H_3, H_3 - VESRLG $26, H_3, T_3 - VN MOD26, H_3, H_3 - VAQ T_3, H_4, H_4 - - // h is now < 2*(2**130-5) - // pack h into h1 (hi) and h0 (lo) - PACK(H_0, H_1, H_2, H_3, H_4) - - // if h > 2**130-5 then h -= 2**130-5 - MOD(H_0, H_1, T_0, T_1, T_2) - - // h += s - MOVD $·bswapMask<>(SB), R5 - VL (R5), T_1 - VL 16(R4), T_0 - VPERM T_0, T_0, T_1, T_0 // reverse bytes (to big) - VAQ T_0, H_0, H_0 - VPERM H_0, H_0, T_1, H_0 // reverse bytes (to little) - VST H_0, (R1) - - RET - -b2: - CMPBLE R3, $16, b1 - - // 2 blocks remaining - SUB $17, R3 - VL (R2), T_0 - VLL R3, 16(R2), T_1 - ADD $1, R3 - MOVBZ $1, R0 - CMPBEQ R3, $16, 2(PC) - VLVGB R3, R0, T_1 - EXPAND(T_0, T_1, F_0, F_1, F_2, F_3, F_4) - CMPBNE R3, $16, 2(PC) - VLEIB $12, $1, F_4 - VLEIB $4, $1, F_4 - - // setup [r²,r] - VLVGG $1, RSAVE_0, R_0 - VLVGG $1, RSAVE_1, R_1 - VLVGG $1, RSAVE_2, R_2 - VLVGG $1, RSAVE_3, R_3 - VLVGG $1, RSAVE_4, R_4 - VPDI $0, R5_1, R5SAVE_1, R5_1 - VPDI $0, R5_2, R5SAVE_2, R5_2 - VPDI $0, R5_3, R5SAVE_3, R5_3 - VPDI $0, R5_4, R5SAVE_4, R5_4 - - MOVD $0, R3 - BR multiply - -skip: - VZERO H_0 - VZERO H_1 - VZERO H_2 - VZERO H_3 - VZERO H_4 - - CMPBEQ R3, $0, finish - -b1: - // 1 block remaining - SUB $1, R3 - VLL R3, (R2), T_0 - ADD $1, R3 - MOVBZ $1, R0 - CMPBEQ R3, $16, 2(PC) - VLVGB R3, R0, T_0 - VZERO T_1 - EXPAND(T_0, T_1, F_0, F_1, F_2, F_3, F_4) - CMPBNE R3, $16, 2(PC) - VLEIB $4, $1, F_4 - VLEIG $1, $1, R_0 - VZERO R_1 - VZERO R_2 - VZERO R_3 - VZERO R_4 - VZERO R5_1 - VZERO R5_2 - VZERO R5_3 - VZERO R5_4 - - // setup [r, 1] - VLVGG $0, RSAVE_0, R_0 - VLVGG $0, RSAVE_1, R_1 - VLVGG $0, RSAVE_2, R_2 - VLVGG $0, RSAVE_3, R_3 - VLVGG $0, RSAVE_4, R_4 - VPDI $0, R5SAVE_1, R5_1, R5_1 - VPDI $0, R5SAVE_2, R5_2, R5_2 - VPDI $0, R5SAVE_3, R5_3, R5_3 - VPDI $0, R5SAVE_4, R5_4, R5_4 - - MOVD $0, R3 - BR multiply diff --git a/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s b/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s deleted file mode 100644 index e60bbc1d7..000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s +++ /dev/null @@ -1,909 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build s390x,go1.11,!gccgo,!appengine - -#include "textflag.h" - -// Implementation of Poly1305 using the vector facility (vx) and the VMSL instruction. - -// constants -#define EX0 V1 -#define EX1 V2 -#define EX2 V3 - -// temporaries -#define T_0 V4 -#define T_1 V5 -#define T_2 V6 -#define T_3 V7 -#define T_4 V8 -#define T_5 V9 -#define T_6 V10 -#define T_7 V11 -#define T_8 V12 -#define T_9 V13 -#define T_10 V14 - -// r**2 & r**4 -#define R_0 V15 -#define R_1 V16 -#define R_2 V17 -#define R5_1 V18 -#define R5_2 V19 -// key (r) -#define RSAVE_0 R7 -#define RSAVE_1 R8 -#define RSAVE_2 R9 -#define R5SAVE_1 R10 -#define R5SAVE_2 R11 - -// message block -#define M0 V20 -#define M1 V21 -#define M2 V22 -#define M3 V23 -#define M4 V24 -#define M5 V25 - -// accumulator -#define H0_0 V26 -#define H1_0 V27 -#define H2_0 V28 -#define H0_1 V29 -#define H1_1 V30 -#define H2_1 V31 - -GLOBL ·keyMask<>(SB), RODATA, $16 -DATA ·keyMask<>+0(SB)/8, $0xffffff0ffcffff0f -DATA ·keyMask<>+8(SB)/8, $0xfcffff0ffcffff0f - -GLOBL ·bswapMask<>(SB), RODATA, $16 -DATA ·bswapMask<>+0(SB)/8, $0x0f0e0d0c0b0a0908 -DATA ·bswapMask<>+8(SB)/8, $0x0706050403020100 - -GLOBL ·constants<>(SB), RODATA, $48 -// EX0 -DATA ·constants<>+0(SB)/8, $0x18191a1b1c1d1e1f -DATA ·constants<>+8(SB)/8, $0x0000050403020100 -// EX1 -DATA ·constants<>+16(SB)/8, $0x18191a1b1c1d1e1f -DATA ·constants<>+24(SB)/8, $0x00000a0908070605 -// EX2 -DATA ·constants<>+32(SB)/8, $0x18191a1b1c1d1e1f -DATA ·constants<>+40(SB)/8, $0x0000000f0e0d0c0b - -GLOBL ·c<>(SB), RODATA, $48 -// EX0 -DATA ·c<>+0(SB)/8, $0x0000050403020100 -DATA ·c<>+8(SB)/8, $0x0000151413121110 -// EX1 -DATA ·c<>+16(SB)/8, $0x00000a0908070605 -DATA ·c<>+24(SB)/8, $0x00001a1918171615 -// EX2 -DATA ·c<>+32(SB)/8, $0x0000000f0e0d0c0b -DATA ·c<>+40(SB)/8, $0x0000001f1e1d1c1b - -GLOBL ·reduce<>(SB), RODATA, $32 -// 44 bit -DATA ·reduce<>+0(SB)/8, $0x0 -DATA ·reduce<>+8(SB)/8, $0xfffffffffff -// 42 bit -DATA ·reduce<>+16(SB)/8, $0x0 -DATA ·reduce<>+24(SB)/8, $0x3ffffffffff - -// h = (f*g) % (2**130-5) [partial reduction] -// uses T_0...T_9 temporary registers -// input: m02_0, m02_1, m02_2, m13_0, m13_1, m13_2, r_0, r_1, r_2, r5_1, r5_2, m4_0, m4_1, m4_2, m5_0, m5_1, m5_2 -// temp: t0, t1, t2, t3, t4, t5, t6, t7, t8, t9 -// output: m02_0, m02_1, m02_2, m13_0, m13_1, m13_2 -#define MULTIPLY(m02_0, m02_1, m02_2, m13_0, m13_1, m13_2, r_0, r_1, r_2, r5_1, r5_2, m4_0, m4_1, m4_2, m5_0, m5_1, m5_2, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) \ - \ // Eliminate the dependency for the last 2 VMSLs - VMSLG m02_0, r_2, m4_2, m4_2 \ - VMSLG m13_0, r_2, m5_2, m5_2 \ // 8 VMSLs pipelined - VMSLG m02_0, r_0, m4_0, m4_0 \ - VMSLG m02_1, r5_2, V0, T_0 \ - VMSLG m02_0, r_1, m4_1, m4_1 \ - VMSLG m02_1, r_0, V0, T_1 \ - VMSLG m02_1, r_1, V0, T_2 \ - VMSLG m02_2, r5_1, V0, T_3 \ - VMSLG m02_2, r5_2, V0, T_4 \ - VMSLG m13_0, r_0, m5_0, m5_0 \ - VMSLG m13_1, r5_2, V0, T_5 \ - VMSLG m13_0, r_1, m5_1, m5_1 \ - VMSLG m13_1, r_0, V0, T_6 \ - VMSLG m13_1, r_1, V0, T_7 \ - VMSLG m13_2, r5_1, V0, T_8 \ - VMSLG m13_2, r5_2, V0, T_9 \ - VMSLG m02_2, r_0, m4_2, m4_2 \ - VMSLG m13_2, r_0, m5_2, m5_2 \ - VAQ m4_0, T_0, m02_0 \ - VAQ m4_1, T_1, m02_1 \ - VAQ m5_0, T_5, m13_0 \ - VAQ m5_1, T_6, m13_1 \ - VAQ m02_0, T_3, m02_0 \ - VAQ m02_1, T_4, m02_1 \ - VAQ m13_0, T_8, m13_0 \ - VAQ m13_1, T_9, m13_1 \ - VAQ m4_2, T_2, m02_2 \ - VAQ m5_2, T_7, m13_2 \ - -// SQUARE uses three limbs of r and r_2*5 to output square of r -// uses T_1, T_5 and T_7 temporary registers -// input: r_0, r_1, r_2, r5_2 -// temp: TEMP0, TEMP1, TEMP2 -// output: p0, p1, p2 -#define SQUARE(r_0, r_1, r_2, r5_2, p0, p1, p2, TEMP0, TEMP1, TEMP2) \ - VMSLG r_0, r_0, p0, p0 \ - VMSLG r_1, r5_2, V0, TEMP0 \ - VMSLG r_2, r5_2, p1, p1 \ - VMSLG r_0, r_1, V0, TEMP1 \ - VMSLG r_1, r_1, p2, p2 \ - VMSLG r_0, r_2, V0, TEMP2 \ - VAQ TEMP0, p0, p0 \ - VAQ TEMP1, p1, p1 \ - VAQ TEMP2, p2, p2 \ - VAQ TEMP0, p0, p0 \ - VAQ TEMP1, p1, p1 \ - VAQ TEMP2, p2, p2 \ - -// carry h0->h1->h2->h0 || h3->h4->h5->h3 -// uses T_2, T_4, T_5, T_7, T_8, T_9 -// t6, t7, t8, t9, t10, t11 -// input: h0, h1, h2, h3, h4, h5 -// temp: t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11 -// output: h0, h1, h2, h3, h4, h5 -#define REDUCE(h0, h1, h2, h3, h4, h5, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) \ - VLM (R12), t6, t7 \ // 44 and 42 bit clear mask - VLEIB $7, $0x28, t10 \ // 5 byte shift mask - VREPIB $4, t8 \ // 4 bit shift mask - VREPIB $2, t11 \ // 2 bit shift mask - VSRLB t10, h0, t0 \ // h0 byte shift - VSRLB t10, h1, t1 \ // h1 byte shift - VSRLB t10, h2, t2 \ // h2 byte shift - VSRLB t10, h3, t3 \ // h3 byte shift - VSRLB t10, h4, t4 \ // h4 byte shift - VSRLB t10, h5, t5 \ // h5 byte shift - VSRL t8, t0, t0 \ // h0 bit shift - VSRL t8, t1, t1 \ // h2 bit shift - VSRL t11, t2, t2 \ // h2 bit shift - VSRL t8, t3, t3 \ // h3 bit shift - VSRL t8, t4, t4 \ // h4 bit shift - VESLG $2, t2, t9 \ // h2 carry x5 - VSRL t11, t5, t5 \ // h5 bit shift - VN t6, h0, h0 \ // h0 clear carry - VAQ t2, t9, t2 \ // h2 carry x5 - VESLG $2, t5, t9 \ // h5 carry x5 - VN t6, h1, h1 \ // h1 clear carry - VN t7, h2, h2 \ // h2 clear carry - VAQ t5, t9, t5 \ // h5 carry x5 - VN t6, h3, h3 \ // h3 clear carry - VN t6, h4, h4 \ // h4 clear carry - VN t7, h5, h5 \ // h5 clear carry - VAQ t0, h1, h1 \ // h0->h1 - VAQ t3, h4, h4 \ // h3->h4 - VAQ t1, h2, h2 \ // h1->h2 - VAQ t4, h5, h5 \ // h4->h5 - VAQ t2, h0, h0 \ // h2->h0 - VAQ t5, h3, h3 \ // h5->h3 - VREPG $1, t6, t6 \ // 44 and 42 bit masks across both halves - VREPG $1, t7, t7 \ - VSLDB $8, h0, h0, h0 \ // set up [h0/1/2, h3/4/5] - VSLDB $8, h1, h1, h1 \ - VSLDB $8, h2, h2, h2 \ - VO h0, h3, h3 \ - VO h1, h4, h4 \ - VO h2, h5, h5 \ - VESRLG $44, h3, t0 \ // 44 bit shift right - VESRLG $44, h4, t1 \ - VESRLG $42, h5, t2 \ - VN t6, h3, h3 \ // clear carry bits - VN t6, h4, h4 \ - VN t7, h5, h5 \ - VESLG $2, t2, t9 \ // multiply carry by 5 - VAQ t9, t2, t2 \ - VAQ t0, h4, h4 \ - VAQ t1, h5, h5 \ - VAQ t2, h3, h3 \ - -// carry h0->h1->h2->h0 -// input: h0, h1, h2 -// temp: t0, t1, t2, t3, t4, t5, t6, t7, t8 -// output: h0, h1, h2 -#define REDUCE2(h0, h1, h2, t0, t1, t2, t3, t4, t5, t6, t7, t8) \ - VLEIB $7, $0x28, t3 \ // 5 byte shift mask - VREPIB $4, t4 \ // 4 bit shift mask - VREPIB $2, t7 \ // 2 bit shift mask - VGBM $0x003F, t5 \ // mask to clear carry bits - VSRLB t3, h0, t0 \ - VSRLB t3, h1, t1 \ - VSRLB t3, h2, t2 \ - VESRLG $4, t5, t5 \ // 44 bit clear mask - VSRL t4, t0, t0 \ - VSRL t4, t1, t1 \ - VSRL t7, t2, t2 \ - VESRLG $2, t5, t6 \ // 42 bit clear mask - VESLG $2, t2, t8 \ - VAQ t8, t2, t2 \ - VN t5, h0, h0 \ - VN t5, h1, h1 \ - VN t6, h2, h2 \ - VAQ t0, h1, h1 \ - VAQ t1, h2, h2 \ - VAQ t2, h0, h0 \ - VSRLB t3, h0, t0 \ - VSRLB t3, h1, t1 \ - VSRLB t3, h2, t2 \ - VSRL t4, t0, t0 \ - VSRL t4, t1, t1 \ - VSRL t7, t2, t2 \ - VN t5, h0, h0 \ - VN t5, h1, h1 \ - VESLG $2, t2, t8 \ - VN t6, h2, h2 \ - VAQ t0, h1, h1 \ - VAQ t8, t2, t2 \ - VAQ t1, h2, h2 \ - VAQ t2, h0, h0 \ - -// expands two message blocks into the lower halfs of the d registers -// moves the contents of the d registers into upper halfs -// input: in1, in2, d0, d1, d2, d3, d4, d5 -// temp: TEMP0, TEMP1, TEMP2, TEMP3 -// output: d0, d1, d2, d3, d4, d5 -#define EXPACC(in1, in2, d0, d1, d2, d3, d4, d5, TEMP0, TEMP1, TEMP2, TEMP3) \ - VGBM $0xff3f, TEMP0 \ - VGBM $0xff1f, TEMP1 \ - VESLG $4, d1, TEMP2 \ - VESLG $4, d4, TEMP3 \ - VESRLG $4, TEMP0, TEMP0 \ - VPERM in1, d0, EX0, d0 \ - VPERM in2, d3, EX0, d3 \ - VPERM in1, d2, EX2, d2 \ - VPERM in2, d5, EX2, d5 \ - VPERM in1, TEMP2, EX1, d1 \ - VPERM in2, TEMP3, EX1, d4 \ - VN TEMP0, d0, d0 \ - VN TEMP0, d3, d3 \ - VESRLG $4, d1, d1 \ - VESRLG $4, d4, d4 \ - VN TEMP1, d2, d2 \ - VN TEMP1, d5, d5 \ - VN TEMP0, d1, d1 \ - VN TEMP0, d4, d4 \ - -// expands one message block into the lower halfs of the d registers -// moves the contents of the d registers into upper halfs -// input: in, d0, d1, d2 -// temp: TEMP0, TEMP1, TEMP2 -// output: d0, d1, d2 -#define EXPACC2(in, d0, d1, d2, TEMP0, TEMP1, TEMP2) \ - VGBM $0xff3f, TEMP0 \ - VESLG $4, d1, TEMP2 \ - VGBM $0xff1f, TEMP1 \ - VPERM in, d0, EX0, d0 \ - VESRLG $4, TEMP0, TEMP0 \ - VPERM in, d2, EX2, d2 \ - VPERM in, TEMP2, EX1, d1 \ - VN TEMP0, d0, d0 \ - VN TEMP1, d2, d2 \ - VESRLG $4, d1, d1 \ - VN TEMP0, d1, d1 \ - -// pack h2:h0 into h1:h0 (no carry) -// input: h0, h1, h2 -// output: h0, h1, h2 -#define PACK(h0, h1, h2) \ - VMRLG h1, h2, h2 \ // copy h1 to upper half h2 - VESLG $44, h1, h1 \ // shift limb 1 44 bits, leaving 20 - VO h0, h1, h0 \ // combine h0 with 20 bits from limb 1 - VESRLG $20, h2, h1 \ // put top 24 bits of limb 1 into h1 - VLEIG $1, $0, h1 \ // clear h2 stuff from lower half of h1 - VO h0, h1, h0 \ // h0 now has 88 bits (limb 0 and 1) - VLEIG $0, $0, h2 \ // clear upper half of h2 - VESRLG $40, h2, h1 \ // h1 now has upper two bits of result - VLEIB $7, $88, h1 \ // for byte shift (11 bytes) - VSLB h1, h2, h2 \ // shift h2 11 bytes to the left - VO h0, h2, h0 \ // combine h0 with 20 bits from limb 1 - VLEIG $0, $0, h1 \ // clear upper half of h1 - -// if h > 2**130-5 then h -= 2**130-5 -// input: h0, h1 -// temp: t0, t1, t2 -// output: h0 -#define MOD(h0, h1, t0, t1, t2) \ - VZERO t0 \ - VLEIG $1, $5, t0 \ - VACCQ h0, t0, t1 \ - VAQ h0, t0, t0 \ - VONE t2 \ - VLEIG $1, $-4, t2 \ - VAQ t2, t1, t1 \ - VACCQ h1, t1, t1 \ - VONE t2 \ - VAQ t2, t1, t1 \ - VN h0, t1, t2 \ - VNC t0, t1, t1 \ - VO t1, t2, h0 \ - -// func poly1305vmsl(out *[16]byte, m *byte, mlen uint64, key *[32]key) -TEXT ·poly1305vmsl(SB), $0-32 - // This code processes 6 + up to 4 blocks (32 bytes) per iteration - // using the algorithm described in: - // NEON crypto, Daniel J. Bernstein & Peter Schwabe - // https://cryptojedi.org/papers/neoncrypto-20120320.pdf - // And as moddified for VMSL as described in - // Accelerating Poly1305 Cryptographic Message Authentication on the z14 - // O'Farrell et al, CASCON 2017, p48-55 - // https://ibm.ent.box.com/s/jf9gedj0e9d2vjctfyh186shaztavnht - - LMG out+0(FP), R1, R4 // R1=out, R2=m, R3=mlen, R4=key - VZERO V0 // c - - // load EX0, EX1 and EX2 - MOVD $·constants<>(SB), R5 - VLM (R5), EX0, EX2 // c - - // setup r - VL (R4), T_0 - MOVD $·keyMask<>(SB), R6 - VL (R6), T_1 - VN T_0, T_1, T_0 - VZERO T_2 // limbs for r - VZERO T_3 - VZERO T_4 - EXPACC2(T_0, T_2, T_3, T_4, T_1, T_5, T_7) - - // T_2, T_3, T_4: [0, r] - - // setup r*20 - VLEIG $0, $0, T_0 - VLEIG $1, $20, T_0 // T_0: [0, 20] - VZERO T_5 - VZERO T_6 - VMSLG T_0, T_3, T_5, T_5 - VMSLG T_0, T_4, T_6, T_6 - - // store r for final block in GR - VLGVG $1, T_2, RSAVE_0 // c - VLGVG $1, T_3, RSAVE_1 // c - VLGVG $1, T_4, RSAVE_2 // c - VLGVG $1, T_5, R5SAVE_1 // c - VLGVG $1, T_6, R5SAVE_2 // c - - // initialize h - VZERO H0_0 - VZERO H1_0 - VZERO H2_0 - VZERO H0_1 - VZERO H1_1 - VZERO H2_1 - - // initialize pointer for reduce constants - MOVD $·reduce<>(SB), R12 - - // calculate r**2 and 20*(r**2) - VZERO R_0 - VZERO R_1 - VZERO R_2 - SQUARE(T_2, T_3, T_4, T_6, R_0, R_1, R_2, T_1, T_5, T_7) - REDUCE2(R_0, R_1, R_2, M0, M1, M2, M3, M4, R5_1, R5_2, M5, T_1) - VZERO R5_1 - VZERO R5_2 - VMSLG T_0, R_1, R5_1, R5_1 - VMSLG T_0, R_2, R5_2, R5_2 - - // skip r**4 calculation if 3 blocks or less - CMPBLE R3, $48, b4 - - // calculate r**4 and 20*(r**4) - VZERO T_8 - VZERO T_9 - VZERO T_10 - SQUARE(R_0, R_1, R_2, R5_2, T_8, T_9, T_10, T_1, T_5, T_7) - REDUCE2(T_8, T_9, T_10, M0, M1, M2, M3, M4, T_2, T_3, M5, T_1) - VZERO T_2 - VZERO T_3 - VMSLG T_0, T_9, T_2, T_2 - VMSLG T_0, T_10, T_3, T_3 - - // put r**2 to the right and r**4 to the left of R_0, R_1, R_2 - VSLDB $8, T_8, T_8, T_8 - VSLDB $8, T_9, T_9, T_9 - VSLDB $8, T_10, T_10, T_10 - VSLDB $8, T_2, T_2, T_2 - VSLDB $8, T_3, T_3, T_3 - - VO T_8, R_0, R_0 - VO T_9, R_1, R_1 - VO T_10, R_2, R_2 - VO T_2, R5_1, R5_1 - VO T_3, R5_2, R5_2 - - CMPBLE R3, $80, load // less than or equal to 5 blocks in message - - // 6(or 5+1) blocks - SUB $81, R3 - VLM (R2), M0, M4 - VLL R3, 80(R2), M5 - ADD $1, R3 - MOVBZ $1, R0 - CMPBGE R3, $16, 2(PC) - VLVGB R3, R0, M5 - MOVD $96(R2), R2 - EXPACC(M0, M1, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3) - EXPACC(M2, M3, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3) - VLEIB $2, $1, H2_0 - VLEIB $2, $1, H2_1 - VLEIB $10, $1, H2_0 - VLEIB $10, $1, H2_1 - - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO T_4 - VZERO T_10 - EXPACC(M4, M5, M0, M1, M2, M3, T_4, T_10, T_0, T_1, T_2, T_3) - VLR T_4, M4 - VLEIB $10, $1, M2 - CMPBLT R3, $16, 2(PC) - VLEIB $10, $1, T_10 - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M2, M3, M4, T_4, T_5, T_2, T_7, T_8, T_9) - VMRHG V0, H0_1, H0_0 - VMRHG V0, H1_1, H1_0 - VMRHG V0, H2_1, H2_0 - VMRLG V0, H0_1, H0_1 - VMRLG V0, H1_1, H1_1 - VMRLG V0, H2_1, H2_1 - - SUB $16, R3 - CMPBLE R3, $0, square - -load: - // load EX0, EX1 and EX2 - MOVD $·c<>(SB), R5 - VLM (R5), EX0, EX2 - -loop: - CMPBLE R3, $64, add // b4 // last 4 or less blocks left - - // next 4 full blocks - VLM (R2), M2, M5 - SUB $64, R3 - MOVD $64(R2), R2 - REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, T_0, T_1, T_3, T_4, T_5, T_2, T_7, T_8, T_9) - - // expacc in-lined to create [m2, m3] limbs - VGBM $0x3f3f, T_0 // 44 bit clear mask - VGBM $0x1f1f, T_1 // 40 bit clear mask - VPERM M2, M3, EX0, T_3 - VESRLG $4, T_0, T_0 // 44 bit clear mask ready - VPERM M2, M3, EX1, T_4 - VPERM M2, M3, EX2, T_5 - VN T_0, T_3, T_3 - VESRLG $4, T_4, T_4 - VN T_1, T_5, T_5 - VN T_0, T_4, T_4 - VMRHG H0_1, T_3, H0_0 - VMRHG H1_1, T_4, H1_0 - VMRHG H2_1, T_5, H2_0 - VMRLG H0_1, T_3, H0_1 - VMRLG H1_1, T_4, H1_1 - VMRLG H2_1, T_5, H2_1 - VLEIB $10, $1, H2_0 - VLEIB $10, $1, H2_1 - VPERM M4, M5, EX0, T_3 - VPERM M4, M5, EX1, T_4 - VPERM M4, M5, EX2, T_5 - VN T_0, T_3, T_3 - VESRLG $4, T_4, T_4 - VN T_1, T_5, T_5 - VN T_0, T_4, T_4 - VMRHG V0, T_3, M0 - VMRHG V0, T_4, M1 - VMRHG V0, T_5, M2 - VMRLG V0, T_3, M3 - VMRLG V0, T_4, M4 - VMRLG V0, T_5, M5 - VLEIB $10, $1, M2 - VLEIB $10, $1, M5 - - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - CMPBNE R3, $0, loop - REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9) - VMRHG V0, H0_1, H0_0 - VMRHG V0, H1_1, H1_0 - VMRHG V0, H2_1, H2_0 - VMRLG V0, H0_1, H0_1 - VMRLG V0, H1_1, H1_1 - VMRLG V0, H2_1, H2_1 - - // load EX0, EX1, EX2 - MOVD $·constants<>(SB), R5 - VLM (R5), EX0, EX2 - - // sum vectors - VAQ H0_0, H0_1, H0_0 - VAQ H1_0, H1_1, H1_0 - VAQ H2_0, H2_1, H2_0 - - // h may be >= 2*(2**130-5) so we need to reduce it again - // M0...M4 are used as temps here - REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) - -next: // carry h1->h2 - VLEIB $7, $0x28, T_1 - VREPIB $4, T_2 - VGBM $0x003F, T_3 - VESRLG $4, T_3 - - // byte shift - VSRLB T_1, H1_0, T_4 - - // bit shift - VSRL T_2, T_4, T_4 - - // clear h1 carry bits - VN T_3, H1_0, H1_0 - - // add carry - VAQ T_4, H2_0, H2_0 - - // h is now < 2*(2**130-5) - // pack h into h1 (hi) and h0 (lo) - PACK(H0_0, H1_0, H2_0) - - // if h > 2**130-5 then h -= 2**130-5 - MOD(H0_0, H1_0, T_0, T_1, T_2) - - // h += s - MOVD $·bswapMask<>(SB), R5 - VL (R5), T_1 - VL 16(R4), T_0 - VPERM T_0, T_0, T_1, T_0 // reverse bytes (to big) - VAQ T_0, H0_0, H0_0 - VPERM H0_0, H0_0, T_1, H0_0 // reverse bytes (to little) - VST H0_0, (R1) - RET - -add: - // load EX0, EX1, EX2 - MOVD $·constants<>(SB), R5 - VLM (R5), EX0, EX2 - - REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9) - VMRHG V0, H0_1, H0_0 - VMRHG V0, H1_1, H1_0 - VMRHG V0, H2_1, H2_0 - VMRLG V0, H0_1, H0_1 - VMRLG V0, H1_1, H1_1 - VMRLG V0, H2_1, H2_1 - CMPBLE R3, $64, b4 - -b4: - CMPBLE R3, $48, b3 // 3 blocks or less - - // 4(3+1) blocks remaining - SUB $49, R3 - VLM (R2), M0, M2 - VLL R3, 48(R2), M3 - ADD $1, R3 - MOVBZ $1, R0 - CMPBEQ R3, $16, 2(PC) - VLVGB R3, R0, M3 - MOVD $64(R2), R2 - EXPACC(M0, M1, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3) - VLEIB $10, $1, H2_0 - VLEIB $10, $1, H2_1 - VZERO M0 - VZERO M1 - VZERO M4 - VZERO M5 - VZERO T_4 - VZERO T_10 - EXPACC(M2, M3, M0, M1, M4, M5, T_4, T_10, T_0, T_1, T_2, T_3) - VLR T_4, M2 - VLEIB $10, $1, M4 - CMPBNE R3, $16, 2(PC) - VLEIB $10, $1, T_10 - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M4, M5, M2, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9) - VMRHG V0, H0_1, H0_0 - VMRHG V0, H1_1, H1_0 - VMRHG V0, H2_1, H2_0 - VMRLG V0, H0_1, H0_1 - VMRLG V0, H1_1, H1_1 - VMRLG V0, H2_1, H2_1 - SUB $16, R3 - CMPBLE R3, $0, square // this condition must always hold true! - -b3: - CMPBLE R3, $32, b2 - - // 3 blocks remaining - - // setup [r²,r] - VSLDB $8, R_0, R_0, R_0 - VSLDB $8, R_1, R_1, R_1 - VSLDB $8, R_2, R_2, R_2 - VSLDB $8, R5_1, R5_1, R5_1 - VSLDB $8, R5_2, R5_2, R5_2 - - VLVGG $1, RSAVE_0, R_0 - VLVGG $1, RSAVE_1, R_1 - VLVGG $1, RSAVE_2, R_2 - VLVGG $1, R5SAVE_1, R5_1 - VLVGG $1, R5SAVE_2, R5_2 - - // setup [h0, h1] - VSLDB $8, H0_0, H0_0, H0_0 - VSLDB $8, H1_0, H1_0, H1_0 - VSLDB $8, H2_0, H2_0, H2_0 - VO H0_1, H0_0, H0_0 - VO H1_1, H1_0, H1_0 - VO H2_1, H2_0, H2_0 - VZERO H0_1 - VZERO H1_1 - VZERO H2_1 - - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - - // H*[r**2, r] - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, H0_1, H1_1, T_10, M5) - - SUB $33, R3 - VLM (R2), M0, M1 - VLL R3, 32(R2), M2 - ADD $1, R3 - MOVBZ $1, R0 - CMPBEQ R3, $16, 2(PC) - VLVGB R3, R0, M2 - - // H += m0 - VZERO T_1 - VZERO T_2 - VZERO T_3 - EXPACC2(M0, T_1, T_2, T_3, T_4, T_5, T_6) - VLEIB $10, $1, T_3 - VAG H0_0, T_1, H0_0 - VAG H1_0, T_2, H1_0 - VAG H2_0, T_3, H2_0 - - VZERO M0 - VZERO M3 - VZERO M4 - VZERO M5 - VZERO T_10 - - // (H+m0)*r - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M3, M4, M5, V0, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M0, M3, M4, M5, T_10, H0_1, H1_1, H2_1, T_9) - - // H += m1 - VZERO V0 - VZERO T_1 - VZERO T_2 - VZERO T_3 - EXPACC2(M1, T_1, T_2, T_3, T_4, T_5, T_6) - VLEIB $10, $1, T_3 - VAQ H0_0, T_1, H0_0 - VAQ H1_0, T_2, H1_0 - VAQ H2_0, T_3, H2_0 - REDUCE2(H0_0, H1_0, H2_0, M0, M3, M4, M5, T_9, H0_1, H1_1, H2_1, T_10) - - // [H, m2] * [r**2, r] - EXPACC2(M2, H0_0, H1_0, H2_0, T_1, T_2, T_3) - CMPBNE R3, $16, 2(PC) - VLEIB $10, $1, H2_0 - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, H0_1, H1_1, M5, T_10) - SUB $16, R3 - CMPBLE R3, $0, next // this condition must always hold true! - -b2: - CMPBLE R3, $16, b1 - - // 2 blocks remaining - - // setup [r²,r] - VSLDB $8, R_0, R_0, R_0 - VSLDB $8, R_1, R_1, R_1 - VSLDB $8, R_2, R_2, R_2 - VSLDB $8, R5_1, R5_1, R5_1 - VSLDB $8, R5_2, R5_2, R5_2 - - VLVGG $1, RSAVE_0, R_0 - VLVGG $1, RSAVE_1, R_1 - VLVGG $1, RSAVE_2, R_2 - VLVGG $1, R5SAVE_1, R5_1 - VLVGG $1, R5SAVE_2, R5_2 - - // setup [h0, h1] - VSLDB $8, H0_0, H0_0, H0_0 - VSLDB $8, H1_0, H1_0, H1_0 - VSLDB $8, H2_0, H2_0, H2_0 - VO H0_1, H0_0, H0_0 - VO H1_1, H1_0, H1_0 - VO H2_1, H2_0, H2_0 - VZERO H0_1 - VZERO H1_1 - VZERO H2_1 - - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - - // H*[r**2, r] - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M2, M3, M4, T_4, T_5, T_2, T_7, T_8, T_9) - VMRHG V0, H0_1, H0_0 - VMRHG V0, H1_1, H1_0 - VMRHG V0, H2_1, H2_0 - VMRLG V0, H0_1, H0_1 - VMRLG V0, H1_1, H1_1 - VMRLG V0, H2_1, H2_1 - - // move h to the left and 0s at the right - VSLDB $8, H0_0, H0_0, H0_0 - VSLDB $8, H1_0, H1_0, H1_0 - VSLDB $8, H2_0, H2_0, H2_0 - - // get message blocks and append 1 to start - SUB $17, R3 - VL (R2), M0 - VLL R3, 16(R2), M1 - ADD $1, R3 - MOVBZ $1, R0 - CMPBEQ R3, $16, 2(PC) - VLVGB R3, R0, M1 - VZERO T_6 - VZERO T_7 - VZERO T_8 - EXPACC2(M0, T_6, T_7, T_8, T_1, T_2, T_3) - EXPACC2(M1, T_6, T_7, T_8, T_1, T_2, T_3) - VLEIB $2, $1, T_8 - CMPBNE R3, $16, 2(PC) - VLEIB $10, $1, T_8 - - // add [m0, m1] to h - VAG H0_0, T_6, H0_0 - VAG H1_0, T_7, H1_0 - VAG H2_0, T_8, H2_0 - - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - VZERO T_10 - VZERO M0 - - // at this point R_0 .. R5_2 look like [r**2, r] - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M2, M3, M4, M5, T_10, M0, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M2, M3, M4, M5, T_9, H0_1, H1_1, H2_1, T_10) - SUB $16, R3, R3 - CMPBLE R3, $0, next - -b1: - CMPBLE R3, $0, next - - // 1 block remaining - - // setup [r²,r] - VSLDB $8, R_0, R_0, R_0 - VSLDB $8, R_1, R_1, R_1 - VSLDB $8, R_2, R_2, R_2 - VSLDB $8, R5_1, R5_1, R5_1 - VSLDB $8, R5_2, R5_2, R5_2 - - VLVGG $1, RSAVE_0, R_0 - VLVGG $1, RSAVE_1, R_1 - VLVGG $1, RSAVE_2, R_2 - VLVGG $1, R5SAVE_1, R5_1 - VLVGG $1, R5SAVE_2, R5_2 - - // setup [h0, h1] - VSLDB $8, H0_0, H0_0, H0_0 - VSLDB $8, H1_0, H1_0, H1_0 - VSLDB $8, H2_0, H2_0, H2_0 - VO H0_1, H0_0, H0_0 - VO H1_1, H1_0, H1_0 - VO H2_1, H2_0, H2_0 - VZERO H0_1 - VZERO H1_1 - VZERO H2_1 - - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - - // H*[r**2, r] - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) - - // set up [0, m0] limbs - SUB $1, R3 - VLL R3, (R2), M0 - ADD $1, R3 - MOVBZ $1, R0 - CMPBEQ R3, $16, 2(PC) - VLVGB R3, R0, M0 - VZERO T_1 - VZERO T_2 - VZERO T_3 - EXPACC2(M0, T_1, T_2, T_3, T_4, T_5, T_6)// limbs: [0, m] - CMPBNE R3, $16, 2(PC) - VLEIB $10, $1, T_3 - - // h+m0 - VAQ H0_0, T_1, H0_0 - VAQ H1_0, T_2, H1_0 - VAQ H2_0, T_3, H2_0 - - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) - - BR next - -square: - // setup [r²,r] - VSLDB $8, R_0, R_0, R_0 - VSLDB $8, R_1, R_1, R_1 - VSLDB $8, R_2, R_2, R_2 - VSLDB $8, R5_1, R5_1, R5_1 - VSLDB $8, R5_2, R5_2, R5_2 - - VLVGG $1, RSAVE_0, R_0 - VLVGG $1, RSAVE_1, R_1 - VLVGG $1, RSAVE_2, R_2 - VLVGG $1, R5SAVE_1, R5_1 - VLVGG $1, R5SAVE_2, R5_2 - - // setup [h0, h1] - VSLDB $8, H0_0, H0_0, H0_0 - VSLDB $8, H1_0, H1_0, H1_0 - VSLDB $8, H2_0, H2_0, H2_0 - VO H0_1, H0_0, H0_0 - VO H1_1, H1_0, H1_0 - VO H2_1, H2_0, H2_0 - VZERO H0_1 - VZERO H1_1 - VZERO H2_1 - - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - - // (h0*r**2) + (h1*r) - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) - BR next diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go index 656e8df94..c400dfcf7 100644 --- a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go +++ b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build amd64,!appengine,!gccgo +//go:build amd64 && !purego && gc +// +build amd64,!purego,gc package salsa diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s index 18085d2e8..c08927720 100644 --- a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s +++ b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s @@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build amd64,!appengine,!gccgo +//go:build amd64 && !purego && gc +// +build amd64,!purego,gc // This code was translated into a form compatible with 6a from the public // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html // func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte) -// This needs up to 64 bytes at 360(SP); hence the non-obvious frame size. +// This needs up to 64 bytes at 360(R12); hence the non-obvious frame size. TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVQ out+0(FP),DI MOVQ in+8(FP),SI @@ -17,10 +18,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVQ key+32(FP),R8 MOVQ SP,R12 - MOVQ SP,R9 - ADDQ $31, R9 - ANDQ $~31, R9 - MOVQ R9, SP + ADDQ $31, R12 + ANDQ $~31, R12 MOVQ DX,R9 MOVQ CX,DX @@ -32,116 +31,116 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL 0(R10),R8 MOVL 0(DX),AX MOVL 16(R10),R11 - MOVL CX,0(SP) - MOVL R8, 4 (SP) - MOVL AX, 8 (SP) - MOVL R11, 12 (SP) + MOVL CX,0(R12) + MOVL R8, 4 (R12) + MOVL AX, 8 (R12) + MOVL R11, 12 (R12) MOVL 8(DX),CX MOVL 24(R10),R8 MOVL 4(R10),AX MOVL 4(DX),R11 - MOVL CX,16(SP) - MOVL R8, 20 (SP) - MOVL AX, 24 (SP) - MOVL R11, 28 (SP) + MOVL CX,16(R12) + MOVL R8, 20 (R12) + MOVL AX, 24 (R12) + MOVL R11, 28 (R12) MOVL 12(DX),CX MOVL 12(R10),DX MOVL 28(R10),R8 MOVL 8(R10),AX - MOVL DX,32(SP) - MOVL CX, 36 (SP) - MOVL R8, 40 (SP) - MOVL AX, 44 (SP) + MOVL DX,32(R12) + MOVL CX, 36 (R12) + MOVL R8, 40 (R12) + MOVL AX, 44 (R12) MOVQ $1634760805,DX MOVQ $857760878,CX MOVQ $2036477234,R8 MOVQ $1797285236,AX - MOVL DX,48(SP) - MOVL CX, 52 (SP) - MOVL R8, 56 (SP) - MOVL AX, 60 (SP) + MOVL DX,48(R12) + MOVL CX, 52 (R12) + MOVL R8, 56 (R12) + MOVL AX, 60 (R12) CMPQ R9,$256 JB BYTESBETWEEN1AND255 - MOVOA 48(SP),X0 + MOVOA 48(R12),X0 PSHUFL $0X55,X0,X1 PSHUFL $0XAA,X0,X2 PSHUFL $0XFF,X0,X3 PSHUFL $0X00,X0,X0 - MOVOA X1,64(SP) - MOVOA X2,80(SP) - MOVOA X3,96(SP) - MOVOA X0,112(SP) - MOVOA 0(SP),X0 + MOVOA X1,64(R12) + MOVOA X2,80(R12) + MOVOA X3,96(R12) + MOVOA X0,112(R12) + MOVOA 0(R12),X0 PSHUFL $0XAA,X0,X1 PSHUFL $0XFF,X0,X2 PSHUFL $0X00,X0,X3 PSHUFL $0X55,X0,X0 - MOVOA X1,128(SP) - MOVOA X2,144(SP) - MOVOA X3,160(SP) - MOVOA X0,176(SP) - MOVOA 16(SP),X0 + MOVOA X1,128(R12) + MOVOA X2,144(R12) + MOVOA X3,160(R12) + MOVOA X0,176(R12) + MOVOA 16(R12),X0 PSHUFL $0XFF,X0,X1 PSHUFL $0X55,X0,X2 PSHUFL $0XAA,X0,X0 - MOVOA X1,192(SP) - MOVOA X2,208(SP) - MOVOA X0,224(SP) - MOVOA 32(SP),X0 + MOVOA X1,192(R12) + MOVOA X2,208(R12) + MOVOA X0,224(R12) + MOVOA 32(R12),X0 PSHUFL $0X00,X0,X1 PSHUFL $0XAA,X0,X2 PSHUFL $0XFF,X0,X0 - MOVOA X1,240(SP) - MOVOA X2,256(SP) - MOVOA X0,272(SP) + MOVOA X1,240(R12) + MOVOA X2,256(R12) + MOVOA X0,272(R12) BYTESATLEAST256: - MOVL 16(SP),DX - MOVL 36 (SP),CX - MOVL DX,288(SP) - MOVL CX,304(SP) + MOVL 16(R12),DX + MOVL 36 (R12),CX + MOVL DX,288(R12) + MOVL CX,304(R12) SHLQ $32,CX ADDQ CX,DX ADDQ $1,DX MOVQ DX,CX SHRQ $32,CX - MOVL DX, 292 (SP) - MOVL CX, 308 (SP) + MOVL DX, 292 (R12) + MOVL CX, 308 (R12) ADDQ $1,DX MOVQ DX,CX SHRQ $32,CX - MOVL DX, 296 (SP) - MOVL CX, 312 (SP) + MOVL DX, 296 (R12) + MOVL CX, 312 (R12) ADDQ $1,DX MOVQ DX,CX SHRQ $32,CX - MOVL DX, 300 (SP) - MOVL CX, 316 (SP) + MOVL DX, 300 (R12) + MOVL CX, 316 (R12) ADDQ $1,DX MOVQ DX,CX SHRQ $32,CX - MOVL DX,16(SP) - MOVL CX, 36 (SP) - MOVQ R9,352(SP) + MOVL DX,16(R12) + MOVL CX, 36 (R12) + MOVQ R9,352(R12) MOVQ $20,DX - MOVOA 64(SP),X0 - MOVOA 80(SP),X1 - MOVOA 96(SP),X2 - MOVOA 256(SP),X3 - MOVOA 272(SP),X4 - MOVOA 128(SP),X5 - MOVOA 144(SP),X6 - MOVOA 176(SP),X7 - MOVOA 192(SP),X8 - MOVOA 208(SP),X9 - MOVOA 224(SP),X10 - MOVOA 304(SP),X11 - MOVOA 112(SP),X12 - MOVOA 160(SP),X13 - MOVOA 240(SP),X14 - MOVOA 288(SP),X15 + MOVOA 64(R12),X0 + MOVOA 80(R12),X1 + MOVOA 96(R12),X2 + MOVOA 256(R12),X3 + MOVOA 272(R12),X4 + MOVOA 128(R12),X5 + MOVOA 144(R12),X6 + MOVOA 176(R12),X7 + MOVOA 192(R12),X8 + MOVOA 208(R12),X9 + MOVOA 224(R12),X10 + MOVOA 304(R12),X11 + MOVOA 112(R12),X12 + MOVOA 160(R12),X13 + MOVOA 240(R12),X14 + MOVOA 288(R12),X15 MAINLOOP1: - MOVOA X1,320(SP) - MOVOA X2,336(SP) + MOVOA X1,320(R12) + MOVOA X2,336(R12) MOVOA X13,X1 PADDL X12,X1 MOVOA X1,X2 @@ -191,8 +190,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X1,X12 PSRLL $14,X2 PXOR X2,X12 - MOVOA 320(SP),X1 - MOVOA X12,320(SP) + MOVOA 320(R12),X1 + MOVOA X12,320(R12) MOVOA X9,X2 PADDL X7,X2 MOVOA X2,X12 @@ -207,8 +206,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X2,X3 PSRLL $25,X12 PXOR X12,X3 - MOVOA 336(SP),X2 - MOVOA X0,336(SP) + MOVOA 336(R12),X2 + MOVOA X0,336(R12) MOVOA X6,X0 PADDL X2,X0 MOVOA X0,X12 @@ -251,8 +250,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X0,X1 PSRLL $14,X12 PXOR X12,X1 - MOVOA 320(SP),X0 - MOVOA X1,320(SP) + MOVOA 320(R12),X0 + MOVOA X1,320(R12) MOVOA X4,X1 PADDL X0,X1 MOVOA X1,X12 @@ -267,8 +266,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X1,X2 PSRLL $14,X12 PXOR X12,X2 - MOVOA 336(SP),X12 - MOVOA X2,336(SP) + MOVOA 336(R12),X12 + MOVOA X2,336(R12) MOVOA X14,X1 PADDL X12,X1 MOVOA X1,X2 @@ -311,8 +310,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X1,X0 PSRLL $14,X2 PXOR X2,X0 - MOVOA 320(SP),X1 - MOVOA X0,320(SP) + MOVOA 320(R12),X1 + MOVOA X0,320(R12) MOVOA X8,X0 PADDL X14,X0 MOVOA X0,X2 @@ -327,8 +326,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X0,X6 PSRLL $25,X2 PXOR X2,X6 - MOVOA 336(SP),X2 - MOVOA X12,336(SP) + MOVOA 336(R12),X2 + MOVOA X12,336(R12) MOVOA X3,X0 PADDL X2,X0 MOVOA X0,X12 @@ -378,14 +377,14 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X0,X2 PSRLL $14,X12 PXOR X12,X2 - MOVOA 320(SP),X12 - MOVOA 336(SP),X0 + MOVOA 320(R12),X12 + MOVOA 336(R12),X0 SUBQ $2,DX JA MAINLOOP1 - PADDL 112(SP),X12 - PADDL 176(SP),X7 - PADDL 224(SP),X10 - PADDL 272(SP),X4 + PADDL 112(R12),X12 + PADDL 176(R12),X7 + PADDL 224(R12),X10 + PADDL 272(R12),X4 MOVD X12,DX MOVD X7,CX MOVD X10,R8 @@ -446,10 +445,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL CX,196(DI) MOVL R8,200(DI) MOVL R9,204(DI) - PADDL 240(SP),X14 - PADDL 64(SP),X0 - PADDL 128(SP),X5 - PADDL 192(SP),X8 + PADDL 240(R12),X14 + PADDL 64(R12),X0 + PADDL 128(R12),X5 + PADDL 192(R12),X8 MOVD X14,DX MOVD X0,CX MOVD X5,R8 @@ -510,10 +509,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL CX,212(DI) MOVL R8,216(DI) MOVL R9,220(DI) - PADDL 288(SP),X15 - PADDL 304(SP),X11 - PADDL 80(SP),X1 - PADDL 144(SP),X6 + PADDL 288(R12),X15 + PADDL 304(R12),X11 + PADDL 80(R12),X1 + PADDL 144(R12),X6 MOVD X15,DX MOVD X11,CX MOVD X1,R8 @@ -574,10 +573,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL CX,228(DI) MOVL R8,232(DI) MOVL R9,236(DI) - PADDL 160(SP),X13 - PADDL 208(SP),X9 - PADDL 256(SP),X3 - PADDL 96(SP),X2 + PADDL 160(R12),X13 + PADDL 208(R12),X9 + PADDL 256(R12),X3 + PADDL 96(R12),X2 MOVD X13,DX MOVD X9,CX MOVD X3,R8 @@ -638,7 +637,7 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL CX,244(DI) MOVL R8,248(DI) MOVL R9,252(DI) - MOVQ 352(SP),R9 + MOVQ 352(R12),R9 SUBQ $256,R9 ADDQ $256,SI ADDQ $256,DI @@ -650,17 +649,17 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment CMPQ R9,$64 JAE NOCOPY MOVQ DI,DX - LEAQ 360(SP),DI + LEAQ 360(R12),DI MOVQ R9,CX REP; MOVSB - LEAQ 360(SP),DI - LEAQ 360(SP),SI + LEAQ 360(R12),DI + LEAQ 360(R12),SI NOCOPY: - MOVQ R9,352(SP) - MOVOA 48(SP),X0 - MOVOA 0(SP),X1 - MOVOA 16(SP),X2 - MOVOA 32(SP),X3 + MOVQ R9,352(R12) + MOVOA 48(R12),X0 + MOVOA 0(R12),X1 + MOVOA 16(R12),X2 + MOVOA 32(R12),X3 MOVOA X1,X4 MOVQ $20,CX MAINLOOP2: @@ -791,10 +790,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PSHUFL $0X39,X3,X3 PXOR X6,X0 JA MAINLOOP2 - PADDL 48(SP),X0 - PADDL 0(SP),X1 - PADDL 16(SP),X2 - PADDL 32(SP),X3 + PADDL 48(R12),X0 + PADDL 0(R12),X1 + PADDL 16(R12),X2 + PADDL 32(R12),X3 MOVD X0,CX MOVD X1,R8 MOVD X2,R9 @@ -855,16 +854,16 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL R8,44(DI) MOVL R9,28(DI) MOVL AX,12(DI) - MOVQ 352(SP),R9 - MOVL 16(SP),CX - MOVL 36 (SP),R8 + MOVQ 352(R12),R9 + MOVL 16(R12),CX + MOVL 36 (R12),R8 ADDQ $1,CX SHLQ $32,R8 ADDQ R8,CX MOVQ CX,R8 SHRQ $32,R8 - MOVL CX,16(SP) - MOVL R8, 36 (SP) + MOVL CX,16(R12) + MOVL R8, 36 (R12) CMPQ R9,$64 JA BYTESATLEAST65 JAE BYTESATLEAST64 @@ -874,7 +873,6 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment REP; MOVSB BYTESATLEAST64: DONE: - MOVQ R12,SP RET BYTESATLEAST65: SUBQ $64,R9 diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go index 8a46bd2b3..4392cc1ac 100644 --- a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go +++ b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !amd64 appengine gccgo +//go:build !amd64 || purego || !gc +// +build !amd64 purego !gc package salsa diff --git a/vendor/golang.org/x/crypto/scrypt/scrypt.go b/vendor/golang.org/x/crypto/scrypt/scrypt.go index 2f81fe414..bbe4494c6 100644 --- a/vendor/golang.org/x/crypto/scrypt/scrypt.go +++ b/vendor/golang.org/x/crypto/scrypt/scrypt.go @@ -9,6 +9,7 @@ package scrypt // import "golang.org/x/crypto/scrypt" import ( "crypto/sha256" + "encoding/binary" "errors" "math/bits" @@ -143,36 +144,34 @@ func integer(b []uint32, r int) uint64 { func smix(b []byte, r, N int, v, xy []uint32) { var tmp [16]uint32 + R := 32 * r x := xy - y := xy[32*r:] + y := xy[R:] j := 0 - for i := 0; i < 32*r; i++ { - x[i] = uint32(b[j]) | uint32(b[j+1])<<8 | uint32(b[j+2])<<16 | uint32(b[j+3])<<24 + for i := 0; i < R; i++ { + x[i] = binary.LittleEndian.Uint32(b[j:]) j += 4 } for i := 0; i < N; i += 2 { - blockCopy(v[i*(32*r):], x, 32*r) + blockCopy(v[i*R:], x, R) blockMix(&tmp, x, y, r) - blockCopy(v[(i+1)*(32*r):], y, 32*r) + blockCopy(v[(i+1)*R:], y, R) blockMix(&tmp, y, x, r) } for i := 0; i < N; i += 2 { j := int(integer(x, r) & uint64(N-1)) - blockXOR(x, v[j*(32*r):], 32*r) + blockXOR(x, v[j*R:], R) blockMix(&tmp, x, y, r) j = int(integer(y, r) & uint64(N-1)) - blockXOR(y, v[j*(32*r):], 32*r) + blockXOR(y, v[j*R:], R) blockMix(&tmp, y, x, r) } j = 0 - for _, v := range x[:32*r] { - b[j+0] = byte(v >> 0) - b[j+1] = byte(v >> 8) - b[j+2] = byte(v >> 16) - b[j+3] = byte(v >> 24) + for _, v := range x[:R] { + binary.LittleEndian.PutUint32(b[j:], v) j += 4 } } diff --git a/vendor/golang.org/x/crypto/ssh/certs.go b/vendor/golang.org/x/crypto/ssh/certs.go index 00ed9923e..916c840b6 100644 --- a/vendor/golang.org/x/crypto/ssh/certs.go +++ b/vendor/golang.org/x/crypto/ssh/certs.go @@ -17,12 +17,14 @@ import ( // These constants from [PROTOCOL.certkeys] represent the algorithm names // for certificate types supported by this package. const ( - CertAlgoRSAv01 = "ssh-rsa-cert-v01@openssh.com" - CertAlgoDSAv01 = "ssh-dss-cert-v01@openssh.com" - CertAlgoECDSA256v01 = "ecdsa-sha2-nistp256-cert-v01@openssh.com" - CertAlgoECDSA384v01 = "ecdsa-sha2-nistp384-cert-v01@openssh.com" - CertAlgoECDSA521v01 = "ecdsa-sha2-nistp521-cert-v01@openssh.com" - CertAlgoED25519v01 = "ssh-ed25519-cert-v01@openssh.com" + CertAlgoRSAv01 = "ssh-rsa-cert-v01@openssh.com" + CertAlgoDSAv01 = "ssh-dss-cert-v01@openssh.com" + CertAlgoECDSA256v01 = "ecdsa-sha2-nistp256-cert-v01@openssh.com" + CertAlgoECDSA384v01 = "ecdsa-sha2-nistp384-cert-v01@openssh.com" + CertAlgoECDSA521v01 = "ecdsa-sha2-nistp521-cert-v01@openssh.com" + CertAlgoSKECDSA256v01 = "sk-ecdsa-sha2-nistp256-cert-v01@openssh.com" + CertAlgoED25519v01 = "ssh-ed25519-cert-v01@openssh.com" + CertAlgoSKED25519v01 = "sk-ssh-ed25519-cert-v01@openssh.com" ) // Certificate types distinguish between host and user @@ -37,6 +39,7 @@ const ( type Signature struct { Format string Blob []byte + Rest []byte `ssh:"rest"` } // CertTimeInfinity can be used for OpenSSHCertV01.ValidBefore to indicate that @@ -411,8 +414,8 @@ func (c *CertChecker) CheckCert(principal string, cert *Certificate) error { return nil } -// SignCert sets c.SignatureKey to the authority's public key and stores a -// Signature, by authority, in the certificate. +// SignCert signs the certificate with an authority, setting the Nonce, +// SignatureKey, and Signature fields. func (c *Certificate) SignCert(rand io.Reader, authority Signer) error { c.Nonce = make([]byte, 32) if _, err := io.ReadFull(rand, c.Nonce); err != nil { @@ -429,12 +432,14 @@ func (c *Certificate) SignCert(rand io.Reader, authority Signer) error { } var certAlgoNames = map[string]string{ - KeyAlgoRSA: CertAlgoRSAv01, - KeyAlgoDSA: CertAlgoDSAv01, - KeyAlgoECDSA256: CertAlgoECDSA256v01, - KeyAlgoECDSA384: CertAlgoECDSA384v01, - KeyAlgoECDSA521: CertAlgoECDSA521v01, - KeyAlgoED25519: CertAlgoED25519v01, + KeyAlgoRSA: CertAlgoRSAv01, + KeyAlgoDSA: CertAlgoDSAv01, + KeyAlgoECDSA256: CertAlgoECDSA256v01, + KeyAlgoECDSA384: CertAlgoECDSA384v01, + KeyAlgoECDSA521: CertAlgoECDSA521v01, + KeyAlgoSKECDSA256: CertAlgoSKECDSA256v01, + KeyAlgoED25519: CertAlgoED25519v01, + KeyAlgoSKED25519: CertAlgoSKED25519v01, } // certToPrivAlgo returns the underlying algorithm for a certificate algorithm. @@ -518,6 +523,12 @@ func parseSignatureBody(in []byte) (out *Signature, rest []byte, ok bool) { return } + switch out.Format { + case KeyAlgoSKECDSA256, CertAlgoSKECDSA256v01, KeyAlgoSKED25519, CertAlgoSKED25519v01: + out.Rest = in + return out, nil, ok + } + return out, in, ok } diff --git a/vendor/golang.org/x/crypto/ssh/cipher.go b/vendor/golang.org/x/crypto/ssh/cipher.go index a65a923be..bddbde5db 100644 --- a/vendor/golang.org/x/crypto/ssh/cipher.go +++ b/vendor/golang.org/x/crypto/ssh/cipher.go @@ -16,10 +16,9 @@ import ( "hash" "io" "io/ioutil" - "math/bits" - "golang.org/x/crypto/internal/chacha20" - "golang.org/x/crypto/poly1305" + "golang.org/x/crypto/chacha20" + "golang.org/x/crypto/internal/poly1305" ) const ( @@ -120,7 +119,7 @@ var cipherModes = map[string]*cipherMode{ chacha20Poly1305ID: {64, 0, newChaCha20Cipher}, // CBC mode is insecure and so is not included in the default config. - // (See http://www.isg.rhul.ac.uk/~kp/SandPfinal.pdf). If absolutely + // (See https://www.ieee-security.org/TC/SP2013/papers/4977a526.pdf). If absolutely // needed, it's possible to specify a custom Config to enable it. // You should expect that an active attacker can recover plaintext if // you do. @@ -642,8 +641,8 @@ const chacha20Poly1305ID = "chacha20-poly1305@openssh.com" // the methods here also implement padding, which RFC4253 Section 6 // also requires of stream ciphers. type chacha20Poly1305Cipher struct { - lengthKey [8]uint32 - contentKey [8]uint32 + lengthKey [32]byte + contentKey [32]byte buf []byte } @@ -656,21 +655,21 @@ func newChaCha20Cipher(key, unusedIV, unusedMACKey []byte, unusedAlgs directionA buf: make([]byte, 256), } - for i := range c.contentKey { - c.contentKey[i] = binary.LittleEndian.Uint32(key[i*4 : (i+1)*4]) - } - for i := range c.lengthKey { - c.lengthKey[i] = binary.LittleEndian.Uint32(key[(i+8)*4 : (i+9)*4]) - } + copy(c.contentKey[:], key[:32]) + copy(c.lengthKey[:], key[32:]) return c, nil } func (c *chacha20Poly1305Cipher) readCipherPacket(seqNum uint32, r io.Reader) ([]byte, error) { - nonce := [3]uint32{0, 0, bits.ReverseBytes32(seqNum)} - s := chacha20.New(c.contentKey, nonce) - var polyKey [32]byte + nonce := make([]byte, 12) + binary.BigEndian.PutUint32(nonce[8:], seqNum) + s, err := chacha20.NewUnauthenticatedCipher(c.contentKey[:], nonce) + if err != nil { + return nil, err + } + var polyKey, discardBuf [32]byte s.XORKeyStream(polyKey[:], polyKey[:]) - s.Advance() // skip next 32 bytes + s.XORKeyStream(discardBuf[:], discardBuf[:]) // skip the next 32 bytes encryptedLength := c.buf[:4] if _, err := io.ReadFull(r, encryptedLength); err != nil { @@ -678,7 +677,11 @@ func (c *chacha20Poly1305Cipher) readCipherPacket(seqNum uint32, r io.Reader) ([ } var lenBytes [4]byte - chacha20.New(c.lengthKey, nonce).XORKeyStream(lenBytes[:], encryptedLength) + ls, err := chacha20.NewUnauthenticatedCipher(c.lengthKey[:], nonce) + if err != nil { + return nil, err + } + ls.XORKeyStream(lenBytes[:], encryptedLength) length := binary.BigEndian.Uint32(lenBytes[:]) if length > maxPacket { @@ -724,11 +727,15 @@ func (c *chacha20Poly1305Cipher) readCipherPacket(seqNum uint32, r io.Reader) ([ } func (c *chacha20Poly1305Cipher) writeCipherPacket(seqNum uint32, w io.Writer, rand io.Reader, payload []byte) error { - nonce := [3]uint32{0, 0, bits.ReverseBytes32(seqNum)} - s := chacha20.New(c.contentKey, nonce) - var polyKey [32]byte + nonce := make([]byte, 12) + binary.BigEndian.PutUint32(nonce[8:], seqNum) + s, err := chacha20.NewUnauthenticatedCipher(c.contentKey[:], nonce) + if err != nil { + return err + } + var polyKey, discardBuf [32]byte s.XORKeyStream(polyKey[:], polyKey[:]) - s.Advance() // skip next 32 bytes + s.XORKeyStream(discardBuf[:], discardBuf[:]) // skip the next 32 bytes // There is no blocksize, so fall back to multiple of 8 byte // padding, as described in RFC 4253, Sec 6. @@ -748,7 +755,11 @@ func (c *chacha20Poly1305Cipher) writeCipherPacket(seqNum uint32, w io.Writer, r } binary.BigEndian.PutUint32(c.buf, uint32(1+len(payload)+padding)) - chacha20.New(c.lengthKey, nonce).XORKeyStream(c.buf, c.buf[:4]) + ls, err := chacha20.NewUnauthenticatedCipher(c.lengthKey[:], nonce) + if err != nil { + return err + } + ls.XORKeyStream(c.buf, c.buf[:4]) c.buf[4] = byte(padding) copy(c.buf[5:], payload) packetEnd := 5 + len(payload) + padding diff --git a/vendor/golang.org/x/crypto/ssh/client.go b/vendor/golang.org/x/crypto/ssh/client.go index 7b00bff1c..99f68bd32 100644 --- a/vendor/golang.org/x/crypto/ssh/client.go +++ b/vendor/golang.org/x/crypto/ssh/client.go @@ -77,7 +77,7 @@ func NewClientConn(c net.Conn, addr string, config *ClientConfig) (Conn, <-chan } conn := &connection{ - sshConn: sshConn{conn: c}, + sshConn: sshConn{conn: c, user: fullConf.User}, } if err := conn.clientHandshake(addr, &fullConf); err != nil { diff --git a/vendor/golang.org/x/crypto/ssh/client_auth.go b/vendor/golang.org/x/crypto/ssh/client_auth.go index 0590070e2..c611aeb68 100644 --- a/vendor/golang.org/x/crypto/ssh/client_auth.go +++ b/vendor/golang.org/x/crypto/ssh/client_auth.go @@ -36,7 +36,7 @@ func (c *connection) clientAuthenticate(config *ClientConfig) error { // during the authentication phase the client first attempts the "none" method // then any untried methods suggested by the server. - tried := make(map[string]bool) + var tried []string var lastMethods []string sessionID := c.transport.getSessionID() @@ -49,7 +49,9 @@ func (c *connection) clientAuthenticate(config *ClientConfig) error { // success return nil } else if ok == authFailure { - tried[auth.method()] = true + if m := auth.method(); !contains(tried, m) { + tried = append(tried, m) + } } if methods == nil { methods = lastMethods @@ -61,7 +63,7 @@ func (c *connection) clientAuthenticate(config *ClientConfig) error { findNext: for _, a := range config.Auth { candidateMethod := a.method() - if tried[candidateMethod] { + if contains(tried, candidateMethod) { continue } for _, meth := range methods { @@ -72,16 +74,16 @@ func (c *connection) clientAuthenticate(config *ClientConfig) error { } } } - return fmt.Errorf("ssh: unable to authenticate, attempted methods %v, no supported methods remain", keys(tried)) + return fmt.Errorf("ssh: unable to authenticate, attempted methods %v, no supported methods remain", tried) } -func keys(m map[string]bool) []string { - s := make([]string, 0, len(m)) - - for key := range m { - s = append(s, key) +func contains(list []string, e string) bool { + for _, s := range list { + if s == e { + return true + } } - return s + return false } // An AuthMethod represents an instance of an RFC 4252 authentication method. @@ -469,7 +471,7 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe } if len(answers) != len(prompts) { - return authFailure, nil, errors.New("ssh: not enough answers from keyboard-interactive callback") + return authFailure, nil, fmt.Errorf("ssh: incorrect number of answers from keyboard-interactive callback %d (expected %d)", len(answers), len(prompts)) } responseLength := 1 + 4 for _, a := range answers { diff --git a/vendor/golang.org/x/crypto/ssh/common.go b/vendor/golang.org/x/crypto/ssh/common.go index d97415d2d..290382d05 100644 --- a/vendor/golang.org/x/crypto/ssh/common.go +++ b/vendor/golang.org/x/crypto/ssh/common.go @@ -51,6 +51,21 @@ var supportedKexAlgos = []string{ kexAlgoDH14SHA1, kexAlgoDH1SHA1, } +// serverForbiddenKexAlgos contains key exchange algorithms, that are forbidden +// for the server half. +var serverForbiddenKexAlgos = map[string]struct{}{ + kexAlgoDHGEXSHA1: {}, // server half implementation is only minimal to satisfy the automated tests + kexAlgoDHGEXSHA256: {}, // server half implementation is only minimal to satisfy the automated tests +} + +// preferredKexAlgos specifies the default preference for key-exchange algorithms +// in preference order. +var preferredKexAlgos = []string{ + kexAlgoCurve25519SHA256, + kexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521, + kexAlgoDH14SHA1, +} + // supportedHostKeyAlgos specifies the supported host-key algorithms (i.e. methods // of authenticating servers) in preference order. var supportedHostKeyAlgos = []string{ @@ -239,7 +254,7 @@ func (c *Config) SetDefaults() { c.Ciphers = ciphers if c.KeyExchanges == nil { - c.KeyExchanges = supportedKexAlgos + c.KeyExchanges = preferredKexAlgos } if c.MACs == nil { diff --git a/vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go b/vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go new file mode 100644 index 000000000..af81d2665 --- /dev/null +++ b/vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go @@ -0,0 +1,93 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package bcrypt_pbkdf implements bcrypt_pbkdf(3) from OpenBSD. +// +// See https://flak.tedunangst.com/post/bcrypt-pbkdf and +// https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libutil/bcrypt_pbkdf.c. +package bcrypt_pbkdf + +import ( + "crypto/sha512" + "errors" + "golang.org/x/crypto/blowfish" +) + +const blockSize = 32 + +// Key derives a key from the password, salt and rounds count, returning a +// []byte of length keyLen that can be used as cryptographic key. +func Key(password, salt []byte, rounds, keyLen int) ([]byte, error) { + if rounds < 1 { + return nil, errors.New("bcrypt_pbkdf: number of rounds is too small") + } + if len(password) == 0 { + return nil, errors.New("bcrypt_pbkdf: empty password") + } + if len(salt) == 0 || len(salt) > 1<<20 { + return nil, errors.New("bcrypt_pbkdf: bad salt length") + } + if keyLen > 1024 { + return nil, errors.New("bcrypt_pbkdf: keyLen is too large") + } + + numBlocks := (keyLen + blockSize - 1) / blockSize + key := make([]byte, numBlocks*blockSize) + + h := sha512.New() + h.Write(password) + shapass := h.Sum(nil) + + shasalt := make([]byte, 0, sha512.Size) + cnt, tmp := make([]byte, 4), make([]byte, blockSize) + for block := 1; block <= numBlocks; block++ { + h.Reset() + h.Write(salt) + cnt[0] = byte(block >> 24) + cnt[1] = byte(block >> 16) + cnt[2] = byte(block >> 8) + cnt[3] = byte(block) + h.Write(cnt) + bcryptHash(tmp, shapass, h.Sum(shasalt)) + + out := make([]byte, blockSize) + copy(out, tmp) + for i := 2; i <= rounds; i++ { + h.Reset() + h.Write(tmp) + bcryptHash(tmp, shapass, h.Sum(shasalt)) + for j := 0; j < len(out); j++ { + out[j] ^= tmp[j] + } + } + + for i, v := range out { + key[i*numBlocks+(block-1)] = v + } + } + return key[:keyLen], nil +} + +var magic = []byte("OxychromaticBlowfishSwatDynamite") + +func bcryptHash(out, shapass, shasalt []byte) { + c, err := blowfish.NewSaltedCipher(shapass, shasalt) + if err != nil { + panic(err) + } + for i := 0; i < 64; i++ { + blowfish.ExpandKey(shasalt, c) + blowfish.ExpandKey(shapass, c) + } + copy(out, magic) + for i := 0; i < 32; i += 8 { + for j := 0; j < 64; j++ { + c.Encrypt(out[i:i+8], out[i:i+8]) + } + } + // Swap bytes due to different endianness. + for i := 0; i < 32; i += 4 { + out[i+3], out[i+2], out[i+1], out[i] = out[i], out[i+1], out[i+2], out[i+3] + } +} diff --git a/vendor/golang.org/x/crypto/ssh/kex.go b/vendor/golang.org/x/crypto/ssh/kex.go index f34bcc013..766e92939 100644 --- a/vendor/golang.org/x/crypto/ssh/kex.go +++ b/vendor/golang.org/x/crypto/ssh/kex.go @@ -10,7 +10,9 @@ import ( "crypto/elliptic" "crypto/rand" "crypto/subtle" + "encoding/binary" "errors" + "fmt" "io" "math/big" @@ -24,6 +26,12 @@ const ( kexAlgoECDH384 = "ecdh-sha2-nistp384" kexAlgoECDH521 = "ecdh-sha2-nistp521" kexAlgoCurve25519SHA256 = "curve25519-sha256@libssh.org" + + // For the following kex only the client half contains a production + // ready implementation. The server half only consists of a minimal + // implementation to satisfy the automated tests. + kexAlgoDHGEXSHA1 = "diffie-hellman-group-exchange-sha1" + kexAlgoDHGEXSHA256 = "diffie-hellman-group-exchange-sha256" ) // kexResult captures the outcome of a key exchange. @@ -204,7 +212,7 @@ func (group *dhGroup) Server(c packetConn, randSource io.Reader, magics *handsha HostKey: hostKeyBytes, Signature: sig, Hash: crypto.SHA1, - }, nil + }, err } // ecdh performs Elliptic Curve Diffie-Hellman key exchange as @@ -402,6 +410,8 @@ func init() { kexAlgoMap[kexAlgoECDH384] = &ecdh{elliptic.P384()} kexAlgoMap[kexAlgoECDH256] = &ecdh{elliptic.P256()} kexAlgoMap[kexAlgoCurve25519SHA256] = &curve25519sha256{} + kexAlgoMap[kexAlgoDHGEXSHA1] = &dhGEXSHA{hashFunc: crypto.SHA1} + kexAlgoMap[kexAlgoDHGEXSHA256] = &dhGEXSHA{hashFunc: crypto.SHA256} } // curve25519sha256 implements the curve25519-sha256@libssh.org key @@ -538,3 +548,235 @@ func (kex *curve25519sha256) Server(c packetConn, rand io.Reader, magics *handsh Hash: crypto.SHA256, }, nil } + +// dhGEXSHA implements the diffie-hellman-group-exchange-sha1 and +// diffie-hellman-group-exchange-sha256 key agreement protocols, +// as described in RFC 4419 +type dhGEXSHA struct { + g, p *big.Int + hashFunc crypto.Hash +} + +const ( + dhGroupExchangeMinimumBits = 2048 + dhGroupExchangePreferredBits = 2048 + dhGroupExchangeMaximumBits = 8192 +) + +func (gex *dhGEXSHA) diffieHellman(theirPublic, myPrivate *big.Int) (*big.Int, error) { + if theirPublic.Sign() <= 0 || theirPublic.Cmp(gex.p) >= 0 { + return nil, fmt.Errorf("ssh: DH parameter out of bounds") + } + return new(big.Int).Exp(theirPublic, myPrivate, gex.p), nil +} + +func (gex dhGEXSHA) Client(c packetConn, randSource io.Reader, magics *handshakeMagics) (*kexResult, error) { + // Send GexRequest + kexDHGexRequest := kexDHGexRequestMsg{ + MinBits: dhGroupExchangeMinimumBits, + PreferedBits: dhGroupExchangePreferredBits, + MaxBits: dhGroupExchangeMaximumBits, + } + if err := c.writePacket(Marshal(&kexDHGexRequest)); err != nil { + return nil, err + } + + // Receive GexGroup + packet, err := c.readPacket() + if err != nil { + return nil, err + } + + var kexDHGexGroup kexDHGexGroupMsg + if err = Unmarshal(packet, &kexDHGexGroup); err != nil { + return nil, err + } + + // reject if p's bit length < dhGroupExchangeMinimumBits or > dhGroupExchangeMaximumBits + if kexDHGexGroup.P.BitLen() < dhGroupExchangeMinimumBits || kexDHGexGroup.P.BitLen() > dhGroupExchangeMaximumBits { + return nil, fmt.Errorf("ssh: server-generated gex p is out of range (%d bits)", kexDHGexGroup.P.BitLen()) + } + + gex.p = kexDHGexGroup.P + gex.g = kexDHGexGroup.G + + // Check if g is safe by verifing that g > 1 and g < p - 1 + one := big.NewInt(1) + var pMinusOne = &big.Int{} + pMinusOne.Sub(gex.p, one) + if gex.g.Cmp(one) != 1 && gex.g.Cmp(pMinusOne) != -1 { + return nil, fmt.Errorf("ssh: server provided gex g is not safe") + } + + // Send GexInit + var pHalf = &big.Int{} + pHalf.Rsh(gex.p, 1) + x, err := rand.Int(randSource, pHalf) + if err != nil { + return nil, err + } + X := new(big.Int).Exp(gex.g, x, gex.p) + kexDHGexInit := kexDHGexInitMsg{ + X: X, + } + if err := c.writePacket(Marshal(&kexDHGexInit)); err != nil { + return nil, err + } + + // Receive GexReply + packet, err = c.readPacket() + if err != nil { + return nil, err + } + + var kexDHGexReply kexDHGexReplyMsg + if err = Unmarshal(packet, &kexDHGexReply); err != nil { + return nil, err + } + + kInt, err := gex.diffieHellman(kexDHGexReply.Y, x) + if err != nil { + return nil, err + } + + // Check if k is safe by verifing that k > 1 and k < p - 1 + if kInt.Cmp(one) != 1 && kInt.Cmp(pMinusOne) != -1 { + return nil, fmt.Errorf("ssh: derived k is not safe") + } + + h := gex.hashFunc.New() + magics.write(h) + writeString(h, kexDHGexReply.HostKey) + binary.Write(h, binary.BigEndian, uint32(dhGroupExchangeMinimumBits)) + binary.Write(h, binary.BigEndian, uint32(dhGroupExchangePreferredBits)) + binary.Write(h, binary.BigEndian, uint32(dhGroupExchangeMaximumBits)) + writeInt(h, gex.p) + writeInt(h, gex.g) + writeInt(h, X) + writeInt(h, kexDHGexReply.Y) + K := make([]byte, intLength(kInt)) + marshalInt(K, kInt) + h.Write(K) + + return &kexResult{ + H: h.Sum(nil), + K: K, + HostKey: kexDHGexReply.HostKey, + Signature: kexDHGexReply.Signature, + Hash: gex.hashFunc, + }, nil +} + +// Server half implementation of the Diffie Hellman Key Exchange with SHA1 and SHA256. +// +// This is a minimal implementation to satisfy the automated tests. +func (gex dhGEXSHA) Server(c packetConn, randSource io.Reader, magics *handshakeMagics, priv Signer) (result *kexResult, err error) { + // Receive GexRequest + packet, err := c.readPacket() + if err != nil { + return + } + var kexDHGexRequest kexDHGexRequestMsg + if err = Unmarshal(packet, &kexDHGexRequest); err != nil { + return + } + + // smoosh the user's preferred size into our own limits + if kexDHGexRequest.PreferedBits > dhGroupExchangeMaximumBits { + kexDHGexRequest.PreferedBits = dhGroupExchangeMaximumBits + } + if kexDHGexRequest.PreferedBits < dhGroupExchangeMinimumBits { + kexDHGexRequest.PreferedBits = dhGroupExchangeMinimumBits + } + // fix min/max if they're inconsistent. technically, we could just pout + // and hang up, but there's no harm in giving them the benefit of the + // doubt and just picking a bitsize for them. + if kexDHGexRequest.MinBits > kexDHGexRequest.PreferedBits { + kexDHGexRequest.MinBits = kexDHGexRequest.PreferedBits + } + if kexDHGexRequest.MaxBits < kexDHGexRequest.PreferedBits { + kexDHGexRequest.MaxBits = kexDHGexRequest.PreferedBits + } + + // Send GexGroup + // This is the group called diffie-hellman-group14-sha1 in RFC + // 4253 and Oakley Group 14 in RFC 3526. + p, _ := new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF", 16) + gex.p = p + gex.g = big.NewInt(2) + + kexDHGexGroup := kexDHGexGroupMsg{ + P: gex.p, + G: gex.g, + } + if err := c.writePacket(Marshal(&kexDHGexGroup)); err != nil { + return nil, err + } + + // Receive GexInit + packet, err = c.readPacket() + if err != nil { + return + } + var kexDHGexInit kexDHGexInitMsg + if err = Unmarshal(packet, &kexDHGexInit); err != nil { + return + } + + var pHalf = &big.Int{} + pHalf.Rsh(gex.p, 1) + + y, err := rand.Int(randSource, pHalf) + if err != nil { + return + } + + Y := new(big.Int).Exp(gex.g, y, gex.p) + kInt, err := gex.diffieHellman(kexDHGexInit.X, y) + if err != nil { + return nil, err + } + + hostKeyBytes := priv.PublicKey().Marshal() + + h := gex.hashFunc.New() + magics.write(h) + writeString(h, hostKeyBytes) + binary.Write(h, binary.BigEndian, uint32(dhGroupExchangeMinimumBits)) + binary.Write(h, binary.BigEndian, uint32(dhGroupExchangePreferredBits)) + binary.Write(h, binary.BigEndian, uint32(dhGroupExchangeMaximumBits)) + writeInt(h, gex.p) + writeInt(h, gex.g) + writeInt(h, kexDHGexInit.X) + writeInt(h, Y) + + K := make([]byte, intLength(kInt)) + marshalInt(K, kInt) + h.Write(K) + + H := h.Sum(nil) + + // H is already a hash, but the hostkey signing will apply its + // own key-specific hash algorithm. + sig, err := signAndMarshal(priv, randSource, H) + if err != nil { + return nil, err + } + + kexDHGexReply := kexDHGexReplyMsg{ + HostKey: hostKeyBytes, + Y: Y, + Signature: sig, + } + packet = Marshal(&kexDHGexReply) + + err = c.writePacket(packet) + + return &kexResult{ + H: H, + K: K, + HostKey: hostKeyBytes, + Signature: sig, + Hash: gex.hashFunc, + }, err +} diff --git a/vendor/golang.org/x/crypto/ssh/keys.go b/vendor/golang.org/x/crypto/ssh/keys.go index 969804794..31f26349a 100644 --- a/vendor/golang.org/x/crypto/ssh/keys.go +++ b/vendor/golang.org/x/crypto/ssh/keys.go @@ -7,6 +7,8 @@ package ssh import ( "bytes" "crypto" + "crypto/aes" + "crypto/cipher" "crypto/dsa" "crypto/ecdsa" "crypto/elliptic" @@ -25,17 +27,20 @@ import ( "strings" "golang.org/x/crypto/ed25519" + "golang.org/x/crypto/ssh/internal/bcrypt_pbkdf" ) // These constants represent the algorithm names for key types supported by this // package. const ( - KeyAlgoRSA = "ssh-rsa" - KeyAlgoDSA = "ssh-dss" - KeyAlgoECDSA256 = "ecdsa-sha2-nistp256" - KeyAlgoECDSA384 = "ecdsa-sha2-nistp384" - KeyAlgoECDSA521 = "ecdsa-sha2-nistp521" - KeyAlgoED25519 = "ssh-ed25519" + KeyAlgoRSA = "ssh-rsa" + KeyAlgoDSA = "ssh-dss" + KeyAlgoECDSA256 = "ecdsa-sha2-nistp256" + KeyAlgoSKECDSA256 = "sk-ecdsa-sha2-nistp256@openssh.com" + KeyAlgoECDSA384 = "ecdsa-sha2-nistp384" + KeyAlgoECDSA521 = "ecdsa-sha2-nistp521" + KeyAlgoED25519 = "ssh-ed25519" + KeyAlgoSKED25519 = "sk-ssh-ed25519@openssh.com" ) // These constants represent non-default signature algorithms that are supported @@ -58,9 +63,13 @@ func parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err err return parseDSA(in) case KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521: return parseECDSA(in) + case KeyAlgoSKECDSA256: + return parseSKECDSA(in) case KeyAlgoED25519: return parseED25519(in) - case CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoED25519v01: + case KeyAlgoSKED25519: + return parseSKEd25519(in) + case CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoSKECDSA256v01, CertAlgoED25519v01, CertAlgoSKED25519v01: cert, err := parseCert(in, certToPrivAlgo(algo)) if err != nil { return nil, nil, err @@ -553,9 +562,11 @@ func parseED25519(in []byte) (out PublicKey, rest []byte, err error) { return nil, nil, err } - key := ed25519.PublicKey(w.KeyBytes) + if l := len(w.KeyBytes); l != ed25519.PublicKeySize { + return nil, nil, fmt.Errorf("invalid size %d for Ed25519 public key", l) + } - return (ed25519PublicKey)(key), w.Rest, nil + return ed25519PublicKey(w.KeyBytes), w.Rest, nil } func (k ed25519PublicKey) Marshal() []byte { @@ -573,9 +584,11 @@ func (k ed25519PublicKey) Verify(b []byte, sig *Signature) error { if sig.Format != k.Type() { return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) } + if l := len(k); l != ed25519.PublicKeySize { + return fmt.Errorf("ssh: invalid size %d for Ed25519 public key", l) + } - edKey := (ed25519.PublicKey)(k) - if ok := ed25519.Verify(edKey, b, sig.Blob); !ok { + if ok := ed25519.Verify(ed25519.PublicKey(k), b, sig.Blob); !ok { return errors.New("ssh: signature did not verify") } @@ -685,6 +698,224 @@ func (k *ecdsaPublicKey) CryptoPublicKey() crypto.PublicKey { return (*ecdsa.PublicKey)(k) } +// skFields holds the additional fields present in U2F/FIDO2 signatures. +// See openssh/PROTOCOL.u2f 'SSH U2F Signatures' for details. +type skFields struct { + // Flags contains U2F/FIDO2 flags such as 'user present' + Flags byte + // Counter is a monotonic signature counter which can be + // used to detect concurrent use of a private key, should + // it be extracted from hardware. + Counter uint32 +} + +type skECDSAPublicKey struct { + // application is a URL-like string, typically "ssh:" for SSH. + // see openssh/PROTOCOL.u2f for details. + application string + ecdsa.PublicKey +} + +func (k *skECDSAPublicKey) Type() string { + return KeyAlgoSKECDSA256 +} + +func (k *skECDSAPublicKey) nistID() string { + return "nistp256" +} + +func parseSKECDSA(in []byte) (out PublicKey, rest []byte, err error) { + var w struct { + Curve string + KeyBytes []byte + Application string + Rest []byte `ssh:"rest"` + } + + if err := Unmarshal(in, &w); err != nil { + return nil, nil, err + } + + key := new(skECDSAPublicKey) + key.application = w.Application + + if w.Curve != "nistp256" { + return nil, nil, errors.New("ssh: unsupported curve") + } + key.Curve = elliptic.P256() + + key.X, key.Y = elliptic.Unmarshal(key.Curve, w.KeyBytes) + if key.X == nil || key.Y == nil { + return nil, nil, errors.New("ssh: invalid curve point") + } + + return key, w.Rest, nil +} + +func (k *skECDSAPublicKey) Marshal() []byte { + // See RFC 5656, section 3.1. + keyBytes := elliptic.Marshal(k.Curve, k.X, k.Y) + w := struct { + Name string + ID string + Key []byte + Application string + }{ + k.Type(), + k.nistID(), + keyBytes, + k.application, + } + + return Marshal(&w) +} + +func (k *skECDSAPublicKey) Verify(data []byte, sig *Signature) error { + if sig.Format != k.Type() { + return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) + } + + h := ecHash(k.Curve).New() + h.Write([]byte(k.application)) + appDigest := h.Sum(nil) + + h.Reset() + h.Write(data) + dataDigest := h.Sum(nil) + + var ecSig struct { + R *big.Int + S *big.Int + } + if err := Unmarshal(sig.Blob, &ecSig); err != nil { + return err + } + + var skf skFields + if err := Unmarshal(sig.Rest, &skf); err != nil { + return err + } + + blob := struct { + ApplicationDigest []byte `ssh:"rest"` + Flags byte + Counter uint32 + MessageDigest []byte `ssh:"rest"` + }{ + appDigest, + skf.Flags, + skf.Counter, + dataDigest, + } + + original := Marshal(blob) + + h.Reset() + h.Write(original) + digest := h.Sum(nil) + + if ecdsa.Verify((*ecdsa.PublicKey)(&k.PublicKey), digest, ecSig.R, ecSig.S) { + return nil + } + return errors.New("ssh: signature did not verify") +} + +type skEd25519PublicKey struct { + // application is a URL-like string, typically "ssh:" for SSH. + // see openssh/PROTOCOL.u2f for details. + application string + ed25519.PublicKey +} + +func (k *skEd25519PublicKey) Type() string { + return KeyAlgoSKED25519 +} + +func parseSKEd25519(in []byte) (out PublicKey, rest []byte, err error) { + var w struct { + KeyBytes []byte + Application string + Rest []byte `ssh:"rest"` + } + + if err := Unmarshal(in, &w); err != nil { + return nil, nil, err + } + + if l := len(w.KeyBytes); l != ed25519.PublicKeySize { + return nil, nil, fmt.Errorf("invalid size %d for Ed25519 public key", l) + } + + key := new(skEd25519PublicKey) + key.application = w.Application + key.PublicKey = ed25519.PublicKey(w.KeyBytes) + + return key, w.Rest, nil +} + +func (k *skEd25519PublicKey) Marshal() []byte { + w := struct { + Name string + KeyBytes []byte + Application string + }{ + KeyAlgoSKED25519, + []byte(k.PublicKey), + k.application, + } + return Marshal(&w) +} + +func (k *skEd25519PublicKey) Verify(data []byte, sig *Signature) error { + if sig.Format != k.Type() { + return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) + } + if l := len(k.PublicKey); l != ed25519.PublicKeySize { + return fmt.Errorf("invalid size %d for Ed25519 public key", l) + } + + h := sha256.New() + h.Write([]byte(k.application)) + appDigest := h.Sum(nil) + + h.Reset() + h.Write(data) + dataDigest := h.Sum(nil) + + var edSig struct { + Signature []byte `ssh:"rest"` + } + + if err := Unmarshal(sig.Blob, &edSig); err != nil { + return err + } + + var skf skFields + if err := Unmarshal(sig.Rest, &skf); err != nil { + return err + } + + blob := struct { + ApplicationDigest []byte `ssh:"rest"` + Flags byte + Counter uint32 + MessageDigest []byte `ssh:"rest"` + }{ + appDigest, + skf.Flags, + skf.Counter, + dataDigest, + } + + original := Marshal(blob) + + if ok := ed25519.Verify(k.PublicKey, original, edSig.Signature); !ok { + return errors.New("ssh: signature did not verify") + } + + return nil +} + // NewSignerFromKey takes an *rsa.PrivateKey, *dsa.PrivateKey, // *ecdsa.PrivateKey or any other crypto.Signer and returns a // corresponding Signer instance. ECDSA keys must use P-256, P-384 or @@ -830,14 +1061,18 @@ func NewPublicKey(key interface{}) (PublicKey, error) { case *dsa.PublicKey: return (*dsaPublicKey)(key), nil case ed25519.PublicKey: - return (ed25519PublicKey)(key), nil + if l := len(key); l != ed25519.PublicKeySize { + return nil, fmt.Errorf("ssh: invalid size %d for Ed25519 public key", l) + } + return ed25519PublicKey(key), nil default: return nil, fmt.Errorf("ssh: unsupported key type %T", key) } } // ParsePrivateKey returns a Signer from a PEM encoded private key. It supports -// the same keys as ParseRawPrivateKey. +// the same keys as ParseRawPrivateKey. If the private key is encrypted, it +// will return a PassphraseMissingError. func ParsePrivateKey(pemBytes []byte) (Signer, error) { key, err := ParseRawPrivateKey(pemBytes) if err != nil { @@ -850,8 +1085,8 @@ func ParsePrivateKey(pemBytes []byte) (Signer, error) { // ParsePrivateKeyWithPassphrase returns a Signer from a PEM encoded private // key and passphrase. It supports the same keys as // ParseRawPrivateKeyWithPassphrase. -func ParsePrivateKeyWithPassphrase(pemBytes, passPhrase []byte) (Signer, error) { - key, err := ParseRawPrivateKeyWithPassphrase(pemBytes, passPhrase) +func ParsePrivateKeyWithPassphrase(pemBytes, passphrase []byte) (Signer, error) { + key, err := ParseRawPrivateKeyWithPassphrase(pemBytes, passphrase) if err != nil { return nil, err } @@ -867,8 +1102,21 @@ func encryptedBlock(block *pem.Block) bool { return strings.Contains(block.Headers["Proc-Type"], "ENCRYPTED") } +// A PassphraseMissingError indicates that parsing this private key requires a +// passphrase. Use ParsePrivateKeyWithPassphrase. +type PassphraseMissingError struct { + // PublicKey will be set if the private key format includes an unencrypted + // public key along with the encrypted private key. + PublicKey PublicKey +} + +func (*PassphraseMissingError) Error() string { + return "ssh: this private key is passphrase protected" +} + // ParseRawPrivateKey returns a private key from a PEM encoded private key. It -// supports RSA (PKCS#1), PKCS#8, DSA (OpenSSL), and ECDSA private keys. +// supports RSA (PKCS#1), PKCS#8, DSA (OpenSSL), and ECDSA private keys. If the +// private key is encrypted, it will return a PassphraseMissingError. func ParseRawPrivateKey(pemBytes []byte) (interface{}, error) { block, _ := pem.Decode(pemBytes) if block == nil { @@ -876,7 +1124,7 @@ func ParseRawPrivateKey(pemBytes []byte) (interface{}, error) { } if encryptedBlock(block) { - return nil, errors.New("ssh: cannot decode encrypted private keys") + return nil, &PassphraseMissingError{} } switch block.Type { @@ -890,33 +1138,35 @@ func ParseRawPrivateKey(pemBytes []byte) (interface{}, error) { case "DSA PRIVATE KEY": return ParseDSAPrivateKey(block.Bytes) case "OPENSSH PRIVATE KEY": - return parseOpenSSHPrivateKey(block.Bytes) + return parseOpenSSHPrivateKey(block.Bytes, unencryptedOpenSSHKey) default: return nil, fmt.Errorf("ssh: unsupported key type %q", block.Type) } } // ParseRawPrivateKeyWithPassphrase returns a private key decrypted with -// passphrase from a PEM encoded private key. If wrong passphrase, return -// x509.IncorrectPasswordError. -func ParseRawPrivateKeyWithPassphrase(pemBytes, passPhrase []byte) (interface{}, error) { +// passphrase from a PEM encoded private key. If the passphrase is wrong, it +// will return x509.IncorrectPasswordError. +func ParseRawPrivateKeyWithPassphrase(pemBytes, passphrase []byte) (interface{}, error) { block, _ := pem.Decode(pemBytes) if block == nil { return nil, errors.New("ssh: no key found") } - buf := block.Bytes - if encryptedBlock(block) { - if x509.IsEncryptedPEMBlock(block) { - var err error - buf, err = x509.DecryptPEMBlock(block, passPhrase) - if err != nil { - if err == x509.IncorrectPasswordError { - return nil, err - } - return nil, fmt.Errorf("ssh: cannot decode encrypted private keys: %v", err) - } + if block.Type == "OPENSSH PRIVATE KEY" { + return parseOpenSSHPrivateKey(block.Bytes, passphraseProtectedOpenSSHKey(passphrase)) + } + + if !encryptedBlock(block) || !x509.IsEncryptedPEMBlock(block) { + return nil, errors.New("ssh: not an encrypted key") + } + + buf, err := x509.DecryptPEMBlock(block, passphrase) + if err != nil { + if err == x509.IncorrectPasswordError { + return nil, err } + return nil, fmt.Errorf("ssh: cannot decode encrypted private keys: %v", err) } switch block.Type { @@ -926,8 +1176,6 @@ func ParseRawPrivateKeyWithPassphrase(pemBytes, passPhrase []byte) (interface{}, return x509.ParseECPrivateKey(buf) case "DSA PRIVATE KEY": return ParseDSAPrivateKey(buf) - case "OPENSSH PRIVATE KEY": - return parseOpenSSHPrivateKey(buf) default: return nil, fmt.Errorf("ssh: unsupported key type %q", block.Type) } @@ -965,9 +1213,68 @@ func ParseDSAPrivateKey(der []byte) (*dsa.PrivateKey, error) { }, nil } -// Implemented based on the documentation at -// https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key -func parseOpenSSHPrivateKey(key []byte) (crypto.PrivateKey, error) { +func unencryptedOpenSSHKey(cipherName, kdfName, kdfOpts string, privKeyBlock []byte) ([]byte, error) { + if kdfName != "none" || cipherName != "none" { + return nil, &PassphraseMissingError{} + } + if kdfOpts != "" { + return nil, errors.New("ssh: invalid openssh private key") + } + return privKeyBlock, nil +} + +func passphraseProtectedOpenSSHKey(passphrase []byte) openSSHDecryptFunc { + return func(cipherName, kdfName, kdfOpts string, privKeyBlock []byte) ([]byte, error) { + if kdfName == "none" || cipherName == "none" { + return nil, errors.New("ssh: key is not password protected") + } + if kdfName != "bcrypt" { + return nil, fmt.Errorf("ssh: unknown KDF %q, only supports %q", kdfName, "bcrypt") + } + + var opts struct { + Salt string + Rounds uint32 + } + if err := Unmarshal([]byte(kdfOpts), &opts); err != nil { + return nil, err + } + + k, err := bcrypt_pbkdf.Key(passphrase, []byte(opts.Salt), int(opts.Rounds), 32+16) + if err != nil { + return nil, err + } + key, iv := k[:32], k[32:] + + c, err := aes.NewCipher(key) + if err != nil { + return nil, err + } + switch cipherName { + case "aes256-ctr": + ctr := cipher.NewCTR(c, iv) + ctr.XORKeyStream(privKeyBlock, privKeyBlock) + case "aes256-cbc": + if len(privKeyBlock)%c.BlockSize() != 0 { + return nil, fmt.Errorf("ssh: invalid encrypted private key length, not a multiple of the block size") + } + cbc := cipher.NewCBCDecrypter(c, iv) + cbc.CryptBlocks(privKeyBlock, privKeyBlock) + default: + return nil, fmt.Errorf("ssh: unknown cipher %q, only supports %q or %q", cipherName, "aes256-ctr", "aes256-cbc") + } + + return privKeyBlock, nil + } +} + +type openSSHDecryptFunc func(CipherName, KdfName, KdfOpts string, PrivKeyBlock []byte) ([]byte, error) + +// parseOpenSSHPrivateKey parses an OpenSSH private key, using the decrypt +// function to unwrap the encrypted portion. unencryptedOpenSSHKey can be used +// as the decrypt function to parse an unencrypted private key. See +// https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key. +func parseOpenSSHPrivateKey(key []byte, decrypt openSSHDecryptFunc) (crypto.PrivateKey, error) { const magic = "openssh-key-v1\x00" if len(key) < len(magic) || string(key[:len(magic)]) != magic { return nil, errors.New("ssh: invalid openssh private key format") @@ -986,9 +1293,22 @@ func parseOpenSSHPrivateKey(key []byte) (crypto.PrivateKey, error) { if err := Unmarshal(remaining, &w); err != nil { return nil, err } + if w.NumKeys != 1 { + // We only support single key files, and so does OpenSSH. + // https://github.com/openssh/openssh-portable/blob/4103a3ec7/sshkey.c#L4171 + return nil, errors.New("ssh: multi-key files are not supported") + } - if w.KdfName != "none" || w.CipherName != "none" { - return nil, errors.New("ssh: cannot decode encrypted private keys") + privKeyBlock, err := decrypt(w.CipherName, w.KdfName, w.KdfOpts, w.PrivKeyBlock) + if err != nil { + if err, ok := err.(*PassphraseMissingError); ok { + pub, errPub := ParsePublicKey(w.PubKey) + if errPub != nil { + return nil, fmt.Errorf("ssh: failed to parse embedded public key: %v", errPub) + } + err.PublicKey = pub + } + return nil, err } pk1 := struct { @@ -998,15 +1318,13 @@ func parseOpenSSHPrivateKey(key []byte) (crypto.PrivateKey, error) { Rest []byte `ssh:"rest"` }{} - if err := Unmarshal(w.PrivKeyBlock, &pk1); err != nil { - return nil, err - } - - if pk1.Check1 != pk1.Check2 { - return nil, errors.New("ssh: checkint mismatch") + if err := Unmarshal(privKeyBlock, &pk1); err != nil || pk1.Check1 != pk1.Check2 { + if w.CipherName != "none" { + return nil, x509.IncorrectPasswordError + } + return nil, errors.New("ssh: malformed OpenSSH key") } - // we only handle ed25519 and rsa keys currently switch pk1.Keytype { case KeyAlgoRSA: // https://github.com/openssh/openssh-portable/blob/master/sshkey.c#L2760-L2773 @@ -1025,10 +1343,8 @@ func parseOpenSSHPrivateKey(key []byte) (crypto.PrivateKey, error) { return nil, err } - for i, b := range key.Pad { - if int(b) != i+1 { - return nil, errors.New("ssh: padding not as expected") - } + if err := checkOpenSSHKeyPadding(key.Pad); err != nil { + return nil, err } pk := &rsa.PrivateKey{ @@ -1063,20 +1379,78 @@ func parseOpenSSHPrivateKey(key []byte) (crypto.PrivateKey, error) { return nil, errors.New("ssh: private key unexpected length") } - for i, b := range key.Pad { - if int(b) != i+1 { - return nil, errors.New("ssh: padding not as expected") - } + if err := checkOpenSSHKeyPadding(key.Pad); err != nil { + return nil, err } pk := ed25519.PrivateKey(make([]byte, ed25519.PrivateKeySize)) copy(pk, key.Priv) return &pk, nil + case KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521: + key := struct { + Curve string + Pub []byte + D *big.Int + Comment string + Pad []byte `ssh:"rest"` + }{} + + if err := Unmarshal(pk1.Rest, &key); err != nil { + return nil, err + } + + if err := checkOpenSSHKeyPadding(key.Pad); err != nil { + return nil, err + } + + var curve elliptic.Curve + switch key.Curve { + case "nistp256": + curve = elliptic.P256() + case "nistp384": + curve = elliptic.P384() + case "nistp521": + curve = elliptic.P521() + default: + return nil, errors.New("ssh: unhandled elliptic curve: " + key.Curve) + } + + X, Y := elliptic.Unmarshal(curve, key.Pub) + if X == nil || Y == nil { + return nil, errors.New("ssh: failed to unmarshal public key") + } + + if key.D.Cmp(curve.Params().N) >= 0 { + return nil, errors.New("ssh: scalar is out of range") + } + + x, y := curve.ScalarBaseMult(key.D.Bytes()) + if x.Cmp(X) != 0 || y.Cmp(Y) != 0 { + return nil, errors.New("ssh: public key does not match private key") + } + + return &ecdsa.PrivateKey{ + PublicKey: ecdsa.PublicKey{ + Curve: curve, + X: X, + Y: Y, + }, + D: key.D, + }, nil default: return nil, errors.New("ssh: unhandled key type") } } +func checkOpenSSHKeyPadding(pad []byte) error { + for i, b := range pad { + if int(b) != i+1 { + return errors.New("ssh: padding not as expected") + } + } + return nil +} + // FingerprintLegacyMD5 returns the user presentation of the key's // fingerprint as described by RFC 4716 section 4. func FingerprintLegacyMD5(pubKey PublicKey) string { diff --git a/vendor/golang.org/x/crypto/ssh/messages.go b/vendor/golang.org/x/crypto/ssh/messages.go index db914d803..ac41a4168 100644 --- a/vendor/golang.org/x/crypto/ssh/messages.go +++ b/vendor/golang.org/x/crypto/ssh/messages.go @@ -97,6 +97,36 @@ type kexDHReplyMsg struct { Signature []byte } +// See RFC 4419, section 5. +const msgKexDHGexGroup = 31 + +type kexDHGexGroupMsg struct { + P *big.Int `sshtype:"31"` + G *big.Int +} + +const msgKexDHGexInit = 32 + +type kexDHGexInitMsg struct { + X *big.Int `sshtype:"32"` +} + +const msgKexDHGexReply = 33 + +type kexDHGexReplyMsg struct { + HostKey []byte `sshtype:"33"` + Y *big.Int + Signature []byte +} + +const msgKexDHGexRequest = 34 + +type kexDHGexRequestMsg struct { + MinBits uint32 `sshtype:"34"` + PreferedBits uint32 + MaxBits uint32 +} + // See RFC 4253, section 10. const msgServiceRequest = 5 diff --git a/vendor/golang.org/x/crypto/ssh/mux.go b/vendor/golang.org/x/crypto/ssh/mux.go index f19016270..9654c0186 100644 --- a/vendor/golang.org/x/crypto/ssh/mux.go +++ b/vendor/golang.org/x/crypto/ssh/mux.go @@ -240,7 +240,7 @@ func (m *mux) onePacket() error { id := binary.BigEndian.Uint32(packet[1:]) ch := m.chanList.getChan(id) if ch == nil { - return fmt.Errorf("ssh: invalid channel %d", id) + return m.handleUnknownChannelPacket(id, packet) } return ch.handlePacket(packet) @@ -328,3 +328,24 @@ func (m *mux) openChannel(chanType string, extra []byte) (*channel, error) { return nil, fmt.Errorf("ssh: unexpected packet in response to channel open: %T", msg) } } + +func (m *mux) handleUnknownChannelPacket(id uint32, packet []byte) error { + msg, err := decode(packet) + if err != nil { + return err + } + + switch msg := msg.(type) { + // RFC 4254 section 5.4 says unrecognized channel requests should + // receive a failure response. + case *channelRequestMsg: + if msg.WantReply { + return m.sendMessage(channelRequestFailureMsg{ + PeersID: msg.PeersID, + }) + } + return nil + default: + return fmt.Errorf("ssh: invalid channel %d", id) + } +} diff --git a/vendor/golang.org/x/crypto/ssh/server.go b/vendor/golang.org/x/crypto/ssh/server.go index ac7f8073c..b6911e830 100644 --- a/vendor/golang.org/x/crypto/ssh/server.go +++ b/vendor/golang.org/x/crypto/ssh/server.go @@ -193,6 +193,12 @@ func NewServerConn(c net.Conn, config *ServerConfig) (*ServerConn, <-chan NewCha if fullConf.MaxAuthTries == 0 { fullConf.MaxAuthTries = 6 } + // Check if the config contains any unsupported key exchanges + for _, kex := range fullConf.KeyExchanges { + if _, ok := serverForbiddenKexAlgos[kex]; ok { + return nil, nil, nil, fmt.Errorf("ssh: unsupported key exchange %s for server", kex) + } + } s := &connection{ sshConn: sshConn{conn: c}, @@ -278,8 +284,8 @@ func (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error) func isAcceptableAlgo(algo string) bool { switch algo { - case KeyAlgoRSA, KeyAlgoDSA, KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, KeyAlgoED25519, - CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoED25519v01: + case KeyAlgoRSA, KeyAlgoDSA, KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, KeyAlgoSKECDSA256, KeyAlgoED25519, KeyAlgoSKED25519, + CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoSKECDSA256v01, CertAlgoED25519v01, CertAlgoSKED25519v01: return true } return false @@ -566,6 +572,10 @@ userAuthLoop: perms = candidate.perms } case "gssapi-with-mic": + if config.GSSAPIWithMICConfig == nil { + authErr = errors.New("ssh: gssapi-with-mic auth not configured") + break + } gssapiConfig := config.GSSAPIWithMICConfig userAuthRequestGSSAPI, err := parseGSSAPIPayload(userAuthReq.Payload) if err != nil { diff --git a/vendor/golang.org/x/image/draw/gen.go b/vendor/golang.org/x/image/draw/gen.go deleted file mode 100644 index 822bb6a50..000000000 --- a/vendor/golang.org/x/image/draw/gen.go +++ /dev/null @@ -1,1404 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "bytes" - "flag" - "fmt" - "go/format" - "io/ioutil" - "log" - "os" - "strings" -) - -var debug = flag.Bool("debug", false, "") - -func main() { - flag.Parse() - - w := new(bytes.Buffer) - w.WriteString("// generated by \"go run gen.go\". DO NOT EDIT.\n\n" + - "package draw\n\nimport (\n" + - "\"image\"\n" + - "\"image/color\"\n" + - "\"math\"\n" + - "\n" + - "\"golang.org/x/image/math/f64\"\n" + - ")\n") - - gen(w, "nnInterpolator", codeNNScaleLeaf, codeNNTransformLeaf) - gen(w, "ablInterpolator", codeABLScaleLeaf, codeABLTransformLeaf) - genKernel(w) - - if *debug { - os.Stdout.Write(w.Bytes()) - return - } - out, err := format.Source(w.Bytes()) - if err != nil { - log.Fatal(err) - } - if err := ioutil.WriteFile("impl.go", out, 0660); err != nil { - log.Fatal(err) - } -} - -var ( - // dsTypes are the (dst image type, src image type) pairs to generate - // scale_DType_SType implementations for. The last element in the slice - // should be the fallback pair ("Image", "image.Image"). - // - // TODO: add *image.CMYK src type after Go 1.5 is released. - // An *image.CMYK is also alwaysOpaque. - dsTypes = []struct{ dType, sType string }{ - {"*image.RGBA", "*image.Gray"}, - {"*image.RGBA", "*image.NRGBA"}, - {"*image.RGBA", "*image.RGBA"}, - {"*image.RGBA", "*image.YCbCr"}, - {"*image.RGBA", "image.Image"}, - {"Image", "image.Image"}, - } - dTypes, sTypes []string - sTypesForDType = map[string][]string{} - subsampleRatios = []string{ - "444", - "422", - "420", - "440", - } - ops = []string{"Over", "Src"} - // alwaysOpaque are those image.Image implementations that are always - // opaque. For these types, Over is equivalent to the faster Src, in the - // absence of a source mask. - alwaysOpaque = map[string]bool{ - "*image.Gray": true, - "*image.YCbCr": true, - } -) - -func init() { - dTypesSeen := map[string]bool{} - sTypesSeen := map[string]bool{} - for _, t := range dsTypes { - if !sTypesSeen[t.sType] { - sTypesSeen[t.sType] = true - sTypes = append(sTypes, t.sType) - } - if !dTypesSeen[t.dType] { - dTypesSeen[t.dType] = true - dTypes = append(dTypes, t.dType) - } - sTypesForDType[t.dType] = append(sTypesForDType[t.dType], t.sType) - } - sTypesForDType["anyDType"] = sTypes -} - -type data struct { - dType string - sType string - sratio string - receiver string - op string -} - -func gen(w *bytes.Buffer, receiver string, codes ...string) { - expn(w, codeRoot, &data{receiver: receiver}) - for _, code := range codes { - for _, t := range dsTypes { - for _, op := range ops { - if op == "Over" && alwaysOpaque[t.sType] { - continue - } - expn(w, code, &data{ - dType: t.dType, - sType: t.sType, - receiver: receiver, - op: op, - }) - } - } - } -} - -func genKernel(w *bytes.Buffer) { - expn(w, codeKernelRoot, &data{}) - for _, sType := range sTypes { - expn(w, codeKernelScaleLeafX, &data{ - sType: sType, - }) - } - for _, dType := range dTypes { - for _, op := range ops { - expn(w, codeKernelScaleLeafY, &data{ - dType: dType, - op: op, - }) - } - } - for _, t := range dsTypes { - for _, op := range ops { - if op == "Over" && alwaysOpaque[t.sType] { - continue - } - expn(w, codeKernelTransformLeaf, &data{ - dType: t.dType, - sType: t.sType, - op: op, - }) - } - } -} - -func expn(w *bytes.Buffer, code string, d *data) { - if d.sType == "*image.YCbCr" && d.sratio == "" { - for _, sratio := range subsampleRatios { - e := *d - e.sratio = sratio - expn(w, code, &e) - } - return - } - - for _, line := range strings.Split(code, "\n") { - line = expnLine(line, d) - if line == ";" { - continue - } - fmt.Fprintln(w, line) - } -} - -func expnLine(line string, d *data) string { - for { - i := strings.IndexByte(line, '$') - if i < 0 { - break - } - prefix, s := line[:i], line[i+1:] - - i = len(s) - for j, c := range s { - if !('A' <= c && c <= 'Z' || 'a' <= c && c <= 'z') { - i = j - break - } - } - dollar, suffix := s[:i], s[i:] - - e := expnDollar(prefix, dollar, suffix, d) - if e == "" { - log.Fatalf("couldn't expand %q", line) - } - line = e - } - return line -} - -// expnDollar expands a "$foo" fragment in a line of generated code. It returns -// the empty string if there was a problem. It returns ";" if the generated -// code is a no-op. -func expnDollar(prefix, dollar, suffix string, d *data) string { - switch dollar { - case "dType": - return prefix + d.dType + suffix - case "dTypeRN": - return prefix + relName(d.dType) + suffix - case "sratio": - return prefix + d.sratio + suffix - case "sType": - return prefix + d.sType + suffix - case "sTypeRN": - return prefix + relName(d.sType) + suffix - case "receiver": - return prefix + d.receiver + suffix - case "op": - return prefix + d.op + suffix - - case "switch": - return expnSwitch("", "", true, suffix) - case "switchD": - return expnSwitch("", "", false, suffix) - case "switchS": - return expnSwitch("", "anyDType", false, suffix) - - case "preOuter": - switch d.dType { - default: - return ";" - case "Image": - s := "" - if d.sType == "image.Image" { - s = "srcMask, smp := opts.SrcMask, opts.SrcMaskP\n" - } - return s + - "dstMask, dmp := opts.DstMask, opts.DstMaskP\n" + - "dstColorRGBA64 := &color.RGBA64{}\n" + - "dstColor := color.Color(dstColorRGBA64)" - } - - case "preInner": - switch d.dType { - default: - return ";" - case "*image.RGBA": - return "d := " + pixOffset("dst", "dr.Min.X+adr.Min.X", "dr.Min.Y+int(dy)", "*4", "*dst.Stride") - } - - case "preKernelOuter": - switch d.sType { - default: - return ";" - case "image.Image": - return "srcMask, smp := opts.SrcMask, opts.SrcMaskP" - } - - case "preKernelInner": - switch d.dType { - default: - return ";" - case "*image.RGBA": - return "d := " + pixOffset("dst", "dr.Min.X+int(dx)", "dr.Min.Y+adr.Min.Y", "*4", "*dst.Stride") - } - - case "blend": - args, _ := splitArgs(suffix) - if len(args) != 4 { - return "" - } - switch d.sType { - default: - return argf(args, ""+ - "$3r = $0*$1r + $2*$3r\n"+ - "$3g = $0*$1g + $2*$3g\n"+ - "$3b = $0*$1b + $2*$3b\n"+ - "$3a = $0*$1a + $2*$3a", - ) - case "*image.Gray": - return argf(args, ""+ - "$3r = $0*$1r + $2*$3r", - ) - case "*image.YCbCr": - return argf(args, ""+ - "$3r = $0*$1r + $2*$3r\n"+ - "$3g = $0*$1g + $2*$3g\n"+ - "$3b = $0*$1b + $2*$3b", - ) - } - - case "clampToAlpha": - if alwaysOpaque[d.sType] { - return ";" - } - // Go uses alpha-premultiplied color. The naive computation can lead to - // invalid colors, e.g. red > alpha, when some weights are negative. - return ` - if pr > pa { - pr = pa - } - if pg > pa { - pg = pa - } - if pb > pa { - pb = pa - } - ` - - case "convFtou": - args, _ := splitArgs(suffix) - if len(args) != 2 { - return "" - } - - switch d.sType { - default: - return argf(args, ""+ - "$0r := uint32($1r)\n"+ - "$0g := uint32($1g)\n"+ - "$0b := uint32($1b)\n"+ - "$0a := uint32($1a)", - ) - case "*image.Gray": - return argf(args, ""+ - "$0r := uint32($1r)", - ) - case "*image.YCbCr": - return argf(args, ""+ - "$0r := uint32($1r)\n"+ - "$0g := uint32($1g)\n"+ - "$0b := uint32($1b)", - ) - } - - case "outputu": - args, _ := splitArgs(suffix) - if len(args) != 3 { - return "" - } - - switch d.op { - case "Over": - switch d.dType { - default: - log.Fatalf("bad dType %q", d.dType) - case "Image": - return argf(args, ""+ - "qr, qg, qb, qa := dst.At($0, $1).RGBA()\n"+ - "if dstMask != nil {\n"+ - " _, _, _, ma := dstMask.At(dmp.X + $0, dmp.Y + $1).RGBA()\n"+ - " $2r = $2r * ma / 0xffff\n"+ - " $2g = $2g * ma / 0xffff\n"+ - " $2b = $2b * ma / 0xffff\n"+ - " $2a = $2a * ma / 0xffff\n"+ - "}\n"+ - "$2a1 := 0xffff - $2a\n"+ - "dstColorRGBA64.R = uint16(qr*$2a1/0xffff + $2r)\n"+ - "dstColorRGBA64.G = uint16(qg*$2a1/0xffff + $2g)\n"+ - "dstColorRGBA64.B = uint16(qb*$2a1/0xffff + $2b)\n"+ - "dstColorRGBA64.A = uint16(qa*$2a1/0xffff + $2a)\n"+ - "dst.Set($0, $1, dstColor)", - ) - case "*image.RGBA": - return argf(args, ""+ - "$2a1 := (0xffff - $2a) * 0x101\n"+ - "dst.Pix[d+0] = uint8((uint32(dst.Pix[d+0])*$2a1/0xffff + $2r) >> 8)\n"+ - "dst.Pix[d+1] = uint8((uint32(dst.Pix[d+1])*$2a1/0xffff + $2g) >> 8)\n"+ - "dst.Pix[d+2] = uint8((uint32(dst.Pix[d+2])*$2a1/0xffff + $2b) >> 8)\n"+ - "dst.Pix[d+3] = uint8((uint32(dst.Pix[d+3])*$2a1/0xffff + $2a) >> 8)", - ) - } - - case "Src": - switch d.dType { - default: - log.Fatalf("bad dType %q", d.dType) - case "Image": - return argf(args, ""+ - "if dstMask != nil {\n"+ - " qr, qg, qb, qa := dst.At($0, $1).RGBA()\n"+ - " _, _, _, ma := dstMask.At(dmp.X + $0, dmp.Y + $1).RGBA()\n"+ - " pr = pr * ma / 0xffff\n"+ - " pg = pg * ma / 0xffff\n"+ - " pb = pb * ma / 0xffff\n"+ - " pa = pa * ma / 0xffff\n"+ - " $2a1 := 0xffff - ma\n"+ // Note that this is ma, not $2a. - " dstColorRGBA64.R = uint16(qr*$2a1/0xffff + $2r)\n"+ - " dstColorRGBA64.G = uint16(qg*$2a1/0xffff + $2g)\n"+ - " dstColorRGBA64.B = uint16(qb*$2a1/0xffff + $2b)\n"+ - " dstColorRGBA64.A = uint16(qa*$2a1/0xffff + $2a)\n"+ - " dst.Set($0, $1, dstColor)\n"+ - "} else {\n"+ - " dstColorRGBA64.R = uint16($2r)\n"+ - " dstColorRGBA64.G = uint16($2g)\n"+ - " dstColorRGBA64.B = uint16($2b)\n"+ - " dstColorRGBA64.A = uint16($2a)\n"+ - " dst.Set($0, $1, dstColor)\n"+ - "}", - ) - case "*image.RGBA": - switch d.sType { - default: - return argf(args, ""+ - "dst.Pix[d+0] = uint8($2r >> 8)\n"+ - "dst.Pix[d+1] = uint8($2g >> 8)\n"+ - "dst.Pix[d+2] = uint8($2b >> 8)\n"+ - "dst.Pix[d+3] = uint8($2a >> 8)", - ) - case "*image.Gray": - return argf(args, ""+ - "out := uint8($2r >> 8)\n"+ - "dst.Pix[d+0] = out\n"+ - "dst.Pix[d+1] = out\n"+ - "dst.Pix[d+2] = out\n"+ - "dst.Pix[d+3] = 0xff", - ) - case "*image.YCbCr": - return argf(args, ""+ - "dst.Pix[d+0] = uint8($2r >> 8)\n"+ - "dst.Pix[d+1] = uint8($2g >> 8)\n"+ - "dst.Pix[d+2] = uint8($2b >> 8)\n"+ - "dst.Pix[d+3] = 0xff", - ) - } - } - } - - case "outputf": - args, _ := splitArgs(suffix) - if len(args) != 5 { - return "" - } - ret := "" - - switch d.op { - case "Over": - switch d.dType { - default: - log.Fatalf("bad dType %q", d.dType) - case "Image": - ret = argf(args, ""+ - "qr, qg, qb, qa := dst.At($0, $1).RGBA()\n"+ - "$3r0 := uint32($2($3r * $4))\n"+ - "$3g0 := uint32($2($3g * $4))\n"+ - "$3b0 := uint32($2($3b * $4))\n"+ - "$3a0 := uint32($2($3a * $4))\n"+ - "if dstMask != nil {\n"+ - " _, _, _, ma := dstMask.At(dmp.X + $0, dmp.Y + $1).RGBA()\n"+ - " $3r0 = $3r0 * ma / 0xffff\n"+ - " $3g0 = $3g0 * ma / 0xffff\n"+ - " $3b0 = $3b0 * ma / 0xffff\n"+ - " $3a0 = $3a0 * ma / 0xffff\n"+ - "}\n"+ - "$3a1 := 0xffff - $3a0\n"+ - "dstColorRGBA64.R = uint16(qr*$3a1/0xffff + $3r0)\n"+ - "dstColorRGBA64.G = uint16(qg*$3a1/0xffff + $3g0)\n"+ - "dstColorRGBA64.B = uint16(qb*$3a1/0xffff + $3b0)\n"+ - "dstColorRGBA64.A = uint16(qa*$3a1/0xffff + $3a0)\n"+ - "dst.Set($0, $1, dstColor)", - ) - case "*image.RGBA": - ret = argf(args, ""+ - "$3r0 := uint32($2($3r * $4))\n"+ - "$3g0 := uint32($2($3g * $4))\n"+ - "$3b0 := uint32($2($3b * $4))\n"+ - "$3a0 := uint32($2($3a * $4))\n"+ - "$3a1 := (0xffff - uint32($3a0)) * 0x101\n"+ - "dst.Pix[d+0] = uint8((uint32(dst.Pix[d+0])*$3a1/0xffff + $3r0) >> 8)\n"+ - "dst.Pix[d+1] = uint8((uint32(dst.Pix[d+1])*$3a1/0xffff + $3g0) >> 8)\n"+ - "dst.Pix[d+2] = uint8((uint32(dst.Pix[d+2])*$3a1/0xffff + $3b0) >> 8)\n"+ - "dst.Pix[d+3] = uint8((uint32(dst.Pix[d+3])*$3a1/0xffff + $3a0) >> 8)", - ) - } - - case "Src": - switch d.dType { - default: - log.Fatalf("bad dType %q", d.dType) - case "Image": - ret = argf(args, ""+ - "if dstMask != nil {\n"+ - " qr, qg, qb, qa := dst.At($0, $1).RGBA()\n"+ - " _, _, _, ma := dstMask.At(dmp.X + $0, dmp.Y + $1).RGBA()\n"+ - " pr := uint32($2($3r * $4)) * ma / 0xffff\n"+ - " pg := uint32($2($3g * $4)) * ma / 0xffff\n"+ - " pb := uint32($2($3b * $4)) * ma / 0xffff\n"+ - " pa := uint32($2($3a * $4)) * ma / 0xffff\n"+ - " pa1 := 0xffff - ma\n"+ // Note that this is ma, not pa. - " dstColorRGBA64.R = uint16(qr*pa1/0xffff + pr)\n"+ - " dstColorRGBA64.G = uint16(qg*pa1/0xffff + pg)\n"+ - " dstColorRGBA64.B = uint16(qb*pa1/0xffff + pb)\n"+ - " dstColorRGBA64.A = uint16(qa*pa1/0xffff + pa)\n"+ - " dst.Set($0, $1, dstColor)\n"+ - "} else {\n"+ - " dstColorRGBA64.R = $2($3r * $4)\n"+ - " dstColorRGBA64.G = $2($3g * $4)\n"+ - " dstColorRGBA64.B = $2($3b * $4)\n"+ - " dstColorRGBA64.A = $2($3a * $4)\n"+ - " dst.Set($0, $1, dstColor)\n"+ - "}", - ) - case "*image.RGBA": - switch d.sType { - default: - ret = argf(args, ""+ - "dst.Pix[d+0] = uint8($2($3r * $4) >> 8)\n"+ - "dst.Pix[d+1] = uint8($2($3g * $4) >> 8)\n"+ - "dst.Pix[d+2] = uint8($2($3b * $4) >> 8)\n"+ - "dst.Pix[d+3] = uint8($2($3a * $4) >> 8)", - ) - case "*image.Gray": - ret = argf(args, ""+ - "out := uint8($2($3r * $4) >> 8)\n"+ - "dst.Pix[d+0] = out\n"+ - "dst.Pix[d+1] = out\n"+ - "dst.Pix[d+2] = out\n"+ - "dst.Pix[d+3] = 0xff", - ) - case "*image.YCbCr": - ret = argf(args, ""+ - "dst.Pix[d+0] = uint8($2($3r * $4) >> 8)\n"+ - "dst.Pix[d+1] = uint8($2($3g * $4) >> 8)\n"+ - "dst.Pix[d+2] = uint8($2($3b * $4) >> 8)\n"+ - "dst.Pix[d+3] = 0xff", - ) - } - } - } - - return strings.Replace(ret, " * 1)", ")", -1) - - case "srcf", "srcu": - lhs, eqOp := splitEq(prefix) - if lhs == "" { - return "" - } - args, extra := splitArgs(suffix) - if len(args) != 2 { - return "" - } - - tmp := "" - if dollar == "srcf" { - tmp = "u" - } - - // TODO: there's no need to multiply by 0x101 in the switch below if - // the next thing we're going to do is shift right by 8. - - buf := new(bytes.Buffer) - switch d.sType { - default: - log.Fatalf("bad sType %q", d.sType) - case "image.Image": - fmt.Fprintf(buf, ""+ - "%sr%s, %sg%s, %sb%s, %sa%s := src.At(%s, %s).RGBA()\n", - lhs, tmp, lhs, tmp, lhs, tmp, lhs, tmp, args[0], args[1], - ) - if d.dType == "" || d.dType == "Image" { - fmt.Fprintf(buf, ""+ - "if srcMask != nil {\n"+ - " _, _, _, ma := srcMask.At(smp.X+%s, smp.Y+%s).RGBA()\n"+ - " %sr%s = %sr%s * ma / 0xffff\n"+ - " %sg%s = %sg%s * ma / 0xffff\n"+ - " %sb%s = %sb%s * ma / 0xffff\n"+ - " %sa%s = %sa%s * ma / 0xffff\n"+ - "}\n", - args[0], args[1], - lhs, tmp, lhs, tmp, - lhs, tmp, lhs, tmp, - lhs, tmp, lhs, tmp, - lhs, tmp, lhs, tmp, - ) - } - case "*image.Gray": - fmt.Fprintf(buf, ""+ - "%si := %s\n"+ - "%sr%s := uint32(src.Pix[%si]) * 0x101\n", - lhs, pixOffset("src", args[0], args[1], "", "*src.Stride"), - lhs, tmp, lhs, - ) - case "*image.NRGBA": - fmt.Fprintf(buf, ""+ - "%si := %s\n"+ - "%sa%s := uint32(src.Pix[%si+3]) * 0x101\n"+ - "%sr%s := uint32(src.Pix[%si+0]) * %sa%s / 0xff\n"+ - "%sg%s := uint32(src.Pix[%si+1]) * %sa%s / 0xff\n"+ - "%sb%s := uint32(src.Pix[%si+2]) * %sa%s / 0xff\n", - lhs, pixOffset("src", args[0], args[1], "*4", "*src.Stride"), - lhs, tmp, lhs, - lhs, tmp, lhs, lhs, tmp, - lhs, tmp, lhs, lhs, tmp, - lhs, tmp, lhs, lhs, tmp, - ) - case "*image.RGBA": - fmt.Fprintf(buf, ""+ - "%si := %s\n"+ - "%sr%s := uint32(src.Pix[%si+0]) * 0x101\n"+ - "%sg%s := uint32(src.Pix[%si+1]) * 0x101\n"+ - "%sb%s := uint32(src.Pix[%si+2]) * 0x101\n"+ - "%sa%s := uint32(src.Pix[%si+3]) * 0x101\n", - lhs, pixOffset("src", args[0], args[1], "*4", "*src.Stride"), - lhs, tmp, lhs, - lhs, tmp, lhs, - lhs, tmp, lhs, - lhs, tmp, lhs, - ) - case "*image.YCbCr": - fmt.Fprintf(buf, ""+ - "%si := %s\n"+ - "%sj := %s\n"+ - "%s\n", - lhs, pixOffset("src", args[0], args[1], "", "*src.YStride"), - lhs, cOffset(args[0], args[1], d.sratio), - ycbcrToRGB(lhs, tmp), - ) - } - - if dollar == "srcf" { - switch d.sType { - default: - fmt.Fprintf(buf, ""+ - "%sr %s float64(%sru)%s\n"+ - "%sg %s float64(%sgu)%s\n"+ - "%sb %s float64(%sbu)%s\n"+ - "%sa %s float64(%sau)%s\n", - lhs, eqOp, lhs, extra, - lhs, eqOp, lhs, extra, - lhs, eqOp, lhs, extra, - lhs, eqOp, lhs, extra, - ) - case "*image.Gray": - fmt.Fprintf(buf, ""+ - "%sr %s float64(%sru)%s\n", - lhs, eqOp, lhs, extra, - ) - case "*image.YCbCr": - fmt.Fprintf(buf, ""+ - "%sr %s float64(%sru)%s\n"+ - "%sg %s float64(%sgu)%s\n"+ - "%sb %s float64(%sbu)%s\n", - lhs, eqOp, lhs, extra, - lhs, eqOp, lhs, extra, - lhs, eqOp, lhs, extra, - ) - } - } - - return strings.TrimSpace(buf.String()) - - case "tweakD": - if d.dType == "*image.RGBA" { - return "d += dst.Stride" - } - return ";" - - case "tweakDx": - if d.dType == "*image.RGBA" { - return strings.Replace(prefix, "dx++", "dx, d = dx+1, d+4", 1) - } - return prefix - - case "tweakDy": - if d.dType == "*image.RGBA" { - return strings.Replace(prefix, "for dy, s", "for _, s", 1) - } - return prefix - - case "tweakP": - switch d.sType { - case "*image.Gray": - if strings.HasPrefix(strings.TrimSpace(prefix), "pa * ") { - return "1," - } - return "pr," - case "*image.YCbCr": - if strings.HasPrefix(strings.TrimSpace(prefix), "pa * ") { - return "1," - } - } - return prefix - - case "tweakPr": - if d.sType == "*image.Gray" { - return "pr *= s.invTotalWeightFFFF" - } - return ";" - - case "tweakVarP": - switch d.sType { - case "*image.Gray": - return strings.Replace(prefix, "var pr, pg, pb, pa", "var pr", 1) - case "*image.YCbCr": - return strings.Replace(prefix, "var pr, pg, pb, pa", "var pr, pg, pb", 1) - } - return prefix - } - return "" -} - -func expnSwitch(op, dType string, expandBoth bool, template string) string { - if op == "" && dType != "anyDType" { - lines := []string{"switch op {"} - for _, op = range ops { - lines = append(lines, - fmt.Sprintf("case %s:", op), - expnSwitch(op, dType, expandBoth, template), - ) - } - lines = append(lines, "}") - return strings.Join(lines, "\n") - } - - switchVar := "dst" - if dType != "" { - switchVar = "src" - } - lines := []string{fmt.Sprintf("switch %s := %s.(type) {", switchVar, switchVar)} - - fallback, values := "Image", dTypes - if dType != "" { - fallback, values = "image.Image", sTypesForDType[dType] - } - for _, v := range values { - if dType != "" { - // v is the sType. Skip those always-opaque sTypes, where Over is - // equivalent to Src. - if op == "Over" && alwaysOpaque[v] { - continue - } - } - - if v == fallback { - lines = append(lines, "default:") - } else { - lines = append(lines, fmt.Sprintf("case %s:", v)) - } - - if dType != "" { - if v == "*image.YCbCr" { - lines = append(lines, expnSwitchYCbCr(op, dType, template)) - } else { - lines = append(lines, expnLine(template, &data{dType: dType, sType: v, op: op})) - } - } else if !expandBoth { - lines = append(lines, expnLine(template, &data{dType: v, op: op})) - } else { - lines = append(lines, expnSwitch(op, v, false, template)) - } - } - - lines = append(lines, "}") - return strings.Join(lines, "\n") -} - -func expnSwitchYCbCr(op, dType, template string) string { - lines := []string{ - "switch src.SubsampleRatio {", - "default:", - expnLine(template, &data{dType: dType, sType: "image.Image", op: op}), - } - for _, sratio := range subsampleRatios { - lines = append(lines, - fmt.Sprintf("case image.YCbCrSubsampleRatio%s:", sratio), - expnLine(template, &data{dType: dType, sType: "*image.YCbCr", sratio: sratio, op: op}), - ) - } - lines = append(lines, "}") - return strings.Join(lines, "\n") -} - -func argf(args []string, s string) string { - if len(args) > 9 { - panic("too many args") - } - for i, a := range args { - old := fmt.Sprintf("$%d", i) - s = strings.Replace(s, old, a, -1) - } - return s -} - -func pixOffset(m, x, y, xstride, ystride string) string { - return fmt.Sprintf("(%s-%s.Rect.Min.Y)%s + (%s-%s.Rect.Min.X)%s", y, m, ystride, x, m, xstride) -} - -func cOffset(x, y, sratio string) string { - switch sratio { - case "444": - return fmt.Sprintf("( %s - src.Rect.Min.Y )*src.CStride + ( %s - src.Rect.Min.X )", y, x) - case "422": - return fmt.Sprintf("( %s - src.Rect.Min.Y )*src.CStride + ((%s)/2 - src.Rect.Min.X/2)", y, x) - case "420": - return fmt.Sprintf("((%s)/2 - src.Rect.Min.Y/2)*src.CStride + ((%s)/2 - src.Rect.Min.X/2)", y, x) - case "440": - return fmt.Sprintf("((%s)/2 - src.Rect.Min.Y/2)*src.CStride + ( %s - src.Rect.Min.X )", y, x) - } - return fmt.Sprintf("unsupported sratio %q", sratio) -} - -func ycbcrToRGB(lhs, tmp string) string { - s := ` - // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - $yy1 := int(src.Y[$i]) * 0x10101 - $cb1 := int(src.Cb[$j]) - 128 - $cr1 := int(src.Cr[$j]) - 128 - $r@ := ($yy1 + 91881*$cr1) >> 8 - $g@ := ($yy1 - 22554*$cb1 - 46802*$cr1) >> 8 - $b@ := ($yy1 + 116130*$cb1) >> 8 - if $r@ < 0 { - $r@ = 0 - } else if $r@ > 0xffff { - $r@ = 0xffff - } - if $g@ < 0 { - $g@ = 0 - } else if $g@ > 0xffff { - $g@ = 0xffff - } - if $b@ < 0 { - $b@ = 0 - } else if $b@ > 0xffff { - $b@ = 0xffff - } - ` - s = strings.Replace(s, "$", lhs, -1) - s = strings.Replace(s, "@", tmp, -1) - return s -} - -func split(s, sep string) (string, string) { - if i := strings.Index(s, sep); i >= 0 { - return strings.TrimSpace(s[:i]), strings.TrimSpace(s[i+len(sep):]) - } - return "", "" -} - -func splitEq(s string) (lhs, eqOp string) { - s = strings.TrimSpace(s) - if lhs, _ = split(s, ":="); lhs != "" { - return lhs, ":=" - } - if lhs, _ = split(s, "+="); lhs != "" { - return lhs, "+=" - } - return "", "" -} - -func splitArgs(s string) (args []string, extra string) { - s = strings.TrimSpace(s) - if s == "" || s[0] != '[' { - return nil, "" - } - s = s[1:] - - i := strings.IndexByte(s, ']') - if i < 0 { - return nil, "" - } - args, extra = strings.Split(s[:i], ","), s[i+1:] - for i := range args { - args[i] = strings.TrimSpace(args[i]) - } - return args, extra -} - -func relName(s string) string { - if i := strings.LastIndex(s, "."); i >= 0 { - return s[i+1:] - } - return s -} - -const ( - codeRoot = ` - func (z $receiver) Scale(dst Image, dr image.Rectangle, src image.Image, sr image.Rectangle, op Op, opts *Options) { - // Try to simplify a Scale to a Copy when DstMask is not specified. - // If DstMask is not nil, Copy will call Scale back with same dr and sr, and cause stack overflow. - if dr.Size() == sr.Size() && (opts == nil || opts.DstMask == nil) { - Copy(dst, dr.Min, src, sr, op, opts) - return - } - - var o Options - if opts != nil { - o = *opts - } - - // adr is the affected destination pixels. - adr := dst.Bounds().Intersect(dr) - adr, o.DstMask = clipAffectedDestRect(adr, o.DstMask, o.DstMaskP) - if adr.Empty() || sr.Empty() { - return - } - // Make adr relative to dr.Min. - adr = adr.Sub(dr.Min) - if op == Over && o.SrcMask == nil && opaque(src) { - op = Src - } - - // sr is the source pixels. If it extends beyond the src bounds, - // we cannot use the type-specific fast paths, as they access - // the Pix fields directly without bounds checking. - // - // Similarly, the fast paths assume that the masks are nil. - if o.DstMask != nil || o.SrcMask != nil || !sr.In(src.Bounds()) { - switch op { - case Over: - z.scale_Image_Image_Over(dst, dr, adr, src, sr, &o) - case Src: - z.scale_Image_Image_Src(dst, dr, adr, src, sr, &o) - } - } else if _, ok := src.(*image.Uniform); ok { - Draw(dst, dr, src, src.Bounds().Min, op) - } else { - $switch z.scale_$dTypeRN_$sTypeRN$sratio_$op(dst, dr, adr, src, sr, &o) - } - } - - func (z $receiver) Transform(dst Image, s2d f64.Aff3, src image.Image, sr image.Rectangle, op Op, opts *Options) { - // Try to simplify a Transform to a Copy. - if s2d[0] == 1 && s2d[1] == 0 && s2d[3] == 0 && s2d[4] == 1 { - dx := int(s2d[2]) - dy := int(s2d[5]) - if float64(dx) == s2d[2] && float64(dy) == s2d[5] { - Copy(dst, image.Point{X: sr.Min.X + dx, Y: sr.Min.X + dy}, src, sr, op, opts) - return - } - } - - var o Options - if opts != nil { - o = *opts - } - - dr := transformRect(&s2d, &sr) - // adr is the affected destination pixels. - adr := dst.Bounds().Intersect(dr) - adr, o.DstMask = clipAffectedDestRect(adr, o.DstMask, o.DstMaskP) - if adr.Empty() || sr.Empty() { - return - } - if op == Over && o.SrcMask == nil && opaque(src) { - op = Src - } - - d2s := invert(&s2d) - // bias is a translation of the mapping from dst coordinates to src - // coordinates such that the latter temporarily have non-negative X - // and Y coordinates. This allows us to write int(f) instead of - // int(math.Floor(f)), since "round to zero" and "round down" are - // equivalent when f >= 0, but the former is much cheaper. The X-- - // and Y-- are because the TransformLeaf methods have a "sx -= 0.5" - // adjustment. - bias := transformRect(&d2s, &adr).Min - bias.X-- - bias.Y-- - d2s[2] -= float64(bias.X) - d2s[5] -= float64(bias.Y) - // Make adr relative to dr.Min. - adr = adr.Sub(dr.Min) - // sr is the source pixels. If it extends beyond the src bounds, - // we cannot use the type-specific fast paths, as they access - // the Pix fields directly without bounds checking. - // - // Similarly, the fast paths assume that the masks are nil. - if o.DstMask != nil || o.SrcMask != nil || !sr.In(src.Bounds()) { - switch op { - case Over: - z.transform_Image_Image_Over(dst, dr, adr, &d2s, src, sr, bias, &o) - case Src: - z.transform_Image_Image_Src(dst, dr, adr, &d2s, src, sr, bias, &o) - } - } else if u, ok := src.(*image.Uniform); ok { - transform_Uniform(dst, dr, adr, &d2s, u, sr, bias, op) - } else { - $switch z.transform_$dTypeRN_$sTypeRN$sratio_$op(dst, dr, adr, &d2s, src, sr, bias, &o) - } - } - ` - - codeNNScaleLeaf = ` - func (nnInterpolator) scale_$dTypeRN_$sTypeRN$sratio_$op(dst $dType, dr, adr image.Rectangle, src $sType, sr image.Rectangle, opts *Options) { - dw2 := uint64(dr.Dx()) * 2 - dh2 := uint64(dr.Dy()) * 2 - sw := uint64(sr.Dx()) - sh := uint64(sr.Dy()) - $preOuter - for dy := int32(adr.Min.Y); dy < int32(adr.Max.Y); dy++ { - sy := (2*uint64(dy) + 1) * sh / dh2 - $preInner - for dx := int32(adr.Min.X); dx < int32(adr.Max.X); dx++ { $tweakDx - sx := (2*uint64(dx) + 1) * sw / dw2 - p := $srcu[sr.Min.X + int(sx), sr.Min.Y + int(sy)] - $outputu[dr.Min.X + int(dx), dr.Min.Y + int(dy), p] - } - } - } - ` - - codeNNTransformLeaf = ` - func (nnInterpolator) transform_$dTypeRN_$sTypeRN$sratio_$op(dst $dType, dr, adr image.Rectangle, d2s *f64.Aff3, src $sType, sr image.Rectangle, bias image.Point, opts *Options) { - $preOuter - for dy := int32(adr.Min.Y); dy < int32(adr.Max.Y); dy++ { - dyf := float64(dr.Min.Y + int(dy)) + 0.5 - $preInner - for dx := int32(adr.Min.X); dx < int32(adr.Max.X); dx++ { $tweakDx - dxf := float64(dr.Min.X + int(dx)) + 0.5 - sx0 := int(d2s[0]*dxf + d2s[1]*dyf + d2s[2]) + bias.X - sy0 := int(d2s[3]*dxf + d2s[4]*dyf + d2s[5]) + bias.Y - if !(image.Point{sx0, sy0}).In(sr) { - continue - } - p := $srcu[sx0, sy0] - $outputu[dr.Min.X + int(dx), dr.Min.Y + int(dy), p] - } - } - } - ` - - codeABLScaleLeaf = ` - func (ablInterpolator) scale_$dTypeRN_$sTypeRN$sratio_$op(dst $dType, dr, adr image.Rectangle, src $sType, sr image.Rectangle, opts *Options) { - sw := int32(sr.Dx()) - sh := int32(sr.Dy()) - yscale := float64(sh) / float64(dr.Dy()) - xscale := float64(sw) / float64(dr.Dx()) - swMinus1, shMinus1 := sw - 1, sh - 1 - $preOuter - - for dy := int32(adr.Min.Y); dy < int32(adr.Max.Y); dy++ { - sy := (float64(dy)+0.5)*yscale - 0.5 - // If sy < 0, we will clamp sy0 to 0 anyway, so it doesn't matter if - // we say int32(sy) instead of int32(math.Floor(sy)). Similarly for - // sx, below. - sy0 := int32(sy) - yFrac0 := sy - float64(sy0) - yFrac1 := 1 - yFrac0 - sy1 := sy0 + 1 - if sy < 0 { - sy0, sy1 = 0, 0 - yFrac0, yFrac1 = 0, 1 - } else if sy1 > shMinus1 { - sy0, sy1 = shMinus1, shMinus1 - yFrac0, yFrac1 = 1, 0 - } - $preInner - - for dx := int32(adr.Min.X); dx < int32(adr.Max.X); dx++ { $tweakDx - sx := (float64(dx)+0.5)*xscale - 0.5 - sx0 := int32(sx) - xFrac0 := sx - float64(sx0) - xFrac1 := 1 - xFrac0 - sx1 := sx0 + 1 - if sx < 0 { - sx0, sx1 = 0, 0 - xFrac0, xFrac1 = 0, 1 - } else if sx1 > swMinus1 { - sx0, sx1 = swMinus1, swMinus1 - xFrac0, xFrac1 = 1, 0 - } - - s00 := $srcf[sr.Min.X + int(sx0), sr.Min.Y + int(sy0)] - s10 := $srcf[sr.Min.X + int(sx1), sr.Min.Y + int(sy0)] - $blend[xFrac1, s00, xFrac0, s10] - s01 := $srcf[sr.Min.X + int(sx0), sr.Min.Y + int(sy1)] - s11 := $srcf[sr.Min.X + int(sx1), sr.Min.Y + int(sy1)] - $blend[xFrac1, s01, xFrac0, s11] - $blend[yFrac1, s10, yFrac0, s11] - $convFtou[p, s11] - $outputu[dr.Min.X + int(dx), dr.Min.Y + int(dy), p] - } - } - } - ` - - codeABLTransformLeaf = ` - func (ablInterpolator) transform_$dTypeRN_$sTypeRN$sratio_$op(dst $dType, dr, adr image.Rectangle, d2s *f64.Aff3, src $sType, sr image.Rectangle, bias image.Point, opts *Options) { - $preOuter - for dy := int32(adr.Min.Y); dy < int32(adr.Max.Y); dy++ { - dyf := float64(dr.Min.Y + int(dy)) + 0.5 - $preInner - for dx := int32(adr.Min.X); dx < int32(adr.Max.X); dx++ { $tweakDx - dxf := float64(dr.Min.X + int(dx)) + 0.5 - sx := d2s[0]*dxf + d2s[1]*dyf + d2s[2] - sy := d2s[3]*dxf + d2s[4]*dyf + d2s[5] - if !(image.Point{int(sx) + bias.X, int(sy) + bias.Y}).In(sr) { - continue - } - - sx -= 0.5 - sx0 := int(sx) - xFrac0 := sx - float64(sx0) - xFrac1 := 1 - xFrac0 - sx0 += bias.X - sx1 := sx0 + 1 - if sx0 < sr.Min.X { - sx0, sx1 = sr.Min.X, sr.Min.X - xFrac0, xFrac1 = 0, 1 - } else if sx1 >= sr.Max.X { - sx0, sx1 = sr.Max.X-1, sr.Max.X-1 - xFrac0, xFrac1 = 1, 0 - } - - sy -= 0.5 - sy0 := int(sy) - yFrac0 := sy - float64(sy0) - yFrac1 := 1 - yFrac0 - sy0 += bias.Y - sy1 := sy0 + 1 - if sy0 < sr.Min.Y { - sy0, sy1 = sr.Min.Y, sr.Min.Y - yFrac0, yFrac1 = 0, 1 - } else if sy1 >= sr.Max.Y { - sy0, sy1 = sr.Max.Y-1, sr.Max.Y-1 - yFrac0, yFrac1 = 1, 0 - } - - s00 := $srcf[sx0, sy0] - s10 := $srcf[sx1, sy0] - $blend[xFrac1, s00, xFrac0, s10] - s01 := $srcf[sx0, sy1] - s11 := $srcf[sx1, sy1] - $blend[xFrac1, s01, xFrac0, s11] - $blend[yFrac1, s10, yFrac0, s11] - $convFtou[p, s11] - $outputu[dr.Min.X + int(dx), dr.Min.Y + int(dy), p] - } - } - } - ` - - codeKernelRoot = ` - func (z *kernelScaler) Scale(dst Image, dr image.Rectangle, src image.Image, sr image.Rectangle, op Op, opts *Options) { - if z.dw != int32(dr.Dx()) || z.dh != int32(dr.Dy()) || z.sw != int32(sr.Dx()) || z.sh != int32(sr.Dy()) { - z.kernel.Scale(dst, dr, src, sr, op, opts) - return - } - - var o Options - if opts != nil { - o = *opts - } - - // adr is the affected destination pixels. - adr := dst.Bounds().Intersect(dr) - adr, o.DstMask = clipAffectedDestRect(adr, o.DstMask, o.DstMaskP) - if adr.Empty() || sr.Empty() { - return - } - // Make adr relative to dr.Min. - adr = adr.Sub(dr.Min) - if op == Over && o.SrcMask == nil && opaque(src) { - op = Src - } - - if _, ok := src.(*image.Uniform); ok && o.DstMask == nil && o.SrcMask == nil && sr.In(src.Bounds()) { - Draw(dst, dr, src, src.Bounds().Min, op) - return - } - - // Create a temporary buffer: - // scaleX distributes the source image's columns over the temporary image. - // scaleY distributes the temporary image's rows over the destination image. - var tmp [][4]float64 - if z.pool.New != nil { - tmpp := z.pool.Get().(*[][4]float64) - defer z.pool.Put(tmpp) - tmp = *tmpp - } else { - tmp = z.makeTmpBuf() - } - - // sr is the source pixels. If it extends beyond the src bounds, - // we cannot use the type-specific fast paths, as they access - // the Pix fields directly without bounds checking. - // - // Similarly, the fast paths assume that the masks are nil. - if o.SrcMask != nil || !sr.In(src.Bounds()) { - z.scaleX_Image(tmp, src, sr, &o) - } else { - $switchS z.scaleX_$sTypeRN$sratio(tmp, src, sr, &o) - } - - if o.DstMask != nil { - switch op { - case Over: - z.scaleY_Image_Over(dst, dr, adr, tmp, &o) - case Src: - z.scaleY_Image_Src(dst, dr, adr, tmp, &o) - } - } else { - $switchD z.scaleY_$dTypeRN_$op(dst, dr, adr, tmp, &o) - } - } - - func (q *Kernel) Transform(dst Image, s2d f64.Aff3, src image.Image, sr image.Rectangle, op Op, opts *Options) { - var o Options - if opts != nil { - o = *opts - } - - dr := transformRect(&s2d, &sr) - // adr is the affected destination pixels. - adr := dst.Bounds().Intersect(dr) - adr, o.DstMask = clipAffectedDestRect(adr, o.DstMask, o.DstMaskP) - if adr.Empty() || sr.Empty() { - return - } - if op == Over && o.SrcMask == nil && opaque(src) { - op = Src - } - d2s := invert(&s2d) - // bias is a translation of the mapping from dst coordinates to src - // coordinates such that the latter temporarily have non-negative X - // and Y coordinates. This allows us to write int(f) instead of - // int(math.Floor(f)), since "round to zero" and "round down" are - // equivalent when f >= 0, but the former is much cheaper. The X-- - // and Y-- are because the TransformLeaf methods have a "sx -= 0.5" - // adjustment. - bias := transformRect(&d2s, &adr).Min - bias.X-- - bias.Y-- - d2s[2] -= float64(bias.X) - d2s[5] -= float64(bias.Y) - // Make adr relative to dr.Min. - adr = adr.Sub(dr.Min) - - if u, ok := src.(*image.Uniform); ok && o.DstMask != nil && o.SrcMask != nil && sr.In(src.Bounds()) { - transform_Uniform(dst, dr, adr, &d2s, u, sr, bias, op) - return - } - - xscale := abs(d2s[0]) - if s := abs(d2s[1]); xscale < s { - xscale = s - } - yscale := abs(d2s[3]) - if s := abs(d2s[4]); yscale < s { - yscale = s - } - - // sr is the source pixels. If it extends beyond the src bounds, - // we cannot use the type-specific fast paths, as they access - // the Pix fields directly without bounds checking. - // - // Similarly, the fast paths assume that the masks are nil. - if o.DstMask != nil || o.SrcMask != nil || !sr.In(src.Bounds()) { - switch op { - case Over: - q.transform_Image_Image_Over(dst, dr, adr, &d2s, src, sr, bias, xscale, yscale, &o) - case Src: - q.transform_Image_Image_Src(dst, dr, adr, &d2s, src, sr, bias, xscale, yscale, &o) - } - } else { - $switch q.transform_$dTypeRN_$sTypeRN$sratio_$op(dst, dr, adr, &d2s, src, sr, bias, xscale, yscale, &o) - } - } - ` - - codeKernelScaleLeafX = ` - func (z *kernelScaler) scaleX_$sTypeRN$sratio(tmp [][4]float64, src $sType, sr image.Rectangle, opts *Options) { - t := 0 - $preKernelOuter - for y := int32(0); y < z.sh; y++ { - for _, s := range z.horizontal.sources { - var pr, pg, pb, pa float64 $tweakVarP - for _, c := range z.horizontal.contribs[s.i:s.j] { - p += $srcf[sr.Min.X + int(c.coord), sr.Min.Y + int(y)] * c.weight - } - $tweakPr - tmp[t] = [4]float64{ - pr * s.invTotalWeightFFFF, $tweakP - pg * s.invTotalWeightFFFF, $tweakP - pb * s.invTotalWeightFFFF, $tweakP - pa * s.invTotalWeightFFFF, $tweakP - } - t++ - } - } - } - ` - - codeKernelScaleLeafY = ` - func (z *kernelScaler) scaleY_$dTypeRN_$op(dst $dType, dr, adr image.Rectangle, tmp [][4]float64, opts *Options) { - $preOuter - for dx := int32(adr.Min.X); dx < int32(adr.Max.X); dx++ { - $preKernelInner - for dy, s := range z.vertical.sources[adr.Min.Y:adr.Max.Y] { $tweakDy - var pr, pg, pb, pa float64 - for _, c := range z.vertical.contribs[s.i:s.j] { - p := &tmp[c.coord*z.dw+dx] - pr += p[0] * c.weight - pg += p[1] * c.weight - pb += p[2] * c.weight - pa += p[3] * c.weight - } - $clampToAlpha - $outputf[dr.Min.X + int(dx), dr.Min.Y + int(adr.Min.Y + dy), ftou, p, s.invTotalWeight] - $tweakD - } - } - } - ` - - codeKernelTransformLeaf = ` - func (q *Kernel) transform_$dTypeRN_$sTypeRN$sratio_$op(dst $dType, dr, adr image.Rectangle, d2s *f64.Aff3, src $sType, sr image.Rectangle, bias image.Point, xscale, yscale float64, opts *Options) { - // When shrinking, broaden the effective kernel support so that we still - // visit every source pixel. - xHalfWidth, xKernelArgScale := q.Support, 1.0 - if xscale > 1 { - xHalfWidth *= xscale - xKernelArgScale = 1 / xscale - } - yHalfWidth, yKernelArgScale := q.Support, 1.0 - if yscale > 1 { - yHalfWidth *= yscale - yKernelArgScale = 1 / yscale - } - - xWeights := make([]float64, 1 + 2*int(math.Ceil(xHalfWidth))) - yWeights := make([]float64, 1 + 2*int(math.Ceil(yHalfWidth))) - - $preOuter - for dy := int32(adr.Min.Y); dy < int32(adr.Max.Y); dy++ { - dyf := float64(dr.Min.Y + int(dy)) + 0.5 - $preInner - for dx := int32(adr.Min.X); dx < int32(adr.Max.X); dx++ { $tweakDx - dxf := float64(dr.Min.X + int(dx)) + 0.5 - sx := d2s[0]*dxf + d2s[1]*dyf + d2s[2] - sy := d2s[3]*dxf + d2s[4]*dyf + d2s[5] - if !(image.Point{int(sx) + bias.X, int(sy) + bias.Y}).In(sr) { - continue - } - - // TODO: adjust the bias so that we can use int(f) instead - // of math.Floor(f) and math.Ceil(f). - sx += float64(bias.X) - sx -= 0.5 - ix := int(math.Floor(sx - xHalfWidth)) - if ix < sr.Min.X { - ix = sr.Min.X - } - jx := int(math.Ceil(sx + xHalfWidth)) - if jx > sr.Max.X { - jx = sr.Max.X - } - - totalXWeight := 0.0 - for kx := ix; kx < jx; kx++ { - xWeight := 0.0 - if t := abs((sx - float64(kx)) * xKernelArgScale); t < q.Support { - xWeight = q.At(t) - } - xWeights[kx - ix] = xWeight - totalXWeight += xWeight - } - for x := range xWeights[:jx-ix] { - xWeights[x] /= totalXWeight - } - - sy += float64(bias.Y) - sy -= 0.5 - iy := int(math.Floor(sy - yHalfWidth)) - if iy < sr.Min.Y { - iy = sr.Min.Y - } - jy := int(math.Ceil(sy + yHalfWidth)) - if jy > sr.Max.Y { - jy = sr.Max.Y - } - - totalYWeight := 0.0 - for ky := iy; ky < jy; ky++ { - yWeight := 0.0 - if t := abs((sy - float64(ky)) * yKernelArgScale); t < q.Support { - yWeight = q.At(t) - } - yWeights[ky - iy] = yWeight - totalYWeight += yWeight - } - for y := range yWeights[:jy-iy] { - yWeights[y] /= totalYWeight - } - - var pr, pg, pb, pa float64 $tweakVarP - for ky := iy; ky < jy; ky++ { - if yWeight := yWeights[ky - iy]; yWeight != 0 { - for kx := ix; kx < jx; kx++ { - if w := xWeights[kx - ix] * yWeight; w != 0 { - p += $srcf[kx, ky] * w - } - } - } - } - $clampToAlpha - $outputf[dr.Min.X + int(dx), dr.Min.Y + int(dy), fffftou, p, 1] - } - } - } - ` -) diff --git a/vendor/golang.org/x/net/AUTHORS b/vendor/golang.org/x/net/AUTHORS deleted file mode 100644 index 15167cd74..000000000 --- a/vendor/golang.org/x/net/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/net/CONTRIBUTORS b/vendor/golang.org/x/net/CONTRIBUTORS deleted file mode 100644 index 1c4577e96..000000000 --- a/vendor/golang.org/x/net/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/net/context/context.go b/vendor/golang.org/x/net/context/context.go index a3c021d3f..cf66309c4 100644 --- a/vendor/golang.org/x/net/context/context.go +++ b/vendor/golang.org/x/net/context/context.go @@ -21,9 +21,9 @@ // explicitly to each function that needs it. The Context should be the first // parameter, typically named ctx: // -// func DoSomething(ctx context.Context, arg Arg) error { -// // ... use ctx ... -// } +// func DoSomething(ctx context.Context, arg Arg) error { +// // ... use ctx ... +// } // // Do not pass a nil Context, even if a function permits it. Pass context.TODO // if you are unsure about which Context to use. diff --git a/vendor/golang.org/x/net/context/go17.go b/vendor/golang.org/x/net/context/go17.go index d20f52b7d..0a54bdbcc 100644 --- a/vendor/golang.org/x/net/context/go17.go +++ b/vendor/golang.org/x/net/context/go17.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.7 // +build go1.7 package context @@ -53,11 +54,11 @@ func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { // Canceling this context releases resources associated with it, so code should // call cancel as soon as the operations running in this Context complete: // -// func slowOperationWithTimeout(ctx context.Context) (Result, error) { -// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) -// defer cancel() // releases resources if slowOperation completes before timeout elapses -// return slowOperation(ctx) -// } +// func slowOperationWithTimeout(ctx context.Context) (Result, error) { +// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) +// defer cancel() // releases resources if slowOperation completes before timeout elapses +// return slowOperation(ctx) +// } func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { return WithDeadline(parent, time.Now().Add(timeout)) } diff --git a/vendor/golang.org/x/net/context/go19.go b/vendor/golang.org/x/net/context/go19.go index d88bd1db1..64d31ecc3 100644 --- a/vendor/golang.org/x/net/context/go19.go +++ b/vendor/golang.org/x/net/context/go19.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.9 // +build go1.9 package context diff --git a/vendor/golang.org/x/net/context/pre_go17.go b/vendor/golang.org/x/net/context/pre_go17.go index 0f35592df..7b6b68511 100644 --- a/vendor/golang.org/x/net/context/pre_go17.go +++ b/vendor/golang.org/x/net/context/pre_go17.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !go1.7 // +build !go1.7 package context @@ -263,11 +264,11 @@ func (c *timerCtx) cancel(removeFromParent bool, err error) { // Canceling this context releases resources associated with it, so code should // call cancel as soon as the operations running in this Context complete: // -// func slowOperationWithTimeout(ctx context.Context) (Result, error) { -// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) -// defer cancel() // releases resources if slowOperation completes before timeout elapses -// return slowOperation(ctx) -// } +// func slowOperationWithTimeout(ctx context.Context) (Result, error) { +// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) +// defer cancel() // releases resources if slowOperation completes before timeout elapses +// return slowOperation(ctx) +// } func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { return WithDeadline(parent, time.Now().Add(timeout)) } diff --git a/vendor/golang.org/x/net/context/pre_go19.go b/vendor/golang.org/x/net/context/pre_go19.go index b105f80be..1f9715341 100644 --- a/vendor/golang.org/x/net/context/pre_go19.go +++ b/vendor/golang.org/x/net/context/pre_go19.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !go1.9 // +build !go1.9 package context diff --git a/vendor/golang.org/x/net/html/atom/gen.go b/vendor/golang.org/x/net/html/atom/gen.go deleted file mode 100644 index 5d052781b..000000000 --- a/vendor/golang.org/x/net/html/atom/gen.go +++ /dev/null @@ -1,712 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -//go:generate go run gen.go -//go:generate go run gen.go -test - -package main - -import ( - "bytes" - "flag" - "fmt" - "go/format" - "io/ioutil" - "math/rand" - "os" - "sort" - "strings" -) - -// identifier converts s to a Go exported identifier. -// It converts "div" to "Div" and "accept-charset" to "AcceptCharset". -func identifier(s string) string { - b := make([]byte, 0, len(s)) - cap := true - for _, c := range s { - if c == '-' { - cap = true - continue - } - if cap && 'a' <= c && c <= 'z' { - c -= 'a' - 'A' - } - cap = false - b = append(b, byte(c)) - } - return string(b) -} - -var test = flag.Bool("test", false, "generate table_test.go") - -func genFile(name string, buf *bytes.Buffer) { - b, err := format.Source(buf.Bytes()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - if err := ioutil.WriteFile(name, b, 0644); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } -} - -func main() { - flag.Parse() - - var all []string - all = append(all, elements...) - all = append(all, attributes...) - all = append(all, eventHandlers...) - all = append(all, extra...) - sort.Strings(all) - - // uniq - lists have dups - w := 0 - for _, s := range all { - if w == 0 || all[w-1] != s { - all[w] = s - w++ - } - } - all = all[:w] - - if *test { - var buf bytes.Buffer - fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") - fmt.Fprintln(&buf, "//go:generate go run gen.go -test\n") - fmt.Fprintln(&buf, "package atom\n") - fmt.Fprintln(&buf, "var testAtomList = []string{") - for _, s := range all { - fmt.Fprintf(&buf, "\t%q,\n", s) - } - fmt.Fprintln(&buf, "}") - - genFile("table_test.go", &buf) - return - } - - // Find hash that minimizes table size. - var best *table - for i := 0; i < 1000000; i++ { - if best != nil && 1<<(best.k-1) < len(all) { - break - } - h := rand.Uint32() - for k := uint(0); k <= 16; k++ { - if best != nil && k >= best.k { - break - } - var t table - if t.init(h, k, all) { - best = &t - break - } - } - } - if best == nil { - fmt.Fprintf(os.Stderr, "failed to construct string table\n") - os.Exit(1) - } - - // Lay out strings, using overlaps when possible. - layout := append([]string{}, all...) - - // Remove strings that are substrings of other strings - for changed := true; changed; { - changed = false - for i, s := range layout { - if s == "" { - continue - } - for j, t := range layout { - if i != j && t != "" && strings.Contains(s, t) { - changed = true - layout[j] = "" - } - } - } - } - - // Join strings where one suffix matches another prefix. - for { - // Find best i, j, k such that layout[i][len-k:] == layout[j][:k], - // maximizing overlap length k. - besti := -1 - bestj := -1 - bestk := 0 - for i, s := range layout { - if s == "" { - continue - } - for j, t := range layout { - if i == j { - continue - } - for k := bestk + 1; k <= len(s) && k <= len(t); k++ { - if s[len(s)-k:] == t[:k] { - besti = i - bestj = j - bestk = k - } - } - } - } - if bestk > 0 { - layout[besti] += layout[bestj][bestk:] - layout[bestj] = "" - continue - } - break - } - - text := strings.Join(layout, "") - - atom := map[string]uint32{} - for _, s := range all { - off := strings.Index(text, s) - if off < 0 { - panic("lost string " + s) - } - atom[s] = uint32(off<<8 | len(s)) - } - - var buf bytes.Buffer - // Generate the Go code. - fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") - fmt.Fprintln(&buf, "//go:generate go run gen.go\n") - fmt.Fprintln(&buf, "package atom\n\nconst (") - - // compute max len - maxLen := 0 - for _, s := range all { - if maxLen < len(s) { - maxLen = len(s) - } - fmt.Fprintf(&buf, "\t%s Atom = %#x\n", identifier(s), atom[s]) - } - fmt.Fprintln(&buf, ")\n") - - fmt.Fprintf(&buf, "const hash0 = %#x\n\n", best.h0) - fmt.Fprintf(&buf, "const maxAtomLen = %d\n\n", maxLen) - - fmt.Fprintf(&buf, "var table = [1<<%d]Atom{\n", best.k) - for i, s := range best.tab { - if s == "" { - continue - } - fmt.Fprintf(&buf, "\t%#x: %#x, // %s\n", i, atom[s], s) - } - fmt.Fprintf(&buf, "}\n") - datasize := (1 << best.k) * 4 - - fmt.Fprintln(&buf, "const atomText =") - textsize := len(text) - for len(text) > 60 { - fmt.Fprintf(&buf, "\t%q +\n", text[:60]) - text = text[60:] - } - fmt.Fprintf(&buf, "\t%q\n\n", text) - - genFile("table.go", &buf) - - fmt.Fprintf(os.Stdout, "%d atoms; %d string bytes + %d tables = %d total data\n", len(all), textsize, datasize, textsize+datasize) -} - -type byLen []string - -func (x byLen) Less(i, j int) bool { return len(x[i]) > len(x[j]) } -func (x byLen) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x byLen) Len() int { return len(x) } - -// fnv computes the FNV hash with an arbitrary starting value h. -func fnv(h uint32, s string) uint32 { - for i := 0; i < len(s); i++ { - h ^= uint32(s[i]) - h *= 16777619 - } - return h -} - -// A table represents an attempt at constructing the lookup table. -// The lookup table uses cuckoo hashing, meaning that each string -// can be found in one of two positions. -type table struct { - h0 uint32 - k uint - mask uint32 - tab []string -} - -// hash returns the two hashes for s. -func (t *table) hash(s string) (h1, h2 uint32) { - h := fnv(t.h0, s) - h1 = h & t.mask - h2 = (h >> 16) & t.mask - return -} - -// init initializes the table with the given parameters. -// h0 is the initial hash value, -// k is the number of bits of hash value to use, and -// x is the list of strings to store in the table. -// init returns false if the table cannot be constructed. -func (t *table) init(h0 uint32, k uint, x []string) bool { - t.h0 = h0 - t.k = k - t.tab = make([]string, 1< len(t.tab) { - return false - } - s := t.tab[i] - h1, h2 := t.hash(s) - j := h1 + h2 - i - if t.tab[j] != "" && !t.push(j, depth+1) { - return false - } - t.tab[j] = s - return true -} - -// The lists of element names and attribute keys were taken from -// https://html.spec.whatwg.org/multipage/indices.html#index -// as of the "HTML Living Standard - Last Updated 16 April 2018" version. - -// "command", "keygen" and "menuitem" have been removed from the spec, -// but are kept here for backwards compatibility. -var elements = []string{ - "a", - "abbr", - "address", - "area", - "article", - "aside", - "audio", - "b", - "base", - "bdi", - "bdo", - "blockquote", - "body", - "br", - "button", - "canvas", - "caption", - "cite", - "code", - "col", - "colgroup", - "command", - "data", - "datalist", - "dd", - "del", - "details", - "dfn", - "dialog", - "div", - "dl", - "dt", - "em", - "embed", - "fieldset", - "figcaption", - "figure", - "footer", - "form", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "hgroup", - "hr", - "html", - "i", - "iframe", - "img", - "input", - "ins", - "kbd", - "keygen", - "label", - "legend", - "li", - "link", - "main", - "map", - "mark", - "menu", - "menuitem", - "meta", - "meter", - "nav", - "noscript", - "object", - "ol", - "optgroup", - "option", - "output", - "p", - "param", - "picture", - "pre", - "progress", - "q", - "rp", - "rt", - "ruby", - "s", - "samp", - "script", - "section", - "select", - "slot", - "small", - "source", - "span", - "strong", - "style", - "sub", - "summary", - "sup", - "table", - "tbody", - "td", - "template", - "textarea", - "tfoot", - "th", - "thead", - "time", - "title", - "tr", - "track", - "u", - "ul", - "var", - "video", - "wbr", -} - -// https://html.spec.whatwg.org/multipage/indices.html#attributes-3 -// -// "challenge", "command", "contextmenu", "dropzone", "icon", "keytype", "mediagroup", -// "radiogroup", "spellcheck", "scoped", "seamless", "sortable" and "sorted" have been removed from the spec, -// but are kept here for backwards compatibility. -var attributes = []string{ - "abbr", - "accept", - "accept-charset", - "accesskey", - "action", - "allowfullscreen", - "allowpaymentrequest", - "allowusermedia", - "alt", - "as", - "async", - "autocomplete", - "autofocus", - "autoplay", - "challenge", - "charset", - "checked", - "cite", - "class", - "color", - "cols", - "colspan", - "command", - "content", - "contenteditable", - "contextmenu", - "controls", - "coords", - "crossorigin", - "data", - "datetime", - "default", - "defer", - "dir", - "dirname", - "disabled", - "download", - "draggable", - "dropzone", - "enctype", - "for", - "form", - "formaction", - "formenctype", - "formmethod", - "formnovalidate", - "formtarget", - "headers", - "height", - "hidden", - "high", - "href", - "hreflang", - "http-equiv", - "icon", - "id", - "inputmode", - "integrity", - "is", - "ismap", - "itemid", - "itemprop", - "itemref", - "itemscope", - "itemtype", - "keytype", - "kind", - "label", - "lang", - "list", - "loop", - "low", - "manifest", - "max", - "maxlength", - "media", - "mediagroup", - "method", - "min", - "minlength", - "multiple", - "muted", - "name", - "nomodule", - "nonce", - "novalidate", - "open", - "optimum", - "pattern", - "ping", - "placeholder", - "playsinline", - "poster", - "preload", - "radiogroup", - "readonly", - "referrerpolicy", - "rel", - "required", - "reversed", - "rows", - "rowspan", - "sandbox", - "spellcheck", - "scope", - "scoped", - "seamless", - "selected", - "shape", - "size", - "sizes", - "sortable", - "sorted", - "slot", - "span", - "spellcheck", - "src", - "srcdoc", - "srclang", - "srcset", - "start", - "step", - "style", - "tabindex", - "target", - "title", - "translate", - "type", - "typemustmatch", - "updateviacache", - "usemap", - "value", - "width", - "workertype", - "wrap", -} - -// "onautocomplete", "onautocompleteerror", "onmousewheel", -// "onshow" and "onsort" have been removed from the spec, -// but are kept here for backwards compatibility. -var eventHandlers = []string{ - "onabort", - "onautocomplete", - "onautocompleteerror", - "onauxclick", - "onafterprint", - "onbeforeprint", - "onbeforeunload", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncopy", - "oncuechange", - "oncut", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragexit", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "onhashchange", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onlanguagechange", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloadstart", - "onmessage", - "onmessageerror", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onwheel", - "onoffline", - "ononline", - "onpagehide", - "onpageshow", - "onpaste", - "onpause", - "onplay", - "onplaying", - "onpopstate", - "onprogress", - "onratechange", - "onreset", - "onresize", - "onrejectionhandled", - "onscroll", - "onsecuritypolicyviolation", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onsort", - "onstalled", - "onstorage", - "onsubmit", - "onsuspend", - "ontimeupdate", - "ontoggle", - "onunhandledrejection", - "onunload", - "onvolumechange", - "onwaiting", -} - -// extra are ad-hoc values not covered by any of the lists above. -var extra = []string{ - "acronym", - "align", - "annotation", - "annotation-xml", - "applet", - "basefont", - "bgsound", - "big", - "blink", - "center", - "color", - "desc", - "face", - "font", - "foreignObject", // HTML is case-insensitive, but SVG-embedded-in-HTML is case-sensitive. - "foreignobject", - "frame", - "frameset", - "image", - "isindex", - "listing", - "malignmark", - "marquee", - "math", - "mglyph", - "mi", - "mn", - "mo", - "ms", - "mtext", - "nobr", - "noembed", - "noframes", - "plaintext", - "prompt", - "public", - "rb", - "rtc", - "spacer", - "strike", - "svg", - "system", - "tt", - "xmp", -} diff --git a/vendor/golang.org/x/net/html/const.go b/vendor/golang.org/x/net/html/const.go index a3a918f0b..ff7acf2d5 100644 --- a/vendor/golang.org/x/net/html/const.go +++ b/vendor/golang.org/x/net/html/const.go @@ -52,8 +52,7 @@ var isSpecialElementMap = map[string]bool{ "iframe": true, "img": true, "input": true, - "isindex": true, // The 'isindex' element has been removed, but keep it for backwards compatibility. - "keygen": true, + "keygen": true, // "keygen" has been removed from the spec, but are kept here for backwards compatibility. "li": true, "link": true, "listing": true, diff --git a/vendor/golang.org/x/net/html/foreign.go b/vendor/golang.org/x/net/html/foreign.go index 01477a963..9da9e9dc4 100644 --- a/vendor/golang.org/x/net/html/foreign.go +++ b/vendor/golang.org/x/net/html/foreign.go @@ -161,66 +161,62 @@ var mathMLAttributeAdjustments = map[string]string{ } var svgAttributeAdjustments = map[string]string{ - "attributename": "attributeName", - "attributetype": "attributeType", - "basefrequency": "baseFrequency", - "baseprofile": "baseProfile", - "calcmode": "calcMode", - "clippathunits": "clipPathUnits", - "contentscripttype": "contentScriptType", - "contentstyletype": "contentStyleType", - "diffuseconstant": "diffuseConstant", - "edgemode": "edgeMode", - "externalresourcesrequired": "externalResourcesRequired", - "filterres": "filterRes", - "filterunits": "filterUnits", - "glyphref": "glyphRef", - "gradienttransform": "gradientTransform", - "gradientunits": "gradientUnits", - "kernelmatrix": "kernelMatrix", - "kernelunitlength": "kernelUnitLength", - "keypoints": "keyPoints", - "keysplines": "keySplines", - "keytimes": "keyTimes", - "lengthadjust": "lengthAdjust", - "limitingconeangle": "limitingConeAngle", - "markerheight": "markerHeight", - "markerunits": "markerUnits", - "markerwidth": "markerWidth", - "maskcontentunits": "maskContentUnits", - "maskunits": "maskUnits", - "numoctaves": "numOctaves", - "pathlength": "pathLength", - "patterncontentunits": "patternContentUnits", - "patterntransform": "patternTransform", - "patternunits": "patternUnits", - "pointsatx": "pointsAtX", - "pointsaty": "pointsAtY", - "pointsatz": "pointsAtZ", - "preservealpha": "preserveAlpha", - "preserveaspectratio": "preserveAspectRatio", - "primitiveunits": "primitiveUnits", - "refx": "refX", - "refy": "refY", - "repeatcount": "repeatCount", - "repeatdur": "repeatDur", - "requiredextensions": "requiredExtensions", - "requiredfeatures": "requiredFeatures", - "specularconstant": "specularConstant", - "specularexponent": "specularExponent", - "spreadmethod": "spreadMethod", - "startoffset": "startOffset", - "stddeviation": "stdDeviation", - "stitchtiles": "stitchTiles", - "surfacescale": "surfaceScale", - "systemlanguage": "systemLanguage", - "tablevalues": "tableValues", - "targetx": "targetX", - "targety": "targetY", - "textlength": "textLength", - "viewbox": "viewBox", - "viewtarget": "viewTarget", - "xchannelselector": "xChannelSelector", - "ychannelselector": "yChannelSelector", - "zoomandpan": "zoomAndPan", + "attributename": "attributeName", + "attributetype": "attributeType", + "basefrequency": "baseFrequency", + "baseprofile": "baseProfile", + "calcmode": "calcMode", + "clippathunits": "clipPathUnits", + "diffuseconstant": "diffuseConstant", + "edgemode": "edgeMode", + "filterunits": "filterUnits", + "glyphref": "glyphRef", + "gradienttransform": "gradientTransform", + "gradientunits": "gradientUnits", + "kernelmatrix": "kernelMatrix", + "kernelunitlength": "kernelUnitLength", + "keypoints": "keyPoints", + "keysplines": "keySplines", + "keytimes": "keyTimes", + "lengthadjust": "lengthAdjust", + "limitingconeangle": "limitingConeAngle", + "markerheight": "markerHeight", + "markerunits": "markerUnits", + "markerwidth": "markerWidth", + "maskcontentunits": "maskContentUnits", + "maskunits": "maskUnits", + "numoctaves": "numOctaves", + "pathlength": "pathLength", + "patterncontentunits": "patternContentUnits", + "patterntransform": "patternTransform", + "patternunits": "patternUnits", + "pointsatx": "pointsAtX", + "pointsaty": "pointsAtY", + "pointsatz": "pointsAtZ", + "preservealpha": "preserveAlpha", + "preserveaspectratio": "preserveAspectRatio", + "primitiveunits": "primitiveUnits", + "refx": "refX", + "refy": "refY", + "repeatcount": "repeatCount", + "repeatdur": "repeatDur", + "requiredextensions": "requiredExtensions", + "requiredfeatures": "requiredFeatures", + "specularconstant": "specularConstant", + "specularexponent": "specularExponent", + "spreadmethod": "spreadMethod", + "startoffset": "startOffset", + "stddeviation": "stdDeviation", + "stitchtiles": "stitchTiles", + "surfacescale": "surfaceScale", + "systemlanguage": "systemLanguage", + "tablevalues": "tableValues", + "targetx": "targetX", + "targety": "targetY", + "textlength": "textLength", + "viewbox": "viewBox", + "viewtarget": "viewTarget", + "xchannelselector": "xChannelSelector", + "ychannelselector": "yChannelSelector", + "zoomandpan": "zoomAndPan", } diff --git a/vendor/golang.org/x/net/html/node.go b/vendor/golang.org/x/net/html/node.go index 633ee15dc..1350eef22 100644 --- a/vendor/golang.org/x/net/html/node.go +++ b/vendor/golang.org/x/net/html/node.go @@ -18,6 +18,11 @@ const ( ElementNode CommentNode DoctypeNode + // RawNode nodes are not returned by the parser, but can be part of the + // Node tree passed to func Render to insert raw HTML (without escaping). + // If so, this package makes no guarantee that the rendered HTML is secure + // (from e.g. Cross Site Scripting attacks) or well-formed. + RawNode scopeMarkerNode ) diff --git a/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go index 992cff2a3..038941d70 100644 --- a/vendor/golang.org/x/net/html/parse.go +++ b/vendor/golang.org/x/net/html/parse.go @@ -184,6 +184,17 @@ func (p *parser) clearStackToContext(s scope) { } } +// parseGenericRawTextElements implements the generic raw text element parsing +// algorithm defined in 12.2.6.2. +// https://html.spec.whatwg.org/multipage/parsing.html#parsing-elements-that-contain-only-text +// TODO: Since both RAWTEXT and RCDATA states are treated as tokenizer's part +// officially, need to make tokenizer consider both states. +func (p *parser) parseGenericRawTextElement() { + p.addElement() + p.originalIM = p.im + p.im = textIM +} + // generateImpliedEndTags pops nodes off the stack of open elements as long as // the top node has a tag name of dd, dt, li, optgroup, option, p, rb, rp, rt or rtc. // If exceptions are specified, nodes with that name will not be popped off. @@ -192,16 +203,17 @@ func (p *parser) generateImpliedEndTags(exceptions ...string) { loop: for i = len(p.oe) - 1; i >= 0; i-- { n := p.oe[i] - if n.Type == ElementNode { - switch n.DataAtom { - case a.Dd, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, a.Rp, a.Rt, a.Rtc: - for _, except := range exceptions { - if n.Data == except { - break loop - } + if n.Type != ElementNode { + break + } + switch n.DataAtom { + case a.Dd, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, a.Rp, a.Rt, a.Rtc: + for _, except := range exceptions { + if n.Data == except { + break loop } - continue } + continue } break } @@ -369,8 +381,7 @@ findIdenticalElements: // Section 12.2.4.3. func (p *parser) clearActiveFormattingElements() { for { - n := p.afe.pop() - if len(p.afe) == 0 || n.Type == scopeMarkerNode { + if n := p.afe.pop(); len(p.afe) == 0 || n.Type == scopeMarkerNode { return } } @@ -625,29 +636,51 @@ func inHeadIM(p *parser) bool { switch p.tok.DataAtom { case a.Html: return inBodyIM(p) - case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta: + case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta: p.addElement() p.oe.pop() p.acknowledgeSelfClosingTag() return true case a.Noscript: - p.addElement() if p.scripting { - p.setOriginalIM() - p.im = textIM - } else { - p.im = inHeadNoscriptIM + p.parseGenericRawTextElement() + return true } + p.addElement() + p.im = inHeadNoscriptIM + // Don't let the tokenizer go into raw text mode when scripting is disabled. + p.tokenizer.NextIsNotRawText() return true - case a.Script, a.Title, a.Noframes, a.Style: + case a.Script, a.Title: p.addElement() p.setOriginalIM() p.im = textIM return true + case a.Noframes, a.Style: + p.parseGenericRawTextElement() + return true case a.Head: // Ignore the token. return true case a.Template: + // TODO: remove this divergence from the HTML5 spec. + // + // We don't handle all of the corner cases when mixing foreign + // content (i.e. or ) with - - - - - {{if .Bootstrap}} - Hello World Bootstrap - - - - - - - - - - - - - - {{else}} - Hello World - {{end}} - - - - {{if .Bootstrap}} -
- {{end}} -
- {{if .Bootstrap}} -
- {{end}} - - - -`, -} diff --git a/vendor/myitcv.io/react/cmd/reactGen/react_gen.go b/vendor/myitcv.io/react/cmd/reactGen/react_gen.go deleted file mode 100644 index ee6ccf8f6..000000000 --- a/vendor/myitcv.io/react/cmd/reactGen/react_gen.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) 2016 Paul Jolly , all rights reserved. -// Use of this document is governed by a license found in the LICENSE document. - -/* - -reactGen is a go generate generator that helps to automate the process of -writing GopherJS React web applications. - -For more information see https://github.com/myitcv/react/wiki - -*/ -package main - -import ( - "flag" - "fmt" - "log" - "os" - - "myitcv.io/gogenerate" -) - -const ( - reactGenCmd = "reactGen" - - jsPkg = "github.com/gopherjs/gopherjs/js" -) - -func main() { - log.SetFlags(0) - log.SetPrefix(reactGenCmd + ": ") - - flag.Usage = usage - flag.Parse() - - wd, err := os.Getwd() - if err != nil { - fatalf("unable to get working directory: %v", err) - } - - if fInit.val != nil { - mainInit(wd) - } else { - mainGen(wd) - } -} - -func mainInit(wd string) { - doinit(wd, *fInit.val) -} - -func mainGen(wd string) { - gogenerate.DefaultLogLevel(fGoGenLog, gogenerate.LogFatal) - - envFile, ok := os.LookupEnv(gogenerate.GOFILE) - if !ok { - fatalf("env not correct; missing %v", gogenerate.GOFILE) - } - - dirFiles, err := gogenerate.FilesContainingCmd(wd, reactGenCmd) - if err != nil { - fatalf("could not determine if we are the first file: %v", err) - } - - if dirFiles == nil { - fatalf("cannot find any files containing the %v directive", reactGenCmd) - } - - if dirFiles[envFile] != 1 { - fatalf("expected a single occurrence of %v directive in %v. Got: %v", reactGenCmd, envFile, dirFiles) - } - - license, err := gogenerate.CommentLicenseHeader(fLicenseFile) - if err != nil { - fatalf("could not comment license file: %v", err) - } - - // if we get here, we know we are the first file... - - dogen(wd, license) -} - -func fatalf(format string, args ...interface{}) { - panic(fmt.Errorf(format, args...)) -} - -func infof(format string, args ...interface{}) { - if *fGoGenLog == string(gogenerate.LogInfo) { - log.Printf(format, args...) - } -} diff --git a/vendor/myitcv.io/react/core.go b/vendor/myitcv.io/react/core.go deleted file mode 100644 index 72c96ee08..000000000 --- a/vendor/myitcv.io/react/core.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2016 Paul Jolly , all rights reserved. -// Use of this document is governed by a license found in the LICENSE document. - -package react - -import ( - "github.com/gopherjs/gopherjs/js" - "honnef.co/go/js/dom" -) - -type AriaSet map[string]string -type DataSet map[string]string - -type SyntheticEvent struct { - o *js.Object - - PreventDefault func() `js:"preventDefault"` - StopPropagation func() `js:"stopPropagation"` -} - -func (s *SyntheticEvent) Target() dom.HTMLElement { - return dom.WrapHTMLElement(s.o.Get("target")) -} - -type SyntheticMouseEvent struct { - *SyntheticEvent - - ClientX int `js:"clientX"` -} - -type RendersLi interface { - Element - RendersLi(*LiElem) -} - -type Event interface{} - -type Ref interface { - Ref(h *js.Object) -} - -type OnChange interface { - Event - - OnChange(e *SyntheticEvent) -} - -type OnClick interface { - Event - - OnClick(e *SyntheticMouseEvent) -} diff --git a/vendor/myitcv.io/react/custom_elements.go b/vendor/myitcv.io/react/custom_elements.go deleted file mode 100644 index f529e916a..000000000 --- a/vendor/myitcv.io/react/custom_elements.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2016 Paul Jolly , all rights reserved. -// Use of this document is governed by a license found in the LICENSE document. - -package react - -import "github.com/gopherjs/gopherjs/js" - -// DangerousInnerHTML is convenience definition that allows HTML to be directly -// set as the child of a DOM element. See -// https://facebook.github.io/react/docs/dom-elements.html#dangerouslysetinnerhtml -// for more details -type DangerousInnerHTML struct { - o *js.Object -} - -// NewDangerousInnerHTML creates a new DangerousInnerHTML instance, using the -// supplied string as the raw HTML -func NewDangerousInnerHTML(s string) *DangerousInnerHTML { - o := object.New() - o.Set("__html", s) - - res := &DangerousInnerHTML{o: o} - - return res -} - -func (d *DangerousInnerHTML) reactElement() {} - -// FragmentElem is the special React Fragment element definition. Fragments let -// you group a list of children without adding extra nodes to the DOM. See -// https://reactjs.org/docs/fragments.html for more details. -type FragmentElem struct { - Element -} - -// Fragment creates a new instance of a element with the -// provided children -func Fragment(children ...Element) *FragmentElem { - return &FragmentElem{ - Element: createElement(symbolFragment, nil, children...), - } -} diff --git a/vendor/myitcv.io/react/gen_react_coreGen.go b/vendor/myitcv.io/react/gen_react_coreGen.go deleted file mode 100644 index f8d60e3e8..000000000 --- a/vendor/myitcv.io/react/gen_react_coreGen.go +++ /dev/null @@ -1,4031 +0,0 @@ -// Code generated by coreGen. DO NOT EDIT. - -package react - -import "github.com/gopherjs/gopherjs/js" - -// AElem is the React element definition corresponding to the HTML element -type AElem struct { - Element -} - -func (a *AElem) coreReactElement() {} - -// AProps defines the properties for the element -type AProps struct { - AriaExpanded bool - AriaHasPopup bool - AriaLabelledBy string - ClassName string - DangerouslySetInnerHTML *DangerousInnerHTML - DataSet DataSet - Href string - ID string - Key string - OnChange OnChange - OnClick OnClick - Ref Ref - Role string - Style *CSS - Target string - Title string -} - -// A creates a new instance of a element with the provided props and -// children -func A(props *AProps, children ...Element) *AElem { - type _AProps struct { - o *js.Object - AriaExpanded bool `js:"aria-expanded"` - AriaHasPopup bool `js:"aria-haspopup"` - AriaLabelledBy string `js:"aria-labelledby"` - ClassName string `js:"className"` - DangerouslySetInnerHTML *DangerousInnerHTML `js:"dangerouslySetInnerHTML"` - Href string `js:"href"` - ID string `js:"id" react:"omitempty"` - Key string `js:"key" react:"omitempty"` - OnChange OnChange `js:"onChange"` - OnClick OnClick `js:"onClick"` - Ref Ref `js:"ref"` - Role string `js:"role"` - Style *CSS `js:"style"` - Target string `js:"target"` - Title string `js:"title"` - } - - rprops := &_AProps{ - o: object.New(), - } - - if props != nil { - rprops.AriaExpanded = props.AriaExpanded - - rprops.AriaHasPopup = props.AriaHasPopup - - rprops.AriaLabelledBy = props.AriaLabelledBy - - rprops.ClassName = props.ClassName - - rprops.DangerouslySetInnerHTML = props.DangerouslySetInnerHTML - - if props.DataSet != nil { - for dk, dv := range props.DataSet { - rprops.o.Set("data-"+dk, dv) - } - } - rprops.Href = props.Href - - if props.ID != "" { - rprops.ID = props.ID - } - if props.Key != "" { - rprops.Key = props.Key - } - if props.OnChange != nil { - rprops.o.Set("onChange", props.OnChange.OnChange) - } - if props.OnClick != nil { - rprops.o.Set("onClick", props.OnClick.OnClick) - } - if props.Ref != nil { - rprops.o.Set("ref", props.Ref.Ref) - } - rprops.Role = props.Role - - // TODO: until we have a resolution on - // https://github.com/gopherjs/gopherjs/issues/236 - rprops.Style = props.Style.hack() - rprops.Target = props.Target - - rprops.Title = props.Title - } - - return &AElem{ - Element: createElement("a", rprops, children...), - } -} - -// AbbrElem is the React element definition corresponding to the HTML element -type AbbrElem struct { - Element -} - -func (a *AbbrElem) coreReactElement() {} - -// AbbrProps defines the properties for the element -type AbbrProps struct { - AriaExpanded bool - AriaHasPopup bool - AriaLabelledBy string - ClassName string - DangerouslySetInnerHTML *DangerousInnerHTML - DataSet DataSet - ID string - Key string - OnChange OnChange - OnClick OnClick - Ref Ref - Role string - Style *CSS -} - -// Abbr creates a new instance of a element with the provided props and -// children -func Abbr(props *AbbrProps, children ...Element) *AbbrElem { - type _AbbrProps struct { - o *js.Object - AriaExpanded bool `js:"aria-expanded"` - AriaHasPopup bool `js:"aria-haspopup"` - AriaLabelledBy string `js:"aria-labelledby"` - ClassName string `js:"className"` - DangerouslySetInnerHTML *DangerousInnerHTML `js:"dangerouslySetInnerHTML"` - ID string `js:"id" react:"omitempty"` - Key string `js:"key" react:"omitempty"` - OnChange OnChange `js:"onChange"` - OnClick OnClick `js:"onClick"` - Ref Ref `js:"ref"` - Role string `js:"role"` - Style *CSS `js:"style"` - } - - rprops := &_AbbrProps{ - o: object.New(), - } - - if props != nil { - rprops.AriaExpanded = props.AriaExpanded - - rprops.AriaHasPopup = props.AriaHasPopup - - rprops.AriaLabelledBy = props.AriaLabelledBy - - rprops.ClassName = props.ClassName - - rprops.DangerouslySetInnerHTML = props.DangerouslySetInnerHTML - - if props.DataSet != nil { - for dk, dv := range props.DataSet { - rprops.o.Set("data-"+dk, dv) - } - } - if props.ID != "" { - rprops.ID = props.ID - } - if props.Key != "" { - rprops.Key = props.Key - } - if props.OnChange != nil { - rprops.o.Set("onChange", props.OnChange.OnChange) - } - if props.OnClick != nil { - rprops.o.Set("onClick", props.OnClick.OnClick) - } - if props.Ref != nil { - rprops.o.Set("ref", props.Ref.Ref) - } - rprops.Role = props.Role - - // TODO: until we have a resolution on - // https://github.com/gopherjs/gopherjs/issues/236 - rprops.Style = props.Style.hack() - } - - return &AbbrElem{ - Element: createElement("abbr", rprops, children...), - } -} - -// ArticleElem is the React element definition corresponding to the HTML
element -type ArticleElem struct { - Element -} - -func (a *ArticleElem) coreReactElement() {} - -// ArticleProps defines the properties for the
element -type ArticleProps struct { - AriaExpanded bool - AriaHasPopup bool - AriaLabelledBy string - ClassName string - DangerouslySetInnerHTML *DangerousInnerHTML - DataSet DataSet - ID string - Key string - OnChange OnChange - OnClick OnClick - Ref Ref - Role string - Style *CSS -} - -// Article creates a new instance of a
element with the provided props and -// children -func Article(props *ArticleProps, children ...Element) *ArticleElem { - type _ArticleProps struct { - o *js.Object - AriaExpanded bool `js:"aria-expanded"` - AriaHasPopup bool `js:"aria-haspopup"` - AriaLabelledBy string `js:"aria-labelledby"` - ClassName string `js:"className"` - DangerouslySetInnerHTML *DangerousInnerHTML `js:"dangerouslySetInnerHTML"` - ID string `js:"id" react:"omitempty"` - Key string `js:"key" react:"omitempty"` - OnChange OnChange `js:"onChange"` - OnClick OnClick `js:"onClick"` - Ref Ref `js:"ref"` - Role string `js:"role"` - Style *CSS `js:"style"` - } - - rprops := &_ArticleProps{ - o: object.New(), - } - - if props != nil { - rprops.AriaExpanded = props.AriaExpanded - - rprops.AriaHasPopup = props.AriaHasPopup - - rprops.AriaLabelledBy = props.AriaLabelledBy - - rprops.ClassName = props.ClassName - - rprops.DangerouslySetInnerHTML = props.DangerouslySetInnerHTML - - if props.DataSet != nil { - for dk, dv := range props.DataSet { - rprops.o.Set("data-"+dk, dv) - } - } - if props.ID != "" { - rprops.ID = props.ID - } - if props.Key != "" { - rprops.Key = props.Key - } - if props.OnChange != nil { - rprops.o.Set("onChange", props.OnChange.OnChange) - } - if props.OnClick != nil { - rprops.o.Set("onClick", props.OnClick.OnClick) - } - if props.Ref != nil { - rprops.o.Set("ref", props.Ref.Ref) - } - rprops.Role = props.Role - - // TODO: until we have a resolution on - // https://github.com/gopherjs/gopherjs/issues/236 - rprops.Style = props.Style.hack() - } - - return &ArticleElem{ - Element: createElement("article", rprops, children...), - } -} - -// AsideElem is the React element definition corresponding to the HTML