From 40ca8e30c18c88de687ade4e1a610557b1b294c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Feb 2023 00:36:02 +0000 Subject: [PATCH] Bump golang.org/x/net from 0.0.0-20200506145744-7e3656a0809f to 0.7.0 Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200506145744-7e3656a0809f to 0.7.0. - [Release notes](https://github.com/golang/net/releases) - [Commits](https://github.com/golang/net/commits/v0.7.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- go.mod | 12 +- go.sum | 79 +- vendor/github.com/yuin/goldmark/Makefile | 2 +- vendor/github.com/yuin/goldmark/README.md | 135 +- vendor/github.com/yuin/goldmark/ast/ast.go | 28 +- vendor/github.com/yuin/goldmark/ast/block.go | 40 +- vendor/github.com/yuin/goldmark/ast/inline.go | 4 +- .../yuin/goldmark/extension/ast/footnote.go | 41 +- .../goldmark/extension/definition_list.go | 2 +- .../yuin/goldmark/extension/footnote.go | 421 +- .../yuin/goldmark/extension/linkify.go | 39 +- .../yuin/goldmark/extension/table.go | 313 +- .../yuin/goldmark/extension/typographer.go | 103 +- vendor/github.com/yuin/goldmark/go.mod | 2 +- .../yuin/goldmark/parser/attribute.go | 11 +- .../yuin/goldmark/parser/atx_heading.go | 8 +- .../yuin/goldmark/parser/code_block.go | 21 + .../yuin/goldmark/parser/code_span.go | 13 +- .../yuin/goldmark/parser/delimiter.go | 26 +- .../yuin/goldmark/parser/fcode_block.go | 15 +- .../yuin/goldmark/parser/html_block.go | 12 +- .../github.com/yuin/goldmark/parser/link.go | 108 +- .../yuin/goldmark/parser/link_ref.go | 73 +- .../github.com/yuin/goldmark/parser/list.go | 58 +- .../yuin/goldmark/parser/list_item.go | 21 +- .../github.com/yuin/goldmark/parser/parser.go | 57 +- .../yuin/goldmark/parser/raw_html.go | 107 +- .../yuin/goldmark/renderer/html/html.go | 60 +- .../github.com/yuin/goldmark/text/reader.go | 110 + .../goldmark/util/unicode_case_folding.go | 3019 +++---- vendor/github.com/yuin/goldmark/util/util.go | 173 +- .../yuin/goldmark/util/util_safe.go | 2 +- .../yuin/goldmark/util/util_unsafe.go | 9 +- vendor/golang.org/x/crypto/acme/acme.go | 6 +- .../x/crypto/acme/autocert/autocert.go | 8 +- vendor/golang.org/x/crypto/acme/http.go | 4 + vendor/golang.org/x/crypto/acme/jws.go | 54 +- vendor/golang.org/x/crypto/acme/rfc8555.go | 56 +- vendor/golang.org/x/crypto/acme/types.go | 74 +- .../golang.org/x/crypto/acme/version_go112.go | 1 + .../x/crypto/argon2/blamka_amd64.go | 3 +- .../golang.org/x/crypto/argon2/blamka_amd64.s | 3 +- .../golang.org/x/crypto/argon2/blamka_ref.go | 3 +- .../x/crypto/blake2b/blake2bAVX2_amd64.go | 3 +- .../x/crypto/blake2b/blake2bAVX2_amd64.s | 97 +- .../x/crypto/blake2b/blake2b_amd64.go | 3 +- .../x/crypto/blake2b/blake2b_amd64.s | 58 +- .../x/crypto/blake2b/blake2b_ref.go | 3 +- .../golang.org/x/crypto/blake2b/register.go | 1 + .../x/crypto/chacha20/chacha_arm64.go | 3 +- .../x/crypto/chacha20/chacha_arm64.s | 3 +- .../x/crypto/chacha20/chacha_noasm.go | 3 +- .../x/crypto/chacha20/chacha_ppc64le.go | 3 +- .../x/crypto/chacha20/chacha_ppc64le.s | 3 +- .../x/crypto/chacha20/chacha_s390x.go | 3 +- .../x/crypto/chacha20/chacha_s390x.s | 3 +- .../x/crypto/curve25519/curve25519.go | 52 +- .../x/crypto/curve25519/curve25519_amd64.go | 240 - .../x/crypto/curve25519/curve25519_amd64.s | 1793 ---- .../x/crypto/curve25519/curve25519_generic.go | 828 -- .../x/crypto/curve25519/curve25519_noasm.go | 11 - .../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 + vendor/golang.org/x/crypto/ed25519/ed25519.go | 1 + .../x/crypto/ed25519/ed25519_go113.go | 1 + .../{ => internal}/poly1305/bits_compat.go | 1 + .../{ => internal}/poly1305/bits_go1.13.go | 1 + .../{ => internal}/poly1305/mac_noasm.go | 3 +- .../{ => internal}/poly1305/poly1305.go | 2 +- .../{ => internal}/poly1305/sum_amd64.go | 3 +- .../{ => internal}/poly1305/sum_amd64.s | 3 +- .../{ => internal}/poly1305/sum_generic.go | 0 .../{ => internal}/poly1305/sum_ppc64le.go | 3 +- .../{ => internal}/poly1305/sum_ppc64le.s | 21 +- .../{ => internal}/poly1305/sum_s390x.go | 3 +- .../{ => internal}/poly1305/sum_s390x.s | 5 +- .../x/crypto/internal/subtle/aliasing.go | 3 +- ...iasing_appengine.go => aliasing_purego.go} | 3 +- .../x/crypto/openpgp/armor/armor.go | 6 + .../x/crypto/openpgp/elgamal/elgamal.go | 6 + .../x/crypto/openpgp/errors/errors.go | 6 + .../x/crypto/openpgp/packet/packet.go | 6 + vendor/golang.org/x/crypto/openpgp/read.go | 6 + vendor/golang.org/x/crypto/openpgp/s2k/s2k.go | 6 + vendor/golang.org/x/crypto/scrypt/scrypt.go | 23 +- vendor/golang.org/x/crypto/ssh/cipher.go | 2 +- 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/kex.go | 13 +- vendor/golang.org/x/crypto/ssh/mux.go | 23 +- vendor/golang.org/x/crypto/ssh/server.go | 4 + .../x/mod/internal/lazyregexp/lazyre.go | 78 + vendor/golang.org/x/mod/module/module.go | 223 +- vendor/golang.org/x/mod/module/pseudo.go | 250 + vendor/golang.org/x/mod/semver/semver.go | 33 +- 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 | 15 +- 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/const.go | 2 +- vendor/golang.org/x/net/html/foreign.go | 119 +- vendor/golang.org/x/net/html/parse.go | 43 +- vendor/golang.org/x/net/html/render.go | 6 +- vendor/golang.org/x/net/html/token.go | 61 +- 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 | 1 + .../idna/{tables12.00.go => tables12.0.0.go} | 3 +- 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 +- vendor/golang.org/x/sys/AUTHORS | 3 - vendor/golang.org/x/sys/CONTRIBUTORS | 3 - vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s | 3 +- vendor/golang.org/x/sys/cpu/byteorder.go | 12 +- vendor/golang.org/x/sys/cpu/cpu.go | 166 +- .../sys/cpu/{cpu_aix_ppc64.go => cpu_aix.go} | 8 +- vendor/golang.org/x/sys/cpu/cpu_arm.go | 33 + vendor/golang.org/x/sys/cpu/cpu_arm64.go | 66 +- vendor/golang.org/x/sys/cpu/cpu_arm64.s | 3 +- vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go | 3 +- 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 | 1 + .../golang.org/x/sys/cpu/cpu_gccgo_s390x.go | 1 + vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c | 30 +- vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go | 7 + vendor/golang.org/x/sys/cpu/cpu_linux.go | 3 +- .../golang.org/x/sys/cpu/cpu_linux_arm64.go | 44 +- .../golang.org/x/sys/cpu/cpu_linux_mips64x.go | 2 + .../golang.org/x/sys/cpu/cpu_linux_noinit.go | 1 + .../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 + .../golang.org/x/sys/cpu/cpu_openbsd_arm64.go | 65 + .../golang.org/x/sys/cpu/cpu_openbsd_arm64.s | 11 + vendor/golang.org/x/sys/cpu/cpu_other_arm.go | 10 + .../golang.org/x/sys/cpu/cpu_other_arm64.go | 3 +- .../golang.org/x/sys/cpu/cpu_other_mips64x.go | 13 + .../golang.org/x/sys/cpu/cpu_other_ppc64x.go | 15 + .../golang.org/x/sys/cpu/cpu_other_riscv64.go | 12 + vendor/golang.org/x/sys/cpu/cpu_ppc64x.go | 17 + vendor/golang.org/x/sys/cpu/cpu_riscv64.go | 3 + 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/endian_big.go | 11 + vendor/golang.org/x/sys/cpu/endian_little.go | 11 + vendor/golang.org/x/sys/cpu/parse.go | 43 + .../x/sys/cpu/proc_cpuinfo_linux.go | 54 + .../golang.org/x/sys/cpu/syscall_aix_gccgo.go | 27 + .../x/sys/cpu/syscall_aix_ppc64_gc.go | 4 +- vendor/golang.org/x/sys/execabs/execabs.go | 102 + .../golang.org/x/sys/execabs/execabs_go118.go | 12 + .../golang.org/x/sys/execabs/execabs_go119.go | 17 + vendor/golang.org/x/sys/unix/README.md | 8 +- vendor/golang.org/x/sys/unix/aliases.go | 3 +- vendor/golang.org/x/sys/unix/asm_aix_ppc64.s | 3 +- .../unix/{asm_netbsd_386.s => asm_bsd_386.s} | 12 +- vendor/golang.org/x/sys/unix/asm_bsd_amd64.s | 29 + .../unix/{asm_darwin_arm.s => asm_bsd_arm.s} | 11 +- .../{asm_openbsd_amd64.s => asm_bsd_arm64.s} | 10 +- .../{asm_netbsd_amd64.s => asm_bsd_ppc64.s} | 8 +- .../{asm_darwin_amd64.s => asm_bsd_riscv64.s} | 10 +- vendor/golang.org/x/sys/unix/asm_darwin_386.s | 29 - .../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 | 4 +- .../golang.org/x/sys/unix/asm_linux_s390x.s | 5 +- vendor/golang.org/x/sys/unix/asm_netbsd_arm.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 + 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 | 3 +- 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 | 233 - .../x/sys/unix/errors_freebsd_amd64.go | 233 - .../x/sys/unix/errors_freebsd_arm.go | 226 - .../x/sys/unix/errors_freebsd_arm64.go | 17 - vendor/golang.org/x/sys/unix/fcntl.go | 1 + 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 | 3 +- 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 | 10 +- .../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 | 12 +- vendor/golang.org/x/sys/unix/ioctl_linux.go | 233 + vendor/golang.org/x/sys/unix/ioctl_zos.go | 74 + vendor/golang.org/x/sys/unix/mkall.sh | 89 +- vendor/golang.org/x/sys/unix/mkerrors.sh | 101 +- 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 | 1 + .../x/sys/unix/readdirent_getdirentries.go | 1 + .../golang.org/x/sys/unix/sockcmsg_linux.go | 49 + vendor/golang.org/x/sys/unix/sockcmsg_unix.go | 17 +- .../x/sys/unix/sockcmsg_unix_other.go | 13 +- vendor/golang.org/x/sys/unix/str.go | 26 - vendor/golang.org/x/sys/unix/syscall.go | 38 +- vendor/golang.org/x/sys/unix/syscall_aix.go | 132 +- .../golang.org/x/sys/unix/syscall_aix_ppc.go | 4 +- .../x/sys/unix/syscall_aix_ppc64.go | 4 +- vendor/golang.org/x/sys/unix/syscall_bsd.go | 146 +- .../x/sys/unix/syscall_darwin.1_12.go | 29 - .../x/sys/unix/syscall_darwin.1_13.go | 108 - .../golang.org/x/sys/unix/syscall_darwin.go | 403 +- .../x/sys/unix/syscall_darwin_386.1_11.go | 9 - .../x/sys/unix/syscall_darwin_386.go | 57 - .../x/sys/unix/syscall_darwin_amd64.1_11.go | 9 - .../x/sys/unix/syscall_darwin_amd64.go | 12 +- .../x/sys/unix/syscall_darwin_arm.go | 57 - .../x/sys/unix/syscall_darwin_arm64.1_11.go | 11 - .../x/sys/unix/syscall_darwin_arm64.go | 14 +- .../x/sys/unix/syscall_darwin_libSystem.go | 10 +- .../x/sys/unix/syscall_dragonfly.go | 60 +- .../x/sys/unix/syscall_dragonfly_amd64.go | 1 + .../golang.org/x/sys/unix/syscall_freebsd.go | 379 +- .../x/sys/unix/syscall_freebsd_386.go | 14 +- .../x/sys/unix/syscall_freebsd_amd64.go | 14 +- .../x/sys/unix/syscall_freebsd_arm.go | 12 +- .../x/sys/unix/syscall_freebsd_arm64.go | 12 +- .../x/sys/unix/syscall_freebsd_riscv64.go | 68 + vendor/golang.org/x/sys/unix/syscall_hurd.go | 22 + .../golang.org/x/sys/unix/syscall_hurd_386.go | 29 + .../golang.org/x/sys/unix/syscall_illumos.go | 40 +- vendor/golang.org/x/sys/unix/syscall_linux.go | 802 +- .../x/sys/unix/syscall_linux_386.go | 66 +- .../x/sys/unix/syscall_linux_alarm.go | 14 + .../x/sys/unix/syscall_linux_amd64.go | 59 +- .../x/sys/unix/syscall_linux_amd64_gc.go | 4 +- .../x/sys/unix/syscall_linux_arm.go | 65 +- .../x/sys/unix/syscall_linux_arm64.go | 66 +- .../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 | 222 + .../x/sys/unix/syscall_linux_mips64x.go | 49 +- .../x/sys/unix/syscall_linux_mipsx.go | 53 +- .../x/sys/unix/syscall_linux_ppc.go | 232 + .../x/sys/unix/syscall_linux_ppc64x.go | 48 +- .../x/sys/unix/syscall_linux_riscv64.go | 62 +- .../x/sys/unix/syscall_linux_s390x.go | 60 +- .../x/sys/unix/syscall_linux_sparc64.go | 47 +- .../golang.org/x/sys/unix/syscall_netbsd.go | 64 +- .../x/sys/unix/syscall_netbsd_386.go | 1 + .../x/sys/unix/syscall_netbsd_amd64.go | 1 + .../x/sys/unix/syscall_netbsd_arm.go | 1 + .../x/sys/unix/syscall_netbsd_arm64.go | 1 + .../golang.org/x/sys/unix/syscall_openbsd.go | 41 +- .../x/sys/unix/syscall_openbsd_386.go | 1 + .../x/sys/unix/syscall_openbsd_amd64.go | 1 + .../x/sys/unix/syscall_openbsd_arm.go | 1 + .../x/sys/unix/syscall_openbsd_arm64.go | 1 + .../x/sys/unix/syscall_openbsd_libc.go | 27 + .../x/sys/unix/syscall_openbsd_mips64.go | 39 + .../x/sys/unix/syscall_openbsd_ppc64.go | 42 + .../x/sys/unix/syscall_openbsd_riscv64.go | 42 + .../golang.org/x/sys/unix/syscall_solaris.go | 537 +- .../x/sys/unix/syscall_solaris_amd64.go | 1 + vendor/golang.org/x/sys/unix/syscall_unix.go | 181 +- .../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 | 1994 +++++ vendor/golang.org/x/sys/unix/sysvshm_linux.go | 21 + vendor/golang.org/x/sys/unix/sysvshm_unix.go | 52 + .../x/sys/unix/sysvshm_unix_other.go | 14 + vendor/golang.org/x/sys/unix/timestruct.go | 29 +- vendor/golang.org/x/sys/unix/xattr_bsd.go | 105 +- .../golang.org/x/sys/unix/zerrors_aix_ppc.go | 1 + .../x/sys/unix/zerrors_aix_ppc64.go | 1 + .../x/sys/unix/zerrors_darwin_amd64.go | 3046 +++---- .../x/sys/unix/zerrors_darwin_arm64.go | 3046 +++---- .../x/sys/unix/zerrors_dragonfly_amd64.go | 139 +- .../x/sys/unix/zerrors_freebsd_386.go | 125 +- .../x/sys/unix/zerrors_freebsd_amd64.go | 123 +- .../x/sys/unix/zerrors_freebsd_arm.go | 245 +- .../x/sys/unix/zerrors_freebsd_arm64.go | 116 +- .../x/sys/unix/zerrors_freebsd_riscv64.go | 2148 +++++ vendor/golang.org/x/sys/unix/zerrors_linux.go | 1158 ++- .../x/sys/unix/zerrors_linux_386.go | 47 +- .../x/sys/unix/zerrors_linux_amd64.go | 47 +- .../x/sys/unix/zerrors_linux_arm.go | 47 +- .../x/sys/unix/zerrors_linux_arm64.go | 52 +- .../x/sys/unix/zerrors_linux_loong64.go | 819 ++ .../x/sys/unix/zerrors_linux_mips.go | 47 +- .../x/sys/unix/zerrors_linux_mips64.go | 47 +- .../x/sys/unix/zerrors_linux_mips64le.go | 47 +- .../x/sys/unix/zerrors_linux_mipsle.go | 47 +- .../x/sys/unix/zerrors_linux_ppc.go | 888 ++ .../x/sys/unix/zerrors_linux_ppc64.go | 47 +- .../x/sys/unix/zerrors_linux_ppc64le.go | 47 +- .../x/sys/unix/zerrors_linux_riscv64.go | 47 +- .../x/sys/unix/zerrors_linux_s390x.go | 49 +- .../x/sys/unix/zerrors_linux_sparc64.go | 47 +- .../x/sys/unix/zerrors_netbsd_386.go | 7 + .../x/sys/unix/zerrors_netbsd_amd64.go | 7 + .../x/sys/unix/zerrors_netbsd_arm.go | 7 + .../x/sys/unix/zerrors_netbsd_arm64.go | 7 + .../x/sys/unix/zerrors_openbsd_386.go | 367 +- .../x/sys/unix/zerrors_openbsd_amd64.go | 197 +- .../x/sys/unix/zerrors_openbsd_arm.go | 359 +- .../x/sys/unix/zerrors_openbsd_arm64.go | 168 +- .../x/sys/unix/zerrors_openbsd_mips64.go | 1906 ++++ ...darwin_arm.go => zerrors_openbsd_ppc64.go} | 1709 ++-- ...rwin_386.go => zerrors_openbsd_riscv64.go} | 1702 ++-- .../x/sys/unix/zerrors_solaris_amd64.go | 26 +- .../x/sys/unix/zerrors_zos_s390x.go | 860 ++ .../x/sys/unix/zptrace_armnn_linux.go | 1 + .../x/sys/unix/zptrace_mipsnn_linux.go | 1 + .../x/sys/unix/zptrace_mipsnnle_linux.go | 1 + .../x/sys/unix/zptrace_x86_linux.go | 1 + .../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 | 1809 ---- .../x/sys/unix/zsyscall_darwin_386.1_13.go | 41 - .../x/sys/unix/zsyscall_darwin_386.1_13.s | 12 - .../x/sys/unix/zsyscall_darwin_386.go | 2497 ------ .../x/sys/unix/zsyscall_darwin_386.s | 284 - .../x/sys/unix/zsyscall_darwin_amd64.1_13.go | 41 - .../x/sys/unix/zsyscall_darwin_amd64.1_13.s | 12 - .../x/sys/unix/zsyscall_darwin_amd64.go | 932 +- .../x/sys/unix/zsyscall_darwin_amd64.s | 912 +- .../x/sys/unix/zsyscall_darwin_arm.1_11.go | 1782 ---- .../x/sys/unix/zsyscall_darwin_arm.1_13.go | 41 - .../x/sys/unix/zsyscall_darwin_arm.1_13.s | 12 - .../x/sys/unix/zsyscall_darwin_arm.go | 2482 ------ .../x/sys/unix/zsyscall_darwin_arm.s | 282 - .../x/sys/unix/zsyscall_darwin_arm64.1_11.go | 1782 ---- .../x/sys/unix/zsyscall_darwin_arm64.1_13.go | 41 - .../x/sys/unix/zsyscall_darwin_arm64.1_13.s | 12 - .../x/sys/unix/zsyscall_darwin_arm64.go | 917 +- .../x/sys/unix/zsyscall_darwin_arm64.s | 910 +- .../x/sys/unix/zsyscall_dragonfly_amd64.go | 55 +- .../x/sys/unix/zsyscall_freebsd_386.go | 156 +- .../x/sys/unix/zsyscall_freebsd_amd64.go | 154 +- .../x/sys/unix/zsyscall_freebsd_arm.go | 188 +- .../x/sys/unix/zsyscall_freebsd_arm64.go | 154 +- ...64.1_11.go => zsyscall_freebsd_riscv64.go} | 542 +- .../x/sys/unix/zsyscall_illumos_amd64.go | 17 +- .../golang.org/x/sys/unix/zsyscall_linux.go | 326 +- .../x/sys/unix/zsyscall_linux_386.go | 95 +- .../x/sys/unix/zsyscall_linux_amd64.go | 129 +- .../x/sys/unix/zsyscall_linux_arm.go | 109 +- .../x/sys/unix/zsyscall_linux_arm64.go | 67 +- .../x/sys/unix/zsyscall_linux_loong64.go | 487 ++ .../x/sys/unix/zsyscall_linux_mips.go | 108 +- .../x/sys/unix/zsyscall_linux_mips64.go | 85 +- .../x/sys/unix/zsyscall_linux_mips64le.go | 88 +- .../x/sys/unix/zsyscall_linux_mipsle.go | 108 +- .../x/sys/unix/zsyscall_linux_ppc.go | 669 ++ .../x/sys/unix/zsyscall_linux_ppc64.go | 122 +- .../x/sys/unix/zsyscall_linux_ppc64le.go | 122 +- .../x/sys/unix/zsyscall_linux_riscv64.go | 67 +- .../x/sys/unix/zsyscall_linux_s390x.go | 99 +- .../x/sys/unix/zsyscall_linux_sparc64.go | 95 +- .../x/sys/unix/zsyscall_netbsd_386.go | 21 +- .../x/sys/unix/zsyscall_netbsd_amd64.go | 21 +- .../x/sys/unix/zsyscall_netbsd_arm.go | 21 +- .../x/sys/unix/zsyscall_netbsd_arm64.go | 21 +- .../x/sys/unix/zsyscall_openbsd_386.go | 817 +- .../x/sys/unix/zsyscall_openbsd_386.s | 669 ++ .../x/sys/unix/zsyscall_openbsd_amd64.go | 817 +- .../x/sys/unix/zsyscall_openbsd_amd64.s | 669 ++ .../x/sys/unix/zsyscall_openbsd_arm.go | 817 +- .../x/sys/unix/zsyscall_openbsd_arm.s | 669 ++ .../x/sys/unix/zsyscall_openbsd_arm64.go | 817 +- .../x/sys/unix/zsyscall_openbsd_arm64.s | 669 ++ .../x/sys/unix/zsyscall_openbsd_mips64.go | 2235 +++++ .../x/sys/unix/zsyscall_openbsd_mips64.s | 669 ++ .../x/sys/unix/zsyscall_openbsd_ppc64.go | 2235 +++++ .../x/sys/unix/zsyscall_openbsd_ppc64.s | 802 ++ .../x/sys/unix/zsyscall_openbsd_riscv64.go | 2235 +++++ .../x/sys/unix/zsyscall_openbsd_riscv64.s | 669 ++ .../x/sys/unix/zsyscall_solaris_amd64.go | 174 +- .../x/sys/unix/zsyscall_zos_s390x.go | 1255 +++ .../x/sys/unix/zsysctl_openbsd_386.go | 55 +- .../x/sys/unix/zsysctl_openbsd_amd64.go | 19 +- .../x/sys/unix/zsysctl_openbsd_arm.go | 53 +- .../x/sys/unix/zsysctl_openbsd_arm64.go | 12 +- .../x/sys/unix/zsysctl_openbsd_mips64.go | 281 + .../x/sys/unix/zsysctl_openbsd_ppc64.go | 281 + .../x/sys/unix/zsysctl_openbsd_riscv64.go | 282 + .../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 | 108 +- .../x/sys/unix/zsysnum_freebsd_amd64.go | 108 +- .../x/sys/unix/zsysnum_freebsd_arm.go | 108 +- .../x/sys/unix/zsysnum_freebsd_arm64.go | 108 +- .../x/sys/unix/zsysnum_freebsd_riscv64.go | 394 + .../x/sys/unix/zsysnum_linux_386.go | 16 +- .../x/sys/unix/zsysnum_linux_amd64.go | 714 +- .../x/sys/unix/zsysnum_linux_arm.go | 16 +- .../x/sys/unix/zsysnum_linux_arm64.go | 604 +- .../x/sys/unix/zsysnum_linux_loong64.go | 311 + .../x/sys/unix/zsysnum_linux_mips.go | 15 +- .../x/sys/unix/zsysnum_linux_mips64.go | 699 +- .../x/sys/unix/zsysnum_linux_mips64le.go | 699 +- .../x/sys/unix/zsysnum_linux_mipsle.go | 15 +- .../x/sys/unix/zsysnum_linux_ppc.go | 441 + .../x/sys/unix/zsysnum_linux_ppc64.go | 797 +- .../x/sys/unix/zsysnum_linux_ppc64le.go | 797 +- .../x/sys/unix/zsysnum_linux_riscv64.go | 602 +- .../x/sys/unix/zsysnum_linux_s390x.go | 727 +- .../x/sys/unix/zsysnum_linux_sparc64.go | 755 +- .../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 | 2 + .../x/sys/unix/zsysnum_openbsd_amd64.go | 2 + .../x/sys/unix/zsysnum_openbsd_arm.go | 2 + .../x/sys/unix/zsysnum_openbsd_arm64.go | 2 + .../x/sys/unix/zsysnum_openbsd_mips64.go | 222 + .../x/sys/unix/zsysnum_openbsd_ppc64.go | 218 + .../x/sys/unix/zsysnum_openbsd_riscv64.go | 219 + .../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 | 51 +- .../x/sys/unix/ztypes_freebsd_386.go | 132 +- .../x/sys/unix/ztypes_freebsd_amd64.go | 130 +- .../x/sys/unix/ztypes_freebsd_arm.go | 185 +- .../x/sys/unix/ztypes_freebsd_arm64.go | 128 +- .../x/sys/unix/ztypes_freebsd_riscv64.go | 638 ++ vendor/golang.org/x/sys/unix/ztypes_linux.go | 4593 ++++++++-- .../golang.org/x/sys/unix/ztypes_linux_386.go | 105 +- .../x/sys/unix/ztypes_linux_amd64.go | 105 +- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 108 +- .../x/sys/unix/ztypes_linux_arm64.go | 105 +- .../x/sys/unix/ztypes_linux_loong64.go | 691 ++ .../x/sys/unix/ztypes_linux_mips.go | 107 +- .../x/sys/unix/ztypes_linux_mips64.go | 105 +- .../x/sys/unix/ztypes_linux_mips64le.go | 105 +- .../x/sys/unix/ztypes_linux_mipsle.go | 107 +- .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 704 ++ .../x/sys/unix/ztypes_linux_ppc64.go | 104 +- .../x/sys/unix/ztypes_linux_ppc64le.go | 104 +- .../x/sys/unix/ztypes_linux_riscv64.go | 105 +- .../x/sys/unix/ztypes_linux_s390x.go | 108 +- .../x/sys/unix/ztypes_linux_sparc64.go | 104 +- .../x/sys/unix/ztypes_netbsd_386.go | 90 +- .../x/sys/unix/ztypes_netbsd_amd64.go | 90 +- .../x/sys/unix/ztypes_netbsd_arm.go | 90 +- .../x/sys/unix/ztypes_netbsd_arm64.go | 90 +- .../x/sys/unix/ztypes_openbsd_386.go | 122 +- .../x/sys/unix/ztypes_openbsd_amd64.go | 58 +- .../x/sys/unix/ztypes_openbsd_arm.go | 34 +- .../x/sys/unix/ztypes_openbsd_arm64.go | 34 +- .../x/sys/unix/ztypes_openbsd_mips64.go | 569 ++ .../x/sys/unix/ztypes_openbsd_ppc64.go | 571 ++ .../x/sys/unix/ztypes_openbsd_riscv64.go | 571 ++ .../x/sys/unix/ztypes_solaris_amd64.go | 110 +- .../golang.org/x/sys/unix/ztypes_zos_s390x.go | 415 + vendor/golang.org/x/sys/windows/aliases.go | 4 +- .../golang.org/x/sys/windows/dll_windows.go | 3 +- vendor/golang.org/x/sys/windows/empty.s | 1 + .../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 | 7 + 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 | 60 +- vendor/golang.org/x/sys/windows/service.go | 22 +- .../x/sys/windows/setupapi_windows.go | 1425 +++ vendor/golang.org/x/sys/windows/str.go | 1 + .../golang.org/x/sys/windows/svc/debug/log.go | 1 + .../x/sys/windows/svc/debug/service.go | 4 +- vendor/golang.org/x/sys/windows/svc/event.go | 48 - vendor/golang.org/x/sys/windows/svc/go12.c | 24 - vendor/golang.org/x/sys/windows/svc/go12.go | 11 - vendor/golang.org/x/sys/windows/svc/go13.go | 31 - .../golang.org/x/sys/windows/svc/security.go | 45 +- .../golang.org/x/sys/windows/svc/service.go | 237 +- vendor/golang.org/x/sys/windows/svc/sys_386.s | 69 - .../golang.org/x/sys/windows/svc/sys_amd64.s | 44 - vendor/golang.org/x/sys/windows/svc/sys_arm.s | 38 - vendor/golang.org/x/sys/windows/syscall.go | 39 +- .../x/sys/windows/syscall_windows.go | 516 +- .../golang.org/x/sys/windows/types_windows.go | 1586 +++- .../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 | 2619 +++++- .../x/sys/windows/zsyscall_windows.go | 5606 ++++++------ vendor/golang.org/x/text/AUTHORS | 3 - vendor/golang.org/x/text/CONTRIBUTORS | 3 - .../x/text/encoding/htmlindex/tables.go | 9 + .../text/encoding/internal/identifier/mib.go | 8 + .../x/text/encoding/simplifiedchinese/gbk.go | 6 +- .../encoding/simplifiedchinese/hzgb2312.go | 2 +- .../x/text/encoding/unicode/unicode.go | 94 +- .../internal/language/compact/language.go | 2 +- .../text/internal/language/compact/tables.go | 36 +- .../x/text/internal/language/language.go | 135 +- .../x/text/internal/language/lookup.go | 4 +- .../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/go1_1.go | 38 - vendor/golang.org/x/text/language/go1_2.go | 11 - vendor/golang.org/x/text/language/language.go | 6 +- vendor/golang.org/x/text/language/match.go | 2 +- vendor/golang.org/x/text/language/parse.go | 30 +- vendor/golang.org/x/text/language/tables.go | 86 +- vendor/golang.org/x/text/runes/runes.go | 2 +- .../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 +- .../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 + .../golang.org/x/text/unicode/bidi/trieval.go | 12 - .../x/text/unicode/norm/forminfo.go | 9 +- .../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/width/tables10.0.0.go | 25 +- .../golang.org/x/text/width/tables11.0.0.go | 27 +- .../golang.org/x/text/width/tables12.0.0.go | 1361 +++ .../golang.org/x/text/width/tables13.0.0.go | 1362 +++ vendor/golang.org/x/text/width/tables9.0.0.go | 25 +- vendor/golang.org/x/tools/AUTHORS | 3 - vendor/golang.org/x/tools/CONTRIBUTORS | 3 - vendor/golang.org/x/tools/cover/profile.go | 20 +- .../x/tools/go/analysis/analysis.go | 33 +- .../x/tools/go/analysis/diagnostic.go | 4 + vendor/golang.org/x/tools/go/analysis/doc.go | 57 +- .../analysis/internal/analysisflags/flags.go | 2 +- .../analysis/internal/analysisflags/help.go | 4 + .../tools/go/analysis/internal/facts/facts.go | 1 - .../go/analysis/internal/facts/imports.go | 34 +- .../go/analysis/unitchecker/unitchecker.go | 24 +- .../go/analysis/unitchecker/unitchecker112.go | 5 + .../x/tools/go/analysis/validate.go | 42 +- .../x/tools/go/ast/astutil/enclosing.go | 49 +- .../x/tools/go/ast/astutil/imports.go | 7 +- .../x/tools/go/ast/astutil/rewrite.go | 17 +- .../golang.org/x/tools/go/ast/astutil/util.go | 4 + .../x/tools/go/buildutil/allpackages.go | 11 +- .../x/tools/go/buildutil/fakecontext.go | 5 +- .../x/tools/go/buildutil/overlay.go | 3 +- .../golang.org/x/tools/go/buildutil/tags.go | 7 +- .../golang.org/x/tools/go/buildutil/util.go | 3 - .../x/tools/go/gcexportdata/gcexportdata.go | 104 +- .../x/tools/go/gcexportdata/importer.go | 2 + .../golang.org/x/tools/go/internal/cgo/cgo.go | 5 +- .../x/tools/go/internal/cgo/cgo_pkgconfig.go | 2 +- .../x/tools/go/internal/gcimporter/bexport.go | 43 +- .../x/tools/go/internal/gcimporter/bimport.go | 52 +- .../go/internal/gcimporter/exportdata.go | 16 +- .../go/internal/gcimporter/gcimporter.go | 173 +- .../x/tools/go/internal/gcimporter/iexport.go | 405 +- .../x/tools/go/internal/gcimporter/iimport.go | 422 +- .../go/internal/gcimporter/newInterface10.go | 1 + .../go/internal/gcimporter/newInterface11.go | 1 + .../go/internal/gcimporter/support_go117.go | 16 + .../go/internal/gcimporter/support_go118.go | 23 + .../go/internal/gcimporter/unified_no.go | 10 + .../go/internal/gcimporter/unified_yes.go | 10 + .../go/internal/gcimporter/ureader_no.go | 19 + .../go/internal/gcimporter/ureader_yes.go | 612 ++ .../tools/go/internal/packagesdriver/sizes.go | 85 +- .../x/tools/go/internal/pkgbits/codes.go | 77 + .../x/tools/go/internal/pkgbits/decoder.go | 433 + .../x/tools/go/internal/pkgbits/doc.go | 32 + .../x/tools/go/internal/pkgbits/encoder.go | 379 + .../x/tools/go/internal/pkgbits/flags.go | 9 + .../x/tools/go/internal/pkgbits/frames_go1.go | 21 + .../tools/go/internal/pkgbits/frames_go17.go | 28 + .../x/tools/go/internal/pkgbits/reloc.go | 42 + .../x/tools/go/internal/pkgbits/support.go | 17 + .../x/tools/go/internal/pkgbits/sync.go | 113 + .../go/internal/pkgbits/syncmarker_string.go | 89 + vendor/golang.org/x/tools/go/loader/doc.go | 42 +- vendor/golang.org/x/tools/go/loader/loader.go | 69 +- vendor/golang.org/x/tools/go/loader/util.go | 1 - vendor/golang.org/x/tools/go/packages/doc.go | 1 - .../x/tools/go/packages/external.go | 4 +- .../golang.org/x/tools/go/packages/golist.go | 489 +- .../x/tools/go/packages/golist_overlay.go | 261 +- .../x/tools/go/packages/loadmode_string.go | 6 +- .../x/tools/go/packages/packages.go | 187 +- .../golang.org/x/tools/go/packages/visit.go | 4 + .../x/tools/go/types/objectpath/objectpath.go | 351 +- vendor/golang.org/x/tools/imports/forward.go | 41 +- .../internal/analysisinternal/analysis.go | 397 + .../x/tools/internal/event/core/event.go | 85 + .../x/tools/internal/event/core/export.go | 70 + .../x/tools/internal/event/core/fast.go | 77 + .../internal/event/doc.go} | 10 +- .../x/tools/internal/event/event.go | 127 + .../x/tools/internal/event/keys/keys.go | 564 ++ .../x/tools/internal/event/keys/standard.go | 22 + .../x/tools/internal/event/label/label.go | 215 + .../x/tools/internal/fastwalk/fastwalk.go | 6 +- .../fastwalk/fastwalk_dirent_fileno.go | 1 + .../internal/fastwalk/fastwalk_dirent_ino.go | 1 + .../fastwalk/fastwalk_dirent_namlen_bsd.go | 1 + .../fastwalk/fastwalk_dirent_namlen_linux.go | 4 +- .../internal/fastwalk/fastwalk_portable.go | 1 + .../tools/internal/fastwalk/fastwalk_unix.go | 29 +- .../x/tools/internal/gocommand/invoke.go | 215 +- .../x/tools/internal/gocommand/vendor.go | 109 + .../x/tools/internal/gocommand/version.go | 51 + .../x/tools/internal/gopathwalk/walk.go | 31 +- .../x/tools/internal/imports/fix.go | 320 +- .../x/tools/internal/imports/imports.go | 113 +- .../x/tools/internal/imports/mod.go | 198 +- .../x/tools/internal/imports/mod_cache.go | 4 + .../x/tools/internal/imports/sortimports.go | 58 +- .../x/tools/internal/imports/zstdlib.go | 440 +- .../internal/packagesinternal/packages.go | 45 +- .../x/tools/internal/typeparams/common.go | 179 + .../x/tools/internal/typeparams/coretype.go | 122 + .../internal/typeparams/enabled_go117.go | 12 + .../internal/typeparams/enabled_go118.go | 15 + .../x/tools/internal/typeparams/normalize.go | 218 + .../x/tools/internal/typeparams/termlist.go | 163 + .../internal/typeparams/typeparams_go117.go | 197 + .../internal/typeparams/typeparams_go118.go | 151 + .../x/tools/internal/typeparams/typeterm.go | 170 + .../tools/internal/typesinternal/errorcode.go | 1526 ++++ .../typesinternal/errorcode_string.go | 167 + .../x/tools/internal/typesinternal/types.go | 52 + .../tools/internal/typesinternal/types_118.go | 19 + vendor/golang.org/x/xerrors/LICENSE | 27 - vendor/golang.org/x/xerrors/PATENTS | 22 - vendor/golang.org/x/xerrors/README | 2 - vendor/golang.org/x/xerrors/adaptor.go | 193 - vendor/golang.org/x/xerrors/codereview.cfg | 1 - vendor/golang.org/x/xerrors/doc.go | 22 - vendor/golang.org/x/xerrors/errors.go | 33 - vendor/golang.org/x/xerrors/fmt.go | 187 - vendor/golang.org/x/xerrors/format.go | 34 - vendor/golang.org/x/xerrors/frame.go | 56 - vendor/golang.org/x/xerrors/go.mod | 3 - .../golang.org/x/xerrors/internal/internal.go | 8 - vendor/golang.org/x/xerrors/wrap.go | 106 - vendor/modules.txt | 30 +- 714 files changed, 118037 insertions(+), 42487 deletions(-) delete mode 100644 vendor/golang.org/x/crypto/curve25519/curve25519_amd64.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/curve25519_amd64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/curve25519_generic.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go 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 rename vendor/golang.org/x/crypto/{ => internal}/poly1305/bits_compat.go (98%) rename vendor/golang.org/x/crypto/{ => internal}/poly1305/bits_go1.13.go (96%) rename vendor/golang.org/x/crypto/{ => internal}/poly1305/mac_noasm.go (66%) rename vendor/golang.org/x/crypto/{ => internal}/poly1305/poly1305.go (98%) rename vendor/golang.org/x/crypto/{ => internal}/poly1305/sum_amd64.go (95%) rename vendor/golang.org/x/crypto/{ => internal}/poly1305/sum_amd64.s (98%) rename vendor/golang.org/x/crypto/{ => internal}/poly1305/sum_generic.go (100%) rename vendor/golang.org/x/crypto/{ => internal}/poly1305/sum_ppc64le.go (95%) rename vendor/golang.org/x/crypto/{ => internal}/poly1305/sum_ppc64le.s (94%) rename vendor/golang.org/x/crypto/{ => internal}/poly1305/sum_s390x.go (97%) rename vendor/golang.org/x/crypto/{ => internal}/poly1305/sum_s390x.s (99%) rename vendor/golang.org/x/crypto/internal/subtle/{aliasing_appengine.go => aliasing_purego.go} (97%) create mode 100644 vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go create mode 100644 vendor/golang.org/x/mod/module/pseudo.go delete mode 100644 vendor/golang.org/x/net/AUTHORS delete mode 100644 vendor/golang.org/x/net/CONTRIBUTORS create mode 100644 vendor/golang.org/x/net/idna/go118.go create mode 100644 vendor/golang.org/x/net/idna/pre_go118.go rename vendor/golang.org/x/net/idna/{tables12.00.go => tables12.0.0.go} (99%) create mode 100644 vendor/golang.org/x/net/idna/tables13.0.0.go delete mode 100644 vendor/golang.org/x/sys/AUTHORS delete mode 100644 vendor/golang.org/x/sys/CONTRIBUTORS 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_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_openbsd_arm64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s 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_ppc64x.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 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/endian_big.go create mode 100644 vendor/golang.org/x/sys/cpu/endian_little.go create mode 100644 vendor/golang.org/x/sys/cpu/parse.go create mode 100644 vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go create mode 100644 vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go create mode 100644 vendor/golang.org/x/sys/execabs/execabs.go create mode 100644 vendor/golang.org/x/sys/execabs/execabs_go118.go create mode 100644 vendor/golang.org/x/sys/execabs/execabs_go119.go rename vendor/golang.org/x/sys/unix/{asm_netbsd_386.s => asm_bsd_386.s} (70%) create mode 100644 vendor/golang.org/x/sys/unix/asm_bsd_amd64.s rename vendor/golang.org/x/sys/unix/{asm_darwin_arm.s => asm_bsd_arm.s} (74%) rename vendor/golang.org/x/sys/unix/{asm_openbsd_amd64.s => asm_bsd_arm64.s} (73%) rename vendor/golang.org/x/sys/unix/{asm_netbsd_amd64.s => asm_bsd_ppc64.s} (73%) rename vendor/golang.org/x/sys/unix/{asm_darwin_amd64.s => asm_bsd_riscv64.s} (73%) delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_386.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 delete mode 100644 vendor/golang.org/x/sys/unix/asm_netbsd_arm.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 delete mode 100644 vendor/golang.org/x/sys/unix/errors_freebsd_arm64.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 create mode 100644 vendor/golang.org/x/sys/unix/ptrace_darwin.go create mode 100644 vendor/golang.org/x/sys/unix/ptrace_ios.go delete mode 100644 vendor/golang.org/x/sys/unix/str.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go delete 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.1_11.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_amd64.1_11.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_hurd.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_hurd_386.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_libc.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.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 create mode 100644 vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.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 create mode 100644 vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go rename vendor/golang.org/x/sys/unix/{zerrors_darwin_arm.go => zerrors_openbsd_ppc64.go} (50%) rename vendor/golang.org/x/sys/unix/{zerrors_darwin_386.go => zerrors_openbsd_riscv64.go} (50%) create mode 100644 vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go 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.1_13.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s 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 delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go delete 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.1_13.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s 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 delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go delete 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} (81%) 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 create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s 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 create mode 100644 vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go create mode 100644 vendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.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_openbsd_ppc64.go create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.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_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_openbsd_ppc64.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/windows/setupapi_windows.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/event.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/go12.c delete mode 100644 vendor/golang.org/x/sys/windows/svc/go12.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/go13.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/sys_386.s delete mode 100644 vendor/golang.org/x/sys/windows/svc/sys_amd64.s delete mode 100644 vendor/golang.org/x/sys/windows/svc/sys_arm.s create mode 100644 vendor/golang.org/x/sys/windows/types_windows_arm64.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/language/go1_1.go delete mode 100644 vendor/golang.org/x/text/language/go1_2.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 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 create mode 100644 vendor/golang.org/x/text/width/tables12.0.0.go create mode 100644 vendor/golang.org/x/text/width/tables13.0.0.go delete mode 100644 vendor/golang.org/x/tools/AUTHORS delete mode 100644 vendor/golang.org/x/tools/CONTRIBUTORS create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/support_go117.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/support_go118.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/unified_no.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/unified_yes.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/ureader_no.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/ureader_yes.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/codes.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/decoder.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/doc.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/encoder.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/flags.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/frames_go1.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/frames_go17.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/reloc.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/support.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/sync.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/syncmarker_string.go create mode 100644 vendor/golang.org/x/tools/internal/analysisinternal/analysis.go create mode 100644 vendor/golang.org/x/tools/internal/event/core/event.go create mode 100644 vendor/golang.org/x/tools/internal/event/core/export.go create mode 100644 vendor/golang.org/x/tools/internal/event/core/fast.go rename vendor/golang.org/x/{sys/unix/syscall_darwin_arm.1_11.go => tools/internal/event/doc.go} (53%) create mode 100644 vendor/golang.org/x/tools/internal/event/event.go create mode 100644 vendor/golang.org/x/tools/internal/event/keys/keys.go create mode 100644 vendor/golang.org/x/tools/internal/event/keys/standard.go create mode 100644 vendor/golang.org/x/tools/internal/event/label/label.go create mode 100644 vendor/golang.org/x/tools/internal/gocommand/vendor.go create mode 100644 vendor/golang.org/x/tools/internal/gocommand/version.go create mode 100644 vendor/golang.org/x/tools/internal/typeparams/common.go create mode 100644 vendor/golang.org/x/tools/internal/typeparams/coretype.go create mode 100644 vendor/golang.org/x/tools/internal/typeparams/enabled_go117.go create mode 100644 vendor/golang.org/x/tools/internal/typeparams/enabled_go118.go create mode 100644 vendor/golang.org/x/tools/internal/typeparams/normalize.go create mode 100644 vendor/golang.org/x/tools/internal/typeparams/termlist.go create mode 100644 vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go create mode 100644 vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go create mode 100644 vendor/golang.org/x/tools/internal/typeparams/typeterm.go create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/errorcode.go create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/types.go create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/types_118.go delete mode 100644 vendor/golang.org/x/xerrors/LICENSE delete mode 100644 vendor/golang.org/x/xerrors/PATENTS delete mode 100644 vendor/golang.org/x/xerrors/README delete mode 100644 vendor/golang.org/x/xerrors/adaptor.go delete mode 100644 vendor/golang.org/x/xerrors/codereview.cfg delete mode 100644 vendor/golang.org/x/xerrors/doc.go delete mode 100644 vendor/golang.org/x/xerrors/errors.go delete mode 100644 vendor/golang.org/x/xerrors/fmt.go delete mode 100644 vendor/golang.org/x/xerrors/format.go delete mode 100644 vendor/golang.org/x/xerrors/frame.go delete mode 100644 vendor/golang.org/x/xerrors/go.mod delete mode 100644 vendor/golang.org/x/xerrors/internal/internal.go delete mode 100644 vendor/golang.org/x/xerrors/wrap.go diff --git a/go.mod b/go.mod index cae0fc97b6ca1..f6d4d5bef95c6 100644 --- a/go.mod +++ b/go.mod @@ -100,15 +100,15 @@ require ( github.com/urfave/cli v1.20.0 github.com/xanzy/go-gitlab v0.31.0 github.com/yohcop/openid-go v1.0.0 - github.com/yuin/goldmark v1.1.25 + github.com/yuin/goldmark v1.4.13 github.com/yuin/goldmark-meta v0.0.0-20191126180153-f0638e958b60 - golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79 - golang.org/x/net v0.0.0-20200506145744-7e3656a0809f + golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 + golang.org/x/net v0.7.0 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d - golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f - golang.org/x/text v0.3.2 + golang.org/x/sys v0.5.0 + golang.org/x/text v0.7.0 golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect - golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224 + golang.org/x/tools v0.1.12 google.golang.org/appengine v1.6.5 // indirect gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect gopkg.in/asn1-ber.v1 v1.0.0-20150924051756-4e86f4367175 // indirect diff --git a/go.sum b/go.sum index 6a57a955716f9..55a95c82030b0 100644 --- a/go.sum +++ b/go.sum @@ -31,11 +31,9 @@ gitea.com/macaron/inject v0.0.0-20190803172902-8375ba841591/go.mod h1:h6E4kLao1Y gitea.com/macaron/inject v0.0.0-20190805023432-d4c86e31027a h1:aOKEXkDTnh4euoH0so/THLXeHtQuqHmDPb1xEk6Ehok= gitea.com/macaron/inject v0.0.0-20190805023432-d4c86e31027a/go.mod h1:h6E4kLao1Yko6DOU6QDnQPcuoNzvbZqzj2mtPcEn1aM= gitea.com/macaron/macaron v1.3.3-0.20190803174002-53e005ff4827/go.mod h1:/rvxMjIkOq4BM8uPUb+VHuU02ZfAO6R4+wD//tiCiRw= -gitea.com/macaron/macaron v1.3.3-0.20190821202302-9646c0587edb h1:amL0md6orTj1tXY16ANzVU9FmzQB+W7aJwp8pVDbrmA= gitea.com/macaron/macaron v1.3.3-0.20190821202302-9646c0587edb/go.mod h1:0coI+mSPSwbsyAbOuFllVS38awuk9mevhLD52l50Gjs= gitea.com/macaron/macaron v1.4.0 h1:FY1QDGqyuUzs21K6ChkbYbRUfwL7v2aUrhNEJ0IgsAw= gitea.com/macaron/macaron v1.4.0/go.mod h1:P7hfDbQjcW22lkYkXlxdRIfWOXxH2+K4EogN4Q0UlLY= -gitea.com/macaron/session v0.0.0-20190821211443-122c47c5f705 h1:mvkQGAlON1Z6Y8pqa/+FpYIskk54mazuECUfZK5oTg0= gitea.com/macaron/session v0.0.0-20190821211443-122c47c5f705/go.mod h1:1ujH0jD6Ca4iK9NL0Q2a7fG2chvXx5hVa7hBfABwpkA= gitea.com/macaron/session v0.0.0-20191207215012-613cebf0674d h1:XLww3CvnFZkXVwauN67fniDaIpIqsE+9KVcxlZKlvLU= gitea.com/macaron/session v0.0.0-20191207215012-613cebf0674d/go.mod h1:FanKy3WjWb5iw/iZBPk4ggoQT9FcM6bkBPvmDmsH6tY= @@ -54,7 +52,6 @@ github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tN github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/RoaringBitmap/roaring v0.4.21 h1:WJ/zIlNX4wQZ9x8Ey33O1UaD9TCTakYsdLFSBcTwH+8= github.com/RoaringBitmap/roaring v0.4.21/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo= github.com/RoaringBitmap/roaring v0.4.23 h1:gpyfd12QohbqhFO4NVDUdoPOCXsyahYRQhINmlHxKeo= github.com/RoaringBitmap/roaring v0.4.23/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo= @@ -121,11 +118,9 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/couchbase/ghistogram v0.1.0/go.mod h1:s1Jhy76zqfEecpNWJfWUiKZookAFaiGOEoyzgHt9i7k= -github.com/couchbase/gomemcached v0.0.0-20190515232915-c4b4ca0eb21d h1:XMf4E1U+b9E3ElF0mjvfXZdflBRZz4gLp16nQ/QSHQM= github.com/couchbase/gomemcached v0.0.0-20190515232915-c4b4ca0eb21d/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c= github.com/couchbase/gomemcached v0.0.0-20191004160342-7b5da2ec40b2 h1:vZryARwW4PSFXd9arwegEywvMTvPuXL3/oa+4L5NTe8= github.com/couchbase/gomemcached v0.0.0-20191004160342-7b5da2ec40b2/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c= -github.com/couchbase/goutils v0.0.0-20190315194238-f9d42b11473b h1:bZ9rKU2/V8sY+NulSfxDOnXTWcs1rySqdF1sVepihvo= github.com/couchbase/goutils v0.0.0-20190315194238-f9d42b11473b/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs= github.com/couchbase/goutils v0.0.0-20191018232750-b49639060d85 h1:0WMIDtuXCKEm4wtAJgAAXa/qtM5O9MariLwgHaRlYmk= github.com/couchbase/goutils v0.0.0-20191018232750-b49639060d85/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs= @@ -147,7 +142,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= -github.com/denisenkom/go-mssqldb v0.0.0-20190924004331-208c0a498538 h1:bpWCJ5MddHsv4Xtl3azkK89mZzd/vvut32mvAnKbyUA= github.com/denisenkom/go-mssqldb v0.0.0-20190924004331-208c0a498538/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc h1:VRRKCwnzqk8QCaRC4os14xoKDdbHqqlJtJA0oc1ZAjg= github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= @@ -166,7 +160,6 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/editorconfig/editorconfig-core-go/v2 v2.1.1 h1:mhPg/0hGebcpiiQLqJD2PWWyoHRLEdZ3sXKaEvT1EQU= github.com/editorconfig/editorconfig-core-go/v2 v2.1.1/go.mod h1:/LuhWJiQ9Gvo1DhVpa4ssm5qeg8rrztdtI7j/iCie2k= -github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= @@ -278,7 +271,6 @@ github.com/go-swagger/go-swagger v0.21.0 h1:AX9mdfzp6eJtUe92nFrWmbK7ocRgkCDPJs0F github.com/go-swagger/go-swagger v0.21.0/go.mod h1:tDb8PdDVFcaE8EPXkMOsuxpL3UEPiwu1UDZar9Z/1RY= github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013 h1:l9rI6sNaZgNC0LnF3MiE+qTmyBA/tZAg1rtyrGbUMK0= github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013/go.mod h1:b65mBPzqzZWxOZGxSWrqs4GInLIn+u99Q9q7p+GKni0= -github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:9wScpmSP5A3Bk8V3XHWUcJmYTh+ZnlHVyc+A4oZYS3Y= github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= @@ -301,13 +293,11 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1 h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= @@ -318,7 +308,6 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -339,7 +328,6 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 h1:twflg0XRTjwKpxb/jFExr4HGq6on2dEOmnL6FV+fgPw= github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -366,7 +354,6 @@ github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVo github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-retryablehttp v0.6.4 h1:BbgctKO892xEyOXnGiaAwIoSq1QZ/SS4AhjoAh9DnfY= github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= @@ -413,7 +400,6 @@ github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4/go.mod h1:ghbZsc github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.2 h1:LfVyl+ZlLlLDeQ/d2AqfGIIH4qEDu0Ed2S5GyhCWIWY= github.com/klauspost/compress v1.9.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.2 h1:Znfn6hXZAHaLPNnlqUYRrBSReFHYybslgv4PTiyz6P0= github.com/klauspost/compress v1.10.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= @@ -427,7 +413,6 @@ github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -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/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -435,7 +420,6 @@ github.com/lafriks/xormstore v1.3.2 h1:hqi3F8s/B4rz8GuEZZDuHuOxRjeuOpEI/cC7vcnWw github.com/lafriks/xormstore v1.3.2/go.mod h1:mVNIwIa25QIr8rfR7YlVjrqN/apswHkVdtLCyVYBzXw= github.com/lestrrat-go/jwx v0.9.0/go.mod h1:iEoxlYfZjvoGpuWwxUz+eR5e6KTJGsaRcy/YNA/UnBk= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.7.0 h1:h93mCPfUSkaul3Ka/VG8uZdmW1uMHDGxzu0NWHuJmHY= github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= @@ -491,7 +475,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mrjones/oauth v0.0.0-20180629183705-f4e24b6d100c h1:3wkDRdxK92dF+c1ke2dtj7ZzemFWBHB9plnJOtlwdFA= github.com/mrjones/oauth v0.0.0-20180629183705-f4e24b6d100c/go.mod h1:skjdDftzkFALcuGzYSklqYd8gvat6F1gZJ4YPVbkZpM= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae h1:VeRdUYdCw49yizlSbMEn2SZ+gT+3IUKx8BqxyQdz+BY= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM= github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= @@ -531,7 +514,6 @@ github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -572,7 +554,6 @@ github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqn github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001 h1:YDeskXpkNDhPdWN3REluVa46HQOVuVkjkd2sWnrABNQ= github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= @@ -617,7 +598,6 @@ github.com/steveyen/gtreap v0.1.0 h1:CjhzTa274PyJLJuMZwIzCO1PfC00oRa8d1Kc78bFXJM github.com/steveyen/gtreap v0.1.0/go.mod h1:kl/5J7XbrOmlIbYIXdRHDDE5QxHqpk0cmkT7Z4dM9/Y= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -629,7 +609,6 @@ github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 h1:HOxvxvnntLiPn1 github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= @@ -642,7 +621,6 @@ github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGr github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ulikunitz/xz v0.5.6 h1:jGHAfXawEGZQ3blwU5wnWKQJvAraT7Ftq9EXjnXYgt8= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e h1:GSGeB9EAKY2spCABz6xOX5DbxZEXolK+nBSvmsQwRjM= github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM= github.com/unknwon/com v1.0.1 h1:3d1LTxD+Lnf3soQiD4Cp/0BRB+Rsa/+RTvz8GMMzIXs= github.com/unknwon/com v1.0.1/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM= @@ -665,11 +643,11 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1: github.com/yohcop/openid-go v1.0.0 h1:EciJ7ZLETHR3wOtxBvKXx9RV6eyHZpCaSZ1inbBaUXE= github.com/yohcop/openid-go v1.0.0/go.mod h1:/408xiwkeItSPJZSTPF7+VtZxPkPrRRpRNK2vjGh6yI= github.com/yuin/goldmark v1.1.7/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.25 h1:isv+Q6HQAmmL2Ofcmg8QauBmDPlUUnSoNhEcC940Rds= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark-meta v0.0.0-20191126180153-f0638e958b60 h1:gZucqLjL1eDzVWrXj4uiWeMbAopJlBR2mKQAsTGdPwo= github.com/yuin/goldmark-meta v0.0.0-20191126180153-f0638e958b60/go.mod h1:i9VhcIHN2PxXMbQrKqXNueok6QNONoPjNMoj9MygVL0= -github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= @@ -696,13 +674,11 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190907121410-71b5226ff739/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad h1:5E5raQxcv+6CZ11RrBYQe5WRbUIWpScjh0kvHZkZIrQ= golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79 h1:IaQbIIB2X/Mp/DKctl6ROxz1KyMlKp4uyvL6+kQ7C88= -golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +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/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -712,10 +688,10 @@ golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +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= @@ -739,15 +715,15 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f h1:QBjCr1Fz5kw158VqdE9JfI9cJnl/ymnJWAdMuinqL7Y= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/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-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -757,6 +733,7 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -781,23 +758,29 @@ golang.org/x/sys v0.0.0-20190730183949-1393eb018365/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190907184412-d223b2b6db03/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f h1:mOhmO9WsBaJCNmaZHPtHs9wOcdqdKCjF6OPJlmDM3KI= -golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/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/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/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/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= 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.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -818,12 +801,11 @@ golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200225230052-807dcd883420 h1:4RJNOV+2rLxMEfr6QIpC7GEv9MjD6ApGXTCLrNF9+eA= golang.org/x/tools v0.0.0-20200225230052-807dcd883420/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224 h1:azwY/v0y0K4mFHVsg5+UrTgchqALYWpqVo6vL5OmkmI= golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +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= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -840,7 +822,6 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.4 h1:WiKh4+/eMB2HaY7QhCfW/R7MuRAoA8QMCSJA6jP5/fo= google.golang.org/appengine v1.6.4/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -861,7 +842,6 @@ google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLY google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0 h1:cJv5/xdbk1NnMPR1VP9+HU6gupuG9MLBoH1r6RHZ2MY= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= @@ -872,7 +852,6 @@ gopkg.in/asn1-ber.v1 v1.0.0-20150924051756-4e86f4367175 h1:nn6Zav2sOQHCFJHEspya8 gopkg.in/asn1-ber.v1 v1.0.0-20150924051756-4e86f4367175/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -898,9 +877,7 @@ gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 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= -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -914,13 +891,11 @@ mvdan.cc/xurls/v2 v2.1.0/go.mod h1:5GrSd9rOnKOpZaji1OZLYL/yeAAtGDlo/cFe+8K5n8E= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251 h1:mUcz5b3FJbP5Cvdq7Khzn6J9OCUQJaBwgBkCR+MOwSs= strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1:FJGmPh3vz9jSos1L/F91iAgnC/aejc0wIIrF2ZwJxdY= -xorm.io/builder v0.3.6 h1:ha28mQ2M+TFx96Hxo+iq6tQgnkC9IZkM6D8w9sKHHF8= xorm.io/builder v0.3.6/go.mod h1:LEFAPISnRzG+zxaxj2vPicRwz67BdhFreKg8yv8/TgU= xorm.io/builder v0.3.7 h1:2pETdKRK+2QG4mLX4oODHEhn5Z8j1m8sXa7jfu+/SZI= xorm.io/builder v0.3.7/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE= xorm.io/core v0.7.2 h1:mEO22A2Z7a3fPaZMk6gKL/jMD80iiyNwRrX5HOv3XLw= xorm.io/core v0.7.2/go.mod h1:jJfd0UAEzZ4t87nbQYtVjmqpIODugN6PD2D9E+dJvdM= -xorm.io/xorm v0.8.0 h1:iALxgJrX8O00f8Jk22GbZwPmxJNgssV5Mv4uc2HL9PM= xorm.io/xorm v0.8.0/go.mod h1:ZkJLEYLoVyg7amJK/5r779bHyzs2AU8f8VMiP6BM7uY= xorm.io/xorm v1.0.2 h1:kZlCh9rqd1AzGwWitcrEEqHE1h1eaZE/ujU5/2tWEtg= xorm.io/xorm v1.0.2/go.mod h1:o4vnEsQ5V2F1/WK6w4XTwmiWJeGj82tqjAnHe44wVHY= diff --git a/vendor/github.com/yuin/goldmark/Makefile b/vendor/github.com/yuin/goldmark/Makefile index 667a19a47454d..d0b99cff20598 100644 --- a/vendor/github.com/yuin/goldmark/Makefile +++ b/vendor/github.com/yuin/goldmark/Makefile @@ -12,5 +12,5 @@ fuzz: rm -rf ./fuzz/crashers rm -rf ./fuzz/suppressions rm -f ./fuzz/fuzz-fuzz.zip - cd ./fuzz && go-fuzz-build + cd ./fuzz && GO111MODULE=off go-fuzz-build cd ./fuzz && go-fuzz diff --git a/vendor/github.com/yuin/goldmark/README.md b/vendor/github.com/yuin/goldmark/README.md index b0923c9301aa3..e3d6918e626c5 100644 --- a/vendor/github.com/yuin/goldmark/README.md +++ b/vendor/github.com/yuin/goldmark/README.md @@ -1,14 +1,14 @@ goldmark ========================================== -[![http://godoc.org/github.com/yuin/goldmark](https://godoc.org/github.com/yuin/goldmark?status.svg)](http://godoc.org/github.com/yuin/goldmark) +[![https://pkg.go.dev/github.com/yuin/goldmark](https://pkg.go.dev/badge/github.com/yuin/goldmark.svg)](https://pkg.go.dev/github.com/yuin/goldmark) [![https://github.com/yuin/goldmark/actions?query=workflow:test](https://github.com/yuin/goldmark/workflows/test/badge.svg?branch=master&event=push)](https://github.com/yuin/goldmark/actions?query=workflow:test) [![https://coveralls.io/github/yuin/goldmark](https://coveralls.io/repos/github/yuin/goldmark/badge.svg?branch=master)](https://coveralls.io/github/yuin/goldmark) [![https://goreportcard.com/report/github.com/yuin/goldmark](https://goreportcard.com/badge/github.com/yuin/goldmark)](https://goreportcard.com/report/github.com/yuin/goldmark) > A Markdown parser written in Go. Easy to extend, standards-compliant, well-structured. -goldmark is compliant with CommonMark 0.29. +goldmark is compliant with CommonMark 0.30. Motivation ---------------------- @@ -173,6 +173,7 @@ Parser and Renderer options - This extension enables Table, Strikethrough, Linkify and TaskList. - This extension does not filter tags defined in [6.11: Disallowed Raw HTML (extension)](https://github.github.com/gfm/#disallowed-raw-html-extension-). If you need to filter HTML tags, see [Security](#security). + - If you need to parse github emojis, you can use [goldmark-emoji](https://github.com/yuin/goldmark-emoji) extension. - `extension.DefinitionList` - [PHP Markdown Extra: Definition lists](https://michelf.ca/projects/php-markdown/extra/#def-list) - `extension.Footnote` @@ -203,6 +204,18 @@ heading {#id .className attrName=attrValue} ============ ``` +### Table extension +The Table extension implements [Table(extension)](https://github.github.com/gfm/#tables-extension-), as +defined in [GitHub Flavored Markdown Spec](https://github.github.com/gfm/). + +Specs are defined for XHTML, so specs use some deprecated attributes for HTML5. + +You can override alignment rendering method via options. + +| Functional option | Type | Description | +| ----------------- | ---- | ----------- | +| `extension.WithTableCellAlignMethod` | `extension.TableCellAlignMethod` | Option indicates how are table cells aligned. | + ### Typographer extension The Typographer extension translates plain ASCII punctuation characters into typographic-punctuation HTML entities. @@ -219,7 +232,7 @@ Default substitutions are: | `<<` | `«` | | `>>` | `»` | -You can override the defualt substitutions via `extensions.WithTypographicSubstitutions`: +You can override the default substitutions via `extensions.WithTypographicSubstitutions`: ```go markdown := goldmark.New( @@ -267,13 +280,96 @@ markdown := goldmark.New( []byte("https:"), }), extension.WithLinkifyURLRegexp( - xurls.Strict(), + xurls.Strict, ), ), ), ) ``` +### Footnotes extension + +The Footnote extension implements [PHP Markdown Extra: Footnotes](https://michelf.ca/projects/php-markdown/extra/#footnotes). + +This extension has some options: + +| Functional option | Type | Description | +| ----------------- | ---- | ----------- | +| `extension.WithFootnoteIDPrefix` | `[]byte` | a prefix for the id attributes.| +| `extension.WithFootnoteIDPrefixFunction` | `func(gast.Node) []byte` | a function that determines the id attribute for given Node.| +| `extension.WithFootnoteLinkTitle` | `[]byte` | an optional title attribute for footnote links.| +| `extension.WithFootnoteBacklinkTitle` | `[]byte` | an optional title attribute for footnote backlinks. | +| `extension.WithFootnoteLinkClass` | `[]byte` | a class for footnote links. This defaults to `footnote-ref`. | +| `extension.WithFootnoteBacklinkClass` | `[]byte` | a class for footnote backlinks. This defaults to `footnote-backref`. | +| `extension.WithFootnoteBacklinkHTML` | `[]byte` | a class for footnote backlinks. This defaults to `↩︎`. | + +Some options can have special substitutions. Occurrences of “^^” in the string will be replaced by the corresponding footnote number in the HTML output. Occurrences of “%%” will be replaced by a number for the reference (footnotes can have multiple references). + +`extension.WithFootnoteIDPrefix` and `extension.WithFootnoteIDPrefixFunction` are useful if you have multiple Markdown documents displayed inside one HTML document to avoid footnote ids to clash each other. + +`extension.WithFootnoteIDPrefix` sets fixed id prefix, so you may write codes like the following: + +```go +for _, path := range files { + source := readAll(path) + prefix := getPrefix(path) + + markdown := goldmark.New( + goldmark.WithExtensions( + NewFootnote( + WithFootnoteIDPrefix([]byte(path)), + ), + ), + ) + var b bytes.Buffer + err := markdown.Convert(source, &b) + if err != nil { + t.Error(err.Error()) + } +} +``` + +`extension.WithFootnoteIDPrefixFunction` determines an id prefix by calling given function, so you may write codes like the following: + +```go +markdown := goldmark.New( + goldmark.WithExtensions( + NewFootnote( + WithFootnoteIDPrefixFunction(func(n gast.Node) []byte { + v, ok := n.OwnerDocument().Meta()["footnote-prefix"] + if ok { + return util.StringToReadOnlyBytes(v.(string)) + } + return nil + }), + ), + ), +) + +for _, path := range files { + source := readAll(path) + var b bytes.Buffer + + doc := markdown.Parser().Parse(text.NewReader(source)) + doc.Meta()["footnote-prefix"] = getPrefix(path) + err := markdown.Renderer().Render(&b, source, doc) +} +``` + +You can use [goldmark-meta](https://github.com/yuin/goldmark-meta) to define a id prefix in the markdown document: + + +```markdown +--- +title: document title +slug: article1 +footnote-prefix: article1 +--- + +# My article + +``` + Security -------------------- By default, goldmark does not render raw HTML or potentially-dangerous URLs. @@ -291,28 +387,29 @@ blackfriday v2 seems to be the fastest, but as it is not CommonMark compliant, i goldmark, meanwhile, builds a clean, extensible AST structure, achieves full compliance with CommonMark, and consumes less memory, all while being reasonably fast. +- MBP 2019 13″(i5, 16GB), Go1.17 + ``` -goos: darwin -goarch: amd64 -BenchmarkMarkdown/Blackfriday-v2-12 326 3465240 ns/op 3298861 B/op 20047 allocs/op -BenchmarkMarkdown/GoldMark-12 303 3927494 ns/op 2574809 B/op 13853 allocs/op -BenchmarkMarkdown/CommonMark-12 244 4900853 ns/op 2753851 B/op 20527 allocs/op -BenchmarkMarkdown/Lute-12 130 9195245 ns/op 9175030 B/op 123534 allocs/op -BenchmarkMarkdown/GoMarkdown-12 9 113541994 ns/op 2187472 B/op 22173 allocs/op +BenchmarkMarkdown/Blackfriday-v2-8 302 3743747 ns/op 3290445 B/op 20050 allocs/op +BenchmarkMarkdown/GoldMark-8 280 4200974 ns/op 2559738 B/op 13435 allocs/op +BenchmarkMarkdown/CommonMark-8 226 5283686 ns/op 2702490 B/op 20792 allocs/op +BenchmarkMarkdown/Lute-8 12 92652857 ns/op 10602649 B/op 40555 allocs/op +BenchmarkMarkdown/GoMarkdown-8 13 81380167 ns/op 2245002 B/op 22889 allocs/op ``` ### against cmark (CommonMark reference implementation written in C) +- MBP 2019 13″(i5, 16GB), Go1.17 + ``` ----------- cmark ----------- file: _data.md iteration: 50 -average: 0.0037760639 sec -go run ./goldmark_benchmark.go +average: 0.0044073057 sec ------- goldmark ------- file: _data.md iteration: 50 -average: 0.0040964230 sec +average: 0.0041611990 sec ``` As you can see, goldmark's performance is on par with cmark's. @@ -324,7 +421,17 @@ Extensions extension for the goldmark Markdown parser. - [goldmark-highlighting](https://github.com/yuin/goldmark-highlighting): A syntax-highlighting extension for the goldmark markdown parser. +- [goldmark-emoji](https://github.com/yuin/goldmark-emoji): An emoji + extension for the goldmark Markdown parser. - [goldmark-mathjax](https://github.com/litao91/goldmark-mathjax): Mathjax support for the goldmark markdown parser +- [goldmark-pdf](https://github.com/stephenafamo/goldmark-pdf): A PDF renderer that can be passed to `goldmark.WithRenderer()`. +- [goldmark-hashtag](https://github.com/abhinav/goldmark-hashtag): Adds support for `#hashtag`-based tagging to goldmark. +- [goldmark-wikilink](https://github.com/abhinav/goldmark-wikilink): Adds support for `[[wiki]]`-style links to goldmark. +- [goldmark-toc](https://github.com/abhinav/goldmark-toc): Adds support for generating tables-of-contents for goldmark documents. +- [goldmark-mermaid](https://github.com/abhinav/goldmark-mermaid): Adds support for rendering [Mermaid](https://mermaid-js.github.io/mermaid/) diagrams in goldmark documents. +- [goldmark-pikchr](https://github.com/jchenry/goldmark-pikchr): Adds support for rendering [Pikchr](https://pikchr.org/home/doc/trunk/homepage.md) diagrams in goldmark documents. +- [goldmark-embed](https://github.com/13rac1/goldmark-embed): Adds support for rendering embeds from YouTube links. + goldmark internal(for extension developers) ---------------------------------------------- diff --git a/vendor/github.com/yuin/goldmark/ast/ast.go b/vendor/github.com/yuin/goldmark/ast/ast.go index 66059e94cc1c0..3719ebbd8d7da 100644 --- a/vendor/github.com/yuin/goldmark/ast/ast.go +++ b/vendor/github.com/yuin/goldmark/ast/ast.go @@ -45,11 +45,6 @@ type Attribute struct { Value interface{} } -var attrNameIDS = []byte("#") -var attrNameID = []byte("id") -var attrNameClassS = []byte(".") -var attrNameClass = []byte("class") - // A Node interface defines basic AST node functionalities. type Node interface { // Type returns a type of this node. @@ -116,6 +111,11 @@ type Node interface { // tail of the children. InsertAfter(self, v1, insertee Node) + // OwnerDocument returns this node's owner document. + // If this node is not a child of the Document node, OwnerDocument + // returns nil. + OwnerDocument() *Document + // Dump dumps an AST tree structure to stdout. // This function completely aimed for debugging. // level is a indent level. Implementer should indent informations with @@ -169,7 +169,7 @@ type Node interface { RemoveAttributes() } -// A BaseNode struct implements the Node interface. +// A BaseNode struct implements the Node interface partialliy. type BaseNode struct { firstChild Node lastChild Node @@ -358,6 +358,22 @@ func (n *BaseNode) InsertBefore(self, v1, insertee Node) { } } +// OwnerDocument implements Node.OwnerDocument +func (n *BaseNode) OwnerDocument() *Document { + d := n.Parent() + for { + p := d.Parent() + if p == nil { + if v, ok := d.(*Document); ok { + return v + } + break + } + d = p + } + return nil +} + // Text implements Node.Text . func (n *BaseNode) Text(source []byte) []byte { var buf bytes.Buffer diff --git a/vendor/github.com/yuin/goldmark/ast/block.go b/vendor/github.com/yuin/goldmark/ast/block.go index f5bca33fe944a..02e9d5190015b 100644 --- a/vendor/github.com/yuin/goldmark/ast/block.go +++ b/vendor/github.com/yuin/goldmark/ast/block.go @@ -7,7 +7,7 @@ import ( textm "github.com/yuin/goldmark/text" ) -// A BaseBlock struct implements the Node interface. +// A BaseBlock struct implements the Node interface partialliy. type BaseBlock struct { BaseNode blankPreviousLines bool @@ -50,6 +50,8 @@ func (b *BaseBlock) SetLines(v *textm.Segments) { // A Document struct is a root node of Markdown text. type Document struct { BaseBlock + + meta map[string]interface{} } // KindDocument is a NodeKind of the Document node. @@ -70,10 +72,42 @@ func (n *Document) Kind() NodeKind { return KindDocument } +// OwnerDocument implements Node.OwnerDocument +func (n *Document) OwnerDocument() *Document { + return n +} + +// Meta returns metadata of this document. +func (n *Document) Meta() map[string]interface{} { + if n.meta == nil { + n.meta = map[string]interface{}{} + } + return n.meta +} + +// SetMeta sets given metadata to this document. +func (n *Document) SetMeta(meta map[string]interface{}) { + if n.meta == nil { + n.meta = map[string]interface{}{} + } + for k, v := range meta { + n.meta[k] = v + } +} + +// AddMeta adds given metadata to this document. +func (n *Document) AddMeta(key string, value interface{}) { + if n.meta == nil { + n.meta = map[string]interface{}{} + } + n.meta[key] = value +} + // NewDocument returns a new Document node. func NewDocument() *Document { return &Document{ BaseBlock: BaseBlock{}, + meta: nil, } } @@ -311,7 +345,7 @@ type List struct { Marker byte // IsTight is a true if this list is a 'tight' list. - // See https://spec.commonmark.org/0.29/#loose for details. + // See https://spec.commonmark.org/0.30/#loose for details. IsTight bool // Start is an initial number of this ordered list. @@ -393,7 +427,7 @@ func NewListItem(offset int) *ListItem { } // HTMLBlockType represents kinds of an html blocks. -// See https://spec.commonmark.org/0.29/#html-blocks +// See https://spec.commonmark.org/0.30/#html-blocks type HTMLBlockType int const ( diff --git a/vendor/github.com/yuin/goldmark/ast/inline.go b/vendor/github.com/yuin/goldmark/ast/inline.go index 23dcad4bc9ada..fa6fc34f95ec7 100644 --- a/vendor/github.com/yuin/goldmark/ast/inline.go +++ b/vendor/github.com/yuin/goldmark/ast/inline.go @@ -8,7 +8,7 @@ import ( "github.com/yuin/goldmark/util" ) -// A BaseInline struct implements the Node interface. +// A BaseInline struct implements the Node interface partialliy. type BaseInline struct { BaseNode } @@ -111,7 +111,7 @@ func (n *Text) SetRaw(v bool) { } // HardLineBreak returns true if this node ends with a hard line break. -// See https://spec.commonmark.org/0.29/#hard-line-breaks for details. +// See https://spec.commonmark.org/0.30/#hard-line-breaks for details. func (n *Text) HardLineBreak() bool { return n.flags&textHardLineBreak != 0 } diff --git a/vendor/github.com/yuin/goldmark/extension/ast/footnote.go b/vendor/github.com/yuin/goldmark/extension/ast/footnote.go index 835f8478b3e6b..97fea4403dd97 100644 --- a/vendor/github.com/yuin/goldmark/extension/ast/footnote.go +++ b/vendor/github.com/yuin/goldmark/extension/ast/footnote.go @@ -2,6 +2,7 @@ package ast import ( "fmt" + gast "github.com/yuin/goldmark/ast" ) @@ -9,13 +10,17 @@ import ( // (PHP Markdown Extra) text. type FootnoteLink struct { gast.BaseInline - Index int + Index int + RefCount int + RefIndex int } // Dump implements Node.Dump. func (n *FootnoteLink) Dump(source []byte, level int) { m := map[string]string{} m["Index"] = fmt.Sprintf("%v", n.Index) + m["RefCount"] = fmt.Sprintf("%v", n.RefCount) + m["RefIndex"] = fmt.Sprintf("%v", n.RefIndex) gast.DumpHelper(n, source, level, m, nil) } @@ -30,36 +35,44 @@ func (n *FootnoteLink) Kind() gast.NodeKind { // NewFootnoteLink returns a new FootnoteLink node. func NewFootnoteLink(index int) *FootnoteLink { return &FootnoteLink{ - Index: index, + Index: index, + RefCount: 0, + RefIndex: 0, } } -// A FootnoteBackLink struct represents a link to a footnote of Markdown +// A FootnoteBacklink struct represents a link to a footnote of Markdown // (PHP Markdown Extra) text. -type FootnoteBackLink struct { +type FootnoteBacklink struct { gast.BaseInline - Index int + Index int + RefCount int + RefIndex int } // Dump implements Node.Dump. -func (n *FootnoteBackLink) Dump(source []byte, level int) { +func (n *FootnoteBacklink) Dump(source []byte, level int) { m := map[string]string{} m["Index"] = fmt.Sprintf("%v", n.Index) + m["RefCount"] = fmt.Sprintf("%v", n.RefCount) + m["RefIndex"] = fmt.Sprintf("%v", n.RefIndex) gast.DumpHelper(n, source, level, m, nil) } -// KindFootnoteBackLink is a NodeKind of the FootnoteBackLink node. -var KindFootnoteBackLink = gast.NewNodeKind("FootnoteBackLink") +// KindFootnoteBacklink is a NodeKind of the FootnoteBacklink node. +var KindFootnoteBacklink = gast.NewNodeKind("FootnoteBacklink") // Kind implements Node.Kind. -func (n *FootnoteBackLink) Kind() gast.NodeKind { - return KindFootnoteBackLink +func (n *FootnoteBacklink) Kind() gast.NodeKind { + return KindFootnoteBacklink } -// NewFootnoteBackLink returns a new FootnoteBackLink node. -func NewFootnoteBackLink(index int) *FootnoteBackLink { - return &FootnoteBackLink{ - Index: index, +// NewFootnoteBacklink returns a new FootnoteBacklink node. +func NewFootnoteBacklink(index int) *FootnoteBacklink { + return &FootnoteBacklink{ + Index: index, + RefCount: 0, + RefIndex: 0, } } diff --git a/vendor/github.com/yuin/goldmark/extension/definition_list.go b/vendor/github.com/yuin/goldmark/extension/definition_list.go index eb16dd03f07e9..d2f5fecbe0cbd 100644 --- a/vendor/github.com/yuin/goldmark/extension/definition_list.go +++ b/vendor/github.com/yuin/goldmark/extension/definition_list.go @@ -138,7 +138,7 @@ func (b *definitionDescriptionParser) Open(parent gast.Node, reader text.Reader, para.Parent().RemoveChild(para.Parent(), para) } cpos, padding := util.IndentPosition(line[pos+1:], pos+1, list.Offset-pos-1) - reader.AdvanceAndSetPadding(cpos, padding) + reader.AdvanceAndSetPadding(cpos+1, padding) return ast.NewDefinitionDescription(), parser.HasChildren } diff --git a/vendor/github.com/yuin/goldmark/extension/footnote.go b/vendor/github.com/yuin/goldmark/extension/footnote.go index ede72db8787f6..09b6fa8b0d4b7 100644 --- a/vendor/github.com/yuin/goldmark/extension/footnote.go +++ b/vendor/github.com/yuin/goldmark/extension/footnote.go @@ -2,6 +2,9 @@ package extension import ( "bytes" + "fmt" + "strconv" + "github.com/yuin/goldmark" gast "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/extension/ast" @@ -10,10 +13,10 @@ import ( "github.com/yuin/goldmark/renderer/html" "github.com/yuin/goldmark/text" "github.com/yuin/goldmark/util" - "strconv" ) var footnoteListKey = parser.NewContextKey() +var footnoteLinkListKey = parser.NewContextKey() type footnoteBlockParser struct { } @@ -164,7 +167,20 @@ func (s *footnoteParser) Parse(parent gast.Node, block text.Reader, pc parser.Co return nil } - return ast.NewFootnoteLink(index) + fnlink := ast.NewFootnoteLink(index) + var fnlist []*ast.FootnoteLink + if tmp := pc.Get(footnoteLinkListKey); tmp != nil { + fnlist = tmp.([]*ast.FootnoteLink) + } else { + fnlist = []*ast.FootnoteLink{} + pc.Set(footnoteLinkListKey, fnlist) + } + pc.Set(footnoteLinkListKey, append(fnlist, fnlink)) + if line[0] == '!' { + parent.AppendChild(parent, gast.NewTextSegment(text.NewSegment(segment.Start, segment.Start+1))) + } + + return fnlink } type footnoteASTTransformer struct { @@ -180,23 +196,62 @@ func NewFootnoteASTTransformer() parser.ASTTransformer { func (a *footnoteASTTransformer) Transform(node *gast.Document, reader text.Reader, pc parser.Context) { var list *ast.FootnoteList - if tlist := pc.Get(footnoteListKey); tlist != nil { - list = tlist.(*ast.FootnoteList) - } else { - return + var fnlist []*ast.FootnoteLink + if tmp := pc.Get(footnoteListKey); tmp != nil { + list = tmp.(*ast.FootnoteList) + } + if tmp := pc.Get(footnoteLinkListKey); tmp != nil { + fnlist = tmp.([]*ast.FootnoteLink) } + pc.Set(footnoteListKey, nil) + pc.Set(footnoteLinkListKey, nil) + + if list == nil { + return + } + + counter := map[int]int{} + if fnlist != nil { + for _, fnlink := range fnlist { + if fnlink.Index >= 0 { + counter[fnlink.Index]++ + } + } + refCounter := map[int]int{} + for _, fnlink := range fnlist { + fnlink.RefCount = counter[fnlink.Index] + if _, ok := refCounter[fnlink.Index]; !ok { + refCounter[fnlink.Index] = 0 + } + fnlink.RefIndex = refCounter[fnlink.Index] + refCounter[fnlink.Index]++ + } + } for footnote := list.FirstChild(); footnote != nil; { var container gast.Node = footnote next := footnote.NextSibling() if fc := container.LastChild(); fc != nil && gast.IsParagraph(fc) { container = fc } - index := footnote.(*ast.Footnote).Index + fn := footnote.(*ast.Footnote) + index := fn.Index if index < 0 { list.RemoveChild(list, footnote) } else { - container.AppendChild(container, ast.NewFootnoteBackLink(index)) + refCount := counter[index] + backLink := ast.NewFootnoteBacklink(index) + backLink.RefCount = refCount + backLink.RefIndex = 0 + container.AppendChild(container, backLink) + if refCount > 1 { + for i := 1; i < refCount; i++ { + backLink := ast.NewFootnoteBacklink(index) + backLink.RefCount = refCount + backLink.RefIndex = i + container.AppendChild(container, backLink) + } + } } footnote = next } @@ -214,19 +269,250 @@ func (a *footnoteASTTransformer) Transform(node *gast.Document, reader text.Read node.AppendChild(node, list) } +// FootnoteConfig holds configuration values for the footnote extension. +// +// Link* and Backlink* configurations have some variables: +// Occurrances of “^^” in the string will be replaced by the +// corresponding footnote number in the HTML output. +// Occurrances of “%%” will be replaced by a number for the +// reference (footnotes can have multiple references). +type FootnoteConfig struct { + html.Config + + // IDPrefix is a prefix for the id attributes generated by footnotes. + IDPrefix []byte + + // IDPrefix is a function that determines the id attribute for given Node. + IDPrefixFunction func(gast.Node) []byte + + // LinkTitle is an optional title attribute for footnote links. + LinkTitle []byte + + // BacklinkTitle is an optional title attribute for footnote backlinks. + BacklinkTitle []byte + + // LinkClass is a class for footnote links. + LinkClass []byte + + // BacklinkClass is a class for footnote backlinks. + BacklinkClass []byte + + // BacklinkHTML is an HTML content for footnote backlinks. + BacklinkHTML []byte +} + +// FootnoteOption interface is a functional option interface for the extension. +type FootnoteOption interface { + renderer.Option + // SetFootnoteOption sets given option to the extension. + SetFootnoteOption(*FootnoteConfig) +} + +// NewFootnoteConfig returns a new Config with defaults. +func NewFootnoteConfig() FootnoteConfig { + return FootnoteConfig{ + Config: html.NewConfig(), + LinkTitle: []byte(""), + BacklinkTitle: []byte(""), + LinkClass: []byte("footnote-ref"), + BacklinkClass: []byte("footnote-backref"), + BacklinkHTML: []byte("↩︎"), + } +} + +// SetOption implements renderer.SetOptioner. +func (c *FootnoteConfig) SetOption(name renderer.OptionName, value interface{}) { + switch name { + case optFootnoteIDPrefixFunction: + c.IDPrefixFunction = value.(func(gast.Node) []byte) + case optFootnoteIDPrefix: + c.IDPrefix = value.([]byte) + case optFootnoteLinkTitle: + c.LinkTitle = value.([]byte) + case optFootnoteBacklinkTitle: + c.BacklinkTitle = value.([]byte) + case optFootnoteLinkClass: + c.LinkClass = value.([]byte) + case optFootnoteBacklinkClass: + c.BacklinkClass = value.([]byte) + case optFootnoteBacklinkHTML: + c.BacklinkHTML = value.([]byte) + default: + c.Config.SetOption(name, value) + } +} + +type withFootnoteHTMLOptions struct { + value []html.Option +} + +func (o *withFootnoteHTMLOptions) SetConfig(c *renderer.Config) { + if o.value != nil { + for _, v := range o.value { + v.(renderer.Option).SetConfig(c) + } + } +} + +func (o *withFootnoteHTMLOptions) SetFootnoteOption(c *FootnoteConfig) { + if o.value != nil { + for _, v := range o.value { + v.SetHTMLOption(&c.Config) + } + } +} + +// WithFootnoteHTMLOptions is functional option that wraps goldmark HTMLRenderer options. +func WithFootnoteHTMLOptions(opts ...html.Option) FootnoteOption { + return &withFootnoteHTMLOptions{opts} +} + +const optFootnoteIDPrefix renderer.OptionName = "FootnoteIDPrefix" + +type withFootnoteIDPrefix struct { + value []byte +} + +func (o *withFootnoteIDPrefix) SetConfig(c *renderer.Config) { + c.Options[optFootnoteIDPrefix] = o.value +} + +func (o *withFootnoteIDPrefix) SetFootnoteOption(c *FootnoteConfig) { + c.IDPrefix = o.value +} + +// WithFootnoteIDPrefix is a functional option that is a prefix for the id attributes generated by footnotes. +func WithFootnoteIDPrefix(a []byte) FootnoteOption { + return &withFootnoteIDPrefix{a} +} + +const optFootnoteIDPrefixFunction renderer.OptionName = "FootnoteIDPrefixFunction" + +type withFootnoteIDPrefixFunction struct { + value func(gast.Node) []byte +} + +func (o *withFootnoteIDPrefixFunction) SetConfig(c *renderer.Config) { + c.Options[optFootnoteIDPrefixFunction] = o.value +} + +func (o *withFootnoteIDPrefixFunction) SetFootnoteOption(c *FootnoteConfig) { + c.IDPrefixFunction = o.value +} + +// WithFootnoteIDPrefixFunction is a functional option that is a prefix for the id attributes generated by footnotes. +func WithFootnoteIDPrefixFunction(a func(gast.Node) []byte) FootnoteOption { + return &withFootnoteIDPrefixFunction{a} +} + +const optFootnoteLinkTitle renderer.OptionName = "FootnoteLinkTitle" + +type withFootnoteLinkTitle struct { + value []byte +} + +func (o *withFootnoteLinkTitle) SetConfig(c *renderer.Config) { + c.Options[optFootnoteLinkTitle] = o.value +} + +func (o *withFootnoteLinkTitle) SetFootnoteOption(c *FootnoteConfig) { + c.LinkTitle = o.value +} + +// WithFootnoteLinkTitle is a functional option that is an optional title attribute for footnote links. +func WithFootnoteLinkTitle(a []byte) FootnoteOption { + return &withFootnoteLinkTitle{a} +} + +const optFootnoteBacklinkTitle renderer.OptionName = "FootnoteBacklinkTitle" + +type withFootnoteBacklinkTitle struct { + value []byte +} + +func (o *withFootnoteBacklinkTitle) SetConfig(c *renderer.Config) { + c.Options[optFootnoteBacklinkTitle] = o.value +} + +func (o *withFootnoteBacklinkTitle) SetFootnoteOption(c *FootnoteConfig) { + c.BacklinkTitle = o.value +} + +// WithFootnoteBacklinkTitle is a functional option that is an optional title attribute for footnote backlinks. +func WithFootnoteBacklinkTitle(a []byte) FootnoteOption { + return &withFootnoteBacklinkTitle{a} +} + +const optFootnoteLinkClass renderer.OptionName = "FootnoteLinkClass" + +type withFootnoteLinkClass struct { + value []byte +} + +func (o *withFootnoteLinkClass) SetConfig(c *renderer.Config) { + c.Options[optFootnoteLinkClass] = o.value +} + +func (o *withFootnoteLinkClass) SetFootnoteOption(c *FootnoteConfig) { + c.LinkClass = o.value +} + +// WithFootnoteLinkClass is a functional option that is a class for footnote links. +func WithFootnoteLinkClass(a []byte) FootnoteOption { + return &withFootnoteLinkClass{a} +} + +const optFootnoteBacklinkClass renderer.OptionName = "FootnoteBacklinkClass" + +type withFootnoteBacklinkClass struct { + value []byte +} + +func (o *withFootnoteBacklinkClass) SetConfig(c *renderer.Config) { + c.Options[optFootnoteBacklinkClass] = o.value +} + +func (o *withFootnoteBacklinkClass) SetFootnoteOption(c *FootnoteConfig) { + c.BacklinkClass = o.value +} + +// WithFootnoteBacklinkClass is a functional option that is a class for footnote backlinks. +func WithFootnoteBacklinkClass(a []byte) FootnoteOption { + return &withFootnoteBacklinkClass{a} +} + +const optFootnoteBacklinkHTML renderer.OptionName = "FootnoteBacklinkHTML" + +type withFootnoteBacklinkHTML struct { + value []byte +} + +func (o *withFootnoteBacklinkHTML) SetConfig(c *renderer.Config) { + c.Options[optFootnoteBacklinkHTML] = o.value +} + +func (o *withFootnoteBacklinkHTML) SetFootnoteOption(c *FootnoteConfig) { + c.BacklinkHTML = o.value +} + +// WithFootnoteBacklinkHTML is an HTML content for footnote backlinks. +func WithFootnoteBacklinkHTML(a []byte) FootnoteOption { + return &withFootnoteBacklinkHTML{a} +} + // FootnoteHTMLRenderer is a renderer.NodeRenderer implementation that // renders FootnoteLink nodes. type FootnoteHTMLRenderer struct { - html.Config + FootnoteConfig } // NewFootnoteHTMLRenderer returns a new FootnoteHTMLRenderer. -func NewFootnoteHTMLRenderer(opts ...html.Option) renderer.NodeRenderer { +func NewFootnoteHTMLRenderer(opts ...FootnoteOption) renderer.NodeRenderer { r := &FootnoteHTMLRenderer{ - Config: html.NewConfig(), + FootnoteConfig: NewFootnoteConfig(), } for _, opt := range opts { - opt.SetHTMLOption(&r.Config) + opt.SetFootnoteOption(&r.FootnoteConfig) } return r } @@ -234,7 +520,7 @@ func NewFootnoteHTMLRenderer(opts ...html.Option) renderer.NodeRenderer { // RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs. func (r *FootnoteHTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) { reg.Register(ast.KindFootnoteLink, r.renderFootnoteLink) - reg.Register(ast.KindFootnoteBackLink, r.renderFootnoteBackLink) + reg.Register(ast.KindFootnoteBacklink, r.renderFootnoteBacklink) reg.Register(ast.KindFootnote, r.renderFootnote) reg.Register(ast.KindFootnoteList, r.renderFootnoteList) } @@ -243,25 +529,53 @@ func (r *FootnoteHTMLRenderer) renderFootnoteLink(w util.BufWriter, source []byt if entering { n := node.(*ast.FootnoteLink) is := strconv.Itoa(n.Index) - _, _ = w.WriteString(` 0 { + _, _ = w.WriteString(fmt.Sprintf("%v", n.RefIndex)) + } + _ = w.WriteByte(':') _, _ = w.WriteString(is) - _, _ = w.WriteString(`">`) + _, _ = w.WriteString(`" class="`) + _, _ = w.Write(applyFootnoteTemplate(r.FootnoteConfig.LinkClass, + n.Index, n.RefCount)) + if len(r.FootnoteConfig.LinkTitle) > 0 { + _, _ = w.WriteString(`" title="`) + _, _ = w.Write(util.EscapeHTML(applyFootnoteTemplate(r.FootnoteConfig.LinkTitle, n.Index, n.RefCount))) + } + _, _ = w.WriteString(`" role="doc-noteref">`) + _, _ = w.WriteString(is) _, _ = w.WriteString(``) } return gast.WalkContinue, nil } -func (r *FootnoteHTMLRenderer) renderFootnoteBackLink(w util.BufWriter, source []byte, node gast.Node, entering bool) (gast.WalkStatus, error) { +func (r *FootnoteHTMLRenderer) renderFootnoteBacklink(w util.BufWriter, source []byte, node gast.Node, entering bool) (gast.WalkStatus, error) { if entering { - n := node.(*ast.FootnoteBackLink) + n := node.(*ast.FootnoteBacklink) is := strconv.Itoa(n.Index) - _, _ = w.WriteString(` 0 { + _, _ = w.WriteString(fmt.Sprintf("%v", n.RefIndex)) + } + _ = w.WriteByte(':') _, _ = w.WriteString(is) - _, _ = w.WriteString(`" class="footnote-backref" role="doc-backlink">`) - _, _ = w.WriteString("↩︎") + _, _ = w.WriteString(`" class="`) + _, _ = w.Write(applyFootnoteTemplate(r.FootnoteConfig.BacklinkClass, n.Index, n.RefCount)) + if len(r.FootnoteConfig.BacklinkTitle) > 0 { + _, _ = w.WriteString(`" title="`) + _, _ = w.Write(util.EscapeHTML(applyFootnoteTemplate(r.FootnoteConfig.BacklinkTitle, n.Index, n.RefCount))) + } + _, _ = w.WriteString(`" role="doc-backlink">`) + _, _ = w.Write(applyFootnoteTemplate(r.FootnoteConfig.BacklinkHTML, n.Index, n.RefCount)) _, _ = w.WriteString(``) } return gast.WalkContinue, nil @@ -271,9 +585,11 @@ func (r *FootnoteHTMLRenderer) renderFootnote(w util.BufWriter, source []byte, n n := node.(*ast.Footnote) is := strconv.Itoa(n.Index) if entering { - _, _ = w.WriteString(`
  • \n") } else { _, _ = w.WriteString("\n") - _, _ = w.WriteString("\n") + _, _ = w.WriteString("\n") } return gast.WalkContinue, nil } +func (r *FootnoteHTMLRenderer) idPrefix(node gast.Node) []byte { + if r.FootnoteConfig.IDPrefix != nil { + return r.FootnoteConfig.IDPrefix + } + if r.FootnoteConfig.IDPrefixFunction != nil { + return r.FootnoteConfig.IDPrefixFunction(node) + } + return []byte("") +} + +func applyFootnoteTemplate(b []byte, index, refCount int) []byte { + fast := true + for i, c := range b { + if i != 0 { + if b[i-1] == '^' && c == '^' { + fast = false + break + } + if b[i-1] == '%' && c == '%' { + fast = false + break + } + } + } + if fast { + return b + } + is := []byte(strconv.Itoa(index)) + rs := []byte(strconv.Itoa(refCount)) + ret := bytes.Replace(b, []byte("^^"), is, -1) + return bytes.Replace(ret, []byte("%%"), rs, -1) +} + type footnote struct { + options []FootnoteOption } // Footnote is an extension that allow you to use PHP Markdown Extra Footnotes. -var Footnote = &footnote{} +var Footnote = &footnote{ + options: []FootnoteOption{}, +} + +// NewFootnote returns a new extension with given options. +func NewFootnote(opts ...FootnoteOption) goldmark.Extender { + return &footnote{ + options: opts, + } +} func (e *footnote) Extend(m goldmark.Markdown) { m.Parser().AddOptions( @@ -331,6 +682,6 @@ func (e *footnote) Extend(m goldmark.Markdown) { ), ) m.Renderer().AddOptions(renderer.WithNodeRenderers( - util.Prioritized(NewFootnoteHTMLRenderer(), 500), + util.Prioritized(NewFootnoteHTMLRenderer(e.options...), 500), )) } diff --git a/vendor/github.com/yuin/goldmark/extension/linkify.go b/vendor/github.com/yuin/goldmark/extension/linkify.go index 9e68fa5349f1c..2f046eb54670c 100644 --- a/vendor/github.com/yuin/goldmark/extension/linkify.go +++ b/vendor/github.com/yuin/goldmark/extension/linkify.go @@ -11,9 +11,9 @@ import ( "github.com/yuin/goldmark/util" ) -var wwwURLRegxp = regexp.MustCompile(`^www\.[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]+(?:(?:/|[#?])[-a-zA-Z0-9@:%_\+.~#!?&//=\(\);,'">\^{}\[\]` + "`" + `]*)?`) +var wwwURLRegxp = regexp.MustCompile(`^www\.[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]+(?:[/#?][-a-zA-Z0-9@:%_\+.~#!?&/=\(\);,'">\^{}\[\]` + "`" + `]*)?`) -var urlRegexp = regexp.MustCompile(`^(?:http|https|ftp):\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]+(?:(?:/|[#?])[-a-zA-Z0-9@:%_+.~#$!?&//=\(\);,'">\^{}\[\]` + "`" + `]*)?`) +var urlRegexp = regexp.MustCompile(`^(?:http|https|ftp)://[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]+(?::\d+)?(?:[/#?][-a-zA-Z0-9@:%_+.~#$!?&/=\(\);,'">\^{}\[\]` + "`" + `]*)?`) // An LinkifyConfig struct is a data structure that holds configuration of the // Linkify extension. @@ -24,10 +24,12 @@ type LinkifyConfig struct { EmailRegexp *regexp.Regexp } -const optLinkifyAllowedProtocols parser.OptionName = "LinkifyAllowedProtocols" -const optLinkifyURLRegexp parser.OptionName = "LinkifyURLRegexp" -const optLinkifyWWWRegexp parser.OptionName = "LinkifyWWWRegexp" -const optLinkifyEmailRegexp parser.OptionName = "LinkifyEmailRegexp" +const ( + optLinkifyAllowedProtocols parser.OptionName = "LinkifyAllowedProtocols" + optLinkifyURLRegexp parser.OptionName = "LinkifyURLRegexp" + optLinkifyWWWRegexp parser.OptionName = "LinkifyWWWRegexp" + optLinkifyEmailRegexp parser.OptionName = "LinkifyEmailRegexp" +) // SetOption implements SetOptioner. func (c *LinkifyConfig) SetOption(name parser.OptionName, value interface{}) { @@ -156,10 +158,12 @@ func (s *linkifyParser) Trigger() []byte { return []byte{' ', '*', '_', '~', '('} } -var protoHTTP = []byte("http:") -var protoHTTPS = []byte("https:") -var protoFTP = []byte("ftp:") -var domainWWW = []byte("www.") +var ( + protoHTTP = []byte("http:") + protoHTTPS = []byte("https:") + protoFTP = []byte("ftp:") + domainWWW = []byte("www.") +) func (s *linkifyParser) Parse(parent ast.Node, block text.Reader, pc parser.Context) ast.Node { if pc.IsInLinkLabel() { @@ -269,9 +273,20 @@ func (s *linkifyParser) Parse(parent ast.Node, block text.Reader, pc parser.Cont s := segment.WithStop(segment.Start + 1) ast.MergeOrAppendTextSegment(parent, s) } - consumes += m[1] + i := m[1] - 1 + for ; i > 0; i-- { + c := line[i] + switch c { + case '?', '!', '.', ',', ':', '*', '_', '~': + default: + goto endfor + } + } +endfor: + i++ + consumes += i block.Advance(consumes) - n := ast.NewTextSegment(text.NewSegment(start, start+m[1])) + n := ast.NewTextSegment(text.NewSegment(start, start+i)) link := ast.NewAutoLink(typ, n) link.Protocol = protocol return link diff --git a/vendor/github.com/yuin/goldmark/extension/table.go b/vendor/github.com/yuin/goldmark/extension/table.go index 91ba331995d19..c637b99f044df 100644 --- a/vendor/github.com/yuin/goldmark/extension/table.go +++ b/vendor/github.com/yuin/goldmark/extension/table.go @@ -15,7 +15,121 @@ import ( "github.com/yuin/goldmark/util" ) -var tableDelimRegexp = regexp.MustCompile(`^[\s\-\|\:]+$`) +var escapedPipeCellListKey = parser.NewContextKey() + +type escapedPipeCell struct { + Cell *ast.TableCell + Pos []int + Transformed bool +} + +// TableCellAlignMethod indicates how are table cells aligned in HTML format.indicates how are table cells aligned in HTML format. +type TableCellAlignMethod int + +const ( + // TableCellAlignDefault renders alignments by default method. + // With XHTML, alignments are rendered as an align attribute. + // With HTML5, alignments are rendered as a style attribute. + TableCellAlignDefault TableCellAlignMethod = iota + + // TableCellAlignAttribute renders alignments as an align attribute. + TableCellAlignAttribute + + // TableCellAlignStyle renders alignments as a style attribute. + TableCellAlignStyle + + // TableCellAlignNone does not care about alignments. + // If you using classes or other styles, you can add these attributes + // in an ASTTransformer. + TableCellAlignNone +) + +// TableConfig struct holds options for the extension. +type TableConfig struct { + html.Config + + // TableCellAlignMethod indicates how are table celss aligned. + TableCellAlignMethod TableCellAlignMethod +} + +// TableOption interface is a functional option interface for the extension. +type TableOption interface { + renderer.Option + // SetTableOption sets given option to the extension. + SetTableOption(*TableConfig) +} + +// NewTableConfig returns a new Config with defaults. +func NewTableConfig() TableConfig { + return TableConfig{ + Config: html.NewConfig(), + TableCellAlignMethod: TableCellAlignDefault, + } +} + +// SetOption implements renderer.SetOptioner. +func (c *TableConfig) SetOption(name renderer.OptionName, value interface{}) { + switch name { + case optTableCellAlignMethod: + c.TableCellAlignMethod = value.(TableCellAlignMethod) + default: + c.Config.SetOption(name, value) + } +} + +type withTableHTMLOptions struct { + value []html.Option +} + +func (o *withTableHTMLOptions) SetConfig(c *renderer.Config) { + if o.value != nil { + for _, v := range o.value { + v.(renderer.Option).SetConfig(c) + } + } +} + +func (o *withTableHTMLOptions) SetTableOption(c *TableConfig) { + if o.value != nil { + for _, v := range o.value { + v.SetHTMLOption(&c.Config) + } + } +} + +// WithTableHTMLOptions is functional option that wraps goldmark HTMLRenderer options. +func WithTableHTMLOptions(opts ...html.Option) TableOption { + return &withTableHTMLOptions{opts} +} + +const optTableCellAlignMethod renderer.OptionName = "TableTableCellAlignMethod" + +type withTableCellAlignMethod struct { + value TableCellAlignMethod +} + +func (o *withTableCellAlignMethod) SetConfig(c *renderer.Config) { + c.Options[optTableCellAlignMethod] = o.value +} + +func (o *withTableCellAlignMethod) SetTableOption(c *TableConfig) { + c.TableCellAlignMethod = o.value +} + +// WithTableCellAlignMethod is a functional option that indicates how are table cells aligned in HTML format. +func WithTableCellAlignMethod(a TableCellAlignMethod) TableOption { + return &withTableCellAlignMethod{a} +} + +func isTableDelim(bs []byte) bool { + for _, b := range bs { + if !(util.IsSpace(b) || b == '-' || b == '|' || b == ':') { + return false + } + } + return true +} + var tableDelimLeft = regexp.MustCompile(`^\s*\:\-+\s*$`) var tableDelimRight = regexp.MustCompile(`^\s*\-+\:\s*$`) var tableDelimCenter = regexp.MustCompile(`^\s*\:\-+\:\s*$`) @@ -37,25 +151,34 @@ func (b *tableParagraphTransformer) Transform(node *gast.Paragraph, reader text. if lines.Len() < 2 { return } - alignments := b.parseDelimiter(lines.At(1), reader) - if alignments == nil { - return - } - header := b.parseRow(lines.At(0), alignments, true, reader) - if header == nil || len(alignments) != header.ChildCount() { - return - } - table := ast.NewTable() - table.Alignments = alignments - table.AppendChild(table, ast.NewTableHeader(header)) - for i := 2; i < lines.Len(); i++ { - table.AppendChild(table, b.parseRow(lines.At(i), alignments, false, reader)) + for i := 1; i < lines.Len(); i++ { + alignments := b.parseDelimiter(lines.At(i), reader) + if alignments == nil { + continue + } + header := b.parseRow(lines.At(i-1), alignments, true, reader, pc) + if header == nil || len(alignments) != header.ChildCount() { + return + } + table := ast.NewTable() + table.Alignments = alignments + table.AppendChild(table, ast.NewTableHeader(header)) + for j := i + 1; j < lines.Len(); j++ { + table.AppendChild(table, b.parseRow(lines.At(j), alignments, false, reader, pc)) + } + node.Lines().SetSliced(0, i-1) + node.Parent().InsertAfter(node.Parent(), node, table) + if node.Lines().Len() == 0 { + node.Parent().RemoveChild(node.Parent(), node) + } else { + last := node.Lines().At(i - 2) + last.Stop = last.Stop - 1 // trim last newline(\n) + node.Lines().Set(i-2, last) + } } - node.Parent().InsertBefore(node.Parent(), node, table) - node.Parent().RemoveChild(node.Parent(), node) } -func (b *tableParagraphTransformer) parseRow(segment text.Segment, alignments []ast.Alignment, isHeader bool, reader text.Reader) *ast.TableRow { +func (b *tableParagraphTransformer) parseRow(segment text.Segment, alignments []ast.Alignment, isHeader bool, reader text.Reader, pc parser.Context) *ast.TableRow { source := reader.Source() line := segment.Value(source) pos := 0 @@ -79,18 +202,39 @@ func (b *tableParagraphTransformer) parseRow(segment text.Segment, alignments [] } else { alignment = alignments[i] } - closure := util.FindClosure(line[pos:], byte(0), '|', true, false) - if closure < 0 { - closure = len(line[pos:]) - } + + var escapedCell *escapedPipeCell node := ast.NewTableCell() - seg := text.NewSegment(segment.Start+pos, segment.Start+pos+closure) + node.Alignment = alignment + hasBacktick := false + closure := pos + for ; closure < limit; closure++ { + if line[closure] == '`' { + hasBacktick = true + } + if line[closure] == '|' { + if closure == 0 || line[closure-1] != '\\' { + break + } else if hasBacktick { + if escapedCell == nil { + escapedCell = &escapedPipeCell{node, []int{}, false} + escapedList := pc.ComputeIfAbsent(escapedPipeCellListKey, + func() interface{} { + return []*escapedPipeCell{} + }).([]*escapedPipeCell) + escapedList = append(escapedList, escapedCell) + pc.Set(escapedPipeCellListKey, escapedList) + } + escapedCell.Pos = append(escapedCell.Pos, segment.Start+closure-1) + } + } + } + seg := text.NewSegment(segment.Start+pos, segment.Start+closure) seg = seg.TrimLeftSpace(source) seg = seg.TrimRightSpace(source) node.Lines().Append(seg) - node.Alignment = alignment row.AppendChild(row, node) - pos += closure + 1 + pos = closure + 1 } for ; i < len(alignments); i++ { row.AppendChild(row, ast.NewTableCell()) @@ -100,7 +244,7 @@ func (b *tableParagraphTransformer) parseRow(segment text.Segment, alignments [] func (b *tableParagraphTransformer) parseDelimiter(segment text.Segment, reader text.Reader) []ast.Alignment { line := segment.Value(reader.Source()) - if !tableDelimRegexp.Match(line) { + if !isTableDelim(line) { return nil } cols := bytes.Split(line, []byte{'|'}) @@ -128,19 +272,74 @@ func (b *tableParagraphTransformer) parseDelimiter(segment text.Segment, reader return alignments } +type tableASTTransformer struct { +} + +var defaultTableASTTransformer = &tableASTTransformer{} + +// NewTableASTTransformer returns a parser.ASTTransformer for tables. +func NewTableASTTransformer() parser.ASTTransformer { + return defaultTableASTTransformer +} + +func (a *tableASTTransformer) Transform(node *gast.Document, reader text.Reader, pc parser.Context) { + lst := pc.Get(escapedPipeCellListKey) + if lst == nil { + return + } + pc.Set(escapedPipeCellListKey, nil) + for _, v := range lst.([]*escapedPipeCell) { + if v.Transformed { + continue + } + _ = gast.Walk(v.Cell, func(n gast.Node, entering bool) (gast.WalkStatus, error) { + if !entering || n.Kind() != gast.KindCodeSpan { + return gast.WalkContinue, nil + } + + for c := n.FirstChild(); c != nil; { + next := c.NextSibling() + if c.Kind() != gast.KindText { + c = next + continue + } + parent := c.Parent() + ts := &c.(*gast.Text).Segment + n := c + for _, v := range lst.([]*escapedPipeCell) { + for _, pos := range v.Pos { + if ts.Start <= pos && pos < ts.Stop { + segment := n.(*gast.Text).Segment + n1 := gast.NewRawTextSegment(segment.WithStop(pos)) + n2 := gast.NewRawTextSegment(segment.WithStart(pos + 1)) + parent.InsertAfter(parent, n, n1) + parent.InsertAfter(parent, n1, n2) + parent.RemoveChild(parent, n) + n = n2 + v.Transformed = true + } + } + } + c = next + } + return gast.WalkContinue, nil + }) + } +} + // TableHTMLRenderer is a renderer.NodeRenderer implementation that // renders Table nodes. type TableHTMLRenderer struct { - html.Config + TableConfig } // NewTableHTMLRenderer returns a new TableHTMLRenderer. -func NewTableHTMLRenderer(opts ...html.Option) renderer.NodeRenderer { +func NewTableHTMLRenderer(opts ...TableOption) renderer.NodeRenderer { r := &TableHTMLRenderer{ - Config: html.NewConfig(), + TableConfig: NewTableConfig(), } for _, opt := range opts { - opt.SetHTMLOption(&r.Config) + opt.SetTableOption(&r.TableConfig) } return r } @@ -281,14 +480,33 @@ func (r *TableHTMLRenderer) renderTableCell(w util.BufWriter, source []byte, nod tag = "th" } if entering { - align := "" + fmt.Fprintf(w, "<%s", tag) if n.Alignment != ast.AlignNone { - if _, ok := n.AttributeString("align"); !ok { // Skip align render if overridden - // TODO: "align" is deprecated. style="text-align:%s" instead? - align = fmt.Sprintf(` align="%s"`, n.Alignment.String()) + amethod := r.TableConfig.TableCellAlignMethod + if amethod == TableCellAlignDefault { + if r.Config.XHTML { + amethod = TableCellAlignAttribute + } else { + amethod = TableCellAlignStyle + } + } + switch amethod { + case TableCellAlignAttribute: + if _, ok := n.AttributeString("align"); !ok { // Skip align render if overridden + fmt.Fprintf(w, ` align="%s"`, n.Alignment.String()) + } + case TableCellAlignStyle: + v, ok := n.AttributeString("style") + var cob util.CopyOnWriteBuffer + if ok { + cob = util.NewCopyOnWriteBuffer(v.([]byte)) + cob.AppendByte(';') + } + style := fmt.Sprintf("text-align:%s", n.Alignment.String()) + cob.AppendString(style) + n.SetAttributeString("style", cob.Bytes()) } } - fmt.Fprintf(w, "<%s", tag) if n.Attributes() != nil { if tag == "td" { html.RenderAttributes(w, n, TableTdCellAttributeFilter) // @@ -296,7 +514,7 @@ func (r *TableHTMLRenderer) renderTableCell(w util.BufWriter, source []byte, nod html.RenderAttributes(w, n, TableThCellAttributeFilter) // } } - fmt.Fprintf(w, "%s>", align) + _ = w.WriteByte('>') } else { fmt.Fprintf(w, "\n", tag) } @@ -304,16 +522,31 @@ func (r *TableHTMLRenderer) renderTableCell(w util.BufWriter, source []byte, nod } type table struct { + options []TableOption } // Table is an extension that allow you to use GFM tables . -var Table = &table{} +var Table = &table{ + options: []TableOption{}, +} + +// NewTable returns a new extension with given options. +func NewTable(opts ...TableOption) goldmark.Extender { + return &table{ + options: opts, + } +} func (e *table) Extend(m goldmark.Markdown) { - m.Parser().AddOptions(parser.WithParagraphTransformers( - util.Prioritized(NewTableParagraphTransformer(), 200), - )) + m.Parser().AddOptions( + parser.WithParagraphTransformers( + util.Prioritized(NewTableParagraphTransformer(), 200), + ), + parser.WithASTTransformers( + util.Prioritized(defaultTableASTTransformer, 0), + ), + ) m.Renderer().AddOptions(renderer.WithNodeRenderers( - util.Prioritized(NewTableHTMLRenderer(), 500), + util.Prioritized(NewTableHTMLRenderer(e.options...), 500), )) } diff --git a/vendor/github.com/yuin/goldmark/extension/typographer.go b/vendor/github.com/yuin/goldmark/extension/typographer.go index fc4040209a46b..f56c06f747002 100644 --- a/vendor/github.com/yuin/goldmark/extension/typographer.go +++ b/vendor/github.com/yuin/goldmark/extension/typographer.go @@ -10,6 +10,27 @@ import ( "github.com/yuin/goldmark/util" ) +var uncloseCounterKey = parser.NewContextKey() + +type unclosedCounter struct { + Single int + Double int +} + +func (u *unclosedCounter) Reset() { + u.Single = 0 + u.Double = 0 +} + +func getUnclosedCounter(pc parser.Context) *unclosedCounter { + v := pc.Get(uncloseCounterKey) + if v == nil { + v = &unclosedCounter{} + pc.Set(uncloseCounterKey, v) + } + return v.(*unclosedCounter) +} + // TypographicPunctuation is a key of the punctuations that can be replaced with // typographic entities. type TypographicPunctuation int @@ -139,11 +160,10 @@ func NewTypographerParser(opts ...TypographerOption) parser.InlineParser { } func (s *typographerParser) Trigger() []byte { - return []byte{'\'', '"', '-', '.', '<', '>'} + return []byte{'\'', '"', '-', '.', ',', '<', '>', '*', '['} } func (s *typographerParser) Parse(parent gast.Node, block text.Reader, pc parser.Context) gast.Node { - before := block.PrecendingCharacter() line, _ := block.PeekLine() c := line[0] if len(line) > 2 { @@ -189,25 +209,37 @@ func (s *typographerParser) Parse(parent gast.Node, block text.Reader, pc parser } } if c == '\'' || c == '"' { + before := block.PrecendingCharacter() d := parser.ScanDelimiter(line, before, 1, defaultTypographerDelimiterProcessor) if d == nil { return nil } + counter := getUnclosedCounter(pc) if c == '\'' { if s.Substitutions[Apostrophe] != nil { // Handle decade abbrevations such as '90s if d.CanOpen && !d.CanClose && len(line) > 3 && util.IsNumeric(line[1]) && util.IsNumeric(line[2]) && line[3] == 's' { - after := util.ToRune(line, 4) - if len(line) == 3 || unicode.IsSpace(after) || unicode.IsPunct(after) { + after := rune(' ') + if len(line) > 4 { + after = util.ToRune(line, 4) + } + if len(line) == 3 || util.IsSpaceRune(after) || util.IsPunctRune(after) { node := gast.NewString(s.Substitutions[Apostrophe]) node.SetCode(true) block.Advance(1) return node } } + // special cases: 'twas, 'em, 'net + if len(line) > 1 && (unicode.IsPunct(before) || unicode.IsSpace(before)) && (line[1] == 't' || line[1] == 'e' || line[1] == 'n' || line[1] == 'l') { + node := gast.NewString(s.Substitutions[Apostrophe]) + node.SetCode(true) + block.Advance(1) + return node + } // Convert normal apostrophes. This is probably more flexible than necessary but // converts any apostrophe in between two alphanumerics. - if len(line) > 1 && (unicode.IsDigit(before) || unicode.IsLetter(before)) && (util.IsAlphaNumeric(line[1])) { + if len(line) > 1 && (unicode.IsDigit(before) || unicode.IsLetter(before)) && (unicode.IsLetter(util.ToRune(line, 1))) { node := gast.NewString(s.Substitutions[Apostrophe]) node.SetCode(true) block.Advance(1) @@ -215,16 +247,43 @@ func (s *typographerParser) Parse(parent gast.Node, block text.Reader, pc parser } } if s.Substitutions[LeftSingleQuote] != nil && d.CanOpen && !d.CanClose { - node := gast.NewString(s.Substitutions[LeftSingleQuote]) + nt := LeftSingleQuote + // special cases: Alice's, I'm, Don't, You'd + if len(line) > 1 && (line[1] == 's' || line[1] == 'm' || line[1] == 't' || line[1] == 'd') && (len(line) < 3 || util.IsPunct(line[2]) || util.IsSpace(line[2])) { + nt = RightSingleQuote + } + // special cases: I've, I'll, You're + if len(line) > 2 && ((line[1] == 'v' && line[2] == 'e') || (line[1] == 'l' && line[2] == 'l') || (line[1] == 'r' && line[2] == 'e')) && (len(line) < 4 || util.IsPunct(line[3]) || util.IsSpace(line[3])) { + nt = RightSingleQuote + } + if nt == LeftSingleQuote { + counter.Single++ + } + + node := gast.NewString(s.Substitutions[nt]) node.SetCode(true) block.Advance(1) return node } - if s.Substitutions[RightSingleQuote] != nil && d.CanClose && !d.CanOpen { - node := gast.NewString(s.Substitutions[RightSingleQuote]) - node.SetCode(true) - block.Advance(1) - return node + if s.Substitutions[RightSingleQuote] != nil { + // plural possesives and abbreviations: Smiths', doin' + if len(line) > 1 && unicode.IsSpace(util.ToRune(line, 0)) || unicode.IsPunct(util.ToRune(line, 0)) && (len(line) > 2 && !unicode.IsDigit(util.ToRune(line, 1))) { + node := gast.NewString(s.Substitutions[RightSingleQuote]) + node.SetCode(true) + block.Advance(1) + return node + } + } + if s.Substitutions[RightSingleQuote] != nil && counter.Single > 0 { + isClose := d.CanClose && !d.CanOpen + maybeClose := d.CanClose && d.CanOpen && len(line) > 1 && unicode.IsPunct(util.ToRune(line, 1)) && (len(line) == 2 || (len(line) > 2 && util.IsPunct(line[2]) || util.IsSpace(line[2]))) + if isClose || maybeClose { + node := gast.NewString(s.Substitutions[RightSingleQuote]) + node.SetCode(true) + block.Advance(1) + counter.Single-- + return node + } } } if c == '"' { @@ -232,13 +291,23 @@ func (s *typographerParser) Parse(parent gast.Node, block text.Reader, pc parser node := gast.NewString(s.Substitutions[LeftDoubleQuote]) node.SetCode(true) block.Advance(1) + counter.Double++ return node } - if s.Substitutions[RightDoubleQuote] != nil && d.CanClose && !d.CanOpen { - node := gast.NewString(s.Substitutions[RightDoubleQuote]) - node.SetCode(true) - block.Advance(1) - return node + if s.Substitutions[RightDoubleQuote] != nil && counter.Double > 0 { + isClose := d.CanClose && !d.CanOpen + maybeClose := d.CanClose && d.CanOpen && len(line) > 1 && (unicode.IsPunct(util.ToRune(line, 1))) && (len(line) == 2 || (len(line) > 2 && util.IsPunct(line[2]) || util.IsSpace(line[2]))) + if isClose || maybeClose { + // special case: "Monitor 21"" + if len(line) > 1 && line[1] == '"' && unicode.IsDigit(before) { + return nil + } + node := gast.NewString(s.Substitutions[RightDoubleQuote]) + node.SetCode(true) + block.Advance(1) + counter.Double-- + return node + } } } } @@ -246,7 +315,7 @@ func (s *typographerParser) Parse(parent gast.Node, block text.Reader, pc parser } func (s *typographerParser) CloseBlock(parent gast.Node, pc parser.Context) { - // nothing to do + getUnclosedCounter(pc).Reset() } type typographer struct { diff --git a/vendor/github.com/yuin/goldmark/go.mod b/vendor/github.com/yuin/goldmark/go.mod index a10efcad5288d..3a2e0db9e8832 100644 --- a/vendor/github.com/yuin/goldmark/go.mod +++ b/vendor/github.com/yuin/goldmark/go.mod @@ -1,3 +1,3 @@ module github.com/yuin/goldmark -go 1.13 +go 1.18 diff --git a/vendor/github.com/yuin/goldmark/parser/attribute.go b/vendor/github.com/yuin/goldmark/parser/attribute.go index ea8c0645df8a3..f86c83610e475 100644 --- a/vendor/github.com/yuin/goldmark/parser/attribute.go +++ b/vendor/github.com/yuin/goldmark/parser/attribute.go @@ -89,7 +89,11 @@ func parseAttribute(reader text.Reader) (Attribute, bool) { reader.Advance(1) line, _ := reader.PeekLine() i := 0 - for ; i < len(line) && !util.IsSpace(line[i]) && (!util.IsPunct(line[i]) || line[i] == '_' || line[i] == '-'); i++ { + // HTML5 allows any kind of characters as id, but XHTML restricts characters for id. + // CommonMark is basically defined for XHTML(even though it is legacy). + // So we restrict id characters. + for ; i < len(line) && !util.IsSpace(line[i]) && + (!util.IsPunct(line[i]) || line[i] == '_' || line[i] == '-' || line[i] == ':' || line[i] == '.'); i++ { } name := attrNameClass if c == '#' { @@ -129,6 +133,11 @@ func parseAttribute(reader text.Reader) (Attribute, bool) { if !ok { return Attribute{}, false } + if bytes.Equal(name, attrNameClass) { + if _, ok = value.([]byte); !ok { + return Attribute{}, false + } + } return Attribute{Name: name, Value: value}, true } diff --git a/vendor/github.com/yuin/goldmark/parser/atx_heading.go b/vendor/github.com/yuin/goldmark/parser/atx_heading.go index 0b63fabc0b4d8..13a198b52b058 100644 --- a/vendor/github.com/yuin/goldmark/parser/atx_heading.go +++ b/vendor/github.com/yuin/goldmark/parser/atx_heading.go @@ -91,6 +91,9 @@ func (b *atxHeadingParser) Open(parent ast.Node, reader text.Reader, pc Context) if i == pos || level > 6 { return nil, NoChildren } + if i == len(line) { // alone '#' (without a new line character) + return ast.NewHeading(level), NoChildren + } l := util.TrimLeftSpaceLength(line[i:]) if l == 0 { return nil, NoChildren @@ -126,7 +129,8 @@ func (b *atxHeadingParser) Open(parent ast.Node, reader text.Reader, pc Context) if closureClose > 0 { reader.Advance(closureClose) attrs, ok := ParseAttributes(reader) - parsed = ok + rest, _ := reader.PeekLine() + parsed = ok && util.IsBlank(rest) if parsed { for _, attr := range attrs { node.SetAttribute(attr.Name, attr.Value) @@ -232,7 +236,7 @@ func parseLastLineAttributes(node ast.Node, reader text.Reader, pc Context) { } lr.Advance(1) } - if ok && util.IsBlank(line[end.Stop:]) { + if ok && util.IsBlank(line[end.Start:]) { for _, attr := range attrs { node.SetAttribute(attr.Name, attr.Value) } diff --git a/vendor/github.com/yuin/goldmark/parser/code_block.go b/vendor/github.com/yuin/goldmark/parser/code_block.go index d02c21fc71339..732f18c65dea9 100644 --- a/vendor/github.com/yuin/goldmark/parser/code_block.go +++ b/vendor/github.com/yuin/goldmark/parser/code_block.go @@ -31,6 +31,10 @@ func (b *codeBlockParser) Open(parent ast.Node, reader text.Reader, pc Context) node := ast.NewCodeBlock() reader.AdvanceAndSetPadding(pos, padding) _, segment = reader.PeekLine() + // if code block line starts with a tab, keep a tab as it is. + if segment.Padding != 0 { + preserveLeadingTabInCodeBlock(&segment, reader, 0) + } node.Lines().Append(segment) reader.Advance(segment.Len() - 1) return node, NoChildren @@ -49,6 +53,12 @@ func (b *codeBlockParser) Continue(node ast.Node, reader text.Reader, pc Context } reader.AdvanceAndSetPadding(pos, padding) _, segment = reader.PeekLine() + + // if code block line starts with a tab, keep a tab as it is. + if segment.Padding != 0 { + preserveLeadingTabInCodeBlock(&segment, reader, 0) + } + node.Lines().Append(segment) reader.Advance(segment.Len() - 1) return Continue | NoChildren @@ -77,3 +87,14 @@ func (b *codeBlockParser) CanInterruptParagraph() bool { func (b *codeBlockParser) CanAcceptIndentedLine() bool { return true } + +func preserveLeadingTabInCodeBlock(segment *text.Segment, reader text.Reader, indent int) { + offsetWithPadding := reader.LineOffset() + indent + sl, ss := reader.Position() + reader.SetPosition(sl, text.NewSegment(ss.Start-1, ss.Stop)) + if offsetWithPadding == reader.LineOffset() { + segment.Padding = 0 + segment.Start-- + } + reader.SetPosition(sl, ss) +} diff --git a/vendor/github.com/yuin/goldmark/parser/code_span.go b/vendor/github.com/yuin/goldmark/parser/code_span.go index 13652367f5a9b..a74b09bc4f71c 100644 --- a/vendor/github.com/yuin/goldmark/parser/code_span.go +++ b/vendor/github.com/yuin/goldmark/parser/code_span.go @@ -3,7 +3,6 @@ package parser import ( "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" ) type codeSpanParser struct { @@ -52,9 +51,7 @@ func (s *codeSpanParser) Parse(parent ast.Node, block text.Reader, pc Context) a } } } - if !util.IsBlank(line) { - node.AppendChild(node, ast.NewRawTextSegment(segment)) - } + node.AppendChild(node, ast.NewRawTextSegment(segment)) block.AdvanceLine() } end: @@ -62,11 +59,11 @@ end: // trim first halfspace and last halfspace segment := node.FirstChild().(*ast.Text).Segment shouldTrimmed := true - if !(!segment.IsEmpty() && block.Source()[segment.Start] == ' ') { + if !(!segment.IsEmpty() && isSpaceOrNewline(block.Source()[segment.Start])) { shouldTrimmed = false } segment = node.LastChild().(*ast.Text).Segment - if !(!segment.IsEmpty() && block.Source()[segment.Stop-1] == ' ') { + if !(!segment.IsEmpty() && isSpaceOrNewline(block.Source()[segment.Stop-1])) { shouldTrimmed = false } if shouldTrimmed { @@ -81,3 +78,7 @@ end: } return node } + +func isSpaceOrNewline(c byte) bool { + return c == ' ' || c == '\n' +} diff --git a/vendor/github.com/yuin/goldmark/parser/delimiter.go b/vendor/github.com/yuin/goldmark/parser/delimiter.go index 612d7b7377561..eb843af44acb5 100644 --- a/vendor/github.com/yuin/goldmark/parser/delimiter.go +++ b/vendor/github.com/yuin/goldmark/parser/delimiter.go @@ -3,7 +3,6 @@ package parser import ( "fmt" "strings" - "unicode" "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/text" @@ -31,11 +30,11 @@ type Delimiter struct { Segment text.Segment // CanOpen is set true if this delimiter can open a span for a new node. - // See https://spec.commonmark.org/0.29/#can-open-emphasis for details. + // See https://spec.commonmark.org/0.30/#can-open-emphasis for details. CanOpen bool // CanClose is set true if this delimiter can close a span for a new node. - // See https://spec.commonmark.org/0.29/#can-open-emphasis for details. + // See https://spec.commonmark.org/0.30/#can-open-emphasis for details. CanClose bool // Length is a remaining length of this delimiter. @@ -128,10 +127,10 @@ func ScanDelimiter(line []byte, before rune, min int, processor DelimiterProcess } canOpen, canClose := false, false - beforeIsPunctuation := unicode.IsPunct(before) - beforeIsWhitespace := unicode.IsSpace(before) - afterIsPunctuation := unicode.IsPunct(after) - afterIsWhitespace := unicode.IsSpace(after) + beforeIsPunctuation := util.IsPunctRune(before) + beforeIsWhitespace := util.IsSpaceRune(before) + afterIsPunctuation := util.IsPunctRune(after) + afterIsWhitespace := util.IsSpaceRune(after) isLeft := !afterIsWhitespace && (!afterIsPunctuation || beforeIsWhitespace || beforeIsPunctuation) @@ -163,15 +162,11 @@ func ProcessDelimiters(bottom ast.Node, pc Context) { var closer *Delimiter if bottom != nil { if bottom != lastDelimiter { - for c := lastDelimiter.PreviousSibling(); c != nil; { + for c := lastDelimiter.PreviousSibling(); c != nil && c != bottom; { if d, ok := c.(*Delimiter); ok { closer = d } - prev := c.PreviousSibling() - if prev == bottom { - break - } - c = prev + c = c.PreviousSibling() } } } else { @@ -190,7 +185,7 @@ func ProcessDelimiters(bottom ast.Node, pc Context) { found := false maybeOpener := false var opener *Delimiter - for opener = closer.PreviousDelimiter; opener != nil; opener = opener.PreviousDelimiter { + for opener = closer.PreviousDelimiter; opener != nil && opener != bottom; opener = opener.PreviousDelimiter { if opener.CanOpen && opener.Processor.CanOpenCloser(opener, closer) { maybeOpener = true consume = opener.CalcComsumption(closer) @@ -201,10 +196,11 @@ func ProcessDelimiters(bottom ast.Node, pc Context) { } } if !found { + next := closer.NextDelimiter if !maybeOpener && !closer.CanOpen { pc.RemoveDelimiter(closer) } - closer = closer.NextDelimiter + closer = next continue } opener.ConsumeCharacters(consume) diff --git a/vendor/github.com/yuin/goldmark/parser/fcode_block.go b/vendor/github.com/yuin/goldmark/parser/fcode_block.go index f5b83eef7b4f0..5914138d30574 100644 --- a/vendor/github.com/yuin/goldmark/parser/fcode_block.go +++ b/vendor/github.com/yuin/goldmark/parser/fcode_block.go @@ -71,6 +71,7 @@ func (b *fencedCodeBlockParser) Open(parent ast.Node, reader text.Reader, pc Con func (b *fencedCodeBlockParser) Continue(node ast.Node, reader text.Reader, pc Context) State { line, segment := reader.PeekLine() fdata := pc.Get(fencedCodeBlockInfoKey).(*fenceData) + w, pos := util.IndentWidth(line, reader.LineOffset()) if w < 4 { i := pos @@ -86,9 +87,19 @@ func (b *fencedCodeBlockParser) Continue(node ast.Node, reader text.Reader, pc C return Close } } - pos, padding := util.DedentPositionPadding(line, reader.LineOffset(), segment.Padding, fdata.indent) - + pos, padding := util.IndentPositionPadding(line, reader.LineOffset(), segment.Padding, fdata.indent) + if pos < 0 { + pos = util.FirstNonSpacePosition(line) + if pos < 0 { + pos = 0 + } + padding = 0 + } seg := text.NewSegmentPadding(segment.Start+pos, segment.Stop, padding) + // if code block line starts with a tab, keep a tab as it is. + if padding != 0 { + preserveLeadingTabInCodeBlock(&seg, reader, fdata.indent) + } node.Lines().Append(seg) reader.AdvanceAndSetPadding(segment.Stop-segment.Start-pos-1, padding) return Continue | NoChildren diff --git a/vendor/github.com/yuin/goldmark/parser/html_block.go b/vendor/github.com/yuin/goldmark/parser/html_block.go index 95b6918cdc164..380e723f2275a 100644 --- a/vendor/github.com/yuin/goldmark/parser/html_block.go +++ b/vendor/github.com/yuin/goldmark/parser/html_block.go @@ -76,8 +76,8 @@ var allowedBlockTags = map[string]bool{ "ul": true, } -var htmlBlockType1OpenRegexp = regexp.MustCompile(`(?i)^[ ]{0,3}<(script|pre|style)(?:\s.*|>.*|/>.*|)\n?$`) -var htmlBlockType1CloseRegexp = regexp.MustCompile(`(?i)^.*.*`) +var htmlBlockType1OpenRegexp = regexp.MustCompile(`(?i)^[ ]{0,3}<(script|pre|style|textarea)(?:\s.*|>.*|/>.*|)(?:\r\n|\n)?$`) +var htmlBlockType1CloseRegexp = regexp.MustCompile(`(?i)^.*.*`) var htmlBlockType2OpenRegexp = regexp.MustCompile(`^[ ]{0,3}'} @@ -85,15 +85,15 @@ var htmlBlockType2Close = []byte{'-', '-', '>'} var htmlBlockType3OpenRegexp = regexp.MustCompile(`^[ ]{0,3}<\?`) var htmlBlockType3Close = []byte{'?', '>'} -var htmlBlockType4OpenRegexp = regexp.MustCompile(`^[ ]{0,3}'} var htmlBlockType5OpenRegexp = regexp.MustCompile(`^[ ]{0,3}<\!\[CDATA\[`) var htmlBlockType5Close = []byte{']', ']', '>'} -var htmlBlockType6Regexp = regexp.MustCompile(`^[ ]{0,3}.*|/>.*|)\n?$`) +var htmlBlockType6Regexp = regexp.MustCompile(`^[ ]{0,3}<(?:/[ ]*)?([a-zA-Z]+[a-zA-Z0-9\-]*)(?:[ ].*|>.*|/>.*|)(?:\r\n|\n)?$`) -var htmlBlockType7Regexp = regexp.MustCompile(`^[ ]{0,3}<(/)?([a-zA-Z0-9]+)(` + attributePattern + `*)(:?>|/>)\s*\n?$`) +var htmlBlockType7Regexp = regexp.MustCompile(`^[ ]{0,3}<(/[ ]*)?([a-zA-Z]+[a-zA-Z0-9\-]*)(` + attributePattern + `*)[ ]*(?:>|/>)[ ]*(?:\r\n|\n)?$`) type htmlBlockParser struct { } @@ -201,7 +201,7 @@ func (b *htmlBlockParser) Continue(node ast.Node, reader text.Reader, pc Context } if bytes.Contains(line, closurePattern) { htmlBlock.ClosureLine = segment - reader.Advance(segment.Len() - 1) + reader.Advance(segment.Len()) return Close } diff --git a/vendor/github.com/yuin/goldmark/parser/link.go b/vendor/github.com/yuin/goldmark/parser/link.go index e7c6966f3def1..99583ac2a9dd5 100644 --- a/vendor/github.com/yuin/goldmark/parser/link.go +++ b/vendor/github.com/yuin/goldmark/parser/link.go @@ -2,7 +2,6 @@ package parser import ( "fmt" - "regexp" "strings" "github.com/yuin/goldmark/ast" @@ -49,6 +48,13 @@ func (s *linkLabelState) Kind() ast.NodeKind { return kindLinkLabelState } +func linkLabelStateLength(v *linkLabelState) int { + if v == nil || v.Last == nil || v.First == nil { + return 0 + } + return v.Last.Segment.Stop - v.First.Segment.Start +} + func pushLinkLabelState(pc Context, v *linkLabelState) { tlist := pc.Get(linkLabelStateKey) var list *linkLabelState @@ -113,8 +119,6 @@ func (s *linkParser) Trigger() []byte { return []byte{'!', '[', ']'} } -var linkDestinationRegexp = regexp.MustCompile(`\s*([^\s].+)`) -var linkTitleRegexp = regexp.MustCompile(`\s+(\)|["'\(].+)`) var linkBottom = NewContextKey() func (s *linkParser) Parse(parent ast.Node, block text.Reader, pc Context) ast.Node { @@ -143,7 +147,14 @@ func (s *linkParser) Parse(parent ast.Node, block text.Reader, pc Context) ast.N } block.Advance(1) removeLinkLabelState(pc, last) - if s.containsLink(last) { // a link in a link text is not allowed + // CommonMark spec says: + // > A link label can have at most 999 characters inside the square brackets. + if linkLabelStateLength(tlist.(*linkLabelState)) > 998 { + ast.MergeOrReplaceTextSegment(last.Parent(), last, last.Segment) + return nil + } + + if !last.IsImage && s.containsLink(last) { // a link in a link text is not allowed ast.MergeOrReplaceTextSegment(last.Parent(), last, last.Segment) return nil } @@ -167,6 +178,13 @@ func (s *linkParser) Parse(parent ast.Node, block text.Reader, pc Context) ast.N block.SetPosition(l, pos) ssegment := text.NewSegment(last.Segment.Stop, segment.Start) maybeReference := block.Value(ssegment) + // CommonMark spec says: + // > A link label can have at most 999 characters inside the square brackets. + if len(maybeReference) > 999 { + ast.MergeOrReplaceTextSegment(last.Parent(), last, last.Segment) + return nil + } + ref, ok := pc.Reference(util.ToLinkReference(maybeReference)) if !ok { ast.MergeOrReplaceTextSegment(last.Parent(), last, last.Segment) @@ -185,15 +203,17 @@ func (s *linkParser) Parse(parent ast.Node, block text.Reader, pc Context) ast.N return link } -func (s *linkParser) containsLink(last *linkLabelState) bool { - if last.IsImage { +func (s *linkParser) containsLink(n ast.Node) bool { + if n == nil { return false } - var c ast.Node - for c = last; c != nil; c = c.NextSibling() { + for c := n; c != nil; c = c.NextSibling() { if _, ok := c.(*ast.Link); ok { return true } + if s.containsLink(c.FirstChild()) { + return true + } } return false } @@ -224,21 +244,38 @@ func (s *linkParser) processLinkLabel(parent ast.Node, link *ast.Link, last *lin } } +var linkFindClosureOptions text.FindClosureOptions = text.FindClosureOptions{ + Nesting: false, + Newline: true, + Advance: true, +} + func (s *linkParser) parseReferenceLink(parent ast.Node, last *linkLabelState, block text.Reader, pc Context) (*ast.Link, bool) { _, orgpos := block.Position() block.Advance(1) // skip '[' - line, segment := block.PeekLine() - endIndex := util.FindClosure(line, '[', ']', false, true) - if endIndex < 0 { + segments, found := block.FindClosure('[', ']', linkFindClosureOptions) + if !found { return nil, false } - block.Advance(endIndex + 1) - ssegment := segment.WithStop(segment.Start + endIndex) - maybeReference := block.Value(ssegment) + var maybeReference []byte + if segments.Len() == 1 { // avoid allocate a new byte slice + maybeReference = block.Value(segments.At(0)) + } else { + maybeReference = []byte{} + for i := 0; i < segments.Len(); i++ { + s := segments.At(i) + maybeReference = append(maybeReference, block.Value(s)...) + } + } if util.IsBlank(maybeReference) { // collapsed reference link - ssegment = text.NewSegment(last.Segment.Stop, orgpos.Start-1) - maybeReference = block.Value(ssegment) + s := text.NewSegment(last.Segment.Stop, orgpos.Start-1) + maybeReference = block.Value(s) + } + // CommonMark spec says: + // > A link label can have at most 999 characters inside the square brackets. + if len(maybeReference) > 999 { + return nil, true } ref, ok := pc.Reference(util.ToLinkReference(maybeReference)) @@ -293,20 +330,17 @@ func (s *linkParser) parseLink(parent ast.Node, last *linkLabelState, block text func parseLinkDestination(block text.Reader) ([]byte, bool) { block.SkipSpaces() line, _ := block.PeekLine() - buf := []byte{} if block.Peek() == '<' { i := 1 for i < len(line) { c := line[i] if c == '\\' && i < len(line)-1 && util.IsPunct(line[i+1]) { - buf = append(buf, '\\', line[i+1]) i += 2 continue } else if c == '>' { block.Advance(i + 1) return line[1:i], true } - buf = append(buf, c) i++ } return nil, false @@ -316,7 +350,6 @@ func parseLinkDestination(block text.Reader) ([]byte, bool) { for i < len(line) { c := line[i] if c == '\\' && i < len(line)-1 && util.IsPunct(line[i+1]) { - buf = append(buf, '\\', line[i+1]) i += 2 continue } else if c == '(' { @@ -329,7 +362,6 @@ func parseLinkDestination(block text.Reader) ([]byte, bool) { } else if util.IsSpace(c) { break } - buf = append(buf, c) i++ } block.Advance(i) @@ -346,34 +378,24 @@ func parseLinkTitle(block text.Reader) ([]byte, bool) { if opener == '(' { closer = ')' } - savedLine, savedPosition := block.Position() - var title []byte - for i := 0; ; i++ { - line, _ := block.PeekLine() - if line == nil { - block.SetPosition(savedLine, savedPosition) - return nil, false - } - offset := 0 - if i == 0 { - offset = 1 - } - pos := util.FindClosure(line[offset:], opener, closer, false, true) - if pos < 0 { - title = append(title, line[offset:]...) - block.AdvanceLine() - continue + block.Advance(1) + segments, found := block.FindClosure(opener, closer, linkFindClosureOptions) + if found { + if segments.Len() == 1 { + return block.Value(segments.At(0)), true } - pos += offset + 1 // 1: closer - block.Advance(pos) - if i == 0 { // avoid allocating new slice - return line[offset : pos-1], true + var title []byte + for i := 0; i < segments.Len(); i++ { + s := segments.At(i) + title = append(title, block.Value(s)...) } - return append(title, line[offset:pos-1]...), true + return title, true } + return nil, false } func (s *linkParser) CloseBlock(parent ast.Node, block text.Reader, pc Context) { + pc.Set(linkBottom, nil) tlist := pc.Get(linkLabelStateKey) if tlist == nil { return diff --git a/vendor/github.com/yuin/goldmark/parser/link_ref.go b/vendor/github.com/yuin/goldmark/parser/link_ref.go index 3fa1ecf6fa30c..ea3f6544a1ef7 100644 --- a/vendor/github.com/yuin/goldmark/parser/link_ref.go +++ b/vendor/github.com/yuin/goldmark/parser/link_ref.go @@ -52,7 +52,7 @@ func (p *linkReferenceParagraphTransformer) Transform(node *ast.Paragraph, reade func parseLinkReferenceDefinition(block text.Reader, pc Context) (int, int) { block.SkipSpaces() - line, segment := block.PeekLine() + line, _ := block.PeekLine() if line == nil { return -1, -1 } @@ -67,39 +67,33 @@ func parseLinkReferenceDefinition(block text.Reader, pc Context) (int, int) { if line[pos] != '[' { return -1, -1 } - open := segment.Start + pos + 1 - closes := -1 block.Advance(pos + 1) - for { - line, segment = block.PeekLine() - if line == nil { - return -1, -1 - } - closure := util.FindClosure(line, '[', ']', false, false) - if closure > -1 { - closes = segment.Start + closure - next := closure + 1 - if next >= len(line) || line[next] != ':' { - return -1, -1 - } - block.Advance(next + 1) - break + segments, found := block.FindClosure('[', ']', linkFindClosureOptions) + if !found { + return -1, -1 + } + var label []byte + if segments.Len() == 1 { + label = block.Value(segments.At(0)) + } else { + for i := 0; i < segments.Len(); i++ { + s := segments.At(i) + label = append(label, block.Value(s)...) } - block.AdvanceLine() } - if closes < 0 { + if util.IsBlank(label) { return -1, -1 } - label := block.Value(text.NewSegment(open, closes)) - if util.IsBlank(label) { + if block.Peek() != ':' { return -1, -1 } + block.Advance(1) block.SkipSpaces() destination, ok := parseLinkDestination(block) if !ok { return -1, -1 } - line, segment = block.PeekLine() + line, _ = block.PeekLine() isNewLine := line == nil || util.IsBlank(line) endLine, _ := block.Position() @@ -117,45 +111,40 @@ func parseLinkReferenceDefinition(block text.Reader, pc Context) (int, int) { return -1, -1 } block.Advance(1) - open = -1 - closes = -1 closer := opener if opener == '(' { closer = ')' } - for { - line, segment = block.PeekLine() - if line == nil { + segments, found = block.FindClosure(opener, closer, linkFindClosureOptions) + if !found { + if !isNewLine { return -1, -1 } - if open < 0 { - open = segment.Start - } - closure := util.FindClosure(line, opener, closer, false, true) - if closure > -1 { - closes = segment.Start + closure - block.Advance(closure + 1) - break - } + ref := NewReference(label, destination, nil) + pc.AddReference(ref) block.AdvanceLine() + return startLine, endLine + 1 } - if closes < 0 { - return -1, -1 + var title []byte + if segments.Len() == 1 { + title = block.Value(segments.At(0)) + } else { + for i := 0; i < segments.Len(); i++ { + s := segments.At(i) + title = append(title, block.Value(s)...) + } } - line, segment = block.PeekLine() + line, _ = block.PeekLine() if line != nil && !util.IsBlank(line) { if !isNewLine { return -1, -1 } - title := block.Value(text.NewSegment(open, closes)) ref := NewReference(label, destination, title) pc.AddReference(ref) return startLine, endLine } - title := block.Value(text.NewSegment(open, closes)) - endLine, _ = block.Position() ref := NewReference(label, destination, title) pc.AddReference(ref) diff --git a/vendor/github.com/yuin/goldmark/parser/list.go b/vendor/github.com/yuin/goldmark/parser/list.go index df1607ea0fc73..e5cad11735e53 100644 --- a/vendor/github.com/yuin/goldmark/parser/list.go +++ b/vendor/github.com/yuin/goldmark/parser/list.go @@ -1,10 +1,11 @@ package parser import ( + "strconv" + "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/text" "github.com/yuin/goldmark/util" - "strconv" ) type listItemType int @@ -15,6 +16,10 @@ const ( orderedList ) +var skipListParserKey = NewContextKey() +var emptyListItemWithBlankLines = NewContextKey() +var listItemFlagValue interface{} = true + // Same as // `^(([ ]*)([\-\*\+]))(\s+.*)?\n?$`.FindSubmatchIndex or // `^(([ ]*)(\d{1,9}[\.\)]))(\s+.*)?\n?$`.FindSubmatchIndex @@ -122,8 +127,8 @@ func (b *listParser) Trigger() []byte { func (b *listParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) { last := pc.LastOpenedBlock().Node - if _, lok := last.(*ast.List); lok || pc.Get(skipListParser) != nil { - pc.Set(skipListParser, nil) + if _, lok := last.(*ast.List); lok || pc.Get(skipListParserKey) != nil { + pc.Set(skipListParserKey, nil) return nil, NoChildren } line, _ := reader.PeekLine() @@ -143,7 +148,7 @@ func (b *listParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast. return nil, NoChildren } //an empty list item cannot interrupt a paragraph: - if match[5]-match[4] == 1 { + if match[4] < 0 || util.IsBlank(line[match[4]:match[5]]) { return nil, NoChildren } } @@ -153,6 +158,7 @@ func (b *listParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast. if start > -1 { node.Start = start } + pc.Set(emptyListItemWithBlankLines, nil) return node, HasChildren } @@ -160,9 +166,8 @@ func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) Sta list := node.(*ast.List) line, _ := reader.PeekLine() if util.IsBlank(line) { - // A list item can begin with at most one blank line - if node.ChildCount() == 1 && node.LastChild().ChildCount() == 0 { - return Close + if node.LastChild().ChildCount() == 0 { + pc.Set(emptyListItemWithBlankLines, listItemFlagValue) } return Continue | HasChildren } @@ -175,10 +180,23 @@ func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) Sta // - a // - b <--- current line // it maybe a new child of the list. + // + // Empty list items can have multiple blanklines + // + // - <--- 1st item is an empty thus "offset" is unknown + // + // + // - <--- current line + // + // -> 1 list with 2 blank items + // + // So if the last item is an empty, it maybe a new child of the list. + // offset := lastOffset(node) + lastIsEmpty := node.LastChild().ChildCount() == 0 indent, _ := util.IndentWidth(line, reader.LineOffset()) - if indent < offset { + if indent < offset || lastIsEmpty { if indent < 4 { match, typ := matchesListItem(line, false) // may have a leading spaces more than 3 if typ != notList && match[1]-offset < 4 { @@ -191,7 +209,7 @@ func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) Sta isHeading := false last := pc.LastOpenedBlock().Node if ast.IsParagraph(last) { - c, ok := matchesSetextHeadingBar(line) + c, ok := matchesSetextHeadingBar(line[match[3]-1:]) if ok && c == '-' { isHeading = true } @@ -200,10 +218,27 @@ func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) Sta return Close } } - return Continue | HasChildren } } + if !lastIsEmpty { + return Close + } + } + + if lastIsEmpty && indent < offset { + return Close + } + + // Non empty items can not exist next to an empty list item + // with blank lines. So we need to close the current list + // + // - + // + // foo + // + // -> 1 list with 1 blank items and 1 paragraph + if pc.Get(emptyListItemWithBlankLines) != nil { return Close } return Continue | HasChildren @@ -230,8 +265,9 @@ func (b *listParser) Close(node ast.Node, reader text.Reader, pc Context) { if list.IsTight { for child := node.FirstChild(); child != nil; child = child.NextSibling() { - for gc := child.FirstChild(); gc != nil; gc = gc.NextSibling() { + for gc := child.FirstChild(); gc != nil; { paragraph, ok := gc.(*ast.Paragraph) + gc = gc.NextSibling() if ok { textBlock := ast.NewTextBlock() textBlock.SetLines(paragraph.Lines()) diff --git a/vendor/github.com/yuin/goldmark/parser/list_item.go b/vendor/github.com/yuin/goldmark/parser/list_item.go index 4a698d83833d9..81357a9ad5efd 100644 --- a/vendor/github.com/yuin/goldmark/parser/list_item.go +++ b/vendor/github.com/yuin/goldmark/parser/list_item.go @@ -17,9 +17,6 @@ func NewListItemParser() BlockParser { return defaultListItemParser } -var skipListParser = NewContextKey() -var skipListParserValue interface{} = true - func (b *listItemParser) Trigger() []byte { return []byte{'-', '+', '*', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} } @@ -38,9 +35,12 @@ func (b *listItemParser) Open(parent ast.Node, reader text.Reader, pc Context) ( if match[1]-offset > 3 { return nil, NoChildren } + + pc.Set(emptyListItemWithBlankLines, nil) + itemOffset := calcListOffset(line, match) node := ast.NewListItem(match[3] + itemOffset) - if match[4] < 0 || match[5]-match[4] == 1 { + if match[4] < 0 || util.IsBlank(line[match[4]:match[5]]) { return node, NoChildren } @@ -53,18 +53,23 @@ func (b *listItemParser) Open(parent ast.Node, reader text.Reader, pc Context) ( func (b *listItemParser) Continue(node ast.Node, reader text.Reader, pc Context) State { line, _ := reader.PeekLine() if util.IsBlank(line) { + reader.Advance(len(line) - 1) return Continue | HasChildren } - indent, _ := util.IndentWidth(line, reader.LineOffset()) offset := lastOffset(node.Parent()) - if indent < offset && indent < 4 { + isEmpty := node.ChildCount() == 0 + indent, _ := util.IndentWidth(line, reader.LineOffset()) + if (isEmpty || indent < offset) && indent < 4 { _, typ := matchesListItem(line, true) // new list item found if typ != notList { - pc.Set(skipListParser, skipListParserValue) + pc.Set(skipListParserKey, listItemFlagValue) + return Close + } + if !isEmpty { + return Close } - return Close } pos, padding := util.IndentPosition(line, reader.LineOffset(), offset) reader.AdvanceAndSetPadding(pos, padding) diff --git a/vendor/github.com/yuin/goldmark/parser/parser.go b/vendor/github.com/yuin/goldmark/parser/parser.go index def13db66635f..bac0704526283 100644 --- a/vendor/github.com/yuin/goldmark/parser/parser.go +++ b/vendor/github.com/yuin/goldmark/parser/parser.go @@ -138,6 +138,9 @@ type Context interface { // Get returns a value associated with the given key. Get(ContextKey) interface{} + // ComputeIfAbsent computes a value if a value associated with the given key is absent and returns the value. + ComputeIfAbsent(ContextKey, func() interface{}) interface{} + // Set sets the given value to the context. Set(ContextKey, interface{}) @@ -252,6 +255,15 @@ func (p *parseContext) Get(key ContextKey) interface{} { return p.store[key] } +func (p *parseContext) ComputeIfAbsent(key ContextKey, f func() interface{}) interface{} { + v := p.store[key] + if v == nil { + v = f() + p.store[key] = v + } + return v +} + func (p *parseContext) Set(key ContextKey, value interface{}) { p.store[key] = value } @@ -1103,6 +1115,12 @@ func (p *parser) walkBlock(block ast.Node, cb func(node ast.Node)) { cb(block) } +const ( + lineBreakHard uint8 = 1 << iota + lineBreakSoft + lineBreakVisible +) + func (p *parser) parseBlock(block text.BlockReader, parent ast.Node, pc Context) { if parent.IsRaw() { return @@ -1117,21 +1135,25 @@ func (p *parser) parseBlock(block text.BlockReader, parent ast.Node, pc Context) break } lineLength := len(line) - hardlineBreak := false - softLinebreak := line[lineLength-1] == '\n' - if lineLength >= 2 && line[lineLength-2] == '\\' && softLinebreak { // ends with \\n + var lineBreakFlags uint8 = 0 + hasNewLine := line[lineLength-1] == '\n' + if ((lineLength >= 3 && line[lineLength-2] == '\\' && line[lineLength-3] != '\\') || (lineLength == 2 && line[lineLength-2] == '\\')) && hasNewLine { // ends with \\n lineLength -= 2 - hardlineBreak = true - - } else if lineLength >= 3 && line[lineLength-3] == '\\' && line[lineLength-2] == '\r' && softLinebreak { // ends with \\r\n + lineBreakFlags |= lineBreakHard | lineBreakVisible + } else if ((lineLength >= 4 && line[lineLength-3] == '\\' && line[lineLength-2] == '\r' && line[lineLength-4] != '\\') || (lineLength == 3 && line[lineLength-3] == '\\' && line[lineLength-2] == '\r')) && hasNewLine { // ends with \\r\n lineLength -= 3 - hardlineBreak = true - } else if lineLength >= 3 && line[lineLength-3] == ' ' && line[lineLength-2] == ' ' && softLinebreak { // ends with [space][space]\n + lineBreakFlags |= lineBreakHard | lineBreakVisible + } else if lineLength >= 3 && line[lineLength-3] == ' ' && line[lineLength-2] == ' ' && hasNewLine { // ends with [space][space]\n lineLength -= 3 - hardlineBreak = true - } else if lineLength >= 4 && line[lineLength-4] == ' ' && line[lineLength-3] == ' ' && line[lineLength-2] == '\r' && softLinebreak { // ends with [space][space]\r\n + lineBreakFlags |= lineBreakHard + } else if lineLength >= 4 && line[lineLength-4] == ' ' && line[lineLength-3] == ' ' && line[lineLength-2] == '\r' && hasNewLine { // ends with [space][space]\r\n lineLength -= 4 - hardlineBreak = true + lineBreakFlags |= lineBreakHard + } else if hasNewLine { + // If the line ends with a newline character, but it is not a hardlineBreak, then it is a softLinebreak + // If the line ends with a hardlineBreak, then it cannot end with a softLinebreak + // See https://spec.commonmark.org/0.30/#soft-line-breaks + lineBreakFlags |= lineBreakSoft } l, startPosition := block.Position() @@ -1195,11 +1217,14 @@ func (p *parser) parseBlock(block text.BlockReader, parent ast.Node, pc Context) continue } diff := startPosition.Between(currentPosition) - stop := diff.Stop - rest := diff.WithStop(stop) - text := ast.NewTextSegment(rest.TrimRightSpace(source)) - text.SetSoftLineBreak(softLinebreak) - text.SetHardLineBreak(hardlineBreak) + var text *ast.Text + if lineBreakFlags&(lineBreakHard|lineBreakVisible) == lineBreakHard|lineBreakVisible { + text = ast.NewTextSegment(diff) + } else { + text = ast.NewTextSegment(diff.TrimRightSpace(source)) + } + text.SetSoftLineBreak(lineBreakFlags&lineBreakSoft != 0) + text.SetHardLineBreak(lineBreakFlags&lineBreakHard != 0) parent.AppendChild(parent, text) block.AdvanceLine() } diff --git a/vendor/github.com/yuin/goldmark/parser/raw_html.go b/vendor/github.com/yuin/goldmark/parser/raw_html.go index d7ba414ff21b3..55b9a99678e0a 100644 --- a/vendor/github.com/yuin/goldmark/parser/raw_html.go +++ b/vendor/github.com/yuin/goldmark/parser/raw_html.go @@ -2,10 +2,11 @@ package parser import ( "bytes" + "regexp" + "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/text" "github.com/yuin/goldmark/util" - "regexp" ) type rawHTMLParser struct { @@ -31,43 +32,101 @@ func (s *rawHTMLParser) Parse(parent ast.Node, block text.Reader, pc Context) as if len(line) > 2 && line[1] == '/' && util.IsAlphaNumeric(line[2]) { return s.parseMultiLineRegexp(closeTagRegexp, block, pc) } - if bytes.HasPrefix(line, []byte("|`) -var processingInstructionRegexp = regexp.MustCompile(`^(?:<\?).*?(?:\?>)`) -var declRegexp = regexp.MustCompile(`^]*>`) -var cdataRegexp = regexp.MustCompile(``) -func (s *rawHTMLParser) parseSingleLineRegexp(reg *regexp.Regexp, block text.Reader, pc Context) ast.Node { +var openProcessingInstruction = []byte("") +var openCDATA = []byte("") +var closeDecl = []byte(">") +var emptyComment = []byte("") +var invalidComment1 = []byte("") +var invalidComment2 = []byte("") +var openComment = []byte("") +var doubleHyphen = []byte("--") + +func (s *rawHTMLParser) parseComment(block text.Reader, pc Context) ast.Node { + savedLine, savedSegment := block.Position() + node := ast.NewRawHTML() line, segment := block.PeekLine() - match := reg.FindSubmatchIndex(line) - if match == nil { + if bytes.HasPrefix(line, emptyComment) { + node.Segments.Append(segment.WithStop(segment.Start + len(emptyComment))) + block.Advance(len(emptyComment)) + return node + } + if bytes.HasPrefix(line, invalidComment1) || bytes.HasPrefix(line, invalidComment2) { return nil } - node := ast.NewRawHTML() - node.Segments.Append(segment.WithStop(segment.Start + match[1])) - block.Advance(match[1]) - return node + offset := len(openComment) + line = line[offset:] + for { + hindex := bytes.Index(line, doubleHyphen) + if hindex > -1 { + hindex += offset + } + index := bytes.Index(line, closeComment) + offset + if index > -1 && hindex == index { + if index == 0 || len(line) < 2 || line[index-offset-1] != '-' { + node.Segments.Append(segment.WithStop(segment.Start + index + len(closeComment))) + block.Advance(index + len(closeComment)) + return node + } + } + if hindex > 0 { + break + } + node.Segments.Append(segment) + block.AdvanceLine() + line, segment = block.PeekLine() + offset = 0 + if line == nil { + break + } + } + block.SetPosition(savedLine, savedSegment) + return nil } -var dummyMatch = [][]byte{} +func (s *rawHTMLParser) parseUntil(block text.Reader, closer []byte, pc Context) ast.Node { + savedLine, savedSegment := block.Position() + node := ast.NewRawHTML() + for { + line, segment := block.PeekLine() + if line == nil { + break + } + index := bytes.Index(line, closer) + if index > -1 { + node.Segments.Append(segment.WithStop(segment.Start + index + len(closer))) + block.Advance(index + len(closer)) + return node + } + node.Segments.Append(segment) + block.AdvanceLine() + } + block.SetPosition(savedLine, savedSegment) + return nil +} func (s *rawHTMLParser) parseMultiLineRegexp(reg *regexp.Regexp, block text.Reader, pc Context) ast.Node { sline, ssegment := block.Position() @@ -102,7 +161,3 @@ func (s *rawHTMLParser) parseMultiLineRegexp(reg *regexp.Regexp, block text.Read } return nil } - -func (s *rawHTMLParser) CloseBlock(parent ast.Node, pc Context) { - // nothing to do -} diff --git a/vendor/github.com/yuin/goldmark/renderer/html/html.go b/vendor/github.com/yuin/goldmark/renderer/html/html.go index 537a256feb1a0..12fa7ce2cdb97 100644 --- a/vendor/github.com/yuin/goldmark/renderer/html/html.go +++ b/vendor/github.com/yuin/goldmark/renderer/html/html.go @@ -198,16 +198,24 @@ func (r *Renderer) writeLines(w util.BufWriter, source []byte, n ast.Node) { var GlobalAttributeFilter = util.NewBytesFilter( []byte("accesskey"), []byte("autocapitalize"), + []byte("autofocus"), []byte("class"), []byte("contenteditable"), - []byte("contextmenu"), []byte("dir"), []byte("draggable"), - []byte("dropzone"), + []byte("enterkeyhint"), []byte("hidden"), []byte("id"), + []byte("inert"), + []byte("inputmode"), + []byte("is"), + []byte("itemid"), []byte("itemprop"), + []byte("itemref"), + []byte("itemscope"), + []byte("itemtype"), []byte("lang"), + []byte("part"), []byte("slot"), []byte("spellcheck"), []byte("style"), @@ -296,7 +304,7 @@ func (r *Renderer) renderHTMLBlock(w util.BufWriter, source []byte, node ast.Nod l := n.Lines().Len() for i := 0; i < l; i++ { line := n.Lines().At(i) - _, _ = w.Write(line.Value(source)) + r.Writer.SecureWrite(w, line.Value(source)) } } else { _, _ = w.WriteString("\n") @@ -305,7 +313,7 @@ func (r *Renderer) renderHTMLBlock(w util.BufWriter, source []byte, node ast.Nod if n.HasClosure() { if r.Unsafe { closure := n.ClosureLine - _, _ = w.Write(closure.Value(source)) + r.Writer.SecureWrite(w, closure.Value(source)) } else { _, _ = w.WriteString("\n") } @@ -318,6 +326,7 @@ func (r *Renderer) renderHTMLBlock(w util.BufWriter, source []byte, node ast.Nod var ListAttributeFilter = GlobalAttributeFilter.Extend( []byte("start"), []byte("reversed"), + []byte("type"), ) func (r *Renderer) renderList(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { @@ -476,9 +485,7 @@ func (r *Renderer) renderCodeSpan(w util.BufWriter, source []byte, n ast.Node, e value := segment.Value(source) if bytes.HasSuffix(value, []byte("\n")) { r.Writer.RawWrite(w, value[:len(value)-1]) - if c != n.LastChild() { - r.Writer.RawWrite(w, []byte(" ")) - } + r.Writer.RawWrite(w, []byte(" ")) } else { r.Writer.RawWrite(w, value) } @@ -564,7 +571,7 @@ func (r *Renderer) renderImage(w util.BufWriter, source []byte, node ast.Node, e _, _ = w.Write(util.EscapeHTML(util.URLEscape(n.Destination, true))) } _, _ = w.WriteString(`" alt="`) - _, _ = w.Write(n.Text(source)) + _, _ = w.Write(util.EscapeHTML(n.Text(source))) _ = w.WriteByte('"') if n.Title != nil { _, _ = w.WriteString(` title="`) @@ -669,8 +676,13 @@ type Writer interface { // RawWrite writes the given source to writer without resolving references and // unescaping backslash escaped characters. RawWrite(writer util.BufWriter, source []byte) + + // SecureWrite writes the given source to writer with replacing insecure characters. + SecureWrite(writer util.BufWriter, source []byte) } +var replacementCharacter = []byte("\ufffd") + type defaultWriter struct { } @@ -685,6 +697,23 @@ func escapeRune(writer util.BufWriter, r rune) { _, _ = writer.WriteRune(util.ToValidRune(r)) } +func (d *defaultWriter) SecureWrite(writer util.BufWriter, source []byte) { + n := 0 + l := len(source) + for i := 0; i < l; i++ { + if source[i] == '\u0000' { + _, _ = writer.Write(source[i-n : i]) + n = 0 + _, _ = writer.Write(replacementCharacter) + continue + } + n++ + } + if n != 0 { + _, _ = writer.Write(source[l-n:]) + } +} + func (d *defaultWriter) RawWrite(writer util.BufWriter, source []byte) { n := 0 l := len(source) @@ -718,6 +747,13 @@ func (d *defaultWriter) Write(writer util.BufWriter, source []byte) { continue } } + if c == '\x00' { + d.RawWrite(writer, source[n:i]) + d.RawWrite(writer, replacementCharacter) + n = i + 1 + escaped = false + continue + } if c == '&' { pos := i next := i + 1 @@ -729,7 +765,7 @@ func (d *defaultWriter) Write(writer util.BufWriter, source []byte) { if nnext < limit && nc == 'x' || nc == 'X' { start := nnext + 1 i, ok = util.ReadWhile(source, [2]int{start, limit}, util.IsHexDecimal) - if ok && i < limit && source[i] == ';' { + if ok && i < limit && source[i] == ';' && i-start < 7 { v, _ := strconv.ParseUint(util.BytesToReadOnlyString(source[start:i]), 16, 32) d.RawWrite(writer, source[n:pos]) n = i + 1 @@ -741,7 +777,7 @@ func (d *defaultWriter) Write(writer util.BufWriter, source []byte) { start := nnext i, ok = util.ReadWhile(source, [2]int{start, limit}, util.IsNumeric) if ok && i < limit && i-start < 8 && source[i] == ';' { - v, _ := strconv.ParseUint(util.BytesToReadOnlyString(source[start:i]), 0, 32) + v, _ := strconv.ParseUint(util.BytesToReadOnlyString(source[start:i]), 10, 32) d.RawWrite(writer, source[n:pos]) n = i + 1 escapeRune(writer, rune(v)) @@ -783,6 +819,7 @@ var bPng = []byte("png;") var bGif = []byte("gif;") var bJpeg = []byte("jpeg;") var bWebp = []byte("webp;") +var bSvg = []byte("svg;") var bJs = []byte("javascript:") var bVb = []byte("vbscript:") var bFile = []byte("file:") @@ -794,7 +831,8 @@ func IsDangerousURL(url []byte) bool { if bytes.HasPrefix(url, bDataImage) && len(url) >= 11 { v := url[11:] if bytes.HasPrefix(v, bPng) || bytes.HasPrefix(v, bGif) || - bytes.HasPrefix(v, bJpeg) || bytes.HasPrefix(v, bWebp) { + bytes.HasPrefix(v, bJpeg) || bytes.HasPrefix(v, bWebp) || + bytes.HasPrefix(v, bSvg) { return false } return true diff --git a/vendor/github.com/yuin/goldmark/text/reader.go b/vendor/github.com/yuin/goldmark/text/reader.go index df25e5457cc85..319f1c8b8248e 100644 --- a/vendor/github.com/yuin/goldmark/text/reader.go +++ b/vendor/github.com/yuin/goldmark/text/reader.go @@ -70,6 +70,28 @@ type Reader interface { // Match performs regular expression searching to current line. FindSubMatch(reg *regexp.Regexp) [][]byte + + // FindClosure finds corresponding closure. + FindClosure(opener, closer byte, options FindClosureOptions) (*Segments, bool) +} + +// FindClosureOptions is options for Reader.FindClosure +type FindClosureOptions struct { + // CodeSpan is a flag for the FindClosure. If this is set to true, + // FindClosure ignores closers in codespans. + CodeSpan bool + + // Nesting is a flag for the FindClosure. If this is set to true, + // FindClosure allows nesting. + Nesting bool + + // Newline is a flag for the FindClosure. If this is set to true, + // FindClosure searches for a closer over multiple lines. + Newline bool + + // Advance is a flag for the FindClosure. If this is set to true, + // FindClosure advances pointers when closer is found. + Advance bool } type reader struct { @@ -92,6 +114,10 @@ func NewReader(source []byte) Reader { return r } +func (r *reader) FindClosure(opener, closer byte, options FindClosureOptions) (*Segments, bool) { + return findClosureReader(r, opener, closer, options) +} + func (r *reader) ResetPosition() { r.line = -1 r.head = 0 @@ -272,6 +298,10 @@ func NewBlockReader(source []byte, segments *Segments) BlockReader { return r } +func (r *blockReader) FindClosure(opener, closer byte, options FindClosureOptions) (*Segments, bool) { + return findClosureReader(r, opener, closer, options) +} + func (r *blockReader) ResetPosition() { r.line = -1 r.head = 0 @@ -541,3 +571,83 @@ func readRuneReader(r Reader) (rune, int, error) { r.Advance(size) return rn, size, nil } + +func findClosureReader(r Reader, opener, closer byte, opts FindClosureOptions) (*Segments, bool) { + opened := 1 + codeSpanOpener := 0 + closed := false + orgline, orgpos := r.Position() + var ret *Segments + + for { + bs, seg := r.PeekLine() + if bs == nil { + goto end + } + i := 0 + for i < len(bs) { + c := bs[i] + if opts.CodeSpan && codeSpanOpener != 0 && c == '`' { + codeSpanCloser := 0 + for ; i < len(bs); i++ { + if bs[i] == '`' { + codeSpanCloser++ + } else { + i-- + break + } + } + if codeSpanCloser == codeSpanOpener { + codeSpanOpener = 0 + } + } else if codeSpanOpener == 0 && c == '\\' && i < len(bs)-1 && util.IsPunct(bs[i+1]) { + i += 2 + continue + } else if opts.CodeSpan && codeSpanOpener == 0 && c == '`' { + for ; i < len(bs); i++ { + if bs[i] == '`' { + codeSpanOpener++ + } else { + i-- + break + } + } + } else if (opts.CodeSpan && codeSpanOpener == 0) || !opts.CodeSpan { + if c == closer { + opened-- + if opened == 0 { + if ret == nil { + ret = NewSegments() + } + ret.Append(seg.WithStop(seg.Start + i)) + r.Advance(i + 1) + closed = true + goto end + } + } else if c == opener { + if !opts.Nesting { + goto end + } + opened++ + } + } + i++ + } + if !opts.Newline { + goto end + } + r.AdvanceLine() + if ret == nil { + ret = NewSegments() + } + ret.Append(seg) + } +end: + if !opts.Advance { + r.SetPosition(orgline, orgpos) + } + if closed { + return ret, true + } + return nil, false +} diff --git a/vendor/github.com/yuin/goldmark/util/unicode_case_folding.go b/vendor/github.com/yuin/goldmark/util/unicode_case_folding.go index f66ee7c43ece0..f0e6aa4b86e44 100644 --- a/vendor/github.com/yuin/goldmark/util/unicode_case_folding.go +++ b/vendor/github.com/yuin/goldmark/util/unicode_case_folding.go @@ -1,1491 +1,1534 @@ package util -var unicodeCaseFoldings = map[rune][]rune{ - 0x41: []int32{97}, - 0x42: []int32{98}, - 0x43: []int32{99}, - 0x44: []int32{100}, - 0x45: []int32{101}, - 0x46: []int32{102}, - 0x47: []int32{103}, - 0x48: []int32{104}, - 0x49: []int32{105}, - 0x4a: []int32{106}, - 0x4b: []int32{107}, - 0x4c: []int32{108}, - 0x4d: []int32{109}, - 0x4e: []int32{110}, - 0x4f: []int32{111}, - 0x50: []int32{112}, - 0x51: []int32{113}, - 0x52: []int32{114}, - 0x53: []int32{115}, - 0x54: []int32{116}, - 0x55: []int32{117}, - 0x56: []int32{118}, - 0x57: []int32{119}, - 0x58: []int32{120}, - 0x59: []int32{121}, - 0x5a: []int32{122}, - 0xb5: []int32{956}, - 0xc0: []int32{224}, - 0xc1: []int32{225}, - 0xc2: []int32{226}, - 0xc3: []int32{227}, - 0xc4: []int32{228}, - 0xc5: []int32{229}, - 0xc6: []int32{230}, - 0xc7: []int32{231}, - 0xc8: []int32{232}, - 0xc9: []int32{233}, - 0xca: []int32{234}, - 0xcb: []int32{235}, - 0xcc: []int32{236}, - 0xcd: []int32{237}, - 0xce: []int32{238}, - 0xcf: []int32{239}, - 0xd0: []int32{240}, - 0xd1: []int32{241}, - 0xd2: []int32{242}, - 0xd3: []int32{243}, - 0xd4: []int32{244}, - 0xd5: []int32{245}, - 0xd6: []int32{246}, - 0xd8: []int32{248}, - 0xd9: []int32{249}, - 0xda: []int32{250}, - 0xdb: []int32{251}, - 0xdc: []int32{252}, - 0xdd: []int32{253}, - 0xde: []int32{254}, - 0xdf: []int32{115, 115}, - 0x100: []int32{257}, - 0x102: []int32{259}, - 0x104: []int32{261}, - 0x106: []int32{263}, - 0x108: []int32{265}, - 0x10a: []int32{267}, - 0x10c: []int32{269}, - 0x10e: []int32{271}, - 0x110: []int32{273}, - 0x112: []int32{275}, - 0x114: []int32{277}, - 0x116: []int32{279}, - 0x118: []int32{281}, - 0x11a: []int32{283}, - 0x11c: []int32{285}, - 0x11e: []int32{287}, - 0x120: []int32{289}, - 0x122: []int32{291}, - 0x124: []int32{293}, - 0x126: []int32{295}, - 0x128: []int32{297}, - 0x12a: []int32{299}, - 0x12c: []int32{301}, - 0x12e: []int32{303}, - 0x130: []int32{105, 775}, - 0x132: []int32{307}, - 0x134: []int32{309}, - 0x136: []int32{311}, - 0x139: []int32{314}, - 0x13b: []int32{316}, - 0x13d: []int32{318}, - 0x13f: []int32{320}, - 0x141: []int32{322}, - 0x143: []int32{324}, - 0x145: []int32{326}, - 0x147: []int32{328}, - 0x149: []int32{700, 110}, - 0x14a: []int32{331}, - 0x14c: []int32{333}, - 0x14e: []int32{335}, - 0x150: []int32{337}, - 0x152: []int32{339}, - 0x154: []int32{341}, - 0x156: []int32{343}, - 0x158: []int32{345}, - 0x15a: []int32{347}, - 0x15c: []int32{349}, - 0x15e: []int32{351}, - 0x160: []int32{353}, - 0x162: []int32{355}, - 0x164: []int32{357}, - 0x166: []int32{359}, - 0x168: []int32{361}, - 0x16a: []int32{363}, - 0x16c: []int32{365}, - 0x16e: []int32{367}, - 0x170: []int32{369}, - 0x172: []int32{371}, - 0x174: []int32{373}, - 0x176: []int32{375}, - 0x178: []int32{255}, - 0x179: []int32{378}, - 0x17b: []int32{380}, - 0x17d: []int32{382}, - 0x17f: []int32{115}, - 0x181: []int32{595}, - 0x182: []int32{387}, - 0x184: []int32{389}, - 0x186: []int32{596}, - 0x187: []int32{392}, - 0x189: []int32{598}, - 0x18a: []int32{599}, - 0x18b: []int32{396}, - 0x18e: []int32{477}, - 0x18f: []int32{601}, - 0x190: []int32{603}, - 0x191: []int32{402}, - 0x193: []int32{608}, - 0x194: []int32{611}, - 0x196: []int32{617}, - 0x197: []int32{616}, - 0x198: []int32{409}, - 0x19c: []int32{623}, - 0x19d: []int32{626}, - 0x19f: []int32{629}, - 0x1a0: []int32{417}, - 0x1a2: []int32{419}, - 0x1a4: []int32{421}, - 0x1a6: []int32{640}, - 0x1a7: []int32{424}, - 0x1a9: []int32{643}, - 0x1ac: []int32{429}, - 0x1ae: []int32{648}, - 0x1af: []int32{432}, - 0x1b1: []int32{650}, - 0x1b2: []int32{651}, - 0x1b3: []int32{436}, - 0x1b5: []int32{438}, - 0x1b7: []int32{658}, - 0x1b8: []int32{441}, - 0x1bc: []int32{445}, - 0x1c4: []int32{454}, - 0x1c5: []int32{454}, - 0x1c7: []int32{457}, - 0x1c8: []int32{457}, - 0x1ca: []int32{460}, - 0x1cb: []int32{460}, - 0x1cd: []int32{462}, - 0x1cf: []int32{464}, - 0x1d1: []int32{466}, - 0x1d3: []int32{468}, - 0x1d5: []int32{470}, - 0x1d7: []int32{472}, - 0x1d9: []int32{474}, - 0x1db: []int32{476}, - 0x1de: []int32{479}, - 0x1e0: []int32{481}, - 0x1e2: []int32{483}, - 0x1e4: []int32{485}, - 0x1e6: []int32{487}, - 0x1e8: []int32{489}, - 0x1ea: []int32{491}, - 0x1ec: []int32{493}, - 0x1ee: []int32{495}, - 0x1f0: []int32{106, 780}, - 0x1f1: []int32{499}, - 0x1f2: []int32{499}, - 0x1f4: []int32{501}, - 0x1f6: []int32{405}, - 0x1f7: []int32{447}, - 0x1f8: []int32{505}, - 0x1fa: []int32{507}, - 0x1fc: []int32{509}, - 0x1fe: []int32{511}, - 0x200: []int32{513}, - 0x202: []int32{515}, - 0x204: []int32{517}, - 0x206: []int32{519}, - 0x208: []int32{521}, - 0x20a: []int32{523}, - 0x20c: []int32{525}, - 0x20e: []int32{527}, - 0x210: []int32{529}, - 0x212: []int32{531}, - 0x214: []int32{533}, - 0x216: []int32{535}, - 0x218: []int32{537}, - 0x21a: []int32{539}, - 0x21c: []int32{541}, - 0x21e: []int32{543}, - 0x220: []int32{414}, - 0x222: []int32{547}, - 0x224: []int32{549}, - 0x226: []int32{551}, - 0x228: []int32{553}, - 0x22a: []int32{555}, - 0x22c: []int32{557}, - 0x22e: []int32{559}, - 0x230: []int32{561}, - 0x232: []int32{563}, - 0x23a: []int32{11365}, - 0x23b: []int32{572}, - 0x23d: []int32{410}, - 0x23e: []int32{11366}, - 0x241: []int32{578}, - 0x243: []int32{384}, - 0x244: []int32{649}, - 0x245: []int32{652}, - 0x246: []int32{583}, - 0x248: []int32{585}, - 0x24a: []int32{587}, - 0x24c: []int32{589}, - 0x24e: []int32{591}, - 0x345: []int32{953}, - 0x370: []int32{881}, - 0x372: []int32{883}, - 0x376: []int32{887}, - 0x37f: []int32{1011}, - 0x386: []int32{940}, - 0x388: []int32{941}, - 0x389: []int32{942}, - 0x38a: []int32{943}, - 0x38c: []int32{972}, - 0x38e: []int32{973}, - 0x38f: []int32{974}, - 0x390: []int32{953, 776, 769}, - 0x391: []int32{945}, - 0x392: []int32{946}, - 0x393: []int32{947}, - 0x394: []int32{948}, - 0x395: []int32{949}, - 0x396: []int32{950}, - 0x397: []int32{951}, - 0x398: []int32{952}, - 0x399: []int32{953}, - 0x39a: []int32{954}, - 0x39b: []int32{955}, - 0x39c: []int32{956}, - 0x39d: []int32{957}, - 0x39e: []int32{958}, - 0x39f: []int32{959}, - 0x3a0: []int32{960}, - 0x3a1: []int32{961}, - 0x3a3: []int32{963}, - 0x3a4: []int32{964}, - 0x3a5: []int32{965}, - 0x3a6: []int32{966}, - 0x3a7: []int32{967}, - 0x3a8: []int32{968}, - 0x3a9: []int32{969}, - 0x3aa: []int32{970}, - 0x3ab: []int32{971}, - 0x3b0: []int32{965, 776, 769}, - 0x3c2: []int32{963}, - 0x3cf: []int32{983}, - 0x3d0: []int32{946}, - 0x3d1: []int32{952}, - 0x3d5: []int32{966}, - 0x3d6: []int32{960}, - 0x3d8: []int32{985}, - 0x3da: []int32{987}, - 0x3dc: []int32{989}, - 0x3de: []int32{991}, - 0x3e0: []int32{993}, - 0x3e2: []int32{995}, - 0x3e4: []int32{997}, - 0x3e6: []int32{999}, - 0x3e8: []int32{1001}, - 0x3ea: []int32{1003}, - 0x3ec: []int32{1005}, - 0x3ee: []int32{1007}, - 0x3f0: []int32{954}, - 0x3f1: []int32{961}, - 0x3f4: []int32{952}, - 0x3f5: []int32{949}, - 0x3f7: []int32{1016}, - 0x3f9: []int32{1010}, - 0x3fa: []int32{1019}, - 0x3fd: []int32{891}, - 0x3fe: []int32{892}, - 0x3ff: []int32{893}, - 0x400: []int32{1104}, - 0x401: []int32{1105}, - 0x402: []int32{1106}, - 0x403: []int32{1107}, - 0x404: []int32{1108}, - 0x405: []int32{1109}, - 0x406: []int32{1110}, - 0x407: []int32{1111}, - 0x408: []int32{1112}, - 0x409: []int32{1113}, - 0x40a: []int32{1114}, - 0x40b: []int32{1115}, - 0x40c: []int32{1116}, - 0x40d: []int32{1117}, - 0x40e: []int32{1118}, - 0x40f: []int32{1119}, - 0x410: []int32{1072}, - 0x411: []int32{1073}, - 0x412: []int32{1074}, - 0x413: []int32{1075}, - 0x414: []int32{1076}, - 0x415: []int32{1077}, - 0x416: []int32{1078}, - 0x417: []int32{1079}, - 0x418: []int32{1080}, - 0x419: []int32{1081}, - 0x41a: []int32{1082}, - 0x41b: []int32{1083}, - 0x41c: []int32{1084}, - 0x41d: []int32{1085}, - 0x41e: []int32{1086}, - 0x41f: []int32{1087}, - 0x420: []int32{1088}, - 0x421: []int32{1089}, - 0x422: []int32{1090}, - 0x423: []int32{1091}, - 0x424: []int32{1092}, - 0x425: []int32{1093}, - 0x426: []int32{1094}, - 0x427: []int32{1095}, - 0x428: []int32{1096}, - 0x429: []int32{1097}, - 0x42a: []int32{1098}, - 0x42b: []int32{1099}, - 0x42c: []int32{1100}, - 0x42d: []int32{1101}, - 0x42e: []int32{1102}, - 0x42f: []int32{1103}, - 0x460: []int32{1121}, - 0x462: []int32{1123}, - 0x464: []int32{1125}, - 0x466: []int32{1127}, - 0x468: []int32{1129}, - 0x46a: []int32{1131}, - 0x46c: []int32{1133}, - 0x46e: []int32{1135}, - 0x470: []int32{1137}, - 0x472: []int32{1139}, - 0x474: []int32{1141}, - 0x476: []int32{1143}, - 0x478: []int32{1145}, - 0x47a: []int32{1147}, - 0x47c: []int32{1149}, - 0x47e: []int32{1151}, - 0x480: []int32{1153}, - 0x48a: []int32{1163}, - 0x48c: []int32{1165}, - 0x48e: []int32{1167}, - 0x490: []int32{1169}, - 0x492: []int32{1171}, - 0x494: []int32{1173}, - 0x496: []int32{1175}, - 0x498: []int32{1177}, - 0x49a: []int32{1179}, - 0x49c: []int32{1181}, - 0x49e: []int32{1183}, - 0x4a0: []int32{1185}, - 0x4a2: []int32{1187}, - 0x4a4: []int32{1189}, - 0x4a6: []int32{1191}, - 0x4a8: []int32{1193}, - 0x4aa: []int32{1195}, - 0x4ac: []int32{1197}, - 0x4ae: []int32{1199}, - 0x4b0: []int32{1201}, - 0x4b2: []int32{1203}, - 0x4b4: []int32{1205}, - 0x4b6: []int32{1207}, - 0x4b8: []int32{1209}, - 0x4ba: []int32{1211}, - 0x4bc: []int32{1213}, - 0x4be: []int32{1215}, - 0x4c0: []int32{1231}, - 0x4c1: []int32{1218}, - 0x4c3: []int32{1220}, - 0x4c5: []int32{1222}, - 0x4c7: []int32{1224}, - 0x4c9: []int32{1226}, - 0x4cb: []int32{1228}, - 0x4cd: []int32{1230}, - 0x4d0: []int32{1233}, - 0x4d2: []int32{1235}, - 0x4d4: []int32{1237}, - 0x4d6: []int32{1239}, - 0x4d8: []int32{1241}, - 0x4da: []int32{1243}, - 0x4dc: []int32{1245}, - 0x4de: []int32{1247}, - 0x4e0: []int32{1249}, - 0x4e2: []int32{1251}, - 0x4e4: []int32{1253}, - 0x4e6: []int32{1255}, - 0x4e8: []int32{1257}, - 0x4ea: []int32{1259}, - 0x4ec: []int32{1261}, - 0x4ee: []int32{1263}, - 0x4f0: []int32{1265}, - 0x4f2: []int32{1267}, - 0x4f4: []int32{1269}, - 0x4f6: []int32{1271}, - 0x4f8: []int32{1273}, - 0x4fa: []int32{1275}, - 0x4fc: []int32{1277}, - 0x4fe: []int32{1279}, - 0x500: []int32{1281}, - 0x502: []int32{1283}, - 0x504: []int32{1285}, - 0x506: []int32{1287}, - 0x508: []int32{1289}, - 0x50a: []int32{1291}, - 0x50c: []int32{1293}, - 0x50e: []int32{1295}, - 0x510: []int32{1297}, - 0x512: []int32{1299}, - 0x514: []int32{1301}, - 0x516: []int32{1303}, - 0x518: []int32{1305}, - 0x51a: []int32{1307}, - 0x51c: []int32{1309}, - 0x51e: []int32{1311}, - 0x520: []int32{1313}, - 0x522: []int32{1315}, - 0x524: []int32{1317}, - 0x526: []int32{1319}, - 0x528: []int32{1321}, - 0x52a: []int32{1323}, - 0x52c: []int32{1325}, - 0x52e: []int32{1327}, - 0x531: []int32{1377}, - 0x532: []int32{1378}, - 0x533: []int32{1379}, - 0x534: []int32{1380}, - 0x535: []int32{1381}, - 0x536: []int32{1382}, - 0x537: []int32{1383}, - 0x538: []int32{1384}, - 0x539: []int32{1385}, - 0x53a: []int32{1386}, - 0x53b: []int32{1387}, - 0x53c: []int32{1388}, - 0x53d: []int32{1389}, - 0x53e: []int32{1390}, - 0x53f: []int32{1391}, - 0x540: []int32{1392}, - 0x541: []int32{1393}, - 0x542: []int32{1394}, - 0x543: []int32{1395}, - 0x544: []int32{1396}, - 0x545: []int32{1397}, - 0x546: []int32{1398}, - 0x547: []int32{1399}, - 0x548: []int32{1400}, - 0x549: []int32{1401}, - 0x54a: []int32{1402}, - 0x54b: []int32{1403}, - 0x54c: []int32{1404}, - 0x54d: []int32{1405}, - 0x54e: []int32{1406}, - 0x54f: []int32{1407}, - 0x550: []int32{1408}, - 0x551: []int32{1409}, - 0x552: []int32{1410}, - 0x553: []int32{1411}, - 0x554: []int32{1412}, - 0x555: []int32{1413}, - 0x556: []int32{1414}, - 0x587: []int32{1381, 1410}, - 0x10a0: []int32{11520}, - 0x10a1: []int32{11521}, - 0x10a2: []int32{11522}, - 0x10a3: []int32{11523}, - 0x10a4: []int32{11524}, - 0x10a5: []int32{11525}, - 0x10a6: []int32{11526}, - 0x10a7: []int32{11527}, - 0x10a8: []int32{11528}, - 0x10a9: []int32{11529}, - 0x10aa: []int32{11530}, - 0x10ab: []int32{11531}, - 0x10ac: []int32{11532}, - 0x10ad: []int32{11533}, - 0x10ae: []int32{11534}, - 0x10af: []int32{11535}, - 0x10b0: []int32{11536}, - 0x10b1: []int32{11537}, - 0x10b2: []int32{11538}, - 0x10b3: []int32{11539}, - 0x10b4: []int32{11540}, - 0x10b5: []int32{11541}, - 0x10b6: []int32{11542}, - 0x10b7: []int32{11543}, - 0x10b8: []int32{11544}, - 0x10b9: []int32{11545}, - 0x10ba: []int32{11546}, - 0x10bb: []int32{11547}, - 0x10bc: []int32{11548}, - 0x10bd: []int32{11549}, - 0x10be: []int32{11550}, - 0x10bf: []int32{11551}, - 0x10c0: []int32{11552}, - 0x10c1: []int32{11553}, - 0x10c2: []int32{11554}, - 0x10c3: []int32{11555}, - 0x10c4: []int32{11556}, - 0x10c5: []int32{11557}, - 0x10c7: []int32{11559}, - 0x10cd: []int32{11565}, - 0x13f8: []int32{5104}, - 0x13f9: []int32{5105}, - 0x13fa: []int32{5106}, - 0x13fb: []int32{5107}, - 0x13fc: []int32{5108}, - 0x13fd: []int32{5109}, - 0x1c80: []int32{1074}, - 0x1c81: []int32{1076}, - 0x1c82: []int32{1086}, - 0x1c83: []int32{1089}, - 0x1c84: []int32{1090}, - 0x1c85: []int32{1090}, - 0x1c86: []int32{1098}, - 0x1c87: []int32{1123}, - 0x1c88: []int32{42571}, - 0x1c90: []int32{4304}, - 0x1c91: []int32{4305}, - 0x1c92: []int32{4306}, - 0x1c93: []int32{4307}, - 0x1c94: []int32{4308}, - 0x1c95: []int32{4309}, - 0x1c96: []int32{4310}, - 0x1c97: []int32{4311}, - 0x1c98: []int32{4312}, - 0x1c99: []int32{4313}, - 0x1c9a: []int32{4314}, - 0x1c9b: []int32{4315}, - 0x1c9c: []int32{4316}, - 0x1c9d: []int32{4317}, - 0x1c9e: []int32{4318}, - 0x1c9f: []int32{4319}, - 0x1ca0: []int32{4320}, - 0x1ca1: []int32{4321}, - 0x1ca2: []int32{4322}, - 0x1ca3: []int32{4323}, - 0x1ca4: []int32{4324}, - 0x1ca5: []int32{4325}, - 0x1ca6: []int32{4326}, - 0x1ca7: []int32{4327}, - 0x1ca8: []int32{4328}, - 0x1ca9: []int32{4329}, - 0x1caa: []int32{4330}, - 0x1cab: []int32{4331}, - 0x1cac: []int32{4332}, - 0x1cad: []int32{4333}, - 0x1cae: []int32{4334}, - 0x1caf: []int32{4335}, - 0x1cb0: []int32{4336}, - 0x1cb1: []int32{4337}, - 0x1cb2: []int32{4338}, - 0x1cb3: []int32{4339}, - 0x1cb4: []int32{4340}, - 0x1cb5: []int32{4341}, - 0x1cb6: []int32{4342}, - 0x1cb7: []int32{4343}, - 0x1cb8: []int32{4344}, - 0x1cb9: []int32{4345}, - 0x1cba: []int32{4346}, - 0x1cbd: []int32{4349}, - 0x1cbe: []int32{4350}, - 0x1cbf: []int32{4351}, - 0x1e00: []int32{7681}, - 0x1e02: []int32{7683}, - 0x1e04: []int32{7685}, - 0x1e06: []int32{7687}, - 0x1e08: []int32{7689}, - 0x1e0a: []int32{7691}, - 0x1e0c: []int32{7693}, - 0x1e0e: []int32{7695}, - 0x1e10: []int32{7697}, - 0x1e12: []int32{7699}, - 0x1e14: []int32{7701}, - 0x1e16: []int32{7703}, - 0x1e18: []int32{7705}, - 0x1e1a: []int32{7707}, - 0x1e1c: []int32{7709}, - 0x1e1e: []int32{7711}, - 0x1e20: []int32{7713}, - 0x1e22: []int32{7715}, - 0x1e24: []int32{7717}, - 0x1e26: []int32{7719}, - 0x1e28: []int32{7721}, - 0x1e2a: []int32{7723}, - 0x1e2c: []int32{7725}, - 0x1e2e: []int32{7727}, - 0x1e30: []int32{7729}, - 0x1e32: []int32{7731}, - 0x1e34: []int32{7733}, - 0x1e36: []int32{7735}, - 0x1e38: []int32{7737}, - 0x1e3a: []int32{7739}, - 0x1e3c: []int32{7741}, - 0x1e3e: []int32{7743}, - 0x1e40: []int32{7745}, - 0x1e42: []int32{7747}, - 0x1e44: []int32{7749}, - 0x1e46: []int32{7751}, - 0x1e48: []int32{7753}, - 0x1e4a: []int32{7755}, - 0x1e4c: []int32{7757}, - 0x1e4e: []int32{7759}, - 0x1e50: []int32{7761}, - 0x1e52: []int32{7763}, - 0x1e54: []int32{7765}, - 0x1e56: []int32{7767}, - 0x1e58: []int32{7769}, - 0x1e5a: []int32{7771}, - 0x1e5c: []int32{7773}, - 0x1e5e: []int32{7775}, - 0x1e60: []int32{7777}, - 0x1e62: []int32{7779}, - 0x1e64: []int32{7781}, - 0x1e66: []int32{7783}, - 0x1e68: []int32{7785}, - 0x1e6a: []int32{7787}, - 0x1e6c: []int32{7789}, - 0x1e6e: []int32{7791}, - 0x1e70: []int32{7793}, - 0x1e72: []int32{7795}, - 0x1e74: []int32{7797}, - 0x1e76: []int32{7799}, - 0x1e78: []int32{7801}, - 0x1e7a: []int32{7803}, - 0x1e7c: []int32{7805}, - 0x1e7e: []int32{7807}, - 0x1e80: []int32{7809}, - 0x1e82: []int32{7811}, - 0x1e84: []int32{7813}, - 0x1e86: []int32{7815}, - 0x1e88: []int32{7817}, - 0x1e8a: []int32{7819}, - 0x1e8c: []int32{7821}, - 0x1e8e: []int32{7823}, - 0x1e90: []int32{7825}, - 0x1e92: []int32{7827}, - 0x1e94: []int32{7829}, - 0x1e96: []int32{104, 817}, - 0x1e97: []int32{116, 776}, - 0x1e98: []int32{119, 778}, - 0x1e99: []int32{121, 778}, - 0x1e9a: []int32{97, 702}, - 0x1e9b: []int32{7777}, - 0x1e9e: []int32{115, 115}, - 0x1ea0: []int32{7841}, - 0x1ea2: []int32{7843}, - 0x1ea4: []int32{7845}, - 0x1ea6: []int32{7847}, - 0x1ea8: []int32{7849}, - 0x1eaa: []int32{7851}, - 0x1eac: []int32{7853}, - 0x1eae: []int32{7855}, - 0x1eb0: []int32{7857}, - 0x1eb2: []int32{7859}, - 0x1eb4: []int32{7861}, - 0x1eb6: []int32{7863}, - 0x1eb8: []int32{7865}, - 0x1eba: []int32{7867}, - 0x1ebc: []int32{7869}, - 0x1ebe: []int32{7871}, - 0x1ec0: []int32{7873}, - 0x1ec2: []int32{7875}, - 0x1ec4: []int32{7877}, - 0x1ec6: []int32{7879}, - 0x1ec8: []int32{7881}, - 0x1eca: []int32{7883}, - 0x1ecc: []int32{7885}, - 0x1ece: []int32{7887}, - 0x1ed0: []int32{7889}, - 0x1ed2: []int32{7891}, - 0x1ed4: []int32{7893}, - 0x1ed6: []int32{7895}, - 0x1ed8: []int32{7897}, - 0x1eda: []int32{7899}, - 0x1edc: []int32{7901}, - 0x1ede: []int32{7903}, - 0x1ee0: []int32{7905}, - 0x1ee2: []int32{7907}, - 0x1ee4: []int32{7909}, - 0x1ee6: []int32{7911}, - 0x1ee8: []int32{7913}, - 0x1eea: []int32{7915}, - 0x1eec: []int32{7917}, - 0x1eee: []int32{7919}, - 0x1ef0: []int32{7921}, - 0x1ef2: []int32{7923}, - 0x1ef4: []int32{7925}, - 0x1ef6: []int32{7927}, - 0x1ef8: []int32{7929}, - 0x1efa: []int32{7931}, - 0x1efc: []int32{7933}, - 0x1efe: []int32{7935}, - 0x1f08: []int32{7936}, - 0x1f09: []int32{7937}, - 0x1f0a: []int32{7938}, - 0x1f0b: []int32{7939}, - 0x1f0c: []int32{7940}, - 0x1f0d: []int32{7941}, - 0x1f0e: []int32{7942}, - 0x1f0f: []int32{7943}, - 0x1f18: []int32{7952}, - 0x1f19: []int32{7953}, - 0x1f1a: []int32{7954}, - 0x1f1b: []int32{7955}, - 0x1f1c: []int32{7956}, - 0x1f1d: []int32{7957}, - 0x1f28: []int32{7968}, - 0x1f29: []int32{7969}, - 0x1f2a: []int32{7970}, - 0x1f2b: []int32{7971}, - 0x1f2c: []int32{7972}, - 0x1f2d: []int32{7973}, - 0x1f2e: []int32{7974}, - 0x1f2f: []int32{7975}, - 0x1f38: []int32{7984}, - 0x1f39: []int32{7985}, - 0x1f3a: []int32{7986}, - 0x1f3b: []int32{7987}, - 0x1f3c: []int32{7988}, - 0x1f3d: []int32{7989}, - 0x1f3e: []int32{7990}, - 0x1f3f: []int32{7991}, - 0x1f48: []int32{8000}, - 0x1f49: []int32{8001}, - 0x1f4a: []int32{8002}, - 0x1f4b: []int32{8003}, - 0x1f4c: []int32{8004}, - 0x1f4d: []int32{8005}, - 0x1f50: []int32{965, 787}, - 0x1f52: []int32{965, 787, 768}, - 0x1f54: []int32{965, 787, 769}, - 0x1f56: []int32{965, 787, 834}, - 0x1f59: []int32{8017}, - 0x1f5b: []int32{8019}, - 0x1f5d: []int32{8021}, - 0x1f5f: []int32{8023}, - 0x1f68: []int32{8032}, - 0x1f69: []int32{8033}, - 0x1f6a: []int32{8034}, - 0x1f6b: []int32{8035}, - 0x1f6c: []int32{8036}, - 0x1f6d: []int32{8037}, - 0x1f6e: []int32{8038}, - 0x1f6f: []int32{8039}, - 0x1f80: []int32{7936, 953}, - 0x1f81: []int32{7937, 953}, - 0x1f82: []int32{7938, 953}, - 0x1f83: []int32{7939, 953}, - 0x1f84: []int32{7940, 953}, - 0x1f85: []int32{7941, 953}, - 0x1f86: []int32{7942, 953}, - 0x1f87: []int32{7943, 953}, - 0x1f88: []int32{7936, 953}, - 0x1f89: []int32{7937, 953}, - 0x1f8a: []int32{7938, 953}, - 0x1f8b: []int32{7939, 953}, - 0x1f8c: []int32{7940, 953}, - 0x1f8d: []int32{7941, 953}, - 0x1f8e: []int32{7942, 953}, - 0x1f8f: []int32{7943, 953}, - 0x1f90: []int32{7968, 953}, - 0x1f91: []int32{7969, 953}, - 0x1f92: []int32{7970, 953}, - 0x1f93: []int32{7971, 953}, - 0x1f94: []int32{7972, 953}, - 0x1f95: []int32{7973, 953}, - 0x1f96: []int32{7974, 953}, - 0x1f97: []int32{7975, 953}, - 0x1f98: []int32{7968, 953}, - 0x1f99: []int32{7969, 953}, - 0x1f9a: []int32{7970, 953}, - 0x1f9b: []int32{7971, 953}, - 0x1f9c: []int32{7972, 953}, - 0x1f9d: []int32{7973, 953}, - 0x1f9e: []int32{7974, 953}, - 0x1f9f: []int32{7975, 953}, - 0x1fa0: []int32{8032, 953}, - 0x1fa1: []int32{8033, 953}, - 0x1fa2: []int32{8034, 953}, - 0x1fa3: []int32{8035, 953}, - 0x1fa4: []int32{8036, 953}, - 0x1fa5: []int32{8037, 953}, - 0x1fa6: []int32{8038, 953}, - 0x1fa7: []int32{8039, 953}, - 0x1fa8: []int32{8032, 953}, - 0x1fa9: []int32{8033, 953}, - 0x1faa: []int32{8034, 953}, - 0x1fab: []int32{8035, 953}, - 0x1fac: []int32{8036, 953}, - 0x1fad: []int32{8037, 953}, - 0x1fae: []int32{8038, 953}, - 0x1faf: []int32{8039, 953}, - 0x1fb2: []int32{8048, 953}, - 0x1fb3: []int32{945, 953}, - 0x1fb4: []int32{940, 953}, - 0x1fb6: []int32{945, 834}, - 0x1fb7: []int32{945, 834, 953}, - 0x1fb8: []int32{8112}, - 0x1fb9: []int32{8113}, - 0x1fba: []int32{8048}, - 0x1fbb: []int32{8049}, - 0x1fbc: []int32{945, 953}, - 0x1fbe: []int32{953}, - 0x1fc2: []int32{8052, 953}, - 0x1fc3: []int32{951, 953}, - 0x1fc4: []int32{942, 953}, - 0x1fc6: []int32{951, 834}, - 0x1fc7: []int32{951, 834, 953}, - 0x1fc8: []int32{8050}, - 0x1fc9: []int32{8051}, - 0x1fca: []int32{8052}, - 0x1fcb: []int32{8053}, - 0x1fcc: []int32{951, 953}, - 0x1fd2: []int32{953, 776, 768}, - 0x1fd3: []int32{953, 776, 769}, - 0x1fd6: []int32{953, 834}, - 0x1fd7: []int32{953, 776, 834}, - 0x1fd8: []int32{8144}, - 0x1fd9: []int32{8145}, - 0x1fda: []int32{8054}, - 0x1fdb: []int32{8055}, - 0x1fe2: []int32{965, 776, 768}, - 0x1fe3: []int32{965, 776, 769}, - 0x1fe4: []int32{961, 787}, - 0x1fe6: []int32{965, 834}, - 0x1fe7: []int32{965, 776, 834}, - 0x1fe8: []int32{8160}, - 0x1fe9: []int32{8161}, - 0x1fea: []int32{8058}, - 0x1feb: []int32{8059}, - 0x1fec: []int32{8165}, - 0x1ff2: []int32{8060, 953}, - 0x1ff3: []int32{969, 953}, - 0x1ff4: []int32{974, 953}, - 0x1ff6: []int32{969, 834}, - 0x1ff7: []int32{969, 834, 953}, - 0x1ff8: []int32{8056}, - 0x1ff9: []int32{8057}, - 0x1ffa: []int32{8060}, - 0x1ffb: []int32{8061}, - 0x1ffc: []int32{969, 953}, - 0x2126: []int32{969}, - 0x212a: []int32{107}, - 0x212b: []int32{229}, - 0x2132: []int32{8526}, - 0x2160: []int32{8560}, - 0x2161: []int32{8561}, - 0x2162: []int32{8562}, - 0x2163: []int32{8563}, - 0x2164: []int32{8564}, - 0x2165: []int32{8565}, - 0x2166: []int32{8566}, - 0x2167: []int32{8567}, - 0x2168: []int32{8568}, - 0x2169: []int32{8569}, - 0x216a: []int32{8570}, - 0x216b: []int32{8571}, - 0x216c: []int32{8572}, - 0x216d: []int32{8573}, - 0x216e: []int32{8574}, - 0x216f: []int32{8575}, - 0x2183: []int32{8580}, - 0x24b6: []int32{9424}, - 0x24b7: []int32{9425}, - 0x24b8: []int32{9426}, - 0x24b9: []int32{9427}, - 0x24ba: []int32{9428}, - 0x24bb: []int32{9429}, - 0x24bc: []int32{9430}, - 0x24bd: []int32{9431}, - 0x24be: []int32{9432}, - 0x24bf: []int32{9433}, - 0x24c0: []int32{9434}, - 0x24c1: []int32{9435}, - 0x24c2: []int32{9436}, - 0x24c3: []int32{9437}, - 0x24c4: []int32{9438}, - 0x24c5: []int32{9439}, - 0x24c6: []int32{9440}, - 0x24c7: []int32{9441}, - 0x24c8: []int32{9442}, - 0x24c9: []int32{9443}, - 0x24ca: []int32{9444}, - 0x24cb: []int32{9445}, - 0x24cc: []int32{9446}, - 0x24cd: []int32{9447}, - 0x24ce: []int32{9448}, - 0x24cf: []int32{9449}, - 0x2c00: []int32{11312}, - 0x2c01: []int32{11313}, - 0x2c02: []int32{11314}, - 0x2c03: []int32{11315}, - 0x2c04: []int32{11316}, - 0x2c05: []int32{11317}, - 0x2c06: []int32{11318}, - 0x2c07: []int32{11319}, - 0x2c08: []int32{11320}, - 0x2c09: []int32{11321}, - 0x2c0a: []int32{11322}, - 0x2c0b: []int32{11323}, - 0x2c0c: []int32{11324}, - 0x2c0d: []int32{11325}, - 0x2c0e: []int32{11326}, - 0x2c0f: []int32{11327}, - 0x2c10: []int32{11328}, - 0x2c11: []int32{11329}, - 0x2c12: []int32{11330}, - 0x2c13: []int32{11331}, - 0x2c14: []int32{11332}, - 0x2c15: []int32{11333}, - 0x2c16: []int32{11334}, - 0x2c17: []int32{11335}, - 0x2c18: []int32{11336}, - 0x2c19: []int32{11337}, - 0x2c1a: []int32{11338}, - 0x2c1b: []int32{11339}, - 0x2c1c: []int32{11340}, - 0x2c1d: []int32{11341}, - 0x2c1e: []int32{11342}, - 0x2c1f: []int32{11343}, - 0x2c20: []int32{11344}, - 0x2c21: []int32{11345}, - 0x2c22: []int32{11346}, - 0x2c23: []int32{11347}, - 0x2c24: []int32{11348}, - 0x2c25: []int32{11349}, - 0x2c26: []int32{11350}, - 0x2c27: []int32{11351}, - 0x2c28: []int32{11352}, - 0x2c29: []int32{11353}, - 0x2c2a: []int32{11354}, - 0x2c2b: []int32{11355}, - 0x2c2c: []int32{11356}, - 0x2c2d: []int32{11357}, - 0x2c2e: []int32{11358}, - 0x2c60: []int32{11361}, - 0x2c62: []int32{619}, - 0x2c63: []int32{7549}, - 0x2c64: []int32{637}, - 0x2c67: []int32{11368}, - 0x2c69: []int32{11370}, - 0x2c6b: []int32{11372}, - 0x2c6d: []int32{593}, - 0x2c6e: []int32{625}, - 0x2c6f: []int32{592}, - 0x2c70: []int32{594}, - 0x2c72: []int32{11379}, - 0x2c75: []int32{11382}, - 0x2c7e: []int32{575}, - 0x2c7f: []int32{576}, - 0x2c80: []int32{11393}, - 0x2c82: []int32{11395}, - 0x2c84: []int32{11397}, - 0x2c86: []int32{11399}, - 0x2c88: []int32{11401}, - 0x2c8a: []int32{11403}, - 0x2c8c: []int32{11405}, - 0x2c8e: []int32{11407}, - 0x2c90: []int32{11409}, - 0x2c92: []int32{11411}, - 0x2c94: []int32{11413}, - 0x2c96: []int32{11415}, - 0x2c98: []int32{11417}, - 0x2c9a: []int32{11419}, - 0x2c9c: []int32{11421}, - 0x2c9e: []int32{11423}, - 0x2ca0: []int32{11425}, - 0x2ca2: []int32{11427}, - 0x2ca4: []int32{11429}, - 0x2ca6: []int32{11431}, - 0x2ca8: []int32{11433}, - 0x2caa: []int32{11435}, - 0x2cac: []int32{11437}, - 0x2cae: []int32{11439}, - 0x2cb0: []int32{11441}, - 0x2cb2: []int32{11443}, - 0x2cb4: []int32{11445}, - 0x2cb6: []int32{11447}, - 0x2cb8: []int32{11449}, - 0x2cba: []int32{11451}, - 0x2cbc: []int32{11453}, - 0x2cbe: []int32{11455}, - 0x2cc0: []int32{11457}, - 0x2cc2: []int32{11459}, - 0x2cc4: []int32{11461}, - 0x2cc6: []int32{11463}, - 0x2cc8: []int32{11465}, - 0x2cca: []int32{11467}, - 0x2ccc: []int32{11469}, - 0x2cce: []int32{11471}, - 0x2cd0: []int32{11473}, - 0x2cd2: []int32{11475}, - 0x2cd4: []int32{11477}, - 0x2cd6: []int32{11479}, - 0x2cd8: []int32{11481}, - 0x2cda: []int32{11483}, - 0x2cdc: []int32{11485}, - 0x2cde: []int32{11487}, - 0x2ce0: []int32{11489}, - 0x2ce2: []int32{11491}, - 0x2ceb: []int32{11500}, - 0x2ced: []int32{11502}, - 0x2cf2: []int32{11507}, - 0xa640: []int32{42561}, - 0xa642: []int32{42563}, - 0xa644: []int32{42565}, - 0xa646: []int32{42567}, - 0xa648: []int32{42569}, - 0xa64a: []int32{42571}, - 0xa64c: []int32{42573}, - 0xa64e: []int32{42575}, - 0xa650: []int32{42577}, - 0xa652: []int32{42579}, - 0xa654: []int32{42581}, - 0xa656: []int32{42583}, - 0xa658: []int32{42585}, - 0xa65a: []int32{42587}, - 0xa65c: []int32{42589}, - 0xa65e: []int32{42591}, - 0xa660: []int32{42593}, - 0xa662: []int32{42595}, - 0xa664: []int32{42597}, - 0xa666: []int32{42599}, - 0xa668: []int32{42601}, - 0xa66a: []int32{42603}, - 0xa66c: []int32{42605}, - 0xa680: []int32{42625}, - 0xa682: []int32{42627}, - 0xa684: []int32{42629}, - 0xa686: []int32{42631}, - 0xa688: []int32{42633}, - 0xa68a: []int32{42635}, - 0xa68c: []int32{42637}, - 0xa68e: []int32{42639}, - 0xa690: []int32{42641}, - 0xa692: []int32{42643}, - 0xa694: []int32{42645}, - 0xa696: []int32{42647}, - 0xa698: []int32{42649}, - 0xa69a: []int32{42651}, - 0xa722: []int32{42787}, - 0xa724: []int32{42789}, - 0xa726: []int32{42791}, - 0xa728: []int32{42793}, - 0xa72a: []int32{42795}, - 0xa72c: []int32{42797}, - 0xa72e: []int32{42799}, - 0xa732: []int32{42803}, - 0xa734: []int32{42805}, - 0xa736: []int32{42807}, - 0xa738: []int32{42809}, - 0xa73a: []int32{42811}, - 0xa73c: []int32{42813}, - 0xa73e: []int32{42815}, - 0xa740: []int32{42817}, - 0xa742: []int32{42819}, - 0xa744: []int32{42821}, - 0xa746: []int32{42823}, - 0xa748: []int32{42825}, - 0xa74a: []int32{42827}, - 0xa74c: []int32{42829}, - 0xa74e: []int32{42831}, - 0xa750: []int32{42833}, - 0xa752: []int32{42835}, - 0xa754: []int32{42837}, - 0xa756: []int32{42839}, - 0xa758: []int32{42841}, - 0xa75a: []int32{42843}, - 0xa75c: []int32{42845}, - 0xa75e: []int32{42847}, - 0xa760: []int32{42849}, - 0xa762: []int32{42851}, - 0xa764: []int32{42853}, - 0xa766: []int32{42855}, - 0xa768: []int32{42857}, - 0xa76a: []int32{42859}, - 0xa76c: []int32{42861}, - 0xa76e: []int32{42863}, - 0xa779: []int32{42874}, - 0xa77b: []int32{42876}, - 0xa77d: []int32{7545}, - 0xa77e: []int32{42879}, - 0xa780: []int32{42881}, - 0xa782: []int32{42883}, - 0xa784: []int32{42885}, - 0xa786: []int32{42887}, - 0xa78b: []int32{42892}, - 0xa78d: []int32{613}, - 0xa790: []int32{42897}, - 0xa792: []int32{42899}, - 0xa796: []int32{42903}, - 0xa798: []int32{42905}, - 0xa79a: []int32{42907}, - 0xa79c: []int32{42909}, - 0xa79e: []int32{42911}, - 0xa7a0: []int32{42913}, - 0xa7a2: []int32{42915}, - 0xa7a4: []int32{42917}, - 0xa7a6: []int32{42919}, - 0xa7a8: []int32{42921}, - 0xa7aa: []int32{614}, - 0xa7ab: []int32{604}, - 0xa7ac: []int32{609}, - 0xa7ad: []int32{620}, - 0xa7ae: []int32{618}, - 0xa7b0: []int32{670}, - 0xa7b1: []int32{647}, - 0xa7b2: []int32{669}, - 0xa7b3: []int32{43859}, - 0xa7b4: []int32{42933}, - 0xa7b6: []int32{42935}, - 0xa7b8: []int32{42937}, - 0xa7ba: []int32{42939}, - 0xa7bc: []int32{42941}, - 0xa7be: []int32{42943}, - 0xa7c2: []int32{42947}, - 0xa7c4: []int32{42900}, - 0xa7c5: []int32{642}, - 0xa7c6: []int32{7566}, - 0xab70: []int32{5024}, - 0xab71: []int32{5025}, - 0xab72: []int32{5026}, - 0xab73: []int32{5027}, - 0xab74: []int32{5028}, - 0xab75: []int32{5029}, - 0xab76: []int32{5030}, - 0xab77: []int32{5031}, - 0xab78: []int32{5032}, - 0xab79: []int32{5033}, - 0xab7a: []int32{5034}, - 0xab7b: []int32{5035}, - 0xab7c: []int32{5036}, - 0xab7d: []int32{5037}, - 0xab7e: []int32{5038}, - 0xab7f: []int32{5039}, - 0xab80: []int32{5040}, - 0xab81: []int32{5041}, - 0xab82: []int32{5042}, - 0xab83: []int32{5043}, - 0xab84: []int32{5044}, - 0xab85: []int32{5045}, - 0xab86: []int32{5046}, - 0xab87: []int32{5047}, - 0xab88: []int32{5048}, - 0xab89: []int32{5049}, - 0xab8a: []int32{5050}, - 0xab8b: []int32{5051}, - 0xab8c: []int32{5052}, - 0xab8d: []int32{5053}, - 0xab8e: []int32{5054}, - 0xab8f: []int32{5055}, - 0xab90: []int32{5056}, - 0xab91: []int32{5057}, - 0xab92: []int32{5058}, - 0xab93: []int32{5059}, - 0xab94: []int32{5060}, - 0xab95: []int32{5061}, - 0xab96: []int32{5062}, - 0xab97: []int32{5063}, - 0xab98: []int32{5064}, - 0xab99: []int32{5065}, - 0xab9a: []int32{5066}, - 0xab9b: []int32{5067}, - 0xab9c: []int32{5068}, - 0xab9d: []int32{5069}, - 0xab9e: []int32{5070}, - 0xab9f: []int32{5071}, - 0xaba0: []int32{5072}, - 0xaba1: []int32{5073}, - 0xaba2: []int32{5074}, - 0xaba3: []int32{5075}, - 0xaba4: []int32{5076}, - 0xaba5: []int32{5077}, - 0xaba6: []int32{5078}, - 0xaba7: []int32{5079}, - 0xaba8: []int32{5080}, - 0xaba9: []int32{5081}, - 0xabaa: []int32{5082}, - 0xabab: []int32{5083}, - 0xabac: []int32{5084}, - 0xabad: []int32{5085}, - 0xabae: []int32{5086}, - 0xabaf: []int32{5087}, - 0xabb0: []int32{5088}, - 0xabb1: []int32{5089}, - 0xabb2: []int32{5090}, - 0xabb3: []int32{5091}, - 0xabb4: []int32{5092}, - 0xabb5: []int32{5093}, - 0xabb6: []int32{5094}, - 0xabb7: []int32{5095}, - 0xabb8: []int32{5096}, - 0xabb9: []int32{5097}, - 0xabba: []int32{5098}, - 0xabbb: []int32{5099}, - 0xabbc: []int32{5100}, - 0xabbd: []int32{5101}, - 0xabbe: []int32{5102}, - 0xabbf: []int32{5103}, - 0xfb00: []int32{102, 102}, - 0xfb01: []int32{102, 105}, - 0xfb02: []int32{102, 108}, - 0xfb03: []int32{102, 102, 105}, - 0xfb04: []int32{102, 102, 108}, - 0xfb05: []int32{115, 116}, - 0xfb06: []int32{115, 116}, - 0xfb13: []int32{1396, 1398}, - 0xfb14: []int32{1396, 1381}, - 0xfb15: []int32{1396, 1387}, - 0xfb16: []int32{1406, 1398}, - 0xfb17: []int32{1396, 1389}, - 0xff21: []int32{65345}, - 0xff22: []int32{65346}, - 0xff23: []int32{65347}, - 0xff24: []int32{65348}, - 0xff25: []int32{65349}, - 0xff26: []int32{65350}, - 0xff27: []int32{65351}, - 0xff28: []int32{65352}, - 0xff29: []int32{65353}, - 0xff2a: []int32{65354}, - 0xff2b: []int32{65355}, - 0xff2c: []int32{65356}, - 0xff2d: []int32{65357}, - 0xff2e: []int32{65358}, - 0xff2f: []int32{65359}, - 0xff30: []int32{65360}, - 0xff31: []int32{65361}, - 0xff32: []int32{65362}, - 0xff33: []int32{65363}, - 0xff34: []int32{65364}, - 0xff35: []int32{65365}, - 0xff36: []int32{65366}, - 0xff37: []int32{65367}, - 0xff38: []int32{65368}, - 0xff39: []int32{65369}, - 0xff3a: []int32{65370}, - 0x10400: []int32{66600}, - 0x10401: []int32{66601}, - 0x10402: []int32{66602}, - 0x10403: []int32{66603}, - 0x10404: []int32{66604}, - 0x10405: []int32{66605}, - 0x10406: []int32{66606}, - 0x10407: []int32{66607}, - 0x10408: []int32{66608}, - 0x10409: []int32{66609}, - 0x1040a: []int32{66610}, - 0x1040b: []int32{66611}, - 0x1040c: []int32{66612}, - 0x1040d: []int32{66613}, - 0x1040e: []int32{66614}, - 0x1040f: []int32{66615}, - 0x10410: []int32{66616}, - 0x10411: []int32{66617}, - 0x10412: []int32{66618}, - 0x10413: []int32{66619}, - 0x10414: []int32{66620}, - 0x10415: []int32{66621}, - 0x10416: []int32{66622}, - 0x10417: []int32{66623}, - 0x10418: []int32{66624}, - 0x10419: []int32{66625}, - 0x1041a: []int32{66626}, - 0x1041b: []int32{66627}, - 0x1041c: []int32{66628}, - 0x1041d: []int32{66629}, - 0x1041e: []int32{66630}, - 0x1041f: []int32{66631}, - 0x10420: []int32{66632}, - 0x10421: []int32{66633}, - 0x10422: []int32{66634}, - 0x10423: []int32{66635}, - 0x10424: []int32{66636}, - 0x10425: []int32{66637}, - 0x10426: []int32{66638}, - 0x10427: []int32{66639}, - 0x104b0: []int32{66776}, - 0x104b1: []int32{66777}, - 0x104b2: []int32{66778}, - 0x104b3: []int32{66779}, - 0x104b4: []int32{66780}, - 0x104b5: []int32{66781}, - 0x104b6: []int32{66782}, - 0x104b7: []int32{66783}, - 0x104b8: []int32{66784}, - 0x104b9: []int32{66785}, - 0x104ba: []int32{66786}, - 0x104bb: []int32{66787}, - 0x104bc: []int32{66788}, - 0x104bd: []int32{66789}, - 0x104be: []int32{66790}, - 0x104bf: []int32{66791}, - 0x104c0: []int32{66792}, - 0x104c1: []int32{66793}, - 0x104c2: []int32{66794}, - 0x104c3: []int32{66795}, - 0x104c4: []int32{66796}, - 0x104c5: []int32{66797}, - 0x104c6: []int32{66798}, - 0x104c7: []int32{66799}, - 0x104c8: []int32{66800}, - 0x104c9: []int32{66801}, - 0x104ca: []int32{66802}, - 0x104cb: []int32{66803}, - 0x104cc: []int32{66804}, - 0x104cd: []int32{66805}, - 0x104ce: []int32{66806}, - 0x104cf: []int32{66807}, - 0x104d0: []int32{66808}, - 0x104d1: []int32{66809}, - 0x104d2: []int32{66810}, - 0x104d3: []int32{66811}, - 0x10c80: []int32{68800}, - 0x10c81: []int32{68801}, - 0x10c82: []int32{68802}, - 0x10c83: []int32{68803}, - 0x10c84: []int32{68804}, - 0x10c85: []int32{68805}, - 0x10c86: []int32{68806}, - 0x10c87: []int32{68807}, - 0x10c88: []int32{68808}, - 0x10c89: []int32{68809}, - 0x10c8a: []int32{68810}, - 0x10c8b: []int32{68811}, - 0x10c8c: []int32{68812}, - 0x10c8d: []int32{68813}, - 0x10c8e: []int32{68814}, - 0x10c8f: []int32{68815}, - 0x10c90: []int32{68816}, - 0x10c91: []int32{68817}, - 0x10c92: []int32{68818}, - 0x10c93: []int32{68819}, - 0x10c94: []int32{68820}, - 0x10c95: []int32{68821}, - 0x10c96: []int32{68822}, - 0x10c97: []int32{68823}, - 0x10c98: []int32{68824}, - 0x10c99: []int32{68825}, - 0x10c9a: []int32{68826}, - 0x10c9b: []int32{68827}, - 0x10c9c: []int32{68828}, - 0x10c9d: []int32{68829}, - 0x10c9e: []int32{68830}, - 0x10c9f: []int32{68831}, - 0x10ca0: []int32{68832}, - 0x10ca1: []int32{68833}, - 0x10ca2: []int32{68834}, - 0x10ca3: []int32{68835}, - 0x10ca4: []int32{68836}, - 0x10ca5: []int32{68837}, - 0x10ca6: []int32{68838}, - 0x10ca7: []int32{68839}, - 0x10ca8: []int32{68840}, - 0x10ca9: []int32{68841}, - 0x10caa: []int32{68842}, - 0x10cab: []int32{68843}, - 0x10cac: []int32{68844}, - 0x10cad: []int32{68845}, - 0x10cae: []int32{68846}, - 0x10caf: []int32{68847}, - 0x10cb0: []int32{68848}, - 0x10cb1: []int32{68849}, - 0x10cb2: []int32{68850}, - 0x118a0: []int32{71872}, - 0x118a1: []int32{71873}, - 0x118a2: []int32{71874}, - 0x118a3: []int32{71875}, - 0x118a4: []int32{71876}, - 0x118a5: []int32{71877}, - 0x118a6: []int32{71878}, - 0x118a7: []int32{71879}, - 0x118a8: []int32{71880}, - 0x118a9: []int32{71881}, - 0x118aa: []int32{71882}, - 0x118ab: []int32{71883}, - 0x118ac: []int32{71884}, - 0x118ad: []int32{71885}, - 0x118ae: []int32{71886}, - 0x118af: []int32{71887}, - 0x118b0: []int32{71888}, - 0x118b1: []int32{71889}, - 0x118b2: []int32{71890}, - 0x118b3: []int32{71891}, - 0x118b4: []int32{71892}, - 0x118b5: []int32{71893}, - 0x118b6: []int32{71894}, - 0x118b7: []int32{71895}, - 0x118b8: []int32{71896}, - 0x118b9: []int32{71897}, - 0x118ba: []int32{71898}, - 0x118bb: []int32{71899}, - 0x118bc: []int32{71900}, - 0x118bd: []int32{71901}, - 0x118be: []int32{71902}, - 0x118bf: []int32{71903}, - 0x16e40: []int32{93792}, - 0x16e41: []int32{93793}, - 0x16e42: []int32{93794}, - 0x16e43: []int32{93795}, - 0x16e44: []int32{93796}, - 0x16e45: []int32{93797}, - 0x16e46: []int32{93798}, - 0x16e47: []int32{93799}, - 0x16e48: []int32{93800}, - 0x16e49: []int32{93801}, - 0x16e4a: []int32{93802}, - 0x16e4b: []int32{93803}, - 0x16e4c: []int32{93804}, - 0x16e4d: []int32{93805}, - 0x16e4e: []int32{93806}, - 0x16e4f: []int32{93807}, - 0x16e50: []int32{93808}, - 0x16e51: []int32{93809}, - 0x16e52: []int32{93810}, - 0x16e53: []int32{93811}, - 0x16e54: []int32{93812}, - 0x16e55: []int32{93813}, - 0x16e56: []int32{93814}, - 0x16e57: []int32{93815}, - 0x16e58: []int32{93816}, - 0x16e59: []int32{93817}, - 0x16e5a: []int32{93818}, - 0x16e5b: []int32{93819}, - 0x16e5c: []int32{93820}, - 0x16e5d: []int32{93821}, - 0x16e5e: []int32{93822}, - 0x16e5f: []int32{93823}, - 0x1e900: []int32{125218}, - 0x1e901: []int32{125219}, - 0x1e902: []int32{125220}, - 0x1e903: []int32{125221}, - 0x1e904: []int32{125222}, - 0x1e905: []int32{125223}, - 0x1e906: []int32{125224}, - 0x1e907: []int32{125225}, - 0x1e908: []int32{125226}, - 0x1e909: []int32{125227}, - 0x1e90a: []int32{125228}, - 0x1e90b: []int32{125229}, - 0x1e90c: []int32{125230}, - 0x1e90d: []int32{125231}, - 0x1e90e: []int32{125232}, - 0x1e90f: []int32{125233}, - 0x1e910: []int32{125234}, - 0x1e911: []int32{125235}, - 0x1e912: []int32{125236}, - 0x1e913: []int32{125237}, - 0x1e914: []int32{125238}, - 0x1e915: []int32{125239}, - 0x1e916: []int32{125240}, - 0x1e917: []int32{125241}, - 0x1e918: []int32{125242}, - 0x1e919: []int32{125243}, - 0x1e91a: []int32{125244}, - 0x1e91b: []int32{125245}, - 0x1e91c: []int32{125246}, - 0x1e91d: []int32{125247}, - 0x1e91e: []int32{125248}, - 0x1e91f: []int32{125249}, - 0x1e920: []int32{125250}, - 0x1e921: []int32{125251}, +var unicodeCaseFoldings = map[rune][]rune { + 0x41 : []int32{97}, + 0x42 : []int32{98}, + 0x43 : []int32{99}, + 0x44 : []int32{100}, + 0x45 : []int32{101}, + 0x46 : []int32{102}, + 0x47 : []int32{103}, + 0x48 : []int32{104}, + 0x49 : []int32{105}, + 0x4a : []int32{106}, + 0x4b : []int32{107}, + 0x4c : []int32{108}, + 0x4d : []int32{109}, + 0x4e : []int32{110}, + 0x4f : []int32{111}, + 0x50 : []int32{112}, + 0x51 : []int32{113}, + 0x52 : []int32{114}, + 0x53 : []int32{115}, + 0x54 : []int32{116}, + 0x55 : []int32{117}, + 0x56 : []int32{118}, + 0x57 : []int32{119}, + 0x58 : []int32{120}, + 0x59 : []int32{121}, + 0x5a : []int32{122}, + 0xb5 : []int32{956}, + 0xc0 : []int32{224}, + 0xc1 : []int32{225}, + 0xc2 : []int32{226}, + 0xc3 : []int32{227}, + 0xc4 : []int32{228}, + 0xc5 : []int32{229}, + 0xc6 : []int32{230}, + 0xc7 : []int32{231}, + 0xc8 : []int32{232}, + 0xc9 : []int32{233}, + 0xca : []int32{234}, + 0xcb : []int32{235}, + 0xcc : []int32{236}, + 0xcd : []int32{237}, + 0xce : []int32{238}, + 0xcf : []int32{239}, + 0xd0 : []int32{240}, + 0xd1 : []int32{241}, + 0xd2 : []int32{242}, + 0xd3 : []int32{243}, + 0xd4 : []int32{244}, + 0xd5 : []int32{245}, + 0xd6 : []int32{246}, + 0xd8 : []int32{248}, + 0xd9 : []int32{249}, + 0xda : []int32{250}, + 0xdb : []int32{251}, + 0xdc : []int32{252}, + 0xdd : []int32{253}, + 0xde : []int32{254}, + 0xdf : []int32{115, 115}, + 0x100 : []int32{257}, + 0x102 : []int32{259}, + 0x104 : []int32{261}, + 0x106 : []int32{263}, + 0x108 : []int32{265}, + 0x10a : []int32{267}, + 0x10c : []int32{269}, + 0x10e : []int32{271}, + 0x110 : []int32{273}, + 0x112 : []int32{275}, + 0x114 : []int32{277}, + 0x116 : []int32{279}, + 0x118 : []int32{281}, + 0x11a : []int32{283}, + 0x11c : []int32{285}, + 0x11e : []int32{287}, + 0x120 : []int32{289}, + 0x122 : []int32{291}, + 0x124 : []int32{293}, + 0x126 : []int32{295}, + 0x128 : []int32{297}, + 0x12a : []int32{299}, + 0x12c : []int32{301}, + 0x12e : []int32{303}, + 0x130 : []int32{105, 775}, + 0x132 : []int32{307}, + 0x134 : []int32{309}, + 0x136 : []int32{311}, + 0x139 : []int32{314}, + 0x13b : []int32{316}, + 0x13d : []int32{318}, + 0x13f : []int32{320}, + 0x141 : []int32{322}, + 0x143 : []int32{324}, + 0x145 : []int32{326}, + 0x147 : []int32{328}, + 0x149 : []int32{700, 110}, + 0x14a : []int32{331}, + 0x14c : []int32{333}, + 0x14e : []int32{335}, + 0x150 : []int32{337}, + 0x152 : []int32{339}, + 0x154 : []int32{341}, + 0x156 : []int32{343}, + 0x158 : []int32{345}, + 0x15a : []int32{347}, + 0x15c : []int32{349}, + 0x15e : []int32{351}, + 0x160 : []int32{353}, + 0x162 : []int32{355}, + 0x164 : []int32{357}, + 0x166 : []int32{359}, + 0x168 : []int32{361}, + 0x16a : []int32{363}, + 0x16c : []int32{365}, + 0x16e : []int32{367}, + 0x170 : []int32{369}, + 0x172 : []int32{371}, + 0x174 : []int32{373}, + 0x176 : []int32{375}, + 0x178 : []int32{255}, + 0x179 : []int32{378}, + 0x17b : []int32{380}, + 0x17d : []int32{382}, + 0x17f : []int32{115}, + 0x181 : []int32{595}, + 0x182 : []int32{387}, + 0x184 : []int32{389}, + 0x186 : []int32{596}, + 0x187 : []int32{392}, + 0x189 : []int32{598}, + 0x18a : []int32{599}, + 0x18b : []int32{396}, + 0x18e : []int32{477}, + 0x18f : []int32{601}, + 0x190 : []int32{603}, + 0x191 : []int32{402}, + 0x193 : []int32{608}, + 0x194 : []int32{611}, + 0x196 : []int32{617}, + 0x197 : []int32{616}, + 0x198 : []int32{409}, + 0x19c : []int32{623}, + 0x19d : []int32{626}, + 0x19f : []int32{629}, + 0x1a0 : []int32{417}, + 0x1a2 : []int32{419}, + 0x1a4 : []int32{421}, + 0x1a6 : []int32{640}, + 0x1a7 : []int32{424}, + 0x1a9 : []int32{643}, + 0x1ac : []int32{429}, + 0x1ae : []int32{648}, + 0x1af : []int32{432}, + 0x1b1 : []int32{650}, + 0x1b2 : []int32{651}, + 0x1b3 : []int32{436}, + 0x1b5 : []int32{438}, + 0x1b7 : []int32{658}, + 0x1b8 : []int32{441}, + 0x1bc : []int32{445}, + 0x1c4 : []int32{454}, + 0x1c5 : []int32{454}, + 0x1c7 : []int32{457}, + 0x1c8 : []int32{457}, + 0x1ca : []int32{460}, + 0x1cb : []int32{460}, + 0x1cd : []int32{462}, + 0x1cf : []int32{464}, + 0x1d1 : []int32{466}, + 0x1d3 : []int32{468}, + 0x1d5 : []int32{470}, + 0x1d7 : []int32{472}, + 0x1d9 : []int32{474}, + 0x1db : []int32{476}, + 0x1de : []int32{479}, + 0x1e0 : []int32{481}, + 0x1e2 : []int32{483}, + 0x1e4 : []int32{485}, + 0x1e6 : []int32{487}, + 0x1e8 : []int32{489}, + 0x1ea : []int32{491}, + 0x1ec : []int32{493}, + 0x1ee : []int32{495}, + 0x1f0 : []int32{106, 780}, + 0x1f1 : []int32{499}, + 0x1f2 : []int32{499}, + 0x1f4 : []int32{501}, + 0x1f6 : []int32{405}, + 0x1f7 : []int32{447}, + 0x1f8 : []int32{505}, + 0x1fa : []int32{507}, + 0x1fc : []int32{509}, + 0x1fe : []int32{511}, + 0x200 : []int32{513}, + 0x202 : []int32{515}, + 0x204 : []int32{517}, + 0x206 : []int32{519}, + 0x208 : []int32{521}, + 0x20a : []int32{523}, + 0x20c : []int32{525}, + 0x20e : []int32{527}, + 0x210 : []int32{529}, + 0x212 : []int32{531}, + 0x214 : []int32{533}, + 0x216 : []int32{535}, + 0x218 : []int32{537}, + 0x21a : []int32{539}, + 0x21c : []int32{541}, + 0x21e : []int32{543}, + 0x220 : []int32{414}, + 0x222 : []int32{547}, + 0x224 : []int32{549}, + 0x226 : []int32{551}, + 0x228 : []int32{553}, + 0x22a : []int32{555}, + 0x22c : []int32{557}, + 0x22e : []int32{559}, + 0x230 : []int32{561}, + 0x232 : []int32{563}, + 0x23a : []int32{11365}, + 0x23b : []int32{572}, + 0x23d : []int32{410}, + 0x23e : []int32{11366}, + 0x241 : []int32{578}, + 0x243 : []int32{384}, + 0x244 : []int32{649}, + 0x245 : []int32{652}, + 0x246 : []int32{583}, + 0x248 : []int32{585}, + 0x24a : []int32{587}, + 0x24c : []int32{589}, + 0x24e : []int32{591}, + 0x345 : []int32{953}, + 0x370 : []int32{881}, + 0x372 : []int32{883}, + 0x376 : []int32{887}, + 0x37f : []int32{1011}, + 0x386 : []int32{940}, + 0x388 : []int32{941}, + 0x389 : []int32{942}, + 0x38a : []int32{943}, + 0x38c : []int32{972}, + 0x38e : []int32{973}, + 0x38f : []int32{974}, + 0x390 : []int32{953, 776, 769}, + 0x391 : []int32{945}, + 0x392 : []int32{946}, + 0x393 : []int32{947}, + 0x394 : []int32{948}, + 0x395 : []int32{949}, + 0x396 : []int32{950}, + 0x397 : []int32{951}, + 0x398 : []int32{952}, + 0x399 : []int32{953}, + 0x39a : []int32{954}, + 0x39b : []int32{955}, + 0x39c : []int32{956}, + 0x39d : []int32{957}, + 0x39e : []int32{958}, + 0x39f : []int32{959}, + 0x3a0 : []int32{960}, + 0x3a1 : []int32{961}, + 0x3a3 : []int32{963}, + 0x3a4 : []int32{964}, + 0x3a5 : []int32{965}, + 0x3a6 : []int32{966}, + 0x3a7 : []int32{967}, + 0x3a8 : []int32{968}, + 0x3a9 : []int32{969}, + 0x3aa : []int32{970}, + 0x3ab : []int32{971}, + 0x3b0 : []int32{965, 776, 769}, + 0x3c2 : []int32{963}, + 0x3cf : []int32{983}, + 0x3d0 : []int32{946}, + 0x3d1 : []int32{952}, + 0x3d5 : []int32{966}, + 0x3d6 : []int32{960}, + 0x3d8 : []int32{985}, + 0x3da : []int32{987}, + 0x3dc : []int32{989}, + 0x3de : []int32{991}, + 0x3e0 : []int32{993}, + 0x3e2 : []int32{995}, + 0x3e4 : []int32{997}, + 0x3e6 : []int32{999}, + 0x3e8 : []int32{1001}, + 0x3ea : []int32{1003}, + 0x3ec : []int32{1005}, + 0x3ee : []int32{1007}, + 0x3f0 : []int32{954}, + 0x3f1 : []int32{961}, + 0x3f4 : []int32{952}, + 0x3f5 : []int32{949}, + 0x3f7 : []int32{1016}, + 0x3f9 : []int32{1010}, + 0x3fa : []int32{1019}, + 0x3fd : []int32{891}, + 0x3fe : []int32{892}, + 0x3ff : []int32{893}, + 0x400 : []int32{1104}, + 0x401 : []int32{1105}, + 0x402 : []int32{1106}, + 0x403 : []int32{1107}, + 0x404 : []int32{1108}, + 0x405 : []int32{1109}, + 0x406 : []int32{1110}, + 0x407 : []int32{1111}, + 0x408 : []int32{1112}, + 0x409 : []int32{1113}, + 0x40a : []int32{1114}, + 0x40b : []int32{1115}, + 0x40c : []int32{1116}, + 0x40d : []int32{1117}, + 0x40e : []int32{1118}, + 0x40f : []int32{1119}, + 0x410 : []int32{1072}, + 0x411 : []int32{1073}, + 0x412 : []int32{1074}, + 0x413 : []int32{1075}, + 0x414 : []int32{1076}, + 0x415 : []int32{1077}, + 0x416 : []int32{1078}, + 0x417 : []int32{1079}, + 0x418 : []int32{1080}, + 0x419 : []int32{1081}, + 0x41a : []int32{1082}, + 0x41b : []int32{1083}, + 0x41c : []int32{1084}, + 0x41d : []int32{1085}, + 0x41e : []int32{1086}, + 0x41f : []int32{1087}, + 0x420 : []int32{1088}, + 0x421 : []int32{1089}, + 0x422 : []int32{1090}, + 0x423 : []int32{1091}, + 0x424 : []int32{1092}, + 0x425 : []int32{1093}, + 0x426 : []int32{1094}, + 0x427 : []int32{1095}, + 0x428 : []int32{1096}, + 0x429 : []int32{1097}, + 0x42a : []int32{1098}, + 0x42b : []int32{1099}, + 0x42c : []int32{1100}, + 0x42d : []int32{1101}, + 0x42e : []int32{1102}, + 0x42f : []int32{1103}, + 0x460 : []int32{1121}, + 0x462 : []int32{1123}, + 0x464 : []int32{1125}, + 0x466 : []int32{1127}, + 0x468 : []int32{1129}, + 0x46a : []int32{1131}, + 0x46c : []int32{1133}, + 0x46e : []int32{1135}, + 0x470 : []int32{1137}, + 0x472 : []int32{1139}, + 0x474 : []int32{1141}, + 0x476 : []int32{1143}, + 0x478 : []int32{1145}, + 0x47a : []int32{1147}, + 0x47c : []int32{1149}, + 0x47e : []int32{1151}, + 0x480 : []int32{1153}, + 0x48a : []int32{1163}, + 0x48c : []int32{1165}, + 0x48e : []int32{1167}, + 0x490 : []int32{1169}, + 0x492 : []int32{1171}, + 0x494 : []int32{1173}, + 0x496 : []int32{1175}, + 0x498 : []int32{1177}, + 0x49a : []int32{1179}, + 0x49c : []int32{1181}, + 0x49e : []int32{1183}, + 0x4a0 : []int32{1185}, + 0x4a2 : []int32{1187}, + 0x4a4 : []int32{1189}, + 0x4a6 : []int32{1191}, + 0x4a8 : []int32{1193}, + 0x4aa : []int32{1195}, + 0x4ac : []int32{1197}, + 0x4ae : []int32{1199}, + 0x4b0 : []int32{1201}, + 0x4b2 : []int32{1203}, + 0x4b4 : []int32{1205}, + 0x4b6 : []int32{1207}, + 0x4b8 : []int32{1209}, + 0x4ba : []int32{1211}, + 0x4bc : []int32{1213}, + 0x4be : []int32{1215}, + 0x4c0 : []int32{1231}, + 0x4c1 : []int32{1218}, + 0x4c3 : []int32{1220}, + 0x4c5 : []int32{1222}, + 0x4c7 : []int32{1224}, + 0x4c9 : []int32{1226}, + 0x4cb : []int32{1228}, + 0x4cd : []int32{1230}, + 0x4d0 : []int32{1233}, + 0x4d2 : []int32{1235}, + 0x4d4 : []int32{1237}, + 0x4d6 : []int32{1239}, + 0x4d8 : []int32{1241}, + 0x4da : []int32{1243}, + 0x4dc : []int32{1245}, + 0x4de : []int32{1247}, + 0x4e0 : []int32{1249}, + 0x4e2 : []int32{1251}, + 0x4e4 : []int32{1253}, + 0x4e6 : []int32{1255}, + 0x4e8 : []int32{1257}, + 0x4ea : []int32{1259}, + 0x4ec : []int32{1261}, + 0x4ee : []int32{1263}, + 0x4f0 : []int32{1265}, + 0x4f2 : []int32{1267}, + 0x4f4 : []int32{1269}, + 0x4f6 : []int32{1271}, + 0x4f8 : []int32{1273}, + 0x4fa : []int32{1275}, + 0x4fc : []int32{1277}, + 0x4fe : []int32{1279}, + 0x500 : []int32{1281}, + 0x502 : []int32{1283}, + 0x504 : []int32{1285}, + 0x506 : []int32{1287}, + 0x508 : []int32{1289}, + 0x50a : []int32{1291}, + 0x50c : []int32{1293}, + 0x50e : []int32{1295}, + 0x510 : []int32{1297}, + 0x512 : []int32{1299}, + 0x514 : []int32{1301}, + 0x516 : []int32{1303}, + 0x518 : []int32{1305}, + 0x51a : []int32{1307}, + 0x51c : []int32{1309}, + 0x51e : []int32{1311}, + 0x520 : []int32{1313}, + 0x522 : []int32{1315}, + 0x524 : []int32{1317}, + 0x526 : []int32{1319}, + 0x528 : []int32{1321}, + 0x52a : []int32{1323}, + 0x52c : []int32{1325}, + 0x52e : []int32{1327}, + 0x531 : []int32{1377}, + 0x532 : []int32{1378}, + 0x533 : []int32{1379}, + 0x534 : []int32{1380}, + 0x535 : []int32{1381}, + 0x536 : []int32{1382}, + 0x537 : []int32{1383}, + 0x538 : []int32{1384}, + 0x539 : []int32{1385}, + 0x53a : []int32{1386}, + 0x53b : []int32{1387}, + 0x53c : []int32{1388}, + 0x53d : []int32{1389}, + 0x53e : []int32{1390}, + 0x53f : []int32{1391}, + 0x540 : []int32{1392}, + 0x541 : []int32{1393}, + 0x542 : []int32{1394}, + 0x543 : []int32{1395}, + 0x544 : []int32{1396}, + 0x545 : []int32{1397}, + 0x546 : []int32{1398}, + 0x547 : []int32{1399}, + 0x548 : []int32{1400}, + 0x549 : []int32{1401}, + 0x54a : []int32{1402}, + 0x54b : []int32{1403}, + 0x54c : []int32{1404}, + 0x54d : []int32{1405}, + 0x54e : []int32{1406}, + 0x54f : []int32{1407}, + 0x550 : []int32{1408}, + 0x551 : []int32{1409}, + 0x552 : []int32{1410}, + 0x553 : []int32{1411}, + 0x554 : []int32{1412}, + 0x555 : []int32{1413}, + 0x556 : []int32{1414}, + 0x587 : []int32{1381, 1410}, + 0x10a0 : []int32{11520}, + 0x10a1 : []int32{11521}, + 0x10a2 : []int32{11522}, + 0x10a3 : []int32{11523}, + 0x10a4 : []int32{11524}, + 0x10a5 : []int32{11525}, + 0x10a6 : []int32{11526}, + 0x10a7 : []int32{11527}, + 0x10a8 : []int32{11528}, + 0x10a9 : []int32{11529}, + 0x10aa : []int32{11530}, + 0x10ab : []int32{11531}, + 0x10ac : []int32{11532}, + 0x10ad : []int32{11533}, + 0x10ae : []int32{11534}, + 0x10af : []int32{11535}, + 0x10b0 : []int32{11536}, + 0x10b1 : []int32{11537}, + 0x10b2 : []int32{11538}, + 0x10b3 : []int32{11539}, + 0x10b4 : []int32{11540}, + 0x10b5 : []int32{11541}, + 0x10b6 : []int32{11542}, + 0x10b7 : []int32{11543}, + 0x10b8 : []int32{11544}, + 0x10b9 : []int32{11545}, + 0x10ba : []int32{11546}, + 0x10bb : []int32{11547}, + 0x10bc : []int32{11548}, + 0x10bd : []int32{11549}, + 0x10be : []int32{11550}, + 0x10bf : []int32{11551}, + 0x10c0 : []int32{11552}, + 0x10c1 : []int32{11553}, + 0x10c2 : []int32{11554}, + 0x10c3 : []int32{11555}, + 0x10c4 : []int32{11556}, + 0x10c5 : []int32{11557}, + 0x10c7 : []int32{11559}, + 0x10cd : []int32{11565}, + 0x13f8 : []int32{5104}, + 0x13f9 : []int32{5105}, + 0x13fa : []int32{5106}, + 0x13fb : []int32{5107}, + 0x13fc : []int32{5108}, + 0x13fd : []int32{5109}, + 0x1c80 : []int32{1074}, + 0x1c81 : []int32{1076}, + 0x1c82 : []int32{1086}, + 0x1c83 : []int32{1089}, + 0x1c84 : []int32{1090}, + 0x1c85 : []int32{1090}, + 0x1c86 : []int32{1098}, + 0x1c87 : []int32{1123}, + 0x1c88 : []int32{42571}, + 0x1c90 : []int32{4304}, + 0x1c91 : []int32{4305}, + 0x1c92 : []int32{4306}, + 0x1c93 : []int32{4307}, + 0x1c94 : []int32{4308}, + 0x1c95 : []int32{4309}, + 0x1c96 : []int32{4310}, + 0x1c97 : []int32{4311}, + 0x1c98 : []int32{4312}, + 0x1c99 : []int32{4313}, + 0x1c9a : []int32{4314}, + 0x1c9b : []int32{4315}, + 0x1c9c : []int32{4316}, + 0x1c9d : []int32{4317}, + 0x1c9e : []int32{4318}, + 0x1c9f : []int32{4319}, + 0x1ca0 : []int32{4320}, + 0x1ca1 : []int32{4321}, + 0x1ca2 : []int32{4322}, + 0x1ca3 : []int32{4323}, + 0x1ca4 : []int32{4324}, + 0x1ca5 : []int32{4325}, + 0x1ca6 : []int32{4326}, + 0x1ca7 : []int32{4327}, + 0x1ca8 : []int32{4328}, + 0x1ca9 : []int32{4329}, + 0x1caa : []int32{4330}, + 0x1cab : []int32{4331}, + 0x1cac : []int32{4332}, + 0x1cad : []int32{4333}, + 0x1cae : []int32{4334}, + 0x1caf : []int32{4335}, + 0x1cb0 : []int32{4336}, + 0x1cb1 : []int32{4337}, + 0x1cb2 : []int32{4338}, + 0x1cb3 : []int32{4339}, + 0x1cb4 : []int32{4340}, + 0x1cb5 : []int32{4341}, + 0x1cb6 : []int32{4342}, + 0x1cb7 : []int32{4343}, + 0x1cb8 : []int32{4344}, + 0x1cb9 : []int32{4345}, + 0x1cba : []int32{4346}, + 0x1cbd : []int32{4349}, + 0x1cbe : []int32{4350}, + 0x1cbf : []int32{4351}, + 0x1e00 : []int32{7681}, + 0x1e02 : []int32{7683}, + 0x1e04 : []int32{7685}, + 0x1e06 : []int32{7687}, + 0x1e08 : []int32{7689}, + 0x1e0a : []int32{7691}, + 0x1e0c : []int32{7693}, + 0x1e0e : []int32{7695}, + 0x1e10 : []int32{7697}, + 0x1e12 : []int32{7699}, + 0x1e14 : []int32{7701}, + 0x1e16 : []int32{7703}, + 0x1e18 : []int32{7705}, + 0x1e1a : []int32{7707}, + 0x1e1c : []int32{7709}, + 0x1e1e : []int32{7711}, + 0x1e20 : []int32{7713}, + 0x1e22 : []int32{7715}, + 0x1e24 : []int32{7717}, + 0x1e26 : []int32{7719}, + 0x1e28 : []int32{7721}, + 0x1e2a : []int32{7723}, + 0x1e2c : []int32{7725}, + 0x1e2e : []int32{7727}, + 0x1e30 : []int32{7729}, + 0x1e32 : []int32{7731}, + 0x1e34 : []int32{7733}, + 0x1e36 : []int32{7735}, + 0x1e38 : []int32{7737}, + 0x1e3a : []int32{7739}, + 0x1e3c : []int32{7741}, + 0x1e3e : []int32{7743}, + 0x1e40 : []int32{7745}, + 0x1e42 : []int32{7747}, + 0x1e44 : []int32{7749}, + 0x1e46 : []int32{7751}, + 0x1e48 : []int32{7753}, + 0x1e4a : []int32{7755}, + 0x1e4c : []int32{7757}, + 0x1e4e : []int32{7759}, + 0x1e50 : []int32{7761}, + 0x1e52 : []int32{7763}, + 0x1e54 : []int32{7765}, + 0x1e56 : []int32{7767}, + 0x1e58 : []int32{7769}, + 0x1e5a : []int32{7771}, + 0x1e5c : []int32{7773}, + 0x1e5e : []int32{7775}, + 0x1e60 : []int32{7777}, + 0x1e62 : []int32{7779}, + 0x1e64 : []int32{7781}, + 0x1e66 : []int32{7783}, + 0x1e68 : []int32{7785}, + 0x1e6a : []int32{7787}, + 0x1e6c : []int32{7789}, + 0x1e6e : []int32{7791}, + 0x1e70 : []int32{7793}, + 0x1e72 : []int32{7795}, + 0x1e74 : []int32{7797}, + 0x1e76 : []int32{7799}, + 0x1e78 : []int32{7801}, + 0x1e7a : []int32{7803}, + 0x1e7c : []int32{7805}, + 0x1e7e : []int32{7807}, + 0x1e80 : []int32{7809}, + 0x1e82 : []int32{7811}, + 0x1e84 : []int32{7813}, + 0x1e86 : []int32{7815}, + 0x1e88 : []int32{7817}, + 0x1e8a : []int32{7819}, + 0x1e8c : []int32{7821}, + 0x1e8e : []int32{7823}, + 0x1e90 : []int32{7825}, + 0x1e92 : []int32{7827}, + 0x1e94 : []int32{7829}, + 0x1e96 : []int32{104, 817}, + 0x1e97 : []int32{116, 776}, + 0x1e98 : []int32{119, 778}, + 0x1e99 : []int32{121, 778}, + 0x1e9a : []int32{97, 702}, + 0x1e9b : []int32{7777}, + 0x1e9e : []int32{115, 115}, + 0x1ea0 : []int32{7841}, + 0x1ea2 : []int32{7843}, + 0x1ea4 : []int32{7845}, + 0x1ea6 : []int32{7847}, + 0x1ea8 : []int32{7849}, + 0x1eaa : []int32{7851}, + 0x1eac : []int32{7853}, + 0x1eae : []int32{7855}, + 0x1eb0 : []int32{7857}, + 0x1eb2 : []int32{7859}, + 0x1eb4 : []int32{7861}, + 0x1eb6 : []int32{7863}, + 0x1eb8 : []int32{7865}, + 0x1eba : []int32{7867}, + 0x1ebc : []int32{7869}, + 0x1ebe : []int32{7871}, + 0x1ec0 : []int32{7873}, + 0x1ec2 : []int32{7875}, + 0x1ec4 : []int32{7877}, + 0x1ec6 : []int32{7879}, + 0x1ec8 : []int32{7881}, + 0x1eca : []int32{7883}, + 0x1ecc : []int32{7885}, + 0x1ece : []int32{7887}, + 0x1ed0 : []int32{7889}, + 0x1ed2 : []int32{7891}, + 0x1ed4 : []int32{7893}, + 0x1ed6 : []int32{7895}, + 0x1ed8 : []int32{7897}, + 0x1eda : []int32{7899}, + 0x1edc : []int32{7901}, + 0x1ede : []int32{7903}, + 0x1ee0 : []int32{7905}, + 0x1ee2 : []int32{7907}, + 0x1ee4 : []int32{7909}, + 0x1ee6 : []int32{7911}, + 0x1ee8 : []int32{7913}, + 0x1eea : []int32{7915}, + 0x1eec : []int32{7917}, + 0x1eee : []int32{7919}, + 0x1ef0 : []int32{7921}, + 0x1ef2 : []int32{7923}, + 0x1ef4 : []int32{7925}, + 0x1ef6 : []int32{7927}, + 0x1ef8 : []int32{7929}, + 0x1efa : []int32{7931}, + 0x1efc : []int32{7933}, + 0x1efe : []int32{7935}, + 0x1f08 : []int32{7936}, + 0x1f09 : []int32{7937}, + 0x1f0a : []int32{7938}, + 0x1f0b : []int32{7939}, + 0x1f0c : []int32{7940}, + 0x1f0d : []int32{7941}, + 0x1f0e : []int32{7942}, + 0x1f0f : []int32{7943}, + 0x1f18 : []int32{7952}, + 0x1f19 : []int32{7953}, + 0x1f1a : []int32{7954}, + 0x1f1b : []int32{7955}, + 0x1f1c : []int32{7956}, + 0x1f1d : []int32{7957}, + 0x1f28 : []int32{7968}, + 0x1f29 : []int32{7969}, + 0x1f2a : []int32{7970}, + 0x1f2b : []int32{7971}, + 0x1f2c : []int32{7972}, + 0x1f2d : []int32{7973}, + 0x1f2e : []int32{7974}, + 0x1f2f : []int32{7975}, + 0x1f38 : []int32{7984}, + 0x1f39 : []int32{7985}, + 0x1f3a : []int32{7986}, + 0x1f3b : []int32{7987}, + 0x1f3c : []int32{7988}, + 0x1f3d : []int32{7989}, + 0x1f3e : []int32{7990}, + 0x1f3f : []int32{7991}, + 0x1f48 : []int32{8000}, + 0x1f49 : []int32{8001}, + 0x1f4a : []int32{8002}, + 0x1f4b : []int32{8003}, + 0x1f4c : []int32{8004}, + 0x1f4d : []int32{8005}, + 0x1f50 : []int32{965, 787}, + 0x1f52 : []int32{965, 787, 768}, + 0x1f54 : []int32{965, 787, 769}, + 0x1f56 : []int32{965, 787, 834}, + 0x1f59 : []int32{8017}, + 0x1f5b : []int32{8019}, + 0x1f5d : []int32{8021}, + 0x1f5f : []int32{8023}, + 0x1f68 : []int32{8032}, + 0x1f69 : []int32{8033}, + 0x1f6a : []int32{8034}, + 0x1f6b : []int32{8035}, + 0x1f6c : []int32{8036}, + 0x1f6d : []int32{8037}, + 0x1f6e : []int32{8038}, + 0x1f6f : []int32{8039}, + 0x1f80 : []int32{7936, 953}, + 0x1f81 : []int32{7937, 953}, + 0x1f82 : []int32{7938, 953}, + 0x1f83 : []int32{7939, 953}, + 0x1f84 : []int32{7940, 953}, + 0x1f85 : []int32{7941, 953}, + 0x1f86 : []int32{7942, 953}, + 0x1f87 : []int32{7943, 953}, + 0x1f88 : []int32{7936, 953}, + 0x1f89 : []int32{7937, 953}, + 0x1f8a : []int32{7938, 953}, + 0x1f8b : []int32{7939, 953}, + 0x1f8c : []int32{7940, 953}, + 0x1f8d : []int32{7941, 953}, + 0x1f8e : []int32{7942, 953}, + 0x1f8f : []int32{7943, 953}, + 0x1f90 : []int32{7968, 953}, + 0x1f91 : []int32{7969, 953}, + 0x1f92 : []int32{7970, 953}, + 0x1f93 : []int32{7971, 953}, + 0x1f94 : []int32{7972, 953}, + 0x1f95 : []int32{7973, 953}, + 0x1f96 : []int32{7974, 953}, + 0x1f97 : []int32{7975, 953}, + 0x1f98 : []int32{7968, 953}, + 0x1f99 : []int32{7969, 953}, + 0x1f9a : []int32{7970, 953}, + 0x1f9b : []int32{7971, 953}, + 0x1f9c : []int32{7972, 953}, + 0x1f9d : []int32{7973, 953}, + 0x1f9e : []int32{7974, 953}, + 0x1f9f : []int32{7975, 953}, + 0x1fa0 : []int32{8032, 953}, + 0x1fa1 : []int32{8033, 953}, + 0x1fa2 : []int32{8034, 953}, + 0x1fa3 : []int32{8035, 953}, + 0x1fa4 : []int32{8036, 953}, + 0x1fa5 : []int32{8037, 953}, + 0x1fa6 : []int32{8038, 953}, + 0x1fa7 : []int32{8039, 953}, + 0x1fa8 : []int32{8032, 953}, + 0x1fa9 : []int32{8033, 953}, + 0x1faa : []int32{8034, 953}, + 0x1fab : []int32{8035, 953}, + 0x1fac : []int32{8036, 953}, + 0x1fad : []int32{8037, 953}, + 0x1fae : []int32{8038, 953}, + 0x1faf : []int32{8039, 953}, + 0x1fb2 : []int32{8048, 953}, + 0x1fb3 : []int32{945, 953}, + 0x1fb4 : []int32{940, 953}, + 0x1fb6 : []int32{945, 834}, + 0x1fb7 : []int32{945, 834, 953}, + 0x1fb8 : []int32{8112}, + 0x1fb9 : []int32{8113}, + 0x1fba : []int32{8048}, + 0x1fbb : []int32{8049}, + 0x1fbc : []int32{945, 953}, + 0x1fbe : []int32{953}, + 0x1fc2 : []int32{8052, 953}, + 0x1fc3 : []int32{951, 953}, + 0x1fc4 : []int32{942, 953}, + 0x1fc6 : []int32{951, 834}, + 0x1fc7 : []int32{951, 834, 953}, + 0x1fc8 : []int32{8050}, + 0x1fc9 : []int32{8051}, + 0x1fca : []int32{8052}, + 0x1fcb : []int32{8053}, + 0x1fcc : []int32{951, 953}, + 0x1fd2 : []int32{953, 776, 768}, + 0x1fd3 : []int32{953, 776, 769}, + 0x1fd6 : []int32{953, 834}, + 0x1fd7 : []int32{953, 776, 834}, + 0x1fd8 : []int32{8144}, + 0x1fd9 : []int32{8145}, + 0x1fda : []int32{8054}, + 0x1fdb : []int32{8055}, + 0x1fe2 : []int32{965, 776, 768}, + 0x1fe3 : []int32{965, 776, 769}, + 0x1fe4 : []int32{961, 787}, + 0x1fe6 : []int32{965, 834}, + 0x1fe7 : []int32{965, 776, 834}, + 0x1fe8 : []int32{8160}, + 0x1fe9 : []int32{8161}, + 0x1fea : []int32{8058}, + 0x1feb : []int32{8059}, + 0x1fec : []int32{8165}, + 0x1ff2 : []int32{8060, 953}, + 0x1ff3 : []int32{969, 953}, + 0x1ff4 : []int32{974, 953}, + 0x1ff6 : []int32{969, 834}, + 0x1ff7 : []int32{969, 834, 953}, + 0x1ff8 : []int32{8056}, + 0x1ff9 : []int32{8057}, + 0x1ffa : []int32{8060}, + 0x1ffb : []int32{8061}, + 0x1ffc : []int32{969, 953}, + 0x2126 : []int32{969}, + 0x212a : []int32{107}, + 0x212b : []int32{229}, + 0x2132 : []int32{8526}, + 0x2160 : []int32{8560}, + 0x2161 : []int32{8561}, + 0x2162 : []int32{8562}, + 0x2163 : []int32{8563}, + 0x2164 : []int32{8564}, + 0x2165 : []int32{8565}, + 0x2166 : []int32{8566}, + 0x2167 : []int32{8567}, + 0x2168 : []int32{8568}, + 0x2169 : []int32{8569}, + 0x216a : []int32{8570}, + 0x216b : []int32{8571}, + 0x216c : []int32{8572}, + 0x216d : []int32{8573}, + 0x216e : []int32{8574}, + 0x216f : []int32{8575}, + 0x2183 : []int32{8580}, + 0x24b6 : []int32{9424}, + 0x24b7 : []int32{9425}, + 0x24b8 : []int32{9426}, + 0x24b9 : []int32{9427}, + 0x24ba : []int32{9428}, + 0x24bb : []int32{9429}, + 0x24bc : []int32{9430}, + 0x24bd : []int32{9431}, + 0x24be : []int32{9432}, + 0x24bf : []int32{9433}, + 0x24c0 : []int32{9434}, + 0x24c1 : []int32{9435}, + 0x24c2 : []int32{9436}, + 0x24c3 : []int32{9437}, + 0x24c4 : []int32{9438}, + 0x24c5 : []int32{9439}, + 0x24c6 : []int32{9440}, + 0x24c7 : []int32{9441}, + 0x24c8 : []int32{9442}, + 0x24c9 : []int32{9443}, + 0x24ca : []int32{9444}, + 0x24cb : []int32{9445}, + 0x24cc : []int32{9446}, + 0x24cd : []int32{9447}, + 0x24ce : []int32{9448}, + 0x24cf : []int32{9449}, + 0x2c00 : []int32{11312}, + 0x2c01 : []int32{11313}, + 0x2c02 : []int32{11314}, + 0x2c03 : []int32{11315}, + 0x2c04 : []int32{11316}, + 0x2c05 : []int32{11317}, + 0x2c06 : []int32{11318}, + 0x2c07 : []int32{11319}, + 0x2c08 : []int32{11320}, + 0x2c09 : []int32{11321}, + 0x2c0a : []int32{11322}, + 0x2c0b : []int32{11323}, + 0x2c0c : []int32{11324}, + 0x2c0d : []int32{11325}, + 0x2c0e : []int32{11326}, + 0x2c0f : []int32{11327}, + 0x2c10 : []int32{11328}, + 0x2c11 : []int32{11329}, + 0x2c12 : []int32{11330}, + 0x2c13 : []int32{11331}, + 0x2c14 : []int32{11332}, + 0x2c15 : []int32{11333}, + 0x2c16 : []int32{11334}, + 0x2c17 : []int32{11335}, + 0x2c18 : []int32{11336}, + 0x2c19 : []int32{11337}, + 0x2c1a : []int32{11338}, + 0x2c1b : []int32{11339}, + 0x2c1c : []int32{11340}, + 0x2c1d : []int32{11341}, + 0x2c1e : []int32{11342}, + 0x2c1f : []int32{11343}, + 0x2c20 : []int32{11344}, + 0x2c21 : []int32{11345}, + 0x2c22 : []int32{11346}, + 0x2c23 : []int32{11347}, + 0x2c24 : []int32{11348}, + 0x2c25 : []int32{11349}, + 0x2c26 : []int32{11350}, + 0x2c27 : []int32{11351}, + 0x2c28 : []int32{11352}, + 0x2c29 : []int32{11353}, + 0x2c2a : []int32{11354}, + 0x2c2b : []int32{11355}, + 0x2c2c : []int32{11356}, + 0x2c2d : []int32{11357}, + 0x2c2e : []int32{11358}, + 0x2c2f : []int32{11359}, + 0x2c60 : []int32{11361}, + 0x2c62 : []int32{619}, + 0x2c63 : []int32{7549}, + 0x2c64 : []int32{637}, + 0x2c67 : []int32{11368}, + 0x2c69 : []int32{11370}, + 0x2c6b : []int32{11372}, + 0x2c6d : []int32{593}, + 0x2c6e : []int32{625}, + 0x2c6f : []int32{592}, + 0x2c70 : []int32{594}, + 0x2c72 : []int32{11379}, + 0x2c75 : []int32{11382}, + 0x2c7e : []int32{575}, + 0x2c7f : []int32{576}, + 0x2c80 : []int32{11393}, + 0x2c82 : []int32{11395}, + 0x2c84 : []int32{11397}, + 0x2c86 : []int32{11399}, + 0x2c88 : []int32{11401}, + 0x2c8a : []int32{11403}, + 0x2c8c : []int32{11405}, + 0x2c8e : []int32{11407}, + 0x2c90 : []int32{11409}, + 0x2c92 : []int32{11411}, + 0x2c94 : []int32{11413}, + 0x2c96 : []int32{11415}, + 0x2c98 : []int32{11417}, + 0x2c9a : []int32{11419}, + 0x2c9c : []int32{11421}, + 0x2c9e : []int32{11423}, + 0x2ca0 : []int32{11425}, + 0x2ca2 : []int32{11427}, + 0x2ca4 : []int32{11429}, + 0x2ca6 : []int32{11431}, + 0x2ca8 : []int32{11433}, + 0x2caa : []int32{11435}, + 0x2cac : []int32{11437}, + 0x2cae : []int32{11439}, + 0x2cb0 : []int32{11441}, + 0x2cb2 : []int32{11443}, + 0x2cb4 : []int32{11445}, + 0x2cb6 : []int32{11447}, + 0x2cb8 : []int32{11449}, + 0x2cba : []int32{11451}, + 0x2cbc : []int32{11453}, + 0x2cbe : []int32{11455}, + 0x2cc0 : []int32{11457}, + 0x2cc2 : []int32{11459}, + 0x2cc4 : []int32{11461}, + 0x2cc6 : []int32{11463}, + 0x2cc8 : []int32{11465}, + 0x2cca : []int32{11467}, + 0x2ccc : []int32{11469}, + 0x2cce : []int32{11471}, + 0x2cd0 : []int32{11473}, + 0x2cd2 : []int32{11475}, + 0x2cd4 : []int32{11477}, + 0x2cd6 : []int32{11479}, + 0x2cd8 : []int32{11481}, + 0x2cda : []int32{11483}, + 0x2cdc : []int32{11485}, + 0x2cde : []int32{11487}, + 0x2ce0 : []int32{11489}, + 0x2ce2 : []int32{11491}, + 0x2ceb : []int32{11500}, + 0x2ced : []int32{11502}, + 0x2cf2 : []int32{11507}, + 0xa640 : []int32{42561}, + 0xa642 : []int32{42563}, + 0xa644 : []int32{42565}, + 0xa646 : []int32{42567}, + 0xa648 : []int32{42569}, + 0xa64a : []int32{42571}, + 0xa64c : []int32{42573}, + 0xa64e : []int32{42575}, + 0xa650 : []int32{42577}, + 0xa652 : []int32{42579}, + 0xa654 : []int32{42581}, + 0xa656 : []int32{42583}, + 0xa658 : []int32{42585}, + 0xa65a : []int32{42587}, + 0xa65c : []int32{42589}, + 0xa65e : []int32{42591}, + 0xa660 : []int32{42593}, + 0xa662 : []int32{42595}, + 0xa664 : []int32{42597}, + 0xa666 : []int32{42599}, + 0xa668 : []int32{42601}, + 0xa66a : []int32{42603}, + 0xa66c : []int32{42605}, + 0xa680 : []int32{42625}, + 0xa682 : []int32{42627}, + 0xa684 : []int32{42629}, + 0xa686 : []int32{42631}, + 0xa688 : []int32{42633}, + 0xa68a : []int32{42635}, + 0xa68c : []int32{42637}, + 0xa68e : []int32{42639}, + 0xa690 : []int32{42641}, + 0xa692 : []int32{42643}, + 0xa694 : []int32{42645}, + 0xa696 : []int32{42647}, + 0xa698 : []int32{42649}, + 0xa69a : []int32{42651}, + 0xa722 : []int32{42787}, + 0xa724 : []int32{42789}, + 0xa726 : []int32{42791}, + 0xa728 : []int32{42793}, + 0xa72a : []int32{42795}, + 0xa72c : []int32{42797}, + 0xa72e : []int32{42799}, + 0xa732 : []int32{42803}, + 0xa734 : []int32{42805}, + 0xa736 : []int32{42807}, + 0xa738 : []int32{42809}, + 0xa73a : []int32{42811}, + 0xa73c : []int32{42813}, + 0xa73e : []int32{42815}, + 0xa740 : []int32{42817}, + 0xa742 : []int32{42819}, + 0xa744 : []int32{42821}, + 0xa746 : []int32{42823}, + 0xa748 : []int32{42825}, + 0xa74a : []int32{42827}, + 0xa74c : []int32{42829}, + 0xa74e : []int32{42831}, + 0xa750 : []int32{42833}, + 0xa752 : []int32{42835}, + 0xa754 : []int32{42837}, + 0xa756 : []int32{42839}, + 0xa758 : []int32{42841}, + 0xa75a : []int32{42843}, + 0xa75c : []int32{42845}, + 0xa75e : []int32{42847}, + 0xa760 : []int32{42849}, + 0xa762 : []int32{42851}, + 0xa764 : []int32{42853}, + 0xa766 : []int32{42855}, + 0xa768 : []int32{42857}, + 0xa76a : []int32{42859}, + 0xa76c : []int32{42861}, + 0xa76e : []int32{42863}, + 0xa779 : []int32{42874}, + 0xa77b : []int32{42876}, + 0xa77d : []int32{7545}, + 0xa77e : []int32{42879}, + 0xa780 : []int32{42881}, + 0xa782 : []int32{42883}, + 0xa784 : []int32{42885}, + 0xa786 : []int32{42887}, + 0xa78b : []int32{42892}, + 0xa78d : []int32{613}, + 0xa790 : []int32{42897}, + 0xa792 : []int32{42899}, + 0xa796 : []int32{42903}, + 0xa798 : []int32{42905}, + 0xa79a : []int32{42907}, + 0xa79c : []int32{42909}, + 0xa79e : []int32{42911}, + 0xa7a0 : []int32{42913}, + 0xa7a2 : []int32{42915}, + 0xa7a4 : []int32{42917}, + 0xa7a6 : []int32{42919}, + 0xa7a8 : []int32{42921}, + 0xa7aa : []int32{614}, + 0xa7ab : []int32{604}, + 0xa7ac : []int32{609}, + 0xa7ad : []int32{620}, + 0xa7ae : []int32{618}, + 0xa7b0 : []int32{670}, + 0xa7b1 : []int32{647}, + 0xa7b2 : []int32{669}, + 0xa7b3 : []int32{43859}, + 0xa7b4 : []int32{42933}, + 0xa7b6 : []int32{42935}, + 0xa7b8 : []int32{42937}, + 0xa7ba : []int32{42939}, + 0xa7bc : []int32{42941}, + 0xa7be : []int32{42943}, + 0xa7c0 : []int32{42945}, + 0xa7c2 : []int32{42947}, + 0xa7c4 : []int32{42900}, + 0xa7c5 : []int32{642}, + 0xa7c6 : []int32{7566}, + 0xa7c7 : []int32{42952}, + 0xa7c9 : []int32{42954}, + 0xa7d0 : []int32{42961}, + 0xa7d6 : []int32{42967}, + 0xa7d8 : []int32{42969}, + 0xa7f5 : []int32{42998}, + 0xab70 : []int32{5024}, + 0xab71 : []int32{5025}, + 0xab72 : []int32{5026}, + 0xab73 : []int32{5027}, + 0xab74 : []int32{5028}, + 0xab75 : []int32{5029}, + 0xab76 : []int32{5030}, + 0xab77 : []int32{5031}, + 0xab78 : []int32{5032}, + 0xab79 : []int32{5033}, + 0xab7a : []int32{5034}, + 0xab7b : []int32{5035}, + 0xab7c : []int32{5036}, + 0xab7d : []int32{5037}, + 0xab7e : []int32{5038}, + 0xab7f : []int32{5039}, + 0xab80 : []int32{5040}, + 0xab81 : []int32{5041}, + 0xab82 : []int32{5042}, + 0xab83 : []int32{5043}, + 0xab84 : []int32{5044}, + 0xab85 : []int32{5045}, + 0xab86 : []int32{5046}, + 0xab87 : []int32{5047}, + 0xab88 : []int32{5048}, + 0xab89 : []int32{5049}, + 0xab8a : []int32{5050}, + 0xab8b : []int32{5051}, + 0xab8c : []int32{5052}, + 0xab8d : []int32{5053}, + 0xab8e : []int32{5054}, + 0xab8f : []int32{5055}, + 0xab90 : []int32{5056}, + 0xab91 : []int32{5057}, + 0xab92 : []int32{5058}, + 0xab93 : []int32{5059}, + 0xab94 : []int32{5060}, + 0xab95 : []int32{5061}, + 0xab96 : []int32{5062}, + 0xab97 : []int32{5063}, + 0xab98 : []int32{5064}, + 0xab99 : []int32{5065}, + 0xab9a : []int32{5066}, + 0xab9b : []int32{5067}, + 0xab9c : []int32{5068}, + 0xab9d : []int32{5069}, + 0xab9e : []int32{5070}, + 0xab9f : []int32{5071}, + 0xaba0 : []int32{5072}, + 0xaba1 : []int32{5073}, + 0xaba2 : []int32{5074}, + 0xaba3 : []int32{5075}, + 0xaba4 : []int32{5076}, + 0xaba5 : []int32{5077}, + 0xaba6 : []int32{5078}, + 0xaba7 : []int32{5079}, + 0xaba8 : []int32{5080}, + 0xaba9 : []int32{5081}, + 0xabaa : []int32{5082}, + 0xabab : []int32{5083}, + 0xabac : []int32{5084}, + 0xabad : []int32{5085}, + 0xabae : []int32{5086}, + 0xabaf : []int32{5087}, + 0xabb0 : []int32{5088}, + 0xabb1 : []int32{5089}, + 0xabb2 : []int32{5090}, + 0xabb3 : []int32{5091}, + 0xabb4 : []int32{5092}, + 0xabb5 : []int32{5093}, + 0xabb6 : []int32{5094}, + 0xabb7 : []int32{5095}, + 0xabb8 : []int32{5096}, + 0xabb9 : []int32{5097}, + 0xabba : []int32{5098}, + 0xabbb : []int32{5099}, + 0xabbc : []int32{5100}, + 0xabbd : []int32{5101}, + 0xabbe : []int32{5102}, + 0xabbf : []int32{5103}, + 0xfb00 : []int32{102, 102}, + 0xfb01 : []int32{102, 105}, + 0xfb02 : []int32{102, 108}, + 0xfb03 : []int32{102, 102, 105}, + 0xfb04 : []int32{102, 102, 108}, + 0xfb05 : []int32{115, 116}, + 0xfb06 : []int32{115, 116}, + 0xfb13 : []int32{1396, 1398}, + 0xfb14 : []int32{1396, 1381}, + 0xfb15 : []int32{1396, 1387}, + 0xfb16 : []int32{1406, 1398}, + 0xfb17 : []int32{1396, 1389}, + 0xff21 : []int32{65345}, + 0xff22 : []int32{65346}, + 0xff23 : []int32{65347}, + 0xff24 : []int32{65348}, + 0xff25 : []int32{65349}, + 0xff26 : []int32{65350}, + 0xff27 : []int32{65351}, + 0xff28 : []int32{65352}, + 0xff29 : []int32{65353}, + 0xff2a : []int32{65354}, + 0xff2b : []int32{65355}, + 0xff2c : []int32{65356}, + 0xff2d : []int32{65357}, + 0xff2e : []int32{65358}, + 0xff2f : []int32{65359}, + 0xff30 : []int32{65360}, + 0xff31 : []int32{65361}, + 0xff32 : []int32{65362}, + 0xff33 : []int32{65363}, + 0xff34 : []int32{65364}, + 0xff35 : []int32{65365}, + 0xff36 : []int32{65366}, + 0xff37 : []int32{65367}, + 0xff38 : []int32{65368}, + 0xff39 : []int32{65369}, + 0xff3a : []int32{65370}, + 0x10400 : []int32{66600}, + 0x10401 : []int32{66601}, + 0x10402 : []int32{66602}, + 0x10403 : []int32{66603}, + 0x10404 : []int32{66604}, + 0x10405 : []int32{66605}, + 0x10406 : []int32{66606}, + 0x10407 : []int32{66607}, + 0x10408 : []int32{66608}, + 0x10409 : []int32{66609}, + 0x1040a : []int32{66610}, + 0x1040b : []int32{66611}, + 0x1040c : []int32{66612}, + 0x1040d : []int32{66613}, + 0x1040e : []int32{66614}, + 0x1040f : []int32{66615}, + 0x10410 : []int32{66616}, + 0x10411 : []int32{66617}, + 0x10412 : []int32{66618}, + 0x10413 : []int32{66619}, + 0x10414 : []int32{66620}, + 0x10415 : []int32{66621}, + 0x10416 : []int32{66622}, + 0x10417 : []int32{66623}, + 0x10418 : []int32{66624}, + 0x10419 : []int32{66625}, + 0x1041a : []int32{66626}, + 0x1041b : []int32{66627}, + 0x1041c : []int32{66628}, + 0x1041d : []int32{66629}, + 0x1041e : []int32{66630}, + 0x1041f : []int32{66631}, + 0x10420 : []int32{66632}, + 0x10421 : []int32{66633}, + 0x10422 : []int32{66634}, + 0x10423 : []int32{66635}, + 0x10424 : []int32{66636}, + 0x10425 : []int32{66637}, + 0x10426 : []int32{66638}, + 0x10427 : []int32{66639}, + 0x104b0 : []int32{66776}, + 0x104b1 : []int32{66777}, + 0x104b2 : []int32{66778}, + 0x104b3 : []int32{66779}, + 0x104b4 : []int32{66780}, + 0x104b5 : []int32{66781}, + 0x104b6 : []int32{66782}, + 0x104b7 : []int32{66783}, + 0x104b8 : []int32{66784}, + 0x104b9 : []int32{66785}, + 0x104ba : []int32{66786}, + 0x104bb : []int32{66787}, + 0x104bc : []int32{66788}, + 0x104bd : []int32{66789}, + 0x104be : []int32{66790}, + 0x104bf : []int32{66791}, + 0x104c0 : []int32{66792}, + 0x104c1 : []int32{66793}, + 0x104c2 : []int32{66794}, + 0x104c3 : []int32{66795}, + 0x104c4 : []int32{66796}, + 0x104c5 : []int32{66797}, + 0x104c6 : []int32{66798}, + 0x104c7 : []int32{66799}, + 0x104c8 : []int32{66800}, + 0x104c9 : []int32{66801}, + 0x104ca : []int32{66802}, + 0x104cb : []int32{66803}, + 0x104cc : []int32{66804}, + 0x104cd : []int32{66805}, + 0x104ce : []int32{66806}, + 0x104cf : []int32{66807}, + 0x104d0 : []int32{66808}, + 0x104d1 : []int32{66809}, + 0x104d2 : []int32{66810}, + 0x104d3 : []int32{66811}, + 0x10570 : []int32{66967}, + 0x10571 : []int32{66968}, + 0x10572 : []int32{66969}, + 0x10573 : []int32{66970}, + 0x10574 : []int32{66971}, + 0x10575 : []int32{66972}, + 0x10576 : []int32{66973}, + 0x10577 : []int32{66974}, + 0x10578 : []int32{66975}, + 0x10579 : []int32{66976}, + 0x1057a : []int32{66977}, + 0x1057c : []int32{66979}, + 0x1057d : []int32{66980}, + 0x1057e : []int32{66981}, + 0x1057f : []int32{66982}, + 0x10580 : []int32{66983}, + 0x10581 : []int32{66984}, + 0x10582 : []int32{66985}, + 0x10583 : []int32{66986}, + 0x10584 : []int32{66987}, + 0x10585 : []int32{66988}, + 0x10586 : []int32{66989}, + 0x10587 : []int32{66990}, + 0x10588 : []int32{66991}, + 0x10589 : []int32{66992}, + 0x1058a : []int32{66993}, + 0x1058c : []int32{66995}, + 0x1058d : []int32{66996}, + 0x1058e : []int32{66997}, + 0x1058f : []int32{66998}, + 0x10590 : []int32{66999}, + 0x10591 : []int32{67000}, + 0x10592 : []int32{67001}, + 0x10594 : []int32{67003}, + 0x10595 : []int32{67004}, + 0x10c80 : []int32{68800}, + 0x10c81 : []int32{68801}, + 0x10c82 : []int32{68802}, + 0x10c83 : []int32{68803}, + 0x10c84 : []int32{68804}, + 0x10c85 : []int32{68805}, + 0x10c86 : []int32{68806}, + 0x10c87 : []int32{68807}, + 0x10c88 : []int32{68808}, + 0x10c89 : []int32{68809}, + 0x10c8a : []int32{68810}, + 0x10c8b : []int32{68811}, + 0x10c8c : []int32{68812}, + 0x10c8d : []int32{68813}, + 0x10c8e : []int32{68814}, + 0x10c8f : []int32{68815}, + 0x10c90 : []int32{68816}, + 0x10c91 : []int32{68817}, + 0x10c92 : []int32{68818}, + 0x10c93 : []int32{68819}, + 0x10c94 : []int32{68820}, + 0x10c95 : []int32{68821}, + 0x10c96 : []int32{68822}, + 0x10c97 : []int32{68823}, + 0x10c98 : []int32{68824}, + 0x10c99 : []int32{68825}, + 0x10c9a : []int32{68826}, + 0x10c9b : []int32{68827}, + 0x10c9c : []int32{68828}, + 0x10c9d : []int32{68829}, + 0x10c9e : []int32{68830}, + 0x10c9f : []int32{68831}, + 0x10ca0 : []int32{68832}, + 0x10ca1 : []int32{68833}, + 0x10ca2 : []int32{68834}, + 0x10ca3 : []int32{68835}, + 0x10ca4 : []int32{68836}, + 0x10ca5 : []int32{68837}, + 0x10ca6 : []int32{68838}, + 0x10ca7 : []int32{68839}, + 0x10ca8 : []int32{68840}, + 0x10ca9 : []int32{68841}, + 0x10caa : []int32{68842}, + 0x10cab : []int32{68843}, + 0x10cac : []int32{68844}, + 0x10cad : []int32{68845}, + 0x10cae : []int32{68846}, + 0x10caf : []int32{68847}, + 0x10cb0 : []int32{68848}, + 0x10cb1 : []int32{68849}, + 0x10cb2 : []int32{68850}, + 0x118a0 : []int32{71872}, + 0x118a1 : []int32{71873}, + 0x118a2 : []int32{71874}, + 0x118a3 : []int32{71875}, + 0x118a4 : []int32{71876}, + 0x118a5 : []int32{71877}, + 0x118a6 : []int32{71878}, + 0x118a7 : []int32{71879}, + 0x118a8 : []int32{71880}, + 0x118a9 : []int32{71881}, + 0x118aa : []int32{71882}, + 0x118ab : []int32{71883}, + 0x118ac : []int32{71884}, + 0x118ad : []int32{71885}, + 0x118ae : []int32{71886}, + 0x118af : []int32{71887}, + 0x118b0 : []int32{71888}, + 0x118b1 : []int32{71889}, + 0x118b2 : []int32{71890}, + 0x118b3 : []int32{71891}, + 0x118b4 : []int32{71892}, + 0x118b5 : []int32{71893}, + 0x118b6 : []int32{71894}, + 0x118b7 : []int32{71895}, + 0x118b8 : []int32{71896}, + 0x118b9 : []int32{71897}, + 0x118ba : []int32{71898}, + 0x118bb : []int32{71899}, + 0x118bc : []int32{71900}, + 0x118bd : []int32{71901}, + 0x118be : []int32{71902}, + 0x118bf : []int32{71903}, + 0x16e40 : []int32{93792}, + 0x16e41 : []int32{93793}, + 0x16e42 : []int32{93794}, + 0x16e43 : []int32{93795}, + 0x16e44 : []int32{93796}, + 0x16e45 : []int32{93797}, + 0x16e46 : []int32{93798}, + 0x16e47 : []int32{93799}, + 0x16e48 : []int32{93800}, + 0x16e49 : []int32{93801}, + 0x16e4a : []int32{93802}, + 0x16e4b : []int32{93803}, + 0x16e4c : []int32{93804}, + 0x16e4d : []int32{93805}, + 0x16e4e : []int32{93806}, + 0x16e4f : []int32{93807}, + 0x16e50 : []int32{93808}, + 0x16e51 : []int32{93809}, + 0x16e52 : []int32{93810}, + 0x16e53 : []int32{93811}, + 0x16e54 : []int32{93812}, + 0x16e55 : []int32{93813}, + 0x16e56 : []int32{93814}, + 0x16e57 : []int32{93815}, + 0x16e58 : []int32{93816}, + 0x16e59 : []int32{93817}, + 0x16e5a : []int32{93818}, + 0x16e5b : []int32{93819}, + 0x16e5c : []int32{93820}, + 0x16e5d : []int32{93821}, + 0x16e5e : []int32{93822}, + 0x16e5f : []int32{93823}, + 0x1e900 : []int32{125218}, + 0x1e901 : []int32{125219}, + 0x1e902 : []int32{125220}, + 0x1e903 : []int32{125221}, + 0x1e904 : []int32{125222}, + 0x1e905 : []int32{125223}, + 0x1e906 : []int32{125224}, + 0x1e907 : []int32{125225}, + 0x1e908 : []int32{125226}, + 0x1e909 : []int32{125227}, + 0x1e90a : []int32{125228}, + 0x1e90b : []int32{125229}, + 0x1e90c : []int32{125230}, + 0x1e90d : []int32{125231}, + 0x1e90e : []int32{125232}, + 0x1e90f : []int32{125233}, + 0x1e910 : []int32{125234}, + 0x1e911 : []int32{125235}, + 0x1e912 : []int32{125236}, + 0x1e913 : []int32{125237}, + 0x1e914 : []int32{125238}, + 0x1e915 : []int32{125239}, + 0x1e916 : []int32{125240}, + 0x1e917 : []int32{125241}, + 0x1e918 : []int32{125242}, + 0x1e919 : []int32{125243}, + 0x1e91a : []int32{125244}, + 0x1e91b : []int32{125245}, + 0x1e91c : []int32{125246}, + 0x1e91d : []int32{125247}, + 0x1e91e : []int32{125248}, + 0x1e91f : []int32{125249}, + 0x1e920 : []int32{125250}, + 0x1e921 : []int32{125251}, } diff --git a/vendor/github.com/yuin/goldmark/util/util.go b/vendor/github.com/yuin/goldmark/util/util.go index b6896ad7c33b9..a817ec63023da 100644 --- a/vendor/github.com/yuin/goldmark/util/util.go +++ b/vendor/github.com/yuin/goldmark/util/util.go @@ -8,6 +8,7 @@ import ( "regexp" "sort" "strconv" + "unicode" "unicode/utf8" ) @@ -27,6 +28,7 @@ func NewCopyOnWriteBuffer(buffer []byte) CopyOnWriteBuffer { } // Write writes given bytes to the buffer. +// Write allocate new buffer and clears it at the first time. func (b *CopyOnWriteBuffer) Write(value []byte) { if !b.copied { b.buffer = make([]byte, 0, len(b.buffer)+20) @@ -35,7 +37,32 @@ func (b *CopyOnWriteBuffer) Write(value []byte) { b.buffer = append(b.buffer, value...) } +// WriteString writes given string to the buffer. +// WriteString allocate new buffer and clears it at the first time. +func (b *CopyOnWriteBuffer) WriteString(value string) { + b.Write(StringToReadOnlyBytes(value)) +} + +// Append appends given bytes to the buffer. +// Append copy buffer at the first time. +func (b *CopyOnWriteBuffer) Append(value []byte) { + if !b.copied { + tmp := make([]byte, len(b.buffer), len(b.buffer)+20) + copy(tmp, b.buffer) + b.buffer = tmp + b.copied = true + } + b.buffer = append(b.buffer, value...) +} + +// AppendString appends given string to the buffer. +// AppendString copy buffer at the first time. +func (b *CopyOnWriteBuffer) AppendString(value string) { + b.Append(StringToReadOnlyBytes(value)) +} + // WriteByte writes the given byte to the buffer. +// WriteByte allocate new buffer and clears it at the first time. func (b *CopyOnWriteBuffer) WriteByte(c byte) { if !b.copied { b.buffer = make([]byte, 0, len(b.buffer)+20) @@ -44,6 +71,18 @@ func (b *CopyOnWriteBuffer) WriteByte(c byte) { b.buffer = append(b.buffer, c) } +// AppendByte appends given bytes to the buffer. +// AppendByte copy buffer at the first time. +func (b *CopyOnWriteBuffer) AppendByte(c byte) { + if !b.copied { + tmp := make([]byte, len(b.buffer), len(b.buffer)+20) + copy(tmp, b.buffer) + b.buffer = tmp + b.copied = true + } + b.buffer = append(b.buffer, c) +} + // Bytes returns bytes of this buffer. func (b *CopyOnWriteBuffer) Bytes() []byte { return b.buffer @@ -91,6 +130,9 @@ func VisualizeSpaces(bs []byte) []byte { bs = bytes.Replace(bs, []byte("\t"), []byte("[TAB]"), -1) bs = bytes.Replace(bs, []byte("\n"), []byte("[NEWLINE]\n"), -1) bs = bytes.Replace(bs, []byte("\r"), []byte("[CR]"), -1) + bs = bytes.Replace(bs, []byte("\v"), []byte("[VTAB]"), -1) + bs = bytes.Replace(bs, []byte("\x00"), []byte("[NUL]"), -1) + bs = bytes.Replace(bs, []byte("\ufffd"), []byte("[U+FFFD]"), -1) return bs } @@ -110,30 +152,7 @@ func TabWidth(currentPos int) int { // width=2 is in the tab character. In this case, IndentPosition returns // (pos=1, padding=2) func IndentPosition(bs []byte, currentPos, width int) (pos, padding int) { - if width == 0 { - return 0, 0 - } - w := 0 - l := len(bs) - i := 0 - hasTab := false - for ; i < l; i++ { - if bs[i] == '\t' { - w += TabWidth(currentPos + w) - hasTab = true - } else if bs[i] == ' ' { - w++ - } else { - break - } - } - if w >= width { - if !hasTab { - return width, 0 - } - return i, w - width - } - return -1, -1 + return IndentPositionPadding(bs, currentPos, 0, width) } // IndentPositionPadding searches an indent position with the given width for the given line. @@ -147,9 +166,9 @@ func IndentPositionPadding(bs []byte, currentPos, paddingv, width int) (pos, pad i := 0 l := len(bs) for ; i < l; i++ { - if bs[i] == '\t' { + if bs[i] == '\t' && w < width { w += TabWidth(currentPos + w) - } else if bs[i] == ' ' { + } else if bs[i] == ' ' && w < width { w++ } else { break @@ -162,52 +181,56 @@ func IndentPositionPadding(bs []byte, currentPos, paddingv, width int) (pos, pad } // DedentPosition dedents lines by the given width. +// +// Deprecated: This function has bugs. Use util.IndentPositionPadding and util.FirstNonSpacePosition. func DedentPosition(bs []byte, currentPos, width int) (pos, padding int) { - if width == 0 { - return 0, 0 - } - w := 0 - l := len(bs) - i := 0 - for ; i < l; i++ { - if bs[i] == '\t' { - w += TabWidth(currentPos + w) - } else if bs[i] == ' ' { - w++ - } else { - break - } - } - if w >= width { - return i, w - width - } - return i, 0 + if width == 0 { + return 0, 0 + } + w := 0 + l := len(bs) + i := 0 + for ; i < l; i++ { + if bs[i] == '\t' { + w += TabWidth(currentPos + w) + } else if bs[i] == ' ' { + w++ + } else { + break + } + } + if w >= width { + return i, w - width + } + return i, 0 } // DedentPositionPadding dedents lines by the given width. // This function is mostly same as DedentPosition except this function // takes account into additional paddings. +// +// Deprecated: This function has bugs. Use util.IndentPositionPadding and util.FirstNonSpacePosition. func DedentPositionPadding(bs []byte, currentPos, paddingv, width int) (pos, padding int) { - if width == 0 { - return 0, paddingv - } - - w := 0 - i := 0 - l := len(bs) - for ; i < l; i++ { - if bs[i] == '\t' { - w += TabWidth(currentPos + w) - } else if bs[i] == ' ' { - w++ - } else { - break - } - } - if w >= width { - return i - paddingv, w - width - } - return i - paddingv, 0 + if width == 0 { + return 0, paddingv + } + + w := 0 + i := 0 + l := len(bs) + for ; i < l; i++ { + if bs[i] == '\t' { + w += TabWidth(currentPos + w) + } else if bs[i] == ' ' { + w++ + } else { + break + } + } + if w >= width { + return i - paddingv, w - width + } + return i - paddingv, 0 } // IndentWidth calculate an indent width for the given line. @@ -249,6 +272,10 @@ func FirstNonSpacePosition(bs []byte) int { // If codeSpan is set true, it ignores characters in code spans. // If allowNesting is set true, closures correspond to nested opener will be // ignored. +// +// Deprecated: This function can not handle newlines. Many elements +// can be existed over multiple lines(e.g. link labels). +// Use text.Reader.FindClosure. func FindClosure(bs []byte, opener, closure byte, codeSpan, allowNesting bool) int { i := 0 opened := 1 @@ -268,7 +295,7 @@ func FindClosure(bs []byte, opener, closure byte, codeSpan, allowNesting bool) i if codeSpanCloser == codeSpanOpener { codeSpanOpener = 0 } - } else if c == '\\' && i < len(bs)-1 && IsPunct(bs[i+1]) { + } else if codeSpanOpener == 0 && c == '\\' && i < len(bs)-1 && IsPunct(bs[i+1]) { i += 2 continue } else if codeSpan && codeSpanOpener == 0 && c == '`' { @@ -668,7 +695,7 @@ func URLEscape(v []byte, resolveReference bool) []byte { n = i continue } - if int(u8len) >= len(v) { + if int(u8len) > len(v) { u8len = int8(len(v) - 1) } if u8len == 0 { @@ -754,7 +781,7 @@ func FindEmailIndex(b []byte) int { var spaces = []byte(" \t\n\x0b\x0c\x0d") -var spaceTable = [256]int8{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0} +var spaceTable = [256]int8{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0} var punctTable = [256]int8{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, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 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, 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, 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, 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, 0, 0, 0, 0, 0} @@ -777,11 +804,21 @@ func IsPunct(c byte) bool { return punctTable[c] == 1 } +// IsPunctRune returns true if the given rune is a punctuation, otherwise false. +func IsPunctRune(r rune) bool { + return int32(r) <= 256 && IsPunct(byte(r)) || unicode.IsPunct(r) +} + // IsSpace returns true if the given character is a space, otherwise false. func IsSpace(c byte) bool { return spaceTable[c] == 1 } +// IsSpaceRune returns true if the given rune is a space, otherwise false. +func IsSpaceRune(r rune) bool { + return int32(r) <= 256 && IsSpace(byte(r)) || unicode.IsSpace(r) +} + // IsNumeric returns true if the given character is a numeric, otherwise false. func IsNumeric(c byte) bool { return c >= '0' && c <= '9' diff --git a/vendor/github.com/yuin/goldmark/util/util_safe.go b/vendor/github.com/yuin/goldmark/util/util_safe.go index d640585d8ba6a..507a9d0293667 100644 --- a/vendor/github.com/yuin/goldmark/util/util_safe.go +++ b/vendor/github.com/yuin/goldmark/util/util_safe.go @@ -1,4 +1,4 @@ -// +build appengine,js +// +build appengine js package util diff --git a/vendor/github.com/yuin/goldmark/util/util_unsafe.go b/vendor/github.com/yuin/goldmark/util/util_unsafe.go index beeae293614f1..d098811044cfa 100644 --- a/vendor/github.com/yuin/goldmark/util/util_unsafe.go +++ b/vendor/github.com/yuin/goldmark/util/util_unsafe.go @@ -13,8 +13,11 @@ func BytesToReadOnlyString(b []byte) string { } // StringToReadOnlyBytes returns bytes converted from given string. -func StringToReadOnlyBytes(s string) []byte { +func StringToReadOnlyBytes(s string) (bs []byte) { sh := (*reflect.StringHeader)(unsafe.Pointer(&s)) - bh := reflect.SliceHeader{Data: sh.Data, Len: sh.Len, Cap: sh.Len} - return *(*[]byte)(unsafe.Pointer(&bh)) + bh := (*reflect.SliceHeader)(unsafe.Pointer(&bs)) + bh.Data = sh.Data + bh.Cap = sh.Len + bh.Len = sh.Len + return } diff --git a/vendor/golang.org/x/crypto/acme/acme.go b/vendor/golang.org/x/crypto/acme/acme.go index 6e6c9d131950d..73b19ef35a2c1 100644 --- a/vendor/golang.org/x/crypto/acme/acme.go +++ b/vendor/golang.org/x/crypto/acme/acme.go @@ -4,7 +4,7 @@ // Package acme provides an implementation of the // Automatic Certificate Management Environment (ACME) spec. -// The intial implementation was based on ACME draft-02 and +// 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. @@ -363,6 +363,10 @@ func AcceptTOS(tosURL string) bool { return true } // 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 diff --git a/vendor/golang.org/x/crypto/acme/autocert/autocert.go b/vendor/golang.org/x/crypto/acme/autocert/autocert.go index 2ea9e23174748..c7fbc54c451bd 100644 --- a/vendor/golang.org/x/crypto/acme/autocert/autocert.go +++ b/vendor/golang.org/x/crypto/acme/autocert/autocert.go @@ -1133,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/http.go b/vendor/golang.org/x/crypto/acme/http.go index c51943e71a420..2b4c1a10d883f 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" @@ -215,6 +216,9 @@ func (c *Client) post(ctx context.Context, key crypto.Signer, url string, body i 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) } diff --git a/vendor/golang.org/x/crypto/acme/jws.go b/vendor/golang.org/x/crypto/acme/jws.go index 76e3fdacf1889..8c3ecceca7dca 100644 --- a/vendor/golang.org/x/crypto/acme/jws.go +++ b/vendor/golang.org/x/crypto/acme/jws.go @@ -7,6 +7,7 @@ package acme import ( "crypto" "crypto/ecdsa" + "crypto/hmac" "crypto/rand" "crypto/rsa" "crypto/sha256" @@ -14,6 +15,7 @@ import ( "encoding/asn1" "encoding/base64" "encoding/json" + "errors" "fmt" "math/big" ) @@ -31,6 +33,14 @@ const noKeyID = keyID("") // 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 containing either kid or jwk // fields based on the provided keyID value. @@ -71,12 +81,7 @@ func jwsEncodeJSON(claimset interface{}, key crypto.Signer, kid keyID, nonce, ur 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), @@ -84,6 +89,43 @@ func jwsEncodeJSON(claimset interface{}, key crypto.Signer, kid keyID, nonce, ur 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 diff --git a/vendor/golang.org/x/crypto/acme/rfc8555.go b/vendor/golang.org/x/crypto/acme/rfc8555.go index dfb57a66fd4be..f9d3011ffc116 100644 --- a/vendor/golang.org/x/crypto/acme/rfc8555.go +++ b/vendor/golang.org/x/crypto/acme/rfc8555.go @@ -37,22 +37,32 @@ func (c *Client) DeactivateReg(ctx context.Context) error { return nil } -// registerRFC is quivalent to c.Register but for CAs implementing RFC 8555. +// registerRFC is equivalent to c.Register but for CAs implementing RFC 8555. // It expects c.Discover to have already been called. -// TODO: Implement externalAccountBinding. 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"` + 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 @@ -75,7 +85,17 @@ func (c *Client) registerRFC(ctx context.Context, acct *Account, prompt func(tos return a, nil } -// updateGegRFC is equivalent to c.UpdateReg but for CAs implementing RFC 8555. +// 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)) @@ -390,3 +410,29 @@ 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 e959cafc82b6a..eaae4529078e8 100644 --- a/vendor/golang.org/x/crypto/acme/types.go +++ b/vendor/golang.org/x/crypto/acme/types.go @@ -57,6 +57,32 @@ var ( 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. type Error struct { @@ -76,10 +102,21 @@ type Error struct { // 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 @@ -199,6 +236,28 @@ type Account struct { // // 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. @@ -511,20 +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 - Instance 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 index b58f2456bea89..b9efdb59e5851 100644 --- a/vendor/golang.org/x/crypto/acme/version_go112.go +++ b/vendor/golang.org/x/crypto/acme/version_go112.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.12 // +build go1.12 package acme diff --git a/vendor/golang.org/x/crypto/argon2/blamka_amd64.go b/vendor/golang.org/x/crypto/argon2/blamka_amd64.go index 2fc1ec0312236..a014ac92aa9f3 100644 --- a/vendor/golang.org/x/crypto/argon2/blamka_amd64.go +++ b/vendor/golang.org/x/crypto/argon2/blamka_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,!gccgo,!appengine +//go:build amd64 && gc && !purego +// +build amd64,gc,!purego package argon2 diff --git a/vendor/golang.org/x/crypto/argon2/blamka_amd64.s b/vendor/golang.org/x/crypto/argon2/blamka_amd64.s index 74a6e7332a94a..b2cc0515049a7 100644 --- a/vendor/golang.org/x/crypto/argon2/blamka_amd64.s +++ b/vendor/golang.org/x/crypto/argon2/blamka_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 amd64 && gc && !purego +// +build amd64,gc,!purego #include "textflag.h" diff --git a/vendor/golang.org/x/crypto/argon2/blamka_ref.go b/vendor/golang.org/x/crypto/argon2/blamka_ref.go index baf7b551daf7d..167c59d2d5ab7 100644 --- a/vendor/golang.org/x/crypto/argon2/blamka_ref.go +++ b/vendor/golang.org/x/crypto/argon2/blamka_ref.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 argon2 diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go index 4d31dd0fdcd5d..56bfaaa17da6d 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_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 go1.7,amd64,!gccgo,!appengine +//go:build go1.7 && amd64 && gc && !purego +// +build go1.7,amd64,gc,!purego package blake2b diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s index 5593b1b3dce26..4b9daa18d9d9c 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s +++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_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 go1.7,amd64,!gccgo,!appengine +//go:build go1.7 && amd64 && gc && !purego +// +build go1.7,amd64,gc,!purego #include "textflag.h" @@ -282,14 +283,12 @@ TEXT ·hashBlocksAVX2(SB), 4, $320-48 // frame size = 288 + 32 byte alignment MOVQ blocks_len+32(FP), DI MOVQ SP, DX - MOVQ SP, R9 - ADDQ $31, R9 - ANDQ $~31, R9 - MOVQ R9, SP + ADDQ $31, DX + ANDQ $~31, DX - MOVQ CX, 16(SP) + MOVQ CX, 16(DX) XORQ CX, CX - MOVQ CX, 24(SP) + MOVQ CX, 24(DX) VMOVDQU ·AVX2_c40<>(SB), Y4 VMOVDQU ·AVX2_c48<>(SB), Y5 @@ -301,33 +300,33 @@ TEXT ·hashBlocksAVX2(SB), 4, $320-48 // frame size = 288 + 32 byte alignment MOVQ 0(BX), R8 MOVQ 8(BX), R9 - MOVQ R9, 8(SP) + MOVQ R9, 8(DX) loop: ADDQ $128, R8 - MOVQ R8, 0(SP) + MOVQ R8, 0(DX) CMPQ R8, $128 JGE noinc INCQ R9 - MOVQ R9, 8(SP) + MOVQ R9, 8(DX) noinc: VMOVDQA Y8, Y0 VMOVDQA Y9, Y1 VMOVDQA Y6, Y2 - VPXOR 0(SP), Y7, Y3 + VPXOR 0(DX), Y7, Y3 LOAD_MSG_AVX2_0_2_4_6_1_3_5_7_8_10_12_14_9_11_13_15() - VMOVDQA Y12, 32(SP) - VMOVDQA Y13, 64(SP) - VMOVDQA Y14, 96(SP) - VMOVDQA Y15, 128(SP) + VMOVDQA Y12, 32(DX) + VMOVDQA Y13, 64(DX) + VMOVDQA Y14, 96(DX) + VMOVDQA Y15, 128(DX) ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) LOAD_MSG_AVX2_14_4_9_13_10_8_15_6_1_0_11_5_12_2_7_3() - VMOVDQA Y12, 160(SP) - VMOVDQA Y13, 192(SP) - VMOVDQA Y14, 224(SP) - VMOVDQA Y15, 256(SP) + VMOVDQA Y12, 160(DX) + VMOVDQA Y13, 192(DX) + VMOVDQA Y14, 224(DX) + VMOVDQA Y15, 256(DX) ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) LOAD_MSG_AVX2_11_12_5_15_8_0_2_13_10_3_7_9_14_6_1_4() @@ -347,8 +346,8 @@ noinc: LOAD_MSG_AVX2_10_8_7_1_2_4_6_5_15_9_3_13_11_14_12_0() ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) - ROUND_AVX2(32(SP), 64(SP), 96(SP), 128(SP), Y10, Y4, Y5) - ROUND_AVX2(160(SP), 192(SP), 224(SP), 256(SP), Y10, Y4, Y5) + ROUND_AVX2(32(DX), 64(DX), 96(DX), 128(DX), Y10, Y4, Y5) + ROUND_AVX2(160(DX), 192(DX), 224(DX), 256(DX), Y10, Y4, Y5) VPXOR Y0, Y8, Y8 VPXOR Y1, Y9, Y9 @@ -366,7 +365,6 @@ noinc: VMOVDQU Y9, 32(AX) VZEROUPPER - MOVQ DX, SP RET #define VPUNPCKLQDQ_X2_X2_X15 BYTE $0xC5; BYTE $0x69; BYTE $0x6C; BYTE $0xFA @@ -584,11 +582,9 @@ TEXT ·hashBlocksAVX(SB), 4, $288-48 // frame size = 272 + 16 byte alignment MOVQ blocks_base+24(FP), SI MOVQ blocks_len+32(FP), DI - MOVQ SP, BP - MOVQ SP, R9 - ADDQ $15, R9 - ANDQ $~15, R9 - MOVQ R9, SP + MOVQ SP, R10 + ADDQ $15, R10 + ANDQ $~15, R10 VMOVDQU ·AVX_c40<>(SB), X0 VMOVDQU ·AVX_c48<>(SB), X1 @@ -596,8 +592,8 @@ TEXT ·hashBlocksAVX(SB), 4, $288-48 // frame size = 272 + 16 byte alignment VMOVDQA X1, X9 VMOVDQU ·AVX_iv3<>(SB), X0 - VMOVDQA X0, 0(SP) - XORQ CX, 0(SP) // 0(SP) = ·AVX_iv3 ^ (CX || 0) + VMOVDQA X0, 0(R10) + XORQ CX, 0(R10) // 0(R10) = ·AVX_iv3 ^ (CX || 0) VMOVDQU 0(AX), X10 VMOVDQU 16(AX), X11 @@ -624,35 +620,35 @@ noinc: VMOVDQU ·AVX_iv2<>(SB), X6 VPXOR X15, X6, X6 - VMOVDQA 0(SP), X7 + VMOVDQA 0(R10), X7 LOAD_MSG_AVX_0_2_4_6_1_3_5_7() - VMOVDQA X12, 16(SP) - VMOVDQA X13, 32(SP) - VMOVDQA X14, 48(SP) - VMOVDQA X15, 64(SP) + VMOVDQA X12, 16(R10) + VMOVDQA X13, 32(R10) + VMOVDQA X14, 48(R10) + VMOVDQA X15, 64(R10) HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX() LOAD_MSG_AVX(8, 10, 12, 14, 9, 11, 13, 15) - VMOVDQA X12, 80(SP) - VMOVDQA X13, 96(SP) - VMOVDQA X14, 112(SP) - VMOVDQA X15, 128(SP) + VMOVDQA X12, 80(R10) + VMOVDQA X13, 96(R10) + VMOVDQA X14, 112(R10) + VMOVDQA X15, 128(R10) HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX_INV() LOAD_MSG_AVX(14, 4, 9, 13, 10, 8, 15, 6) - VMOVDQA X12, 144(SP) - VMOVDQA X13, 160(SP) - VMOVDQA X14, 176(SP) - VMOVDQA X15, 192(SP) + VMOVDQA X12, 144(R10) + VMOVDQA X13, 160(R10) + VMOVDQA X14, 176(R10) + VMOVDQA X15, 192(R10) HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX() LOAD_MSG_AVX_1_0_11_5_12_2_7_3() - VMOVDQA X12, 208(SP) - VMOVDQA X13, 224(SP) - VMOVDQA X14, 240(SP) - VMOVDQA X15, 256(SP) + VMOVDQA X12, 208(R10) + VMOVDQA X13, 224(R10) + VMOVDQA X14, 240(R10) + VMOVDQA X15, 256(R10) HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX_INV() @@ -712,14 +708,14 @@ noinc: HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX_INV() - HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X15, X8, X9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 16(R10), 32(R10), 48(R10), 64(R10), X15, X8, X9) SHUFFLE_AVX() - HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 80(SP), 96(SP), 112(SP), 128(SP), X15, X8, X9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 80(R10), 96(R10), 112(R10), 128(R10), X15, X8, X9) SHUFFLE_AVX_INV() - HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 144(SP), 160(SP), 176(SP), 192(SP), X15, X8, X9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 144(R10), 160(R10), 176(R10), 192(R10), X15, X8, X9) SHUFFLE_AVX() - HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 208(SP), 224(SP), 240(SP), 256(SP), X15, X8, X9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 208(R10), 224(R10), 240(R10), 256(R10), X15, X8, X9) SHUFFLE_AVX_INV() VMOVDQU 32(AX), X14 @@ -746,5 +742,4 @@ noinc: MOVQ R9, 8(BX) VZEROUPPER - MOVQ BP, SP RET diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go index 30e2fcd581fd5..5fa1b32841df3 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_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 !go1.7,amd64,!gccgo,!appengine +//go:build !go1.7 && amd64 && gc && !purego +// +build !go1.7,amd64,gc,!purego package blake2b diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s index 578e947b3bf90..ae75eb9afcd7a 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_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 amd64 && gc && !purego +// +build amd64,gc,!purego #include "textflag.h" @@ -118,15 +119,13 @@ TEXT ·hashBlocksSSE4(SB), 4, $288-48 // frame size = 272 + 16 byte alignment MOVQ blocks_base+24(FP), SI MOVQ blocks_len+32(FP), DI - MOVQ SP, BP - MOVQ SP, R9 - ADDQ $15, R9 - ANDQ $~15, R9 - MOVQ R9, SP + MOVQ SP, R10 + ADDQ $15, R10 + ANDQ $~15, R10 MOVOU ·iv3<>(SB), X0 - MOVO X0, 0(SP) - XORQ CX, 0(SP) // 0(SP) = ·iv3 ^ (CX || 0) + MOVO X0, 0(R10) + XORQ CX, 0(R10) // 0(R10) = ·iv3 ^ (CX || 0) MOVOU ·c40<>(SB), X13 MOVOU ·c48<>(SB), X14 @@ -156,35 +155,35 @@ noinc: MOVOU ·iv2<>(SB), X6 PXOR X8, X6 - MOVO 0(SP), X7 + MOVO 0(R10), X7 LOAD_MSG(X8, X9, X10, X11, SI, 0, 2, 4, 6, 1, 3, 5, 7) - MOVO X8, 16(SP) - MOVO X9, 32(SP) - MOVO X10, 48(SP) - MOVO X11, 64(SP) + MOVO X8, 16(R10) + MOVO X9, 32(R10) + MOVO X10, 48(R10) + MOVO X11, 64(R10) HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) LOAD_MSG(X8, X9, X10, X11, SI, 8, 10, 12, 14, 9, 11, 13, 15) - MOVO X8, 80(SP) - MOVO X9, 96(SP) - MOVO X10, 112(SP) - MOVO X11, 128(SP) + MOVO X8, 80(R10) + MOVO X9, 96(R10) + MOVO X10, 112(R10) + MOVO X11, 128(R10) HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) LOAD_MSG(X8, X9, X10, X11, SI, 14, 4, 9, 13, 10, 8, 15, 6) - MOVO X8, 144(SP) - MOVO X9, 160(SP) - MOVO X10, 176(SP) - MOVO X11, 192(SP) + MOVO X8, 144(R10) + MOVO X9, 160(R10) + MOVO X10, 176(R10) + MOVO X11, 192(R10) HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) LOAD_MSG(X8, X9, X10, X11, SI, 1, 0, 11, 5, 12, 2, 7, 3) - MOVO X8, 208(SP) - MOVO X9, 224(SP) - MOVO X10, 240(SP) - MOVO X11, 256(SP) + MOVO X8, 208(R10) + MOVO X9, 224(R10) + MOVO X10, 240(R10) + MOVO X11, 256(R10) HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) @@ -244,14 +243,14 @@ noinc: HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) - HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X11, X13, X14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 16(R10), 32(R10), 48(R10), 64(R10), X11, X13, X14) SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) - HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 80(SP), 96(SP), 112(SP), 128(SP), X11, X13, X14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 80(R10), 96(R10), 112(R10), 128(R10), X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) - HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 144(SP), 160(SP), 176(SP), 192(SP), X11, X13, X14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 144(R10), 160(R10), 176(R10), 192(R10), X11, X13, X14) SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) - HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 208(SP), 224(SP), 240(SP), 256(SP), X11, X13, X14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 208(R10), 224(R10), 240(R10), 256(R10), X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) MOVOU 32(AX), X10 @@ -277,5 +276,4 @@ noinc: MOVQ R8, 0(BX) MOVQ R9, 8(BX) - MOVQ BP, SP RET diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go b/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go index da156a1ba62cc..b0137cdf025cb 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_ref.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 blake2b diff --git a/vendor/golang.org/x/crypto/blake2b/register.go b/vendor/golang.org/x/crypto/blake2b/register.go index efd689af4b49c..9d8633963cb6e 100644 --- a/vendor/golang.org/x/crypto/blake2b/register.go +++ b/vendor/golang.org/x/crypto/blake2b/register.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 blake2b diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go b/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go index b799e440b4a17..94c71ac1ac863 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go +++ b/vendor/golang.org/x/crypto/chacha20/chacha_arm64.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 go1.11,!gccgo,!purego +//go:build go1.11 && gc && !purego +// +build go1.11,gc,!purego package chacha20 diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_arm64.s b/vendor/golang.org/x/crypto/chacha20/chacha_arm64.s index 891481539a114..63cae9e6f0b1b 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_arm64.s +++ b/vendor/golang.org/x/crypto/chacha20/chacha_arm64.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 go1.11,!gccgo,!purego +//go:build go1.11 && gc && !purego +// +build go1.11,gc,!purego #include "textflag.h" diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go b/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go index 4635307b8f299..025b49897e32b 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go +++ b/vendor/golang.org/x/crypto/chacha20/chacha_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 !arm64,!s390x,!ppc64le arm64,!go1.11 gccgo purego +//go:build (!arm64 && !s390x && !ppc64le) || (arm64 && !go1.11) || !gc || purego +// +build !arm64,!s390x,!ppc64le arm64,!go1.11 !gc purego package chacha20 diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go index b799330341566..da420b2e97b03 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go +++ b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.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 !gccgo,!purego +//go:build gc && !purego +// +build gc,!purego package chacha20 diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s index 23c602164301c..5c0fed26f8502 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s +++ b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s @@ -19,7 +19,8 @@ // The differences in this and the original implementation are // due to the calling conventions and initialization of constants. -// +build !gccgo,!purego +//go:build gc && !purego +// +build gc,!purego #include "textflag.h" diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go b/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go index a9244bdf4dbfd..c5898db465845 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go +++ b/vendor/golang.org/x/crypto/chacha20/chacha_s390x.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 !gccgo,!purego +//go:build gc && !purego +// +build gc,!purego package chacha20 diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_s390x.s b/vendor/golang.org/x/crypto/chacha20/chacha_s390x.s index 89c658c410bf6..f3ef5a019d959 100644 --- a/vendor/golang.org/x/crypto/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 !gccgo,!purego +//go:build gc && !purego +// +build gc,!purego #include "go_asm.h" #include "textflag.h" diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519.go b/vendor/golang.org/x/crypto/curve25519/curve25519.go index 4b9a655d1b562..cda3fdd3540dd 100644 --- a/vendor/golang.org/x/crypto/curve25519/curve25519.go +++ b/vendor/golang.org/x/crypto/curve25519/curve25519.go @@ -10,6 +10,8 @@ package curve25519 // import "golang.org/x/crypto/curve25519" import ( "crypto/subtle" "fmt" + + "golang.org/x/crypto/curve25519/internal/field" ) // ScalarMult sets dst to the product scalar * point. @@ -18,7 +20,55 @@ import ( // zeroes, irrespective of the scalar. Instead, use the X25519 function, which // will return an error. func ScalarMult(dst, scalar, point *[32]byte) { - scalarMult(dst, scalar, point) + var e [32]byte + + copy(e[:], scalar[:]) + e[0] &= 248 + e[31] &= 127 + e[31] |= 64 + + var x1, x2, z2, x3, z3, tmp0, tmp1 field.Element + x1.SetBytes(point[:]) + x2.One() + x3.Set(&x1) + z3.One() + + 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()) } // ScalarBaseMult sets dst to the product scalar * base where base is the diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519_amd64.go b/vendor/golang.org/x/crypto/curve25519/curve25519_amd64.go deleted file mode 100644 index 5120b779b9b48..0000000000000 --- a/vendor/golang.org/x/crypto/curve25519/curve25519_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,!purego - -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/curve25519_amd64.s b/vendor/golang.org/x/crypto/curve25519/curve25519_amd64.s deleted file mode 100644 index 0250c8885929d..0000000000000 --- a/vendor/golang.org/x/crypto/curve25519/curve25519_amd64.s +++ /dev/null @@ -1,1793 +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,!purego - -#define REDMASK51 0x0007FFFFFFFFFFFF - -// 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 - -// 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 - -// 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 - -// 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 - -// 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 - -// 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/curve25519/curve25519_generic.go b/vendor/golang.org/x/crypto/curve25519/curve25519_generic.go deleted file mode 100644 index c43b13fc83e70..0000000000000 --- a/vendor/golang.org/x/crypto/curve25519/curve25519_generic.go +++ /dev/null @@ -1,828 +0,0 @@ -// Copyright 2013 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 - -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 - - 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) -} - -// 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))). -// -// 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. - - 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 - - // 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]. - - 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) -} - -// 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. -// -// 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) -} - -// 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 - - 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 - - carry[9] = (h9 + (1 << 24)) >> 25 - h0 += carry[9] * 19 - h9 -= carry[9] << 25 - - carry[0] = (h0 + (1 << 25)) >> 26 - h1 += carry[0] - h0 -= carry[0] << 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) -} - -// feMul121666 calculates h = f * 121666. 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 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) -} - -func scalarMultGeneric(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) -} diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go b/vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go deleted file mode 100644 index 047d49afc27e3..0000000000000 --- a/vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go +++ /dev/null @@ -1,11 +0,0 @@ -// 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. - -// +build !amd64 gccgo appengine purego - -package curve25519 - -func scalarMult(out, in, base *[32]byte) { - scalarMultGeneric(out, in, base) -} 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 0000000000000..e25bca7dc806b --- /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 0000000000000..ca841ad99e3ab --- /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 0000000000000..44dc8e8caf916 --- /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 0000000000000..293f013c94a66 --- /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 0000000000000..ddb6c9b8f7f24 --- /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 0000000000000..af459ef51549e --- /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 0000000000000..5c91e458923e3 --- /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 0000000000000..234a5b2e5d18a --- /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 0000000000000..7b5b78cbd6d7b --- /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 0000000000000..e3685f95cab22 --- /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 0000000000000..1ba22a8b4c9a2 --- /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/ed25519/ed25519.go b/vendor/golang.org/x/crypto/ed25519/ed25519.go index c7f8c7e64ec83..71ad917dadd8d 100644 --- a/vendor/golang.org/x/crypto/ed25519/ed25519.go +++ b/vendor/golang.org/x/crypto/ed25519/ed25519.go @@ -5,6 +5,7 @@ // 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 diff --git a/vendor/golang.org/x/crypto/ed25519/ed25519_go113.go b/vendor/golang.org/x/crypto/ed25519/ed25519_go113.go index d1448d8d22022..b5974dc8b27bb 100644 --- a/vendor/golang.org/x/crypto/ed25519/ed25519_go113.go +++ b/vendor/golang.org/x/crypto/ed25519/ed25519_go113.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.13 // +build go1.13 // Package ed25519 implements the Ed25519 signature algorithm. See diff --git a/vendor/golang.org/x/crypto/poly1305/bits_compat.go b/vendor/golang.org/x/crypto/internal/poly1305/bits_compat.go similarity index 98% rename from vendor/golang.org/x/crypto/poly1305/bits_compat.go rename to vendor/golang.org/x/crypto/internal/poly1305/bits_compat.go index 157a69f61bd9a..45b5c966b2be3 100644 --- a/vendor/golang.org/x/crypto/poly1305/bits_compat.go +++ b/vendor/golang.org/x/crypto/internal/poly1305/bits_compat.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.13 // +build !go1.13 package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/bits_go1.13.go b/vendor/golang.org/x/crypto/internal/poly1305/bits_go1.13.go similarity index 96% rename from vendor/golang.org/x/crypto/poly1305/bits_go1.13.go rename to vendor/golang.org/x/crypto/internal/poly1305/bits_go1.13.go index a0a185f0fc771..ed52b3418ab53 100644 --- a/vendor/golang.org/x/crypto/poly1305/bits_go1.13.go +++ b/vendor/golang.org/x/crypto/internal/poly1305/bits_go1.13.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.13 // +build go1.13 package poly1305 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 d118f30ed56c0..f184b67d98db2 100644 --- a/vendor/golang.org/x/crypto/poly1305/mac_noasm.go +++ b/vendor/golang.org/x/crypto/internal/poly1305/mac_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,!ppc64le,!s390x gccgo purego +//go:build (!amd64 && !ppc64le && !s390x) || !gc || purego +// +build !amd64,!ppc64le,!s390x !gc purego package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/poly1305.go b/vendor/golang.org/x/crypto/internal/poly1305/poly1305.go similarity index 98% rename from vendor/golang.org/x/crypto/poly1305/poly1305.go rename to vendor/golang.org/x/crypto/internal/poly1305/poly1305.go index 9d7a6af09feb4..4aaea810a2682 100644 --- a/vendor/golang.org/x/crypto/poly1305/poly1305.go +++ b/vendor/golang.org/x/crypto/internal/poly1305/poly1305.go @@ -15,7 +15,7 @@ // 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" diff --git a/vendor/golang.org/x/crypto/poly1305/sum_amd64.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.go similarity index 95% rename from vendor/golang.org/x/crypto/poly1305/sum_amd64.go rename to vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.go index 99e5a1d50efcc..6d522333f29e8 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_amd64.go +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_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 !gccgo,!purego +//go:build gc && !purego +// +build gc,!purego package poly1305 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 98% rename from vendor/golang.org/x/crypto/poly1305/sum_amd64.s rename to vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s index 8d394a212ee92..1d74f0f88189b 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 !gccgo,!purego +//go:build gc && !purego +// +build gc,!purego #include "textflag.h" diff --git a/vendor/golang.org/x/crypto/poly1305/sum_generic.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go similarity index 100% rename from vendor/golang.org/x/crypto/poly1305/sum_generic.go rename to vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go diff --git a/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.go similarity index 95% rename from vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go rename to vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.go index 2e7a120b1923d..4a069941a6ef9 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.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 !gccgo,!purego +//go:build gc && !purego +// +build gc,!purego package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.s b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s similarity index 94% rename from vendor/golang.org/x/crypto/poly1305/sum_ppc64le.s rename to vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s index 4e02813879682..58422aad23057 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.s +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.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 !gccgo,!purego +//go:build gc && !purego +// +build gc,!purego #include "textflag.h" @@ -82,7 +83,7 @@ multiply: BGE loop bytes_between_0_and_15: - CMP $0, R5 + CMP R5, $0 BEQ done MOVD $0, R16 // h0 MOVD $0, R17 // h1 @@ -122,7 +123,7 @@ just1: // Exactly 8 MOVD (R4), R16 - CMP $0, R17 + CMP R17, $0 // Check if we've already set R17; if not // set 1 to indicate end of msg. @@ -151,7 +152,7 @@ less4: ADD $2, R4 less2: - CMP $0, R5 + CMP R5, $0 BEQ insert1 MOVBZ (R4), R21 SLD R22, R21, R21 @@ -166,12 +167,12 @@ insert1: carry: // Add new values to h0, h1, h2 - ADDC R16, R8 - ADDE R17, R9 - ADDE $0, R10 - MOVD $16, R5 - ADD R5, R4 - BR multiply + ADDC R16, R8 + ADDE R17, R9 + ADDZE R10, R10 + MOVD $16, R5 + ADD R5, R4 + BR multiply done: // Save h0, h1, h2 in state diff --git a/vendor/golang.org/x/crypto/poly1305/sum_s390x.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.go similarity index 97% rename from vendor/golang.org/x/crypto/poly1305/sum_s390x.go rename to vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.go index 958fedc0790b1..62cc9f84709e3 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_s390x.go +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.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 !gccgo,!purego +//go:build gc && !purego +// +build gc,!purego package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/sum_s390x.s b/vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.s similarity index 99% rename from vendor/golang.org/x/crypto/poly1305/sum_s390x.s rename to vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.s index 0fa9ee6e0bffc..aa9e0494c909d 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_s390x.s +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_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 !gccgo,!purego +//go:build gc && !purego +// +build gc,!purego #include "textflag.h" @@ -17,7 +18,7 @@ // 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 accomodate +// 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). diff --git a/vendor/golang.org/x/crypto/internal/subtle/aliasing.go b/vendor/golang.org/x/crypto/internal/subtle/aliasing.go index f38797bfa1bfb..4fad24f8dcde8 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 0cc4a8a642c91..80ccbed2c0de2 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/openpgp/armor/armor.go b/vendor/golang.org/x/crypto/openpgp/armor/armor.go index 36a6804364ca6..ebc87876e6a50 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 ( diff --git a/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go b/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go index 72a6a739471ab..84396a0896692 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 ( diff --git a/vendor/golang.org/x/crypto/openpgp/errors/errors.go b/vendor/golang.org/x/crypto/openpgp/errors/errors.go index eb0550b2d04f9..1d7a0ea05adf1 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/packet.go b/vendor/golang.org/x/crypto/openpgp/packet/packet.go index 9728d61d7aa51..0a19794a8e49c 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 ( diff --git a/vendor/golang.org/x/crypto/openpgp/read.go b/vendor/golang.org/x/crypto/openpgp/read.go index 6ec664f44a172..48a893146858c 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 4b9a44ca26d65..9de04958ead0d 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/scrypt/scrypt.go b/vendor/golang.org/x/crypto/scrypt/scrypt.go index 2f81fe4148e95..bbe4494c6c982 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/cipher.go b/vendor/golang.org/x/crypto/ssh/cipher.go index 8bd6b3daff524..bddbde5dbde9f 100644 --- a/vendor/golang.org/x/crypto/ssh/cipher.go +++ b/vendor/golang.org/x/crypto/ssh/cipher.go @@ -18,7 +18,7 @@ import ( "io/ioutil" "golang.org/x/crypto/chacha20" - "golang.org/x/crypto/poly1305" + "golang.org/x/crypto/internal/poly1305" ) const ( diff --git a/vendor/golang.org/x/crypto/ssh/client.go b/vendor/golang.org/x/crypto/ssh/client.go index 7b00bff1caa5e..99f68bd32e959 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 0590070e220b0..c611aeb684673 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/kex.go b/vendor/golang.org/x/crypto/ssh/kex.go index 7eedb209fa7fb..766e9293975e3 100644 --- a/vendor/golang.org/x/crypto/ssh/kex.go +++ b/vendor/golang.org/x/crypto/ssh/kex.go @@ -557,8 +557,6 @@ type dhGEXSHA struct { hashFunc crypto.Hash } -const numMRTests = 64 - const ( dhGroupExchangeMinimumBits = 2048 dhGroupExchangePreferredBits = 2048 @@ -602,15 +600,8 @@ func (gex dhGEXSHA) Client(c packetConn, randSource io.Reader, magics *handshake gex.p = kexDHGexGroup.P gex.g = kexDHGexGroup.G - // Check if p is safe by verifing that p and (p-1)/2 are primes - one := big.NewInt(1) - var pHalf = &big.Int{} - pHalf.Rsh(gex.p, 1) - if !gex.p.ProbablyPrime(numMRTests) || !pHalf.ProbablyPrime(numMRTests) { - return nil, fmt.Errorf("ssh: server provided gex p is not safe") - } - // 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 { @@ -618,6 +609,8 @@ func (gex dhGEXSHA) Client(c packetConn, randSource io.Reader, magics *handshake } // Send GexInit + var pHalf = &big.Int{} + pHalf.Rsh(gex.p, 1) x, err := rand.Int(randSource, pHalf) if err != nil { return nil, err diff --git a/vendor/golang.org/x/crypto/ssh/mux.go b/vendor/golang.org/x/crypto/ssh/mux.go index f19016270e8f9..9654c01869ad1 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 7d42a8c88d26b..b6911e8306d67 100644 --- a/vendor/golang.org/x/crypto/ssh/server.go +++ b/vendor/golang.org/x/crypto/ssh/server.go @@ -572,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/mod/internal/lazyregexp/lazyre.go b/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go new file mode 100644 index 0000000000000..2681af35af195 --- /dev/null +++ b/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go @@ -0,0 +1,78 @@ +// 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 lazyregexp is a thin wrapper over regexp, allowing the use of global +// regexp variables without forcing them to be compiled at init. +package lazyregexp + +import ( + "os" + "regexp" + "strings" + "sync" +) + +// Regexp is a wrapper around regexp.Regexp, where the underlying regexp will be +// compiled the first time it is needed. +type Regexp struct { + str string + once sync.Once + rx *regexp.Regexp +} + +func (r *Regexp) re() *regexp.Regexp { + r.once.Do(r.build) + return r.rx +} + +func (r *Regexp) build() { + r.rx = regexp.MustCompile(r.str) + r.str = "" +} + +func (r *Regexp) FindSubmatch(s []byte) [][]byte { + return r.re().FindSubmatch(s) +} + +func (r *Regexp) FindStringSubmatch(s string) []string { + return r.re().FindStringSubmatch(s) +} + +func (r *Regexp) FindStringSubmatchIndex(s string) []int { + return r.re().FindStringSubmatchIndex(s) +} + +func (r *Regexp) ReplaceAllString(src, repl string) string { + return r.re().ReplaceAllString(src, repl) +} + +func (r *Regexp) FindString(s string) string { + return r.re().FindString(s) +} + +func (r *Regexp) FindAllString(s string, n int) []string { + return r.re().FindAllString(s, n) +} + +func (r *Regexp) MatchString(s string) bool { + return r.re().MatchString(s) +} + +func (r *Regexp) SubexpNames() []string { + return r.re().SubexpNames() +} + +var inTest = len(os.Args) > 0 && strings.HasSuffix(strings.TrimSuffix(os.Args[0], ".exe"), ".test") + +// New creates a new lazy regexp, delaying the compiling work until it is first +// needed. If the code is being run as part of tests, the regexp compiling will +// happen immediately. +func New(str string) *Regexp { + lr := &Regexp{str: str} + if inTest { + // In tests, always compile the regexps early. + lr.re() + } + return lr +} diff --git a/vendor/golang.org/x/mod/module/module.go b/vendor/golang.org/x/mod/module/module.go index 6cd37280a85f5..c26d1d29ec3d0 100644 --- a/vendor/golang.org/x/mod/module/module.go +++ b/vendor/golang.org/x/mod/module/module.go @@ -15,7 +15,7 @@ // but additional checking functions, most notably Check, verify that // a particular path, version pair is valid. // -// Escaped Paths +// # Escaped Paths // // Module paths appear as substrings of file system paths // (in the download cache) and of web server URLs in the proxy protocol. @@ -55,7 +55,7 @@ // Import paths have never allowed exclamation marks, so there is no // need to define how to escape a literal !. // -// Unicode Restrictions +// # Unicode Restrictions // // Today, paths are disallowed from using Unicode. // @@ -97,13 +97,14 @@ package module import ( "fmt" + "path" "sort" "strings" "unicode" "unicode/utf8" + "errors" "golang.org/x/mod/semver" - errors "golang.org/x/xerrors" ) // A Version (for clients, a module.Version) is defined by a module path and version pair. @@ -191,6 +192,21 @@ func (e *InvalidVersionError) Error() string { func (e *InvalidVersionError) Unwrap() error { return e.Err } +// An InvalidPathError indicates a module, import, or file path doesn't +// satisfy all naming constraints. See CheckPath, CheckImportPath, +// and CheckFilePath for specific restrictions. +type InvalidPathError struct { + Kind string // "module", "import", or "file" + Path string + Err error +} + +func (e *InvalidPathError) Error() string { + return fmt.Sprintf("malformed %s path %q: %v", e.Kind, e.Path, e.Err) +} + +func (e *InvalidPathError) Unwrap() error { return e.Err } + // Check checks that a given module path, version pair is valid. // In addition to the path being a valid module path // and the version being a valid semantic version, @@ -223,14 +239,18 @@ func firstPathOK(r rune) bool { 'a' <= r && r <= 'z' } -// pathOK reports whether r can appear in an import path element. -// Paths can be ASCII letters, ASCII digits, and limited ASCII punctuation: + - . _ and ~. -// This matches what "go get" has historically recognized in import paths. +// modPathOK reports whether r can appear in a module path element. +// Paths can be ASCII letters, ASCII digits, and limited ASCII punctuation: - . _ and ~. +// +// This matches what "go get" has historically recognized in import paths, +// and avoids confusing sequences like '%20' or '+' that would change meaning +// if used in a URL. +// // TODO(rsc): We would like to allow Unicode letters, but that requires additional // care in the safe encoding (see "escaped paths" above). -func pathOK(r rune) bool { +func modPathOK(r rune) bool { if r < utf8.RuneSelf { - return r == '+' || r == '-' || r == '.' || r == '_' || r == '~' || + return r == '-' || r == '.' || r == '_' || r == '~' || '0' <= r && r <= '9' || 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' @@ -238,6 +258,17 @@ func pathOK(r rune) bool { return false } +// modPathOK reports whether r can appear in a package import path element. +// +// Import paths are intermediate between module paths and file paths: we allow +// disallow characters that would be confusing or ambiguous as arguments to +// 'go get' (such as '@' and ' ' ), but allow certain characters that are +// otherwise-unambiguous on the command line and historically used for some +// binary names (such as '++' as a suffix for compiler binaries and wrappers). +func importPathOK(r rune) bool { + return modPathOK(r) || r == '+' +} + // fileNameOK reports whether r can appear in a file name. // For now we allow all Unicode letters but otherwise limit to pathOK plus a few more punctuation characters. // If we expand the set of allowed characters here, we have to @@ -255,12 +286,7 @@ func fileNameOK(r rune) bool { if '0' <= r && r <= '9' || 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' { return true } - for i := 0; i < len(allowed); i++ { - if rune(allowed[i]) == r { - return true - } - } - return false + return strings.ContainsRune(allowed, r) } // It may be OK to add more ASCII punctuation here, but only carefully. // For example Windows disallows < > \, and macOS disallows :, so we must not allow those. @@ -269,7 +295,7 @@ func fileNameOK(r rune) bool { // CheckPath checks that a module path is valid. // A valid module path is a valid import path, as checked by CheckImportPath, -// with two additional constraints. +// with three additional constraints. // First, the leading path element (up to the first slash, if any), // by convention a domain name, must contain only lower-case ASCII letters, // ASCII digits, dots (U+002E), and dashes (U+002D); @@ -279,30 +305,37 @@ func fileNameOK(r rune) bool { // and must not contain any dots. For paths beginning with "gopkg.in/", // this second requirement is replaced by a requirement that the path // follow the gopkg.in server's conventions. -func CheckPath(path string) error { - if err := checkPath(path, false); err != nil { - return fmt.Errorf("malformed module path %q: %v", path, err) +// Third, no path element may begin with a dot. +func CheckPath(path string) (err error) { + defer func() { + if err != nil { + err = &InvalidPathError{Kind: "module", Path: path, Err: err} + } + }() + + if err := checkPath(path, modulePath); err != nil { + return err } i := strings.Index(path, "/") if i < 0 { i = len(path) } if i == 0 { - return fmt.Errorf("malformed module path %q: leading slash", path) + return fmt.Errorf("leading slash") } if !strings.Contains(path[:i], ".") { - return fmt.Errorf("malformed module path %q: missing dot in first path element", path) + return fmt.Errorf("missing dot in first path element") } if path[0] == '-' { - return fmt.Errorf("malformed module path %q: leading dash in first path element", path) + return fmt.Errorf("leading dash in first path element") } for _, r := range path[:i] { if !firstPathOK(r) { - return fmt.Errorf("malformed module path %q: invalid char %q in first path element", path, r) + return fmt.Errorf("invalid char %q in first path element", r) } } if _, _, ok := SplitPathVersion(path); !ok { - return fmt.Errorf("malformed module path %q: invalid version", path) + return fmt.Errorf("invalid version") } return nil } @@ -313,36 +346,49 @@ func CheckPath(path string) error { // separated by slashes (U+002F). (It must not begin with nor end in a slash.) // // A valid path element is a non-empty string made up of -// ASCII letters, ASCII digits, and limited ASCII punctuation: + - . _ and ~. -// It must not begin or end with a dot (U+002E), nor contain two dots in a row. +// ASCII letters, ASCII digits, and limited ASCII punctuation: - . _ and ~. +// It must not end with a dot (U+002E), nor contain two dots in a row. // // The element prefix up to the first dot must not be a reserved file name -// on Windows, regardless of case (CON, com1, NuL, and so on). +// on Windows, regardless of case (CON, com1, NuL, and so on). The element +// must not have a suffix of a tilde followed by one or more ASCII digits +// (to exclude paths elements that look like Windows short-names). // // CheckImportPath may be less restrictive in the future, but see the // top-level package documentation for additional information about // subtleties of Unicode. func CheckImportPath(path string) error { - if err := checkPath(path, false); err != nil { - return fmt.Errorf("malformed import path %q: %v", path, err) + if err := checkPath(path, importPath); err != nil { + return &InvalidPathError{Kind: "import", Path: path, Err: err} } return nil } -// checkPath checks that a general path is valid. -// It returns an error describing why but not mentioning path. -// Because these checks apply to both module paths and import paths, -// the caller is expected to add the "malformed ___ path %q: " prefix. -// fileName indicates whether the final element of the path is a file name -// (as opposed to a directory name). -func checkPath(path string, fileName bool) error { +// pathKind indicates what kind of path we're checking. Module paths, +// import paths, and file paths have different restrictions. +type pathKind int + +const ( + modulePath pathKind = iota + importPath + filePath +) + +// checkPath checks that a general path is valid. kind indicates what +// specific constraints should be applied. +// +// checkPath returns an error describing why the path is not valid. +// Because these checks apply to module, import, and file paths, +// and because other checks may be applied, the caller is expected to wrap +// this error with InvalidPathError. +func checkPath(path string, kind pathKind) error { if !utf8.ValidString(path) { return fmt.Errorf("invalid UTF-8") } if path == "" { return fmt.Errorf("empty string") } - if path[0] == '-' { + if path[0] == '-' && kind != filePath { return fmt.Errorf("leading dash") } if strings.Contains(path, "//") { @@ -354,39 +400,45 @@ func checkPath(path string, fileName bool) error { elemStart := 0 for i, r := range path { if r == '/' { - if err := checkElem(path[elemStart:i], fileName); err != nil { + if err := checkElem(path[elemStart:i], kind); err != nil { return err } elemStart = i + 1 } } - if err := checkElem(path[elemStart:], fileName); err != nil { + if err := checkElem(path[elemStart:], kind); err != nil { return err } return nil } // checkElem checks whether an individual path element is valid. -// fileName indicates whether the element is a file name (not a directory name). -func checkElem(elem string, fileName bool) error { +func checkElem(elem string, kind pathKind) error { if elem == "" { return fmt.Errorf("empty path element") } if strings.Count(elem, ".") == len(elem) { return fmt.Errorf("invalid path element %q", elem) } - if elem[0] == '.' && !fileName { + if elem[0] == '.' && kind == modulePath { return fmt.Errorf("leading dot in path element") } if elem[len(elem)-1] == '.' { return fmt.Errorf("trailing dot in path element") } - charOK := pathOK - if fileName { - charOK = fileNameOK - } for _, r := range elem { - if !charOK(r) { + ok := false + switch kind { + case modulePath: + ok = modPathOK(r) + case importPath: + ok = importPathOK(r) + case filePath: + ok = fileNameOK(r) + default: + panic(fmt.Sprintf("internal error: invalid kind %v", kind)) + } + if !ok { return fmt.Errorf("invalid char %q", r) } } @@ -402,6 +454,29 @@ func checkElem(elem string, fileName bool) error { return fmt.Errorf("%q disallowed as path element component on Windows", short) } } + + if kind == filePath { + // don't check for Windows short-names in file names. They're + // only an issue for import paths. + return nil + } + + // Reject path components that look like Windows short-names. + // Those usually end in a tilde followed by one or more ASCII digits. + if tilde := strings.LastIndexByte(short, '~'); tilde >= 0 && tilde < len(short)-1 { + suffix := short[tilde+1:] + suffixIsDigits := true + for _, r := range suffix { + if r < '0' || r > '9' { + suffixIsDigits = false + break + } + } + if suffixIsDigits { + return fmt.Errorf("trailing tilde and digits in path element") + } + } + return nil } @@ -418,8 +493,8 @@ func checkElem(elem string, fileName bool) error { // top-level package documentation for additional information about // subtleties of Unicode. func CheckFilePath(path string) error { - if err := checkPath(path, true); err != nil { - return fmt.Errorf("malformed file path %q: %v", path, err) + if err := checkPath(path, filePath); err != nil { + return &InvalidPathError{Kind: "file", Path: path, Err: err} } return nil } @@ -621,7 +696,7 @@ func EscapePath(path string) (escaped string, err error) { // Versions are allowed to be in non-semver form but must be valid file names // and not contain exclamation marks. func EscapeVersion(v string) (escaped string, err error) { - if err := checkElem(v, true); err != nil || strings.Contains(v, "!") { + if err := checkElem(v, filePath); err != nil || strings.Contains(v, "!") { return "", &InvalidVersionError{ Version: v, Err: fmt.Errorf("disallowed version string"), @@ -680,7 +755,7 @@ func UnescapeVersion(escaped string) (v string, err error) { if !ok { return "", fmt.Errorf("invalid escaped version %q", escaped) } - if err := checkElem(v, true); err != nil { + if err := checkElem(v, filePath); err != nil { return "", fmt.Errorf("invalid escaped version %q: %v", v, err) } return v, nil @@ -716,3 +791,51 @@ func unescapeString(escaped string) (string, bool) { } return string(buf), true } + +// MatchPrefixPatterns reports whether any path prefix of target matches one of +// the glob patterns (as defined by path.Match) in the comma-separated globs +// list. This implements the algorithm used when matching a module path to the +// GOPRIVATE environment variable, as described by 'go help module-private'. +// +// It ignores any empty or malformed patterns in the list. +// Trailing slashes on patterns are ignored. +func MatchPrefixPatterns(globs, target string) bool { + for globs != "" { + // Extract next non-empty glob in comma-separated list. + var glob string + if i := strings.Index(globs, ","); i >= 0 { + glob, globs = globs[:i], globs[i+1:] + } else { + glob, globs = globs, "" + } + glob = strings.TrimSuffix(glob, "/") + if glob == "" { + continue + } + + // A glob with N+1 path elements (N slashes) needs to be matched + // against the first N+1 path elements of target, + // which end just before the N+1'th slash. + n := strings.Count(glob, "/") + prefix := target + // Walk target, counting slashes, truncating at the N+1'th slash. + for i := 0; i < len(target); i++ { + if target[i] == '/' { + if n == 0 { + prefix = target[:i] + break + } + n-- + } + } + if n > 0 { + // Not enough prefix elements. + continue + } + matched, _ := path.Match(glob, prefix) + if matched { + return true + } + } + return false +} diff --git a/vendor/golang.org/x/mod/module/pseudo.go b/vendor/golang.org/x/mod/module/pseudo.go new file mode 100644 index 0000000000000..f04ad3788694f --- /dev/null +++ b/vendor/golang.org/x/mod/module/pseudo.go @@ -0,0 +1,250 @@ +// 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. + +// Pseudo-versions +// +// Code authors are expected to tag the revisions they want users to use, +// including prereleases. However, not all authors tag versions at all, +// and not all commits a user might want to try will have tags. +// A pseudo-version is a version with a special form that allows us to +// address an untagged commit and order that version with respect to +// other versions we might encounter. +// +// A pseudo-version takes one of the general forms: +// +// (1) vX.0.0-yyyymmddhhmmss-abcdef123456 +// (2) vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456 +// (3) vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456+incompatible +// (4) vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456 +// (5) vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456+incompatible +// +// If there is no recently tagged version with the right major version vX, +// then form (1) is used, creating a space of pseudo-versions at the bottom +// of the vX version range, less than any tagged version, including the unlikely v0.0.0. +// +// If the most recent tagged version before the target commit is vX.Y.Z or vX.Y.Z+incompatible, +// then the pseudo-version uses form (2) or (3), making it a prerelease for the next +// possible semantic version after vX.Y.Z. The leading 0 segment in the prerelease string +// ensures that the pseudo-version compares less than possible future explicit prereleases +// like vX.Y.(Z+1)-rc1 or vX.Y.(Z+1)-1. +// +// If the most recent tagged version before the target commit is vX.Y.Z-pre or vX.Y.Z-pre+incompatible, +// then the pseudo-version uses form (4) or (5), making it a slightly later prerelease. + +package module + +import ( + "errors" + "fmt" + "strings" + "time" + + "golang.org/x/mod/internal/lazyregexp" + "golang.org/x/mod/semver" +) + +var pseudoVersionRE = lazyregexp.New(`^v[0-9]+\.(0\.0-|\d+\.\d+-([^+]*\.)?0\.)\d{14}-[A-Za-z0-9]+(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$`) + +const PseudoVersionTimestampFormat = "20060102150405" + +// PseudoVersion returns a pseudo-version for the given major version ("v1") +// preexisting older tagged version ("" or "v1.2.3" or "v1.2.3-pre"), revision time, +// and revision identifier (usually a 12-byte commit hash prefix). +func PseudoVersion(major, older string, t time.Time, rev string) string { + if major == "" { + major = "v0" + } + segment := fmt.Sprintf("%s-%s", t.UTC().Format(PseudoVersionTimestampFormat), rev) + build := semver.Build(older) + older = semver.Canonical(older) + if older == "" { + return major + ".0.0-" + segment // form (1) + } + if semver.Prerelease(older) != "" { + return older + ".0." + segment + build // form (4), (5) + } + + // Form (2), (3). + // Extract patch from vMAJOR.MINOR.PATCH + i := strings.LastIndex(older, ".") + 1 + v, patch := older[:i], older[i:] + + // Reassemble. + return v + incDecimal(patch) + "-0." + segment + build +} + +// ZeroPseudoVersion returns a pseudo-version with a zero timestamp and +// revision, which may be used as a placeholder. +func ZeroPseudoVersion(major string) string { + return PseudoVersion(major, "", time.Time{}, "000000000000") +} + +// incDecimal returns the decimal string incremented by 1. +func incDecimal(decimal string) string { + // Scan right to left turning 9s to 0s until you find a digit to increment. + digits := []byte(decimal) + i := len(digits) - 1 + for ; i >= 0 && digits[i] == '9'; i-- { + digits[i] = '0' + } + if i >= 0 { + digits[i]++ + } else { + // digits is all zeros + digits[0] = '1' + digits = append(digits, '0') + } + return string(digits) +} + +// decDecimal returns the decimal string decremented by 1, or the empty string +// if the decimal is all zeroes. +func decDecimal(decimal string) string { + // Scan right to left turning 0s to 9s until you find a digit to decrement. + digits := []byte(decimal) + i := len(digits) - 1 + for ; i >= 0 && digits[i] == '0'; i-- { + digits[i] = '9' + } + if i < 0 { + // decimal is all zeros + return "" + } + if i == 0 && digits[i] == '1' && len(digits) > 1 { + digits = digits[1:] + } else { + digits[i]-- + } + return string(digits) +} + +// IsPseudoVersion reports whether v is a pseudo-version. +func IsPseudoVersion(v string) bool { + return strings.Count(v, "-") >= 2 && semver.IsValid(v) && pseudoVersionRE.MatchString(v) +} + +// IsZeroPseudoVersion returns whether v is a pseudo-version with a zero base, +// timestamp, and revision, as returned by ZeroPseudoVersion. +func IsZeroPseudoVersion(v string) bool { + return v == ZeroPseudoVersion(semver.Major(v)) +} + +// PseudoVersionTime returns the time stamp of the pseudo-version v. +// It returns an error if v is not a pseudo-version or if the time stamp +// embedded in the pseudo-version is not a valid time. +func PseudoVersionTime(v string) (time.Time, error) { + _, timestamp, _, _, err := parsePseudoVersion(v) + if err != nil { + return time.Time{}, err + } + t, err := time.Parse("20060102150405", timestamp) + if err != nil { + return time.Time{}, &InvalidVersionError{ + Version: v, + Pseudo: true, + Err: fmt.Errorf("malformed time %q", timestamp), + } + } + return t, nil +} + +// PseudoVersionRev returns the revision identifier of the pseudo-version v. +// It returns an error if v is not a pseudo-version. +func PseudoVersionRev(v string) (rev string, err error) { + _, _, rev, _, err = parsePseudoVersion(v) + return +} + +// PseudoVersionBase returns the canonical parent version, if any, upon which +// the pseudo-version v is based. +// +// If v has no parent version (that is, if it is "vX.0.0-[…]"), +// PseudoVersionBase returns the empty string and a nil error. +func PseudoVersionBase(v string) (string, error) { + base, _, _, build, err := parsePseudoVersion(v) + if err != nil { + return "", err + } + + switch pre := semver.Prerelease(base); pre { + case "": + // vX.0.0-yyyymmddhhmmss-abcdef123456 → "" + if build != "" { + // Pseudo-versions of the form vX.0.0-yyyymmddhhmmss-abcdef123456+incompatible + // are nonsensical: the "vX.0.0-" prefix implies that there is no parent tag, + // but the "+incompatible" suffix implies that the major version of + // the parent tag is not compatible with the module's import path. + // + // There are a few such entries in the index generated by proxy.golang.org, + // but we believe those entries were generated by the proxy itself. + return "", &InvalidVersionError{ + Version: v, + Pseudo: true, + Err: fmt.Errorf("lacks base version, but has build metadata %q", build), + } + } + return "", nil + + case "-0": + // vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456 → vX.Y.Z + // vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456+incompatible → vX.Y.Z+incompatible + base = strings.TrimSuffix(base, pre) + i := strings.LastIndexByte(base, '.') + if i < 0 { + panic("base from parsePseudoVersion missing patch number: " + base) + } + patch := decDecimal(base[i+1:]) + if patch == "" { + // vX.0.0-0 is invalid, but has been observed in the wild in the index + // generated by requests to proxy.golang.org. + // + // NOTE(bcmills): I cannot find a historical bug that accounts for + // pseudo-versions of this form, nor have I seen such versions in any + // actual go.mod files. If we find actual examples of this form and a + // reasonable theory of how they came into existence, it seems fine to + // treat them as equivalent to vX.0.0 (especially since the invalid + // pseudo-versions have lower precedence than the real ones). For now, we + // reject them. + return "", &InvalidVersionError{ + Version: v, + Pseudo: true, + Err: fmt.Errorf("version before %s would have negative patch number", base), + } + } + return base[:i+1] + patch + build, nil + + default: + // vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456 → vX.Y.Z-pre + // vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456+incompatible → vX.Y.Z-pre+incompatible + if !strings.HasSuffix(base, ".0") { + panic(`base from parsePseudoVersion missing ".0" before date: ` + base) + } + return strings.TrimSuffix(base, ".0") + build, nil + } +} + +var errPseudoSyntax = errors.New("syntax error") + +func parsePseudoVersion(v string) (base, timestamp, rev, build string, err error) { + if !IsPseudoVersion(v) { + return "", "", "", "", &InvalidVersionError{ + Version: v, + Pseudo: true, + Err: errPseudoSyntax, + } + } + build = semver.Build(v) + v = strings.TrimSuffix(v, build) + j := strings.LastIndex(v, "-") + v, rev = v[:j], v[j+1:] + i := strings.LastIndex(v, "-") + if j := strings.LastIndex(v, "."); j > i { + base = v[:j] // "vX.Y.Z-pre.0" or "vX.Y.(Z+1)-0" + timestamp = v[j+1:] + } else { + base = v[:i] // "vX.0.0" + timestamp = v[i+1:] + } + return base, timestamp, rev, build, nil +} diff --git a/vendor/golang.org/x/mod/semver/semver.go b/vendor/golang.org/x/mod/semver/semver.go index 2988e3cf9c507..a30a22bf20f18 100644 --- a/vendor/golang.org/x/mod/semver/semver.go +++ b/vendor/golang.org/x/mod/semver/semver.go @@ -22,6 +22,8 @@ // as shorthands for vMAJOR.0.0 and vMAJOR.MINOR.0. package semver +import "sort" + // parsed returns the parsed form of a semantic version string. type parsed struct { major string @@ -30,7 +32,6 @@ type parsed struct { short string prerelease string build string - err string } // IsValid reports whether v is a valid semantic version string. @@ -138,6 +139,9 @@ func Compare(v, w string) int { // Max canonicalizes its arguments and then returns the version string // that compares greater. +// +// Deprecated: use Compare instead. In most cases, returning a canonicalized +// version is not expected or desired. func Max(v, w string) string { v = Canonical(v) w = Canonical(w) @@ -147,14 +151,30 @@ func Max(v, w string) string { return w } +// ByVersion implements sort.Interface for sorting semantic version strings. +type ByVersion []string + +func (vs ByVersion) Len() int { return len(vs) } +func (vs ByVersion) Swap(i, j int) { vs[i], vs[j] = vs[j], vs[i] } +func (vs ByVersion) Less(i, j int) bool { + cmp := Compare(vs[i], vs[j]) + if cmp != 0 { + return cmp < 0 + } + return vs[i] < vs[j] +} + +// Sort sorts a list of semantic version strings using ByVersion. +func Sort(list []string) { + sort.Sort(ByVersion(list)) +} + func parse(v string) (p parsed, ok bool) { if v == "" || v[0] != 'v' { - p.err = "missing v prefix" return } p.major, v, ok = parseInt(v[1:]) if !ok { - p.err = "bad major version" return } if v == "" { @@ -164,13 +184,11 @@ func parse(v string) (p parsed, ok bool) { return } if v[0] != '.' { - p.err = "bad minor prefix" ok = false return } p.minor, v, ok = parseInt(v[1:]) if !ok { - p.err = "bad minor version" return } if v == "" { @@ -179,31 +197,26 @@ func parse(v string) (p parsed, ok bool) { return } if v[0] != '.' { - p.err = "bad patch prefix" ok = false return } p.patch, v, ok = parseInt(v[1:]) if !ok { - p.err = "bad patch version" return } if len(v) > 0 && v[0] == '-' { p.prerelease, v, ok = parsePrerelease(v) if !ok { - p.err = "bad prerelease" return } } if len(v) > 0 && v[0] == '+' { p.build, v, ok = parseBuild(v) if !ok { - p.err = "bad build" return } } if v != "" { - p.err = "junk on end" ok = false return } diff --git a/vendor/golang.org/x/net/AUTHORS b/vendor/golang.org/x/net/AUTHORS deleted file mode 100644 index 15167cd746c56..0000000000000 --- 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 1c4577e968061..0000000000000 --- 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 a3c021d3f88e9..cf66309c4a8b8 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 d20f52b7de93f..2cb9c408f2e78 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 @@ -31,7 +32,7 @@ var DeadlineExceeded = context.DeadlineExceeded // call cancel as soon as the operations running in this Context complete. func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { ctx, f := context.WithCancel(parent) - return ctx, CancelFunc(f) + return ctx, f } // WithDeadline returns a copy of the parent context with the deadline adjusted @@ -45,7 +46,7 @@ func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { // call cancel as soon as the operations running in this Context complete. func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { ctx, f := context.WithDeadline(parent, deadline) - return ctx, CancelFunc(f) + return ctx, f } // WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). @@ -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 d88bd1db127dd..64d31ecc3ef43 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 0f35592df5188..7b6b685114a9b 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 b105f80be4fe2..1f9715341faac 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/const.go b/vendor/golang.org/x/net/html/const.go index 73804d3472cff..ff7acf2d5b4b2 100644 --- a/vendor/golang.org/x/net/html/const.go +++ b/vendor/golang.org/x/net/html/const.go @@ -52,7 +52,7 @@ var isSpecialElementMap = map[string]bool{ "iframe": true, "img": true, "input": true, - "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 74774c458ae6f..9da9e9dc42463 100644 --- a/vendor/golang.org/x/net/html/foreign.go +++ b/vendor/golang.org/x/net/html/foreign.go @@ -161,65 +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", - "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/parse.go b/vendor/golang.org/x/net/html/parse.go index 2cd12fc816e71..46a89eda6c199 100644 --- a/vendor/golang.org/x/net/html/parse.go +++ b/vendor/golang.org/x/net/html/parse.go @@ -184,7 +184,7 @@ func (p *parser) clearStackToContext(s scope) { } } -// parseGenericRawTextElements implements the generic raw text element parsing +// parseGenericRawTextElement 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 @@ -663,6 +663,24 @@ func inHeadIM(p *parser) bool { // 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