├── README.md ├── auth.login.go ├── mail.go ├── mail_test.go ├── ntlm.go └── vendor ├── github.com └── ThomsonReutersEikon │ └── go-ntlm │ ├── .gitignore │ ├── License │ ├── README.md │ ├── ntlm │ ├── av_pairs.go │ ├── challenge_responses.go │ ├── crypto.go │ ├── crypto_test.go │ ├── helpers.go │ ├── helpers_test.go │ ├── keys.go │ ├── md4 │ │ ├── LICENSE │ │ ├── md4.go │ │ ├── md4_test.go │ │ └── md4block.go │ ├── message_authenticate.go │ ├── message_authenticate_test.go │ ├── message_challenge.go │ ├── message_challenge_test.go │ ├── message_negotiate.go │ ├── negotiate_flags.go │ ├── negotiate_flags_test.go │ ├── ntlm.go │ ├── ntlmv1.go │ ├── ntlmv1_test.go │ ├── ntlmv2.go │ ├── ntlmv2_test.go │ ├── payload.go │ ├── signature.go │ ├── signature_test.go │ └── version.go │ └── utils │ ├── decode_auth.go │ └── test_auth.go └── golang.org └── x ├── crypto ├── .gitattributes ├── .gitignore ├── AUTHORS ├── CONTRIBUTING.md ├── CONTRIBUTORS ├── LICENSE ├── PATENTS ├── README.md ├── acme │ ├── acme.go │ ├── acme_test.go │ ├── autocert │ │ ├── autocert.go │ │ ├── autocert_test.go │ │ ├── cache.go │ │ ├── cache_test.go │ │ ├── example_test.go │ │ ├── listener.go │ │ ├── renewal.go │ │ └── renewal_test.go │ ├── jws.go │ ├── jws_test.go │ ├── types.go │ └── types_test.go ├── bcrypt │ ├── base64.go │ ├── bcrypt.go │ └── bcrypt_test.go ├── blake2b │ ├── blake2b.go │ ├── blake2bAVX2_amd64.go │ ├── blake2bAVX2_amd64.s │ ├── blake2b_amd64.go │ ├── blake2b_amd64.s │ ├── blake2b_generic.go │ ├── blake2b_ref.go │ ├── blake2b_test.go │ ├── blake2x.go │ └── register.go ├── blake2s │ ├── blake2s.go │ ├── blake2s_386.go │ ├── blake2s_386.s │ ├── blake2s_amd64.go │ ├── blake2s_amd64.s │ ├── blake2s_generic.go │ ├── blake2s_ref.go │ ├── blake2s_test.go │ ├── blake2x.go │ └── register.go ├── blowfish │ ├── block.go │ ├── blowfish_test.go │ ├── cipher.go │ └── const.go ├── bn256 │ ├── bn256.go │ ├── bn256_test.go │ ├── constants.go │ ├── curve.go │ ├── example_test.go │ ├── gfp12.go │ ├── gfp2.go │ ├── gfp6.go │ ├── optate.go │ └── twist.go ├── cast5 │ ├── cast5.go │ └── cast5_test.go ├── chacha20poly1305 │ ├── chacha20poly1305.go │ ├── chacha20poly1305_amd64.go │ ├── chacha20poly1305_amd64.s │ ├── chacha20poly1305_generic.go │ ├── chacha20poly1305_noasm.go │ ├── chacha20poly1305_test.go │ ├── chacha20poly1305_vectors_test.go │ └── internal │ │ └── chacha20 │ │ ├── chacha_generic.go │ │ └── chacha_test.go ├── codereview.cfg ├── cryptobyte │ ├── asn1.go │ ├── asn1_test.go │ ├── builder.go │ ├── cryptobyte_test.go │ ├── example_test.go │ └── string.go ├── curve25519 │ ├── const_amd64.h │ ├── const_amd64.s │ ├── cswap_amd64.s │ ├── curve25519.go │ ├── curve25519_test.go │ ├── doc.go │ ├── freeze_amd64.s │ ├── ladderstep_amd64.s │ ├── mont25519_amd64.go │ ├── mul_amd64.s │ └── square_amd64.s ├── ed25519 │ ├── ed25519.go │ ├── ed25519_test.go │ ├── internal │ │ └── edwards25519 │ │ │ ├── const.go │ │ │ └── edwards25519.go │ └── testdata │ │ └── sign.input.gz ├── hkdf │ ├── example_test.go │ ├── hkdf.go │ └── hkdf_test.go ├── md4 │ ├── example_test.go │ ├── md4.go │ ├── md4_test.go │ └── md4block.go ├── nacl │ ├── auth │ │ ├── auth.go │ │ ├── auth_test.go │ │ └── example_test.go │ ├── box │ │ ├── box.go │ │ ├── box_test.go │ │ └── example_test.go │ └── secretbox │ │ ├── example_test.go │ │ ├── secretbox.go │ │ └── secretbox_test.go ├── ocsp │ ├── ocsp.go │ └── ocsp_test.go ├── openpgp │ ├── armor │ │ ├── armor.go │ │ ├── armor_test.go │ │ └── encode.go │ ├── canonical_text.go │ ├── canonical_text_test.go │ ├── clearsign │ │ ├── clearsign.go │ │ └── clearsign_test.go │ ├── elgamal │ │ ├── elgamal.go │ │ └── elgamal_test.go │ ├── errors │ │ └── errors.go │ ├── keys.go │ ├── keys_test.go │ ├── packet │ │ ├── compressed.go │ │ ├── compressed_test.go │ │ ├── config.go │ │ ├── encrypted_key.go │ │ ├── encrypted_key_test.go │ │ ├── literal.go │ │ ├── ocfb.go │ │ ├── ocfb_test.go │ │ ├── one_pass_signature.go │ │ ├── opaque.go │ │ ├── opaque_test.go │ │ ├── packet.go │ │ ├── packet_test.go │ │ ├── private_key.go │ │ ├── private_key_test.go │ │ ├── public_key.go │ │ ├── public_key_test.go │ │ ├── public_key_v3.go │ │ ├── public_key_v3_test.go │ │ ├── reader.go │ │ ├── signature.go │ │ ├── signature_test.go │ │ ├── signature_v3.go │ │ ├── signature_v3_test.go │ │ ├── symmetric_key_encrypted.go │ │ ├── symmetric_key_encrypted_test.go │ │ ├── symmetrically_encrypted.go │ │ ├── symmetrically_encrypted_test.go │ │ ├── userattribute.go │ │ ├── userattribute_test.go │ │ ├── userid.go │ │ └── userid_test.go │ ├── read.go │ ├── read_test.go │ ├── s2k │ │ ├── s2k.go │ │ └── s2k_test.go │ ├── write.go │ └── write_test.go ├── otr │ ├── libotr_test_helper.c │ ├── otr.go │ ├── otr_test.go │ └── smp.go ├── pbkdf2 │ ├── pbkdf2.go │ └── pbkdf2_test.go ├── pkcs12 │ ├── bmp-string.go │ ├── bmp-string_test.go │ ├── crypto.go │ ├── crypto_test.go │ ├── errors.go │ ├── internal │ │ └── rc2 │ │ │ ├── bench_test.go │ │ │ ├── rc2.go │ │ │ └── rc2_test.go │ ├── mac.go │ ├── mac_test.go │ ├── pbkdf.go │ ├── pbkdf_test.go │ ├── pkcs12.go │ ├── pkcs12_test.go │ └── safebags.go ├── poly1305 │ ├── poly1305.go │ ├── poly1305_test.go │ ├── sum_amd64.go │ ├── sum_amd64.s │ ├── sum_arm.go │ ├── sum_arm.s │ └── sum_ref.go ├── ripemd160 │ ├── ripemd160.go │ ├── ripemd160_test.go │ └── ripemd160block.go ├── salsa20 │ ├── salsa │ │ ├── hsalsa20.go │ │ ├── salsa2020_amd64.s │ │ ├── salsa208.go │ │ ├── salsa20_amd64.go │ │ ├── salsa20_ref.go │ │ └── salsa_test.go │ ├── salsa20.go │ └── salsa20_test.go ├── scrypt │ ├── scrypt.go │ └── scrypt_test.go ├── sha3 │ ├── doc.go │ ├── hashes.go │ ├── keccakf.go │ ├── keccakf_amd64.go │ ├── keccakf_amd64.s │ ├── register.go │ ├── sha3.go │ ├── sha3_test.go │ ├── shake.go │ ├── testdata │ │ └── keccakKats.json.deflate │ ├── xor.go │ ├── xor_generic.go │ └── xor_unaligned.go ├── ssh │ ├── agent │ │ ├── client.go │ │ ├── client_test.go │ │ ├── example_test.go │ │ ├── forward.go │ │ ├── keyring.go │ │ ├── keyring_test.go │ │ ├── server.go │ │ ├── server_test.go │ │ └── testdata_test.go │ ├── benchmark_test.go │ ├── buffer.go │ ├── buffer_test.go │ ├── certs.go │ ├── certs_test.go │ ├── channel.go │ ├── cipher.go │ ├── cipher_test.go │ ├── client.go │ ├── client_auth.go │ ├── client_auth_test.go │ ├── client_test.go │ ├── common.go │ ├── connection.go │ ├── doc.go │ ├── example_test.go │ ├── handshake.go │ ├── handshake_test.go │ ├── kex.go │ ├── kex_test.go │ ├── keys.go │ ├── keys_test.go │ ├── knownhosts │ │ ├── knownhosts.go │ │ └── knownhosts_test.go │ ├── mac.go │ ├── mempipe_test.go │ ├── messages.go │ ├── messages_test.go │ ├── mux.go │ ├── mux_test.go │ ├── server.go │ ├── session.go │ ├── session_test.go │ ├── streamlocal.go │ ├── tcpip.go │ ├── tcpip_test.go │ ├── terminal │ │ ├── terminal.go │ │ ├── terminal_test.go │ │ ├── util.go │ │ ├── util_bsd.go │ │ ├── util_linux.go │ │ ├── util_plan9.go │ │ ├── util_solaris.go │ │ └── util_windows.go │ ├── test │ │ ├── agent_unix_test.go │ │ ├── cert_test.go │ │ ├── dial_unix_test.go │ │ ├── doc.go │ │ ├── forward_unix_test.go │ │ ├── session_test.go │ │ ├── test_unix_test.go │ │ └── testdata_test.go │ ├── testdata │ │ ├── doc.go │ │ └── keys.go │ ├── testdata_test.go │ ├── transport.go │ └── transport_test.go ├── tea │ ├── cipher.go │ └── tea_test.go ├── twofish │ ├── twofish.go │ └── twofish_test.go ├── xtea │ ├── block.go │ ├── cipher.go │ └── xtea_test.go └── xts │ ├── xts.go │ └── xts_test.go ├── net ├── .hgignore ├── AUTHORS ├── CONTRIBUTORS ├── LICENSE ├── PATENTS ├── README ├── codereview.cfg ├── context │ ├── context.go │ ├── context_test.go │ └── withtimeout_test.go ├── dict │ └── dict.go ├── html │ ├── atom │ │ ├── atom.go │ │ ├── atom_test.go │ │ ├── gen.go │ │ ├── table.go │ │ └── table_test.go │ ├── charset │ │ ├── charset.go │ │ ├── charset_test.go │ │ ├── gen.go │ │ ├── table.go │ │ └── testdata │ │ │ ├── HTTP-charset.html │ │ │ ├── HTTP-vs-UTF-8-BOM.html │ │ │ ├── HTTP-vs-meta-charset.html │ │ │ ├── HTTP-vs-meta-content.html │ │ │ ├── No-encoding-declaration.html │ │ │ ├── README │ │ │ ├── UTF-16BE-BOM.html │ │ │ ├── UTF-16LE-BOM.html │ │ │ ├── UTF-8-BOM-vs-meta-charset.html │ │ │ ├── UTF-8-BOM-vs-meta-content.html │ │ │ ├── meta-charset-attribute.html │ │ │ └── meta-content-attribute.html │ ├── const.go │ ├── doc.go │ ├── doctype.go │ ├── entity.go │ ├── entity_test.go │ ├── escape.go │ ├── escape_test.go │ ├── example_test.go │ ├── foreign.go │ ├── node.go │ ├── node_test.go │ ├── parse.go │ ├── parse_test.go │ ├── render.go │ ├── render_test.go │ ├── testdata │ │ ├── go1.html │ │ └── webkit │ │ │ ├── README │ │ │ ├── adoption01.dat │ │ │ ├── adoption02.dat │ │ │ ├── comments01.dat │ │ │ ├── doctype01.dat │ │ │ ├── entities01.dat │ │ │ ├── entities02.dat │ │ │ ├── html5test-com.dat │ │ │ ├── inbody01.dat │ │ │ ├── isindex.dat │ │ │ ├── pending-spec-changes-plain-text-unsafe.dat │ │ │ ├── pending-spec-changes.dat │ │ │ ├── plain-text-unsafe.dat │ │ │ ├── scriptdata01.dat │ │ │ ├── scripted │ │ │ ├── adoption01.dat │ │ │ └── webkit01.dat │ │ │ ├── tables01.dat │ │ │ ├── tests1.dat │ │ │ ├── tests10.dat │ │ │ ├── tests11.dat │ │ │ ├── tests12.dat │ │ │ ├── tests14.dat │ │ │ ├── tests15.dat │ │ │ ├── tests16.dat │ │ │ ├── tests17.dat │ │ │ ├── tests18.dat │ │ │ ├── tests19.dat │ │ │ ├── tests2.dat │ │ │ ├── tests20.dat │ │ │ ├── tests21.dat │ │ │ ├── tests22.dat │ │ │ ├── tests23.dat │ │ │ ├── tests24.dat │ │ │ ├── tests25.dat │ │ │ ├── tests26.dat │ │ │ ├── tests3.dat │ │ │ ├── tests4.dat │ │ │ ├── tests5.dat │ │ │ ├── tests6.dat │ │ │ ├── tests7.dat │ │ │ ├── tests8.dat │ │ │ ├── tests9.dat │ │ │ ├── tests_innerHTML_1.dat │ │ │ ├── tricky01.dat │ │ │ ├── webkit01.dat │ │ │ └── webkit02.dat │ ├── token.go │ └── token_test.go ├── icmp │ ├── dstunreach.go │ ├── echo.go │ ├── endpoint.go │ ├── example_test.go │ ├── helper_unix.go │ ├── ipv4.go │ ├── ipv4_test.go │ ├── ipv6.go │ ├── listen_stub.go │ ├── listen_unix.go │ ├── message.go │ ├── message_test.go │ ├── messagebody.go │ ├── packettoobig.go │ ├── paramprob.go │ ├── ping_test.go │ ├── sys_freebsd.go │ └── timeexceeded.go ├── idna │ ├── idna.go │ ├── idna_test.go │ ├── punycode.go │ └── punycode_test.go ├── internal │ ├── iana │ │ ├── const.go │ │ └── gen.go │ └── nettest │ │ ├── error_posix.go │ │ ├── error_stub.go │ │ ├── interface.go │ │ └── stack.go ├── ipv4 │ ├── control.go │ ├── control_bsd.go │ ├── control_pktinfo.go │ ├── control_stub.go │ ├── control_unix.go │ ├── control_windows.go │ ├── defs_darwin.go │ ├── defs_dragonfly.go │ ├── defs_freebsd.go │ ├── defs_linux.go │ ├── defs_netbsd.go │ ├── defs_openbsd.go │ ├── defs_solaris.go │ ├── dgramopt_posix.go │ ├── dgramopt_stub.go │ ├── doc.go │ ├── endpoint.go │ ├── example_test.go │ ├── gen.go │ ├── genericopt_posix.go │ ├── genericopt_stub.go │ ├── header.go │ ├── header_test.go │ ├── helper.go │ ├── helper_stub.go │ ├── helper_unix.go │ ├── helper_windows.go │ ├── iana.go │ ├── icmp.go │ ├── icmp_linux.go │ ├── icmp_stub.go │ ├── icmp_test.go │ ├── mocktransponder_test.go │ ├── multicast_test.go │ ├── multicastlistener_test.go │ ├── multicastsockopt_test.go │ ├── packet.go │ ├── payload.go │ ├── payload_cmsg.go │ ├── payload_nocmsg.go │ ├── readwrite_test.go │ ├── sockopt.go │ ├── sockopt_asmreq.go │ ├── sockopt_asmreq_stub.go │ ├── sockopt_asmreq_unix.go │ ├── sockopt_asmreq_windows.go │ ├── sockopt_asmreqn_stub.go │ ├── sockopt_asmreqn_unix.go │ ├── sockopt_ssmreq_stub.go │ ├── sockopt_ssmreq_unix.go │ ├── sockopt_stub.go │ ├── sockopt_unix.go │ ├── sockopt_windows.go │ ├── sys_bsd.go │ ├── sys_darwin.go │ ├── sys_freebsd.go │ ├── sys_linux.go │ ├── sys_openbsd.go │ ├── sys_stub.go │ ├── sys_windows.go │ ├── syscall_linux_386.go │ ├── syscall_unix.go │ ├── thunk_linux_386.s │ ├── unicast_test.go │ ├── unicastsockopt_test.go │ ├── zsys_darwin.go │ ├── zsys_dragonfly.go │ ├── zsys_freebsd_386.go │ ├── zsys_freebsd_amd64.go │ ├── zsys_freebsd_arm.go │ ├── zsys_linux_386.go │ ├── zsys_linux_amd64.go │ ├── zsys_linux_arm.go │ ├── zsys_netbsd.go │ ├── zsys_openbsd.go │ └── zsys_solaris.go ├── ipv6 │ ├── control.go │ ├── control_rfc2292_unix.go │ ├── control_rfc3542_unix.go │ ├── control_stub.go │ ├── control_unix.go │ ├── control_windows.go │ ├── defs_darwin.go │ ├── defs_dragonfly.go │ ├── defs_freebsd.go │ ├── defs_linux.go │ ├── defs_netbsd.go │ ├── defs_openbsd.go │ ├── defs_solaris.go │ ├── dgramopt_posix.go │ ├── dgramopt_stub.go │ ├── doc.go │ ├── endpoint.go │ ├── example_test.go │ ├── gen.go │ ├── genericopt_posix.go │ ├── genericopt_stub.go │ ├── header.go │ ├── header_test.go │ ├── helper.go │ ├── helper_stub.go │ ├── helper_unix.go │ ├── helper_windows.go │ ├── iana.go │ ├── icmp.go │ ├── icmp_bsd.go │ ├── icmp_linux.go │ ├── icmp_solaris.go │ ├── icmp_stub.go │ ├── icmp_test.go │ ├── icmp_windows.go │ ├── mocktransponder_test.go │ ├── multicast_test.go │ ├── multicastlistener_test.go │ ├── multicastsockopt_test.go │ ├── payload.go │ ├── payload_cmsg.go │ ├── payload_nocmsg.go │ ├── readwrite_test.go │ ├── sockopt.go │ ├── sockopt_asmreq_unix.go │ ├── sockopt_asmreq_windows.go │ ├── sockopt_ssmreq_stub.go │ ├── sockopt_ssmreq_unix.go │ ├── sockopt_stub.go │ ├── sockopt_test.go │ ├── sockopt_unix.go │ ├── sockopt_windows.go │ ├── sys_bsd.go │ ├── sys_darwin.go │ ├── sys_freebsd.go │ ├── sys_linux.go │ ├── sys_stub.go │ ├── sys_windows.go │ ├── syscall_linux_386.go │ ├── syscall_unix.go │ ├── thunk_linux_386.s │ ├── unicast_test.go │ ├── unicastsockopt_test.go │ ├── zsys_darwin.go │ ├── zsys_dragonfly.go │ ├── zsys_freebsd_386.go │ ├── zsys_freebsd_amd64.go │ ├── zsys_freebsd_arm.go │ ├── zsys_linux_386.go │ ├── zsys_linux_amd64.go │ ├── zsys_linux_arm.go │ ├── zsys_netbsd.go │ ├── zsys_openbsd.go │ └── zsys_solaris.go ├── netutil │ ├── listen.go │ └── listen_test.go ├── proxy │ ├── direct.go │ ├── per_host.go │ ├── per_host_test.go │ ├── proxy.go │ ├── proxy_test.go │ └── socks5.go ├── publicsuffix │ ├── gen.go │ ├── list.go │ ├── list_test.go │ ├── table.go │ └── table_test.go ├── smtp │ ├── auth.go │ ├── example_test.go │ ├── smtp.go │ └── smtp_test.go ├── spdy │ ├── dictionary.go │ ├── read.go │ ├── spdy_test.go │ ├── types.go │ └── write.go ├── webdav │ ├── file.go │ ├── file_test.go │ ├── if.go │ ├── if_test.go │ ├── lock.go │ ├── webdav.go │ ├── xml.go │ └── xml_test.go └── websocket │ ├── client.go │ ├── exampledial_test.go │ ├── examplehandler_test.go │ ├── hybi.go │ ├── hybi_test.go │ ├── server.go │ ├── websocket.go │ └── websocket_test.go └── text ├── AUTHORS ├── CONTRIBUTING.md ├── CONTRIBUTORS ├── LICENSE ├── PATENTS ├── README ├── cases ├── cases.go ├── context.go ├── context_test.go ├── example_test.go ├── fold.go ├── fold_test.go ├── gen.go ├── gen_trieval.go ├── info.go ├── map.go ├── map_test.go ├── tables.go ├── tables_test.go └── trieval.go ├── codereview.cfg ├── collate ├── build │ ├── builder.go │ ├── builder_test.go │ ├── colelem.go │ ├── colelem_test.go │ ├── contract.go │ ├── contract_test.go │ ├── order.go │ ├── order_test.go │ ├── table.go │ ├── trie.go │ └── trie_test.go ├── collate.go ├── collate_test.go ├── export_test.go ├── index.go ├── maketables.go ├── option.go ├── option_test.go ├── reg_test.go ├── sort.go ├── sort_test.go ├── table_test.go ├── tables.go └── tools │ └── colcmp │ ├── Makefile │ ├── chars.go │ ├── col.go │ ├── colcmp.go │ ├── darwin.go │ ├── gen.go │ └── icu.go ├── currency ├── common.go ├── currency.go ├── currency_test.go ├── example_test.go ├── format.go ├── format_test.go ├── gen.go ├── gen_common.go ├── query.go ├── query_test.go ├── tables.go └── tables_test.go ├── doc.go ├── encoding ├── charmap │ ├── charmap.go │ ├── charmap_test.go │ ├── maketables.go │ └── tables.go ├── encoding.go ├── encoding_test.go ├── example_test.go ├── htmlindex │ ├── gen.go │ ├── htmlindex.go │ ├── htmlindex_test.go │ ├── map.go │ └── tables.go ├── ianaindex │ ├── example_test.go │ └── ianaindex.go ├── internal │ ├── identifier │ │ ├── gen.go │ │ ├── identifier.go │ │ └── mib.go │ └── internal.go ├── japanese │ ├── all.go │ ├── all_test.go │ ├── eucjp.go │ ├── iso2022jp.go │ ├── maketables.go │ ├── shiftjis.go │ └── tables.go ├── korean │ ├── all_test.go │ ├── euckr.go │ ├── maketables.go │ └── tables.go ├── simplifiedchinese │ ├── all.go │ ├── all_test.go │ ├── gbk.go │ ├── hzgb2312.go │ ├── maketables.go │ └── tables.go ├── testdata │ ├── candide-gb18030.txt │ ├── candide-utf-16le.txt │ ├── candide-utf-32be.txt │ ├── candide-utf-8.txt │ ├── candide-windows-1252.txt │ ├── rashomon-euc-jp.txt │ ├── rashomon-iso-2022-jp.txt │ ├── rashomon-shift-jis.txt │ ├── rashomon-utf-8.txt │ ├── sunzi-bingfa-gb-levels-1-and-2-hz-gb2312.txt │ ├── sunzi-bingfa-gb-levels-1-and-2-utf-8.txt │ ├── sunzi-bingfa-simplified-gbk.txt │ ├── sunzi-bingfa-simplified-utf-8.txt │ ├── sunzi-bingfa-traditional-big5.txt │ ├── sunzi-bingfa-traditional-utf-8.txt │ ├── unsu-joh-eun-nal-euc-kr.txt │ └── unsu-joh-eun-nal-utf-8.txt ├── traditionalchinese │ ├── all_test.go │ ├── big5.go │ ├── maketables.go │ └── tables.go └── unicode │ ├── override.go │ ├── unicode.go │ ├── unicode_test.go │ └── utf32 │ ├── utf32.go │ └── utf32_test.go ├── gen.go ├── internal ├── colltab │ ├── collate_test.go │ ├── collelem.go │ ├── collelem_test.go │ ├── colltab.go │ ├── colltab_test.go │ ├── contract.go │ ├── contract_test.go │ ├── iter.go │ ├── iter_test.go │ ├── numeric.go │ ├── numeric_test.go │ ├── table.go │ ├── trie.go │ ├── trie_test.go │ ├── weighter.go │ └── weighter_test.go ├── format │ ├── format.go │ └── plural │ │ └── plural.go ├── gen.go ├── gen │ ├── code.go │ └── gen.go ├── gen_test.go ├── internal.go ├── internal_test.go ├── match.go ├── match_test.go ├── number │ ├── common.go │ ├── data_test.go │ ├── decimal.go │ ├── extfloat.go │ ├── ftoa.go │ ├── gen.go │ ├── gen_common.go │ ├── gen_plural.go │ ├── itoa.go │ ├── number.go │ ├── number_test.go │ ├── pattern.go │ ├── pattern_test.go │ ├── plural.go │ ├── plural_test.go │ ├── tables.go │ └── tables_test.go ├── stringset │ ├── set.go │ └── set_test.go ├── tables.go ├── tag │ ├── tag.go │ └── tag_test.go ├── testtext │ ├── codesize.go │ ├── flag.go │ ├── gc.go │ ├── gccgo.go │ ├── go1_6.go │ ├── go1_7.go │ └── text.go ├── triegen │ ├── compact.go │ ├── data_test.go │ ├── example_compact_test.go │ ├── example_test.go │ ├── gen_test.go │ ├── print.go │ └── triegen.go ├── ucd │ ├── example_test.go │ ├── ucd.go │ └── ucd_test.go └── utf8internal │ └── utf8internal.go ├── language ├── Makefile ├── common.go ├── coverage.go ├── coverage_test.go ├── data_test.go ├── display │ ├── dict.go │ ├── dict_test.go │ ├── display.go │ ├── display_test.go │ ├── examples_test.go │ ├── lookup.go │ ├── maketables.go │ └── tables.go ├── examples_test.go ├── gen_common.go ├── gen_index.go ├── go1_1.go ├── go1_2.go ├── httpexample_test.go ├── index.go ├── language.go ├── language_test.go ├── lookup.go ├── lookup_test.go ├── maketables.go ├── match.go ├── match_test.go ├── parse.go ├── parse_test.go ├── tables.go └── tags.go ├── message ├── catalog.go ├── catalog_test.go ├── message.go └── message_test.go ├── runes ├── cond.go ├── cond_test.go ├── example_test.go ├── runes.go └── runes_test.go ├── search ├── index.go ├── pattern.go ├── pattern_test.go ├── search.go └── tables.go ├── secure ├── bidirule │ ├── bidirule.go │ ├── bidirule_test.go │ ├── go1_6_test.go │ └── go1_7_test.go ├── doc.go └── precis │ ├── benchmark_test.go │ ├── class.go │ ├── class_test.go │ ├── context.go │ ├── doc.go │ ├── enforce_test.go │ ├── gen.go │ ├── gen_trieval.go │ ├── go1_6_test.go │ ├── go1_7_test.go │ ├── nickname.go │ ├── options.go │ ├── profile.go │ ├── profiles.go │ ├── tables.go │ ├── tables_test.go │ ├── transformer.go │ └── trieval.go ├── transform ├── examples_test.go ├── transform.go └── transform_test.go ├── unicode ├── bidi │ ├── bidi.go │ ├── bracket.go │ ├── core.go │ ├── core_test.go │ ├── gen.go │ ├── gen_ranges.go │ ├── gen_trieval.go │ ├── prop.go │ ├── ranges_test.go │ ├── tables.go │ ├── tables_test.go │ └── trieval.go ├── cldr │ ├── base.go │ ├── cldr.go │ ├── cldr_test.go │ ├── collate.go │ ├── collate_test.go │ ├── data_test.go │ ├── decode.go │ ├── examples_test.go │ ├── makexml.go │ ├── resolve.go │ ├── resolve_test.go │ ├── slice.go │ ├── slice_test.go │ └── xml.go ├── doc.go ├── norm │ ├── composition.go │ ├── composition_test.go │ ├── example_iter_test.go │ ├── example_test.go │ ├── forminfo.go │ ├── forminfo_test.go │ ├── input.go │ ├── iter.go │ ├── iter_test.go │ ├── maketables.go │ ├── norm_test.go │ ├── normalize.go │ ├── normalize_test.go │ ├── readwriter.go │ ├── readwriter_test.go │ ├── tables.go │ ├── transform.go │ ├── transform_test.go │ ├── trie.go │ ├── triegen.go │ └── ucd_test.go └── rangetable │ ├── gen.go │ ├── merge.go │ ├── merge_test.go │ ├── rangetable.go │ ├── rangetable_test.go │ └── tables.go └── width ├── common_test.go ├── example_test.go ├── gen.go ├── gen_common.go ├── gen_trieval.go ├── kind_string.go ├── runes_test.go ├── tables.go ├── tables_test.go ├── transform.go ├── transform_test.go ├── trieval.go └── width.go /auth.login.go: -------------------------------------------------------------------------------- 1 | package mail 2 | 3 | import ( 4 | "errors" 5 | "golang.org/x/net/smtp" 6 | "strings" 7 | ) 8 | 9 | type loginAuth struct { 10 | username, password string 11 | } 12 | 13 | func LoginAuth(username, password string) smtp.Auth { 14 | return &loginAuth{username, password} 15 | } 16 | 17 | func (a *loginAuth) Start(server *smtp.ServerInfo) (string, []byte, error) { 18 | return "LOGIN", []byte{}, nil 19 | } 20 | 21 | func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) { 22 | if more { 23 | switch strings.ToLower(string(fromServer)) { 24 | case "username:": 25 | return []byte(a.username), nil 26 | case "password:": 27 | return []byte(a.password), nil 28 | default: 29 | return nil, errors.New("Unkown fromServer") 30 | } 31 | } 32 | return nil, nil 33 | } 34 | -------------------------------------------------------------------------------- /mail_test.go: -------------------------------------------------------------------------------- 1 | package mail 2 | 3 | import ( 4 | "testing" 5 | 6 | "golang.org/x/net/smtp" 7 | ) 8 | 9 | func Test_SendMail(t *testing.T) { 10 | email := NewEMail(`{"port":25}`) 11 | email.From = `farmerx@163.com` 12 | email.Host = `smtp.163.com` 13 | email.Port = int(25) // [587 NTLM AUTH] [465,994] 14 | email.Username = `Farmerx` 15 | email.Secure = `` // SSL,TSL 16 | email.Password = `************` 17 | authType := `LOGIN` 18 | switch authType { 19 | case ``: 20 | email.Auth = nil 21 | case `LOGIN`: 22 | email.Auth = LoginAuth(email.Username, email.Password) 23 | case `CRAM-MD5`: 24 | email.Auth = smtp.CRAMMD5Auth(email.Username, email.Password) 25 | case `PLAIN`: 26 | email.Auth = smtp.PlainAuth(email.Identity, email.Username, email.Password, email.Host) 27 | case `NTLM`: 28 | email.Auth = NTLMAuth(email.Host, email.Username, email.Password, NTLMVersion1) 29 | default: 30 | email.Auth = smtp.PlainAuth(email.Identity, email.Username, email.Password, email.Host) 31 | } 32 | 33 | email.To = []string{`farmerx@163.com`} 34 | email.Subject = `send mail success` 35 | email.Text = "尊敬的用户:\r\n 您好,附件中是您订阅的报表,请注意查收。" 36 | //email.AttachFile(reportFile) 37 | if err := email.Send(); err != nil { 38 | t.Error(err) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/ThomsonReutersEikon/go-ntlm/.gitignore: -------------------------------------------------------------------------------- 1 | <<<<<<< HEAD 2 | pkg/ 3 | ======= 4 | pkg 5 | >>>>>>> adding License information and go format 6 | -------------------------------------------------------------------------------- /vendor/github.com/ThomsonReutersEikon/go-ntlm/ntlm/message_negotiate.go: -------------------------------------------------------------------------------- 1 | //Copyright 2013 Thomson Reuters Global Resources. BSD License please see License file for more information 2 | 3 | package ntlm 4 | 5 | type NegotiateMessage struct { 6 | // All bytes of the message 7 | Bytes []byte 8 | 9 | // sig - 8 bytes 10 | Signature []byte 11 | // message type - 4 bytes 12 | MessageType uint32 13 | // negotiate flags - 4bytes 14 | NegotiateFlags uint32 15 | // If the NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED flag is not set in NegotiateFlags, 16 | // indicating that no DomainName is supplied in Payload - then this should have Len 0 / MaxLen 0 17 | // this contains a domain name 18 | DomainNameFields *PayloadStruct 19 | // If the NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED flag is not set in NegotiateFlags, 20 | // indicating that no WorkstationName is supplied in Payload - then this should have Len 0 / MaxLen 0 21 | WorkstationFields *PayloadStruct 22 | // version - 8 bytes 23 | Version *VersionStruct 24 | // payload - variable 25 | Payload []byte 26 | PayloadOffset int 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/ThomsonReutersEikon/go-ntlm/ntlm/negotiate_flags_test.go: -------------------------------------------------------------------------------- 1 | //Copyright 2013 Thomson Reuters Global Resources. BSD License please see License file for more information 2 | 3 | package ntlm 4 | 5 | import ( 6 | "encoding/binary" 7 | "encoding/hex" 8 | "testing" 9 | ) 10 | 11 | func TestFlags(t *testing.T) { 12 | // Sample value from 4.2.2 NTLM v1 Authentication 13 | bytes, _ := hex.DecodeString("338202e2") 14 | 15 | flags := uint32(0) 16 | flags = NTLMSSP_NEGOTIATE_KEY_EXCH.Set(flags) 17 | flags = NTLMSSP_NEGOTIATE_56.Set(flags) 18 | flags = NTLMSSP_NEGOTIATE_128.Set(flags) 19 | flags = NTLMSSP_NEGOTIATE_VERSION.Set(flags) 20 | flags = NTLMSSP_TARGET_TYPE_SERVER.Set(flags) 21 | flags = NTLMSSP_NEGOTIATE_ALWAYS_SIGN.Set(flags) 22 | flags = NTLMSSP_NEGOTIATE_NTLM.Set(flags) 23 | flags = NTLMSSP_NEGOTIATE_SEAL.Set(flags) 24 | flags = NTLMSSP_NEGOTIATE_SIGN.Set(flags) 25 | flags = NTLM_NEGOTIATE_OEM.Set(flags) 26 | flags = NTLMSSP_NEGOTIATE_UNICODE.Set(flags) 27 | 28 | if flags != binary.LittleEndian.Uint32(bytes) { 29 | t.Error("NTLM Flags are not correct") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/ThomsonReutersEikon/go-ntlm/utils/decode_auth.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/base64" 5 | "flag" 6 | "fmt" 7 | 8 | "github.com/ThomsonReutersEikon/go-ntlm/ntlm" 9 | ) 10 | 11 | func main() { 12 | var ntlmVersion = flag.Int("ntlm", 2, "NTLM version to try: 1 or 2") 13 | flag.Parse() 14 | var data string 15 | fmt.Println("Paste the base64 encoded Authenticate message (with no line breaks):") 16 | fmt.Scanf("%s", &data) 17 | authenticateData, _ := base64.StdEncoding.DecodeString(data) 18 | a, _ := ntlm.ParseAuthenticateMessage(authenticateData, *ntlmVersion) 19 | fmt.Printf(a.String()) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at https://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at https://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/README.md: -------------------------------------------------------------------------------- 1 | # Go Cryptography 2 | 3 | This repository holds supplementary Go cryptography libraries. 4 | 5 | ## Download/Install 6 | 7 | The easiest way to install is to run `go get -u golang.org/x/crypto/...`. You 8 | can also manually git clone the repository to `$GOPATH/src/golang.org/x/crypto`. 9 | 10 | ## Report Issues / Send Patches 11 | 12 | This repository uses Gerrit for code changes. To learn how to submit changes to 13 | this repository, see https://golang.org/doc/contribute.html. 14 | 15 | The main issue tracker for the crypto repository is located at 16 | https://github.com/golang/go/issues. Prefix your issue with "x/crypto:" in the 17 | subject line, so it is easy to find. 18 | 19 | Note that contributions to the cryptography package receive additional scrutiny 20 | due to their sensitive nature. Patches may take longer than normal to receive 21 | feedback. 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/acme/autocert/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package autocert_test 6 | 7 | import ( 8 | "crypto/tls" 9 | "fmt" 10 | "log" 11 | "net/http" 12 | 13 | "golang.org/x/crypto/acme/autocert" 14 | ) 15 | 16 | func ExampleNewListener() { 17 | mux := http.NewServeMux() 18 | mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 19 | fmt.Fprintf(w, "Hello, TLS user! Your config: %+v", r.TLS) 20 | }) 21 | log.Fatal(http.Serve(autocert.NewListener("example.com"), mux)) 22 | } 23 | 24 | func ExampleManager() { 25 | m := autocert.Manager{ 26 | Prompt: autocert.AcceptTOS, 27 | HostPolicy: autocert.HostWhitelist("example.org"), 28 | } 29 | s := &http.Server{ 30 | Addr: ":https", 31 | TLSConfig: &tls.Config{GetCertificate: m.GetCertificate}, 32 | } 33 | s.ListenAndServeTLS("", "") 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/bcrypt/base64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bcrypt 6 | 7 | import "encoding/base64" 8 | 9 | const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" 10 | 11 | var bcEncoding = base64.NewEncoding(alphabet) 12 | 13 | func base64Encode(src []byte) []byte { 14 | n := bcEncoding.EncodedLen(len(src)) 15 | dst := make([]byte, n) 16 | bcEncoding.Encode(dst, src) 17 | for dst[n-1] == '=' { 18 | n-- 19 | } 20 | return dst[:n] 21 | } 22 | 23 | func base64Decode(src []byte) ([]byte, error) { 24 | numOfEquals := 4 - (len(src) % 4) 25 | for i := 0; i < numOfEquals; i++ { 26 | src = append(src, '=') 27 | } 28 | 29 | dst := make([]byte, bcEncoding.DecodedLen(len(src))) 30 | n, err := bcEncoding.Decode(dst, src) 31 | if err != nil { 32 | return nil, err 33 | } 34 | return dst[:n], nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7,amd64,!gccgo,!appengine 6 | 7 | package blake2b 8 | 9 | func init() { 10 | useAVX2 = supportsAVX2() 11 | useAVX = supportsAVX() 12 | useSSE4 = supportsSSE4() 13 | } 14 | 15 | //go:noescape 16 | func supportsSSE4() bool 17 | 18 | //go:noescape 19 | func supportsAVX() bool 20 | 21 | //go:noescape 22 | func supportsAVX2() bool 23 | 24 | //go:noescape 25 | func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 26 | 27 | //go:noescape 28 | func hashBlocksAVX(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 29 | 30 | //go:noescape 31 | func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 32 | 33 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 34 | if useAVX2 { 35 | hashBlocksAVX2(h, c, flag, blocks) 36 | } else if useAVX { 37 | hashBlocksAVX(h, c, flag, blocks) 38 | } else if useSSE4 { 39 | hashBlocksSSE4(h, c, flag, blocks) 40 | } else { 41 | hashBlocksGeneric(h, c, flag, blocks) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.7,amd64,!gccgo,!appengine 6 | 7 | package blake2b 8 | 9 | func init() { 10 | useSSE4 = supportsSSE4() 11 | } 12 | 13 | //go:noescape 14 | func supportsSSE4() bool 15 | 16 | //go:noescape 17 | func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 18 | 19 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 20 | if useSSE4 { 21 | hashBlocksSSE4(h, c, flag, blocks) 22 | } else { 23 | hashBlocksGeneric(h, c, flag, blocks) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/blake2b_ref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 appengine gccgo 6 | 7 | package blake2b 8 | 9 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 10 | hashBlocksGeneric(h, c, flag, blocks) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package blake2b 8 | 9 | import ( 10 | "crypto" 11 | "hash" 12 | ) 13 | 14 | func init() { 15 | newHash256 := func() hash.Hash { 16 | h, _ := New256(nil) 17 | return h 18 | } 19 | newHash384 := func() hash.Hash { 20 | h, _ := New384(nil) 21 | return h 22 | } 23 | 24 | newHash512 := func() hash.Hash { 25 | h, _ := New512(nil) 26 | return h 27 | } 28 | 29 | crypto.RegisterHash(crypto.BLAKE2b_256, newHash256) 30 | crypto.RegisterHash(crypto.BLAKE2b_384, newHash384) 31 | crypto.RegisterHash(crypto.BLAKE2b_512, newHash512) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2s/blake2s_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,!gccgo,!appengine 6 | 7 | package blake2s 8 | 9 | var ( 10 | useSSE4 = false 11 | useSSSE3 = supportSSSE3() 12 | useSSE2 = supportSSE2() 13 | ) 14 | 15 | //go:noescape 16 | func supportSSE2() bool 17 | 18 | //go:noescape 19 | func supportSSSE3() bool 20 | 21 | //go:noescape 22 | func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 23 | 24 | //go:noescape 25 | func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 26 | 27 | func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) { 28 | if useSSSE3 { 29 | hashBlocksSSSE3(h, c, flag, blocks) 30 | } else if useSSE2 { 31 | hashBlocksSSE2(h, c, flag, blocks) 32 | } else { 33 | hashBlocksGeneric(h, c, flag, blocks) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2s/blake2s_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!gccgo,!appengine 6 | 7 | package blake2s 8 | 9 | var ( 10 | useSSE4 = supportSSE4() 11 | useSSSE3 = supportSSSE3() 12 | useSSE2 = true // Always available on amd64 13 | ) 14 | 15 | //go:noescape 16 | func supportSSSE3() bool 17 | 18 | //go:noescape 19 | func supportSSE4() bool 20 | 21 | //go:noescape 22 | func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 23 | 24 | //go:noescape 25 | func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 26 | 27 | //go:noescape 28 | func hashBlocksSSE4(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 29 | 30 | func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) { 31 | if useSSE4 { 32 | hashBlocksSSE4(h, c, flag, blocks) 33 | } else if useSSSE3 { 34 | hashBlocksSSSE3(h, c, flag, blocks) 35 | } else if useSSE2 { 36 | hashBlocksSSE2(h, c, flag, blocks) 37 | } else { 38 | hashBlocksGeneric(h, c, flag, blocks) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2s/blake2s_ref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!386 gccgo appengine 6 | 7 | package blake2s 8 | 9 | var ( 10 | useSSE4 = false 11 | useSSSE3 = false 12 | useSSE2 = false 13 | ) 14 | 15 | func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) { 16 | hashBlocksGeneric(h, c, flag, blocks) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2s/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package blake2s 8 | 9 | import ( 10 | "crypto" 11 | "hash" 12 | ) 13 | 14 | func init() { 15 | newHash256 := func() hash.Hash { 16 | h, _ := New256(nil) 17 | return h 18 | } 19 | 20 | crypto.RegisterHash(crypto.BLAKE2s_256, newHash256) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/bn256/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bn256 6 | 7 | import ( 8 | "crypto/rand" 9 | ) 10 | 11 | func ExamplePair() { 12 | // This implements the tripartite Diffie-Hellman algorithm from "A One 13 | // Round Protocol for Tripartite Diffie-Hellman", A. Joux. 14 | // http://www.springerlink.com/content/cddc57yyva0hburb/fulltext.pdf 15 | 16 | // Each of three parties, a, b and c, generate a private value. 17 | a, _ := rand.Int(rand.Reader, Order) 18 | b, _ := rand.Int(rand.Reader, Order) 19 | c, _ := rand.Int(rand.Reader, Order) 20 | 21 | // Then each party calculates g₁ and g₂ times their private value. 22 | pa := new(G1).ScalarBaseMult(a) 23 | qa := new(G2).ScalarBaseMult(a) 24 | 25 | pb := new(G1).ScalarBaseMult(b) 26 | qb := new(G2).ScalarBaseMult(b) 27 | 28 | pc := new(G1).ScalarBaseMult(c) 29 | qc := new(G2).ScalarBaseMult(c) 30 | 31 | // Now each party exchanges its public values with the other two and 32 | // all parties can calculate the shared key. 33 | k1 := Pair(pb, qc) 34 | k1.ScalarMult(k1, a) 35 | 36 | k2 := Pair(pc, qa) 37 | k2.ScalarMult(k2, b) 38 | 39 | k3 := Pair(pa, qb) 40 | k3.ScalarMult(k3, c) 41 | 42 | // k1, k2 and k3 will all be equal. 43 | } 44 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 !go1.7 gccgo appengine 6 | 7 | package chacha20poly1305 8 | 9 | func (c *chacha20poly1305) seal(dst, nonce, plaintext, additionalData []byte) []byte { 10 | return c.sealGeneric(dst, nonce, plaintext, additionalData) 11 | } 12 | 13 | func (c *chacha20poly1305) open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { 14 | return c.openGeneric(dst, nonce, ciphertext, additionalData) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/chacha20poly1305/internal/chacha20/chacha_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package chacha20 6 | 7 | import ( 8 | "encoding/hex" 9 | "testing" 10 | ) 11 | 12 | func TestCore(t *testing.T) { 13 | // This is just a smoke test that checks the example from 14 | // https://tools.ietf.org/html/rfc7539#section-2.3.2. The 15 | // chacha20poly1305 package contains much more extensive tests of this 16 | // code. 17 | var key [32]byte 18 | for i := range key { 19 | key[i] = byte(i) 20 | } 21 | 22 | var input [16]byte 23 | input[0] = 1 24 | input[7] = 9 25 | input[11] = 0x4a 26 | 27 | var out [64]byte 28 | XORKeyStream(out[:], out[:], &input, &key) 29 | const expected = "10f1e7e4d13b5915500fdd1fa32071c4c7d1f4c733c068030422aa9ac3d46c4ed2826446079faa0914c2d705d98b02a2b5129cd1de164eb9cbd083e8a2503c4e" 30 | if result := hex.EncodeToString(out[:]); result != expected { 31 | t.Errorf("wanted %x but got %x", expected, result) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/const_amd64.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html 7 | 8 | #define REDMASK51 0x0007FFFFFFFFFFFF 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/const_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html 7 | 8 | // +build amd64,!gccgo,!appengine 9 | 10 | // These constants cannot be encoded in non-MOVQ immediates. 11 | // We access them directly from memory instead. 12 | 13 | DATA ·_121666_213(SB)/8, $996687872 14 | GLOBL ·_121666_213(SB), 8, $8 15 | 16 | DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA 17 | GLOBL ·_2P0(SB), 8, $8 18 | 19 | DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE 20 | GLOBL ·_2P1234(SB), 8, $8 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/cswap_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!gccgo,!appengine 6 | 7 | // func cswap(inout *[4][5]uint64, v uint64) 8 | TEXT ·cswap(SB),7,$0 9 | MOVQ inout+0(FP),DI 10 | MOVQ v+8(FP),SI 11 | 12 | SUBQ $1, SI 13 | NOTQ SI 14 | MOVQ SI, X15 15 | PSHUFD $0x44, X15, X15 16 | 17 | MOVOU 0(DI), X0 18 | MOVOU 16(DI), X2 19 | MOVOU 32(DI), X4 20 | MOVOU 48(DI), X6 21 | MOVOU 64(DI), X8 22 | MOVOU 80(DI), X1 23 | MOVOU 96(DI), X3 24 | MOVOU 112(DI), X5 25 | MOVOU 128(DI), X7 26 | MOVOU 144(DI), X9 27 | 28 | MOVO X1, X10 29 | MOVO X3, X11 30 | MOVO X5, X12 31 | MOVO X7, X13 32 | MOVO X9, X14 33 | 34 | PXOR X0, X10 35 | PXOR X2, X11 36 | PXOR X4, X12 37 | PXOR X6, X13 38 | PXOR X8, X14 39 | PAND X15, X10 40 | PAND X15, X11 41 | PAND X15, X12 42 | PAND X15, X13 43 | PAND X15, X14 44 | PXOR X10, X0 45 | PXOR X10, X1 46 | PXOR X11, X2 47 | PXOR X11, X3 48 | PXOR X12, X4 49 | PXOR X12, X5 50 | PXOR X13, X6 51 | PXOR X13, X7 52 | PXOR X14, X8 53 | PXOR X14, X9 54 | 55 | MOVOU X0, 0(DI) 56 | MOVOU X2, 16(DI) 57 | MOVOU X4, 32(DI) 58 | MOVOU X6, 48(DI) 59 | MOVOU X8, 64(DI) 60 | MOVOU X1, 80(DI) 61 | MOVOU X3, 96(DI) 62 | MOVOU X5, 112(DI) 63 | MOVOU X7, 128(DI) 64 | MOVOU X9, 144(DI) 65 | RET 66 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/curve25519_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package curve25519 6 | 7 | import ( 8 | "fmt" 9 | "testing" 10 | ) 11 | 12 | const expectedHex = "89161fde887b2b53de549af483940106ecc114d6982daa98256de23bdf77661a" 13 | 14 | func TestBaseScalarMult(t *testing.T) { 15 | var a, b [32]byte 16 | in := &a 17 | out := &b 18 | a[0] = 1 19 | 20 | for i := 0; i < 200; i++ { 21 | ScalarBaseMult(out, in) 22 | in, out = out, in 23 | } 24 | 25 | result := fmt.Sprintf("%x", in[:]) 26 | if result != expectedHex { 27 | t.Errorf("incorrect result: got %s, want %s", result, expectedHex) 28 | } 29 | } 30 | 31 | func BenchmarkScalarBaseMult(b *testing.B) { 32 | var in, out [32]byte 33 | in[0] = 1 34 | 35 | b.SetBytes(32) 36 | for i := 0; i < b.N; i++ { 37 | ScalarBaseMult(&out, &in) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package curve25519 provides an implementation of scalar multiplication on 6 | // the elliptic curve known as curve25519. See https://cr.yp.to/ecdh.html 7 | package curve25519 // import "golang.org/x/crypto/curve25519" 8 | 9 | // basePoint is the x coordinate of the generator of the curve. 10 | var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} 11 | 12 | // ScalarMult sets dst to the product in*base where dst and base are the x 13 | // coordinates of group points and all values are in little-endian form. 14 | func ScalarMult(dst, in, base *[32]byte) { 15 | scalarMult(dst, in, base) 16 | } 17 | 18 | // ScalarBaseMult sets dst to the product in*base where dst and base are the x 19 | // coordinates of group points, base is the standard generator and all values 20 | // are in little-endian form. 21 | func ScalarBaseMult(dst, in *[32]byte) { 22 | ScalarMult(dst, in, &basePoint) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ed25519/testdata/sign.input.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/farmerx/mail/c8944af55a4b44e745be7c27a1e7ecd8a1ec1d4f/vendor/golang.org/x/crypto/ed25519/testdata/sign.input.gz -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/md4/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package md4_test 6 | 7 | import ( 8 | "fmt" 9 | "io" 10 | 11 | "golang.org/x/crypto/md4" 12 | ) 13 | 14 | func ExampleNew() { 15 | h := md4.New() 16 | data := "These pretzels are making me thirsty." 17 | io.WriteString(h, data) 18 | fmt.Printf("%x", h.Sum(nil)) 19 | // Output: 48c4e365090b30a32f084c4888deceaa 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/nacl/auth/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package auth_test 6 | 7 | import ( 8 | "encoding/hex" 9 | "fmt" 10 | 11 | "golang.org/x/crypto/nacl/auth" 12 | ) 13 | 14 | func Example() { 15 | // Load your secret key from a safe place and reuse it across multiple 16 | // Sum calls. (Obviously don't use this example key for anything 17 | // real.) If you want to convert a passphrase to a key, use a suitable 18 | // package like bcrypt or scrypt. 19 | secretKeyBytes, err := hex.DecodeString("6368616e676520746869732070617373776f726420746f206120736563726574") 20 | if err != nil { 21 | panic(err) 22 | } 23 | 24 | var secretKey [32]byte 25 | copy(secretKey[:], secretKeyBytes) 26 | 27 | mac := auth.Sum([]byte("hello world"), &secretKey) 28 | fmt.Printf("%x\n", *mac) 29 | result := auth.Verify(mac[:], []byte("hello world"), &secretKey) 30 | fmt.Println(result) 31 | badResult := auth.Verify(mac[:], []byte("different message"), &secretKey) 32 | fmt.Println(badResult) 33 | // Output: eca5a521f3d77b63f567fb0cb6f5f2d200641bc8dada42f60c5f881260c30317 34 | // true 35 | // false 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/openpgp/canonical_text.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package openpgp 6 | 7 | import "hash" 8 | 9 | // NewCanonicalTextHash reformats text written to it into the canonical 10 | // form and then applies the hash h. See RFC 4880, section 5.2.1. 11 | func NewCanonicalTextHash(h hash.Hash) hash.Hash { 12 | return &canonicalTextHash{h, 0} 13 | } 14 | 15 | type canonicalTextHash struct { 16 | h hash.Hash 17 | s int 18 | } 19 | 20 | var newline = []byte{'\r', '\n'} 21 | 22 | func (cth *canonicalTextHash) Write(buf []byte) (int, error) { 23 | start := 0 24 | 25 | for i, c := range buf { 26 | switch cth.s { 27 | case 0: 28 | if c == '\r' { 29 | cth.s = 1 30 | } else if c == '\n' { 31 | cth.h.Write(buf[start:i]) 32 | cth.h.Write(newline) 33 | start = i + 1 34 | } 35 | case 1: 36 | cth.s = 0 37 | } 38 | } 39 | 40 | cth.h.Write(buf[start:]) 41 | return len(buf), nil 42 | } 43 | 44 | func (cth *canonicalTextHash) Sum(in []byte) []byte { 45 | return cth.h.Sum(in) 46 | } 47 | 48 | func (cth *canonicalTextHash) Reset() { 49 | cth.h.Reset() 50 | cth.s = 0 51 | } 52 | 53 | func (cth *canonicalTextHash) Size() int { 54 | return cth.h.Size() 55 | } 56 | 57 | func (cth *canonicalTextHash) BlockSize() int { 58 | return cth.h.BlockSize() 59 | } 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/openpgp/canonical_text_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package openpgp 6 | 7 | import ( 8 | "bytes" 9 | "testing" 10 | ) 11 | 12 | type recordingHash struct { 13 | buf *bytes.Buffer 14 | } 15 | 16 | func (r recordingHash) Write(b []byte) (n int, err error) { 17 | return r.buf.Write(b) 18 | } 19 | 20 | func (r recordingHash) Sum(in []byte) []byte { 21 | return append(in, r.buf.Bytes()...) 22 | } 23 | 24 | func (r recordingHash) Reset() { 25 | panic("shouldn't be called") 26 | } 27 | 28 | func (r recordingHash) Size() int { 29 | panic("shouldn't be called") 30 | } 31 | 32 | func (r recordingHash) BlockSize() int { 33 | panic("shouldn't be called") 34 | } 35 | 36 | func testCanonicalText(t *testing.T, input, expected string) { 37 | r := recordingHash{bytes.NewBuffer(nil)} 38 | c := NewCanonicalTextHash(r) 39 | c.Write([]byte(input)) 40 | result := c.Sum(nil) 41 | if expected != string(result) { 42 | t.Errorf("input: %x got: %x want: %x", input, result, expected) 43 | } 44 | } 45 | 46 | func TestCanonicalText(t *testing.T) { 47 | testCanonicalText(t, "foo\n", "foo\r\n") 48 | testCanonicalText(t, "foo", "foo") 49 | testCanonicalText(t, "foo\r\n", "foo\r\n") 50 | testCanonicalText(t, "foo\r\nbar", "foo\r\nbar") 51 | testCanonicalText(t, "foo\r\nbar\n\n", "foo\r\nbar\r\n\r\n") 52 | } 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/openpgp/packet/compressed_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package packet 6 | 7 | import ( 8 | "bytes" 9 | "encoding/hex" 10 | "io" 11 | "io/ioutil" 12 | "testing" 13 | ) 14 | 15 | func TestCompressed(t *testing.T) { 16 | packet, err := Read(readerFromHex(compressedHex)) 17 | if err != nil { 18 | t.Errorf("failed to read Compressed: %s", err) 19 | return 20 | } 21 | 22 | c, ok := packet.(*Compressed) 23 | if !ok { 24 | t.Error("didn't find Compressed packet") 25 | return 26 | } 27 | 28 | contents, err := ioutil.ReadAll(c.Body) 29 | if err != nil && err != io.EOF { 30 | t.Error(err) 31 | return 32 | } 33 | 34 | expected, _ := hex.DecodeString(compressedExpectedHex) 35 | if !bytes.Equal(expected, contents) { 36 | t.Errorf("got:%x want:%x", contents, expected) 37 | } 38 | } 39 | 40 | const compressedHex = "a3013b2d90c4e02b72e25f727e5e496a5e49b11e1700" 41 | const compressedExpectedHex = "cb1062004d14c8fe636f6e74656e74732e0a" 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/openpgp/packet/ocfb_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package packet 6 | 7 | import ( 8 | "bytes" 9 | "crypto/aes" 10 | "crypto/rand" 11 | "testing" 12 | ) 13 | 14 | var commonKey128 = []byte{0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c} 15 | 16 | func testOCFB(t *testing.T, resync OCFBResyncOption) { 17 | block, err := aes.NewCipher(commonKey128) 18 | if err != nil { 19 | t.Error(err) 20 | return 21 | } 22 | 23 | plaintext := []byte("this is the plaintext, which is long enough to span several blocks.") 24 | randData := make([]byte, block.BlockSize()) 25 | rand.Reader.Read(randData) 26 | ocfb, prefix := NewOCFBEncrypter(block, randData, resync) 27 | ciphertext := make([]byte, len(plaintext)) 28 | ocfb.XORKeyStream(ciphertext, plaintext) 29 | 30 | ocfbdec := NewOCFBDecrypter(block, prefix, resync) 31 | if ocfbdec == nil { 32 | t.Errorf("NewOCFBDecrypter failed (resync: %t)", resync) 33 | return 34 | } 35 | plaintextCopy := make([]byte, len(plaintext)) 36 | ocfbdec.XORKeyStream(plaintextCopy, ciphertext) 37 | 38 | if !bytes.Equal(plaintextCopy, plaintext) { 39 | t.Errorf("got: %x, want: %x (resync: %t)", plaintextCopy, plaintext, resync) 40 | } 41 | } 42 | 43 | func TestOCFB(t *testing.T) { 44 | testOCFB(t, OCFBNoResync) 45 | testOCFB(t, OCFBResync) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/pkcs12/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkcs12 6 | 7 | import "errors" 8 | 9 | var ( 10 | // ErrDecryption represents a failure to decrypt the input. 11 | ErrDecryption = errors.New("pkcs12: decryption error, incorrect padding") 12 | 13 | // ErrIncorrectPassword is returned when an incorrect password is detected. 14 | // Usually, P12/PFX data is signed to be able to verify the password. 15 | ErrIncorrectPassword = errors.New("pkcs12: decryption password incorrect") 16 | ) 17 | 18 | // NotImplementedError indicates that the input is not currently supported. 19 | type NotImplementedError string 20 | 21 | func (e NotImplementedError) Error() string { 22 | return "pkcs12: " + string(e) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/pkcs12/internal/rc2/bench_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package rc2 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func BenchmarkEncrypt(b *testing.B) { 12 | r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64) 13 | b.ResetTimer() 14 | var src [8]byte 15 | for i := 0; i < b.N; i++ { 16 | r.Encrypt(src[:], src[:]) 17 | } 18 | } 19 | 20 | func BenchmarkDecrypt(b *testing.B) { 21 | r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64) 22 | b.ResetTimer() 23 | var src [8]byte 24 | for i := 0; i < b.N; i++ { 25 | r.Decrypt(src[:], src[:]) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/pkcs12/mac.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkcs12 6 | 7 | import ( 8 | "crypto/hmac" 9 | "crypto/sha1" 10 | "crypto/x509/pkix" 11 | "encoding/asn1" 12 | ) 13 | 14 | type macData struct { 15 | Mac digestInfo 16 | MacSalt []byte 17 | Iterations int `asn1:"optional,default:1"` 18 | } 19 | 20 | // from PKCS#7: 21 | type digestInfo struct { 22 | Algorithm pkix.AlgorithmIdentifier 23 | Digest []byte 24 | } 25 | 26 | var ( 27 | oidSHA1 = asn1.ObjectIdentifier([]int{1, 3, 14, 3, 2, 26}) 28 | ) 29 | 30 | func verifyMac(macData *macData, message, password []byte) error { 31 | if !macData.Mac.Algorithm.Algorithm.Equal(oidSHA1) { 32 | return NotImplementedError("unknown digest algorithm: " + macData.Mac.Algorithm.Algorithm.String()) 33 | } 34 | 35 | key := pbkdf(sha1Sum, 20, 64, macData.MacSalt, password, macData.Iterations, 3, 20) 36 | 37 | mac := hmac.New(sha1.New, key) 38 | mac.Write(message) 39 | expectedMAC := mac.Sum(nil) 40 | 41 | if !hmac.Equal(macData.Mac.Digest, expectedMAC) { 42 | return ErrIncorrectPassword 43 | } 44 | return nil 45 | } 46 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/pkcs12/mac_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkcs12 6 | 7 | import ( 8 | "encoding/asn1" 9 | "testing" 10 | ) 11 | 12 | func TestVerifyMac(t *testing.T) { 13 | td := macData{ 14 | Mac: digestInfo{ 15 | Digest: []byte{0x18, 0x20, 0x3d, 0xff, 0x1e, 0x16, 0xf4, 0x92, 0xf2, 0xaf, 0xc8, 0x91, 0xa9, 0xba, 0xd6, 0xca, 0x9d, 0xee, 0x51, 0x93}, 16 | }, 17 | MacSalt: []byte{1, 2, 3, 4, 5, 6, 7, 8}, 18 | Iterations: 2048, 19 | } 20 | 21 | message := []byte{11, 12, 13, 14, 15} 22 | password, _ := bmpString("") 23 | 24 | td.Mac.Algorithm.Algorithm = asn1.ObjectIdentifier([]int{1, 2, 3}) 25 | err := verifyMac(&td, message, password) 26 | if _, ok := err.(NotImplementedError); !ok { 27 | t.Errorf("err: %v", err) 28 | } 29 | 30 | td.Mac.Algorithm.Algorithm = asn1.ObjectIdentifier([]int{1, 3, 14, 3, 2, 26}) 31 | err = verifyMac(&td, message, password) 32 | if err != ErrIncorrectPassword { 33 | t.Errorf("Expected incorrect password, got err: %v", err) 34 | } 35 | 36 | password, _ = bmpString("Sesame open") 37 | err = verifyMac(&td, message, password) 38 | if err != nil { 39 | t.Errorf("err: %v", err) 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/pkcs12/pbkdf_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkcs12 6 | 7 | import ( 8 | "bytes" 9 | "testing" 10 | ) 11 | 12 | func TestThatPBKDFWorksCorrectlyForLongKeys(t *testing.T) { 13 | cipherInfo := shaWithTripleDESCBC{} 14 | 15 | salt := []byte("\xff\xff\xff\xff\xff\xff\xff\xff") 16 | password, _ := bmpString("sesame") 17 | key := cipherInfo.deriveKey(salt, password, 2048) 18 | 19 | if expected := []byte("\x7c\xd9\xfd\x3e\x2b\x3b\xe7\x69\x1a\x44\xe3\xbe\xf0\xf9\xea\x0f\xb9\xb8\x97\xd4\xe3\x25\xd9\xd1"); bytes.Compare(key, expected) != 0 { 20 | t.Fatalf("expected key '%x', but found '%x'", expected, key) 21 | } 22 | } 23 | 24 | func TestThatPBKDFHandlesLeadingZeros(t *testing.T) { 25 | // This test triggers a case where I_j (in step 6C) ends up with leading zero 26 | // byte, meaning that len(Ijb) < v (leading zeros get stripped by big.Int). 27 | // This was previously causing bug whereby certain inputs would break the 28 | // derivation and produce the wrong output. 29 | key := pbkdf(sha1Sum, 20, 64, []byte("\xf3\x7e\x05\xb5\x18\x32\x4b\x4b"), []byte("\x00\x00"), 2048, 1, 24) 30 | expected := []byte("\x00\xf7\x59\xff\x47\xd1\x4d\xd0\x36\x65\xd5\x94\x3c\xb3\xc4\xa3\x9a\x25\x55\xc0\x2a\xed\x66\xe1") 31 | if bytes.Compare(key, expected) != 0 { 32 | t.Fatalf("expected key '%x', but found '%x'", expected, key) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/poly1305.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Package poly1305 implements Poly1305 one-time message authentication code as 7 | specified in https://cr.yp.to/mac/poly1305-20050329.pdf. 8 | 9 | Poly1305 is a fast, one-time authentication function. It is infeasible for an 10 | attacker to generate an authenticator for a message without the key. However, a 11 | key must only be used for a single message. Authenticating two different 12 | messages with the same key allows an attacker to forge authenticators for other 13 | messages with the same key. 14 | 15 | Poly1305 was originally coupled with AES in order to make Poly1305-AES. AES was 16 | used with a fixed key in order to generate one-time keys from an nonce. 17 | However, in this package AES isn't used and the one-time key is specified 18 | directly. 19 | */ 20 | package poly1305 // import "golang.org/x/crypto/poly1305" 21 | 22 | import "crypto/subtle" 23 | 24 | // TagSize is the size, in bytes, of a poly1305 authenticator. 25 | const TagSize = 16 26 | 27 | // Verify returns true if mac is a valid authenticator for m with the given 28 | // key. 29 | func Verify(mac *[16]byte, m []byte, key *[32]byte) bool { 30 | var tmp [16]byte 31 | Sum(&tmp, m, key) 32 | return subtle.ConstantTimeCompare(tmp[:], mac[:]) == 1 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/sum_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!gccgo,!appengine 6 | 7 | package poly1305 8 | 9 | // This function is implemented in sum_amd64.s 10 | //go:noescape 11 | func poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]byte) 12 | 13 | // Sum generates an authenticator for m using a one-time key and puts the 14 | // 16-byte result into out. Authenticating two different messages with the same 15 | // key allows an attacker to forge messages at will. 16 | func Sum(out *[16]byte, m []byte, key *[32]byte) { 17 | var mPtr *byte 18 | if len(m) > 0 { 19 | mPtr = &m[0] 20 | } 21 | poly1305(out, mPtr, uint64(len(m)), key) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/sum_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,!gccgo,!appengine,!nacl 6 | 7 | package poly1305 8 | 9 | // This function is implemented in sum_arm.s 10 | //go:noescape 11 | func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]byte) 12 | 13 | // Sum generates an authenticator for m using a one-time key and puts the 14 | // 16-byte result into out. Authenticating two different messages with the same 15 | // key allows an attacker to forge messages at will. 16 | func Sum(out *[16]byte, m []byte, key *[32]byte) { 17 | var mPtr *byte 18 | if len(m) > 0 { 19 | mPtr = &m[0] 20 | } 21 | poly1305_auth_armv6(out, mPtr, uint32(len(m)), key) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package salsa 8 | 9 | // This function is implemented in salsa2020_amd64.s. 10 | 11 | //go:noescape 12 | 13 | func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte) 14 | 15 | // XORKeyStream crypts bytes from in to out using the given key and counters. 16 | // In and out may be the same slice but otherwise should not overlap. Counter 17 | // contains the raw salsa20 counter bytes (both nonce and block counter). 18 | func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { 19 | if len(in) == 0 { 20 | return 21 | } 22 | _ = out[len(in)-1] 23 | salsa2020XORKeyStream(&out[0], &in[0], uint64(len(in)), &counter[0], &key[0]) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/keccakf_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package sha3 8 | 9 | // This function is implemented in keccakf_amd64.s. 10 | 11 | //go:noescape 12 | 13 | func keccakF1600(a *[25]uint64) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package sha3 8 | 9 | import ( 10 | "crypto" 11 | ) 12 | 13 | func init() { 14 | crypto.RegisterHash(crypto.SHA3_224, New224) 15 | crypto.RegisterHash(crypto.SHA3_256, New256) 16 | crypto.RegisterHash(crypto.SHA3_384, New384) 17 | crypto.RegisterHash(crypto.SHA3_512, New512) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/testdata/keccakKats.json.deflate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/farmerx/mail/c8944af55a4b44e745be7c27a1e7ecd8a1ec1d4f/vendor/golang.org/x/crypto/sha3/testdata/keccakKats.json.deflate -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!386,!ppc64le appengine 6 | 7 | package sha3 8 | 9 | var ( 10 | xorIn = xorInGeneric 11 | copyOut = copyOutGeneric 12 | xorInUnaligned = xorInGeneric 13 | copyOutUnaligned = copyOutGeneric 14 | ) 15 | 16 | const xorImplementationUnaligned = "generic" 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package sha3 6 | 7 | import "encoding/binary" 8 | 9 | // xorInGeneric xors the bytes in buf into the state; it 10 | // makes no non-portable assumptions about memory layout 11 | // or alignment. 12 | func xorInGeneric(d *state, buf []byte) { 13 | n := len(buf) / 8 14 | 15 | for i := 0; i < n; i++ { 16 | a := binary.LittleEndian.Uint64(buf) 17 | d.a[i] ^= a 18 | buf = buf[8:] 19 | } 20 | } 21 | 22 | // copyOutGeneric copies ulint64s to a byte buffer. 23 | func copyOutGeneric(d *state, b []byte) { 24 | for i := 0; len(b) >= 8; i++ { 25 | binary.LittleEndian.PutUint64(b, d.a[i]) 26 | b = b[8:] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor_unaligned.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64 386 ppc64le 6 | // +build !appengine 7 | 8 | package sha3 9 | 10 | import "unsafe" 11 | 12 | func xorInUnaligned(d *state, buf []byte) { 13 | bw := (*[maxRate / 8]uint64)(unsafe.Pointer(&buf[0])) 14 | n := len(buf) 15 | if n >= 72 { 16 | d.a[0] ^= bw[0] 17 | d.a[1] ^= bw[1] 18 | d.a[2] ^= bw[2] 19 | d.a[3] ^= bw[3] 20 | d.a[4] ^= bw[4] 21 | d.a[5] ^= bw[5] 22 | d.a[6] ^= bw[6] 23 | d.a[7] ^= bw[7] 24 | d.a[8] ^= bw[8] 25 | } 26 | if n >= 104 { 27 | d.a[9] ^= bw[9] 28 | d.a[10] ^= bw[10] 29 | d.a[11] ^= bw[11] 30 | d.a[12] ^= bw[12] 31 | } 32 | if n >= 136 { 33 | d.a[13] ^= bw[13] 34 | d.a[14] ^= bw[14] 35 | d.a[15] ^= bw[15] 36 | d.a[16] ^= bw[16] 37 | } 38 | if n >= 144 { 39 | d.a[17] ^= bw[17] 40 | } 41 | if n >= 168 { 42 | d.a[18] ^= bw[18] 43 | d.a[19] ^= bw[19] 44 | d.a[20] ^= bw[20] 45 | } 46 | } 47 | 48 | func copyOutUnaligned(d *state, buf []byte) { 49 | ab := (*[maxRate]uint8)(unsafe.Pointer(&d.a[0])) 50 | copy(buf, ab[:]) 51 | } 52 | 53 | var ( 54 | xorIn = xorInUnaligned 55 | copyOut = copyOutUnaligned 56 | ) 57 | 58 | const xorImplementationUnaligned = "unaligned" 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/agent/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package agent_test 6 | 7 | import ( 8 | "log" 9 | "net" 10 | "os" 11 | 12 | "golang.org/x/crypto/ssh" 13 | "golang.org/x/crypto/ssh/agent" 14 | ) 15 | 16 | func ExampleClientAgent() { 17 | // ssh-agent has a UNIX socket under $SSH_AUTH_SOCK 18 | socket := os.Getenv("SSH_AUTH_SOCK") 19 | conn, err := net.Dial("unix", socket) 20 | if err != nil { 21 | log.Fatalf("net.Dial: %v", err) 22 | } 23 | agentClient := agent.NewClient(conn) 24 | config := &ssh.ClientConfig{ 25 | User: "username", 26 | Auth: []ssh.AuthMethod{ 27 | // Use a callback rather than PublicKeys 28 | // so we only consult the agent once the remote server 29 | // wants it. 30 | ssh.PublicKeysCallback(agentClient.Signers), 31 | }, 32 | HostKeyCallback: ssh.InsecureIgnoreHostKey(), 33 | } 34 | 35 | sshc, err := ssh.Dial("tcp", "localhost:22", config) 36 | if err != nil { 37 | log.Fatalf("Dial: %v", err) 38 | } 39 | // .. use sshc 40 | sshc.Close() 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Package ssh implements an SSH client and server. 7 | 8 | SSH is a transport security protocol, an authentication protocol and a 9 | family of application protocols. The most typical application level 10 | protocol is a remote shell and this is specifically implemented. However, 11 | the multiplexed nature of SSH is exposed to users that wish to support 12 | others. 13 | 14 | References: 15 | [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD 16 | [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1 17 | 18 | This package does not fall under the stability promise of the Go language itself, 19 | so its API may be changed when pressing needs arise. 20 | */ 21 | package ssh // import "golang.org/x/crypto/ssh" 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/kex_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ssh 6 | 7 | // Key exchange tests. 8 | 9 | import ( 10 | "crypto/rand" 11 | "reflect" 12 | "testing" 13 | ) 14 | 15 | func TestKexes(t *testing.T) { 16 | type kexResultErr struct { 17 | result *kexResult 18 | err error 19 | } 20 | 21 | for name, kex := range kexAlgoMap { 22 | a, b := memPipe() 23 | 24 | s := make(chan kexResultErr, 1) 25 | c := make(chan kexResultErr, 1) 26 | var magics handshakeMagics 27 | go func() { 28 | r, e := kex.Client(a, rand.Reader, &magics) 29 | a.Close() 30 | c <- kexResultErr{r, e} 31 | }() 32 | go func() { 33 | r, e := kex.Server(b, rand.Reader, &magics, testSigners["ecdsa"]) 34 | b.Close() 35 | s <- kexResultErr{r, e} 36 | }() 37 | 38 | clientRes := <-c 39 | serverRes := <-s 40 | if clientRes.err != nil { 41 | t.Errorf("client: %v", clientRes.err) 42 | } 43 | if serverRes.err != nil { 44 | t.Errorf("server: %v", serverRes.err) 45 | } 46 | if !reflect.DeepEqual(clientRes.result, serverRes.result) { 47 | t.Errorf("kex %q: mismatch %#v, %#v", name, clientRes.result, serverRes.result) 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/tcpip_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ssh 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func TestAutoPortListenBroken(t *testing.T) { 12 | broken := "SSH-2.0-OpenSSH_5.9hh11" 13 | works := "SSH-2.0-OpenSSH_6.1" 14 | if !isBrokenOpenSSHVersion(broken) { 15 | t.Errorf("version %q not marked as broken", broken) 16 | } 17 | if isBrokenOpenSSHVersion(works) { 18 | t.Errorf("version %q marked as broken", works) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TIOCGETA 12 | const ioctlWriteTermios = unix.TIOCSETA 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package terminal 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | const ioctlReadTermios = unix.TCGETS 10 | const ioctlWriteTermios = unix.TCSETS 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/test/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This package contains integration tests for the 6 | // golang.org/x/crypto/ssh package. 7 | package test // import "golang.org/x/crypto/ssh/test" 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/testdata/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This package contains test data shared between the various subpackages of 6 | // the golang.org/x/crypto/ssh package. Under no circumstance should 7 | // this data be used for production code. 8 | package testdata // import "golang.org/x/crypto/ssh/testdata" 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/.hgignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | syntax:glob 3 | last-change 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go networking libraries. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/codereview.cfg: -------------------------------------------------------------------------------- 1 | defaultcc: golang-codereviews@googlegroups.com 2 | contributors: http://go.googlecode.com/hg/CONTRIBUTORS 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/withtimeout_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package context_test 6 | 7 | import ( 8 | "fmt" 9 | "time" 10 | 11 | "golang.org/x/net/context" 12 | ) 13 | 14 | func ExampleWithTimeout() { 15 | // Pass a context with a timeout to tell a blocking function that it 16 | // should abandon its work after the timeout elapses. 17 | ctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond) 18 | select { 19 | case <-time.After(200 * time.Millisecond): 20 | fmt.Println("overslept") 21 | case <-ctx.Done(): 22 | fmt.Println(ctx.Err()) // prints "context deadline exceeded" 23 | } 24 | // Output: 25 | // context deadline exceeded 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/charset/testdata/README: -------------------------------------------------------------------------------- 1 | These test cases come from http://www.w3.org/International/tests/html5/the-input-byte-stream/results-basics 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/farmerx/mail/c8944af55a4b44e745be7c27a1e7ecd8a1ec1d4f/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/farmerx/mail/c8944af55a4b44e745be7c27a1e7ecd8a1ec1d4f/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/entity_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package html 6 | 7 | import ( 8 | "testing" 9 | "unicode/utf8" 10 | ) 11 | 12 | func TestEntityLength(t *testing.T) { 13 | // We verify that the length of UTF-8 encoding of each value is <= 1 + len(key). 14 | // The +1 comes from the leading "&". This property implies that the length of 15 | // unescaped text is <= the length of escaped text. 16 | for k, v := range entity { 17 | if 1+len(k) < utf8.RuneLen(v) { 18 | t.Error("escaped entity &" + k + " is shorter than its UTF-8 encoding " + string(v)) 19 | } 20 | if len(k) > longestEntityWithoutSemicolon && k[len(k)-1] != ';' { 21 | t.Errorf("entity name %s is %d characters, but longestEntityWithoutSemicolon=%d", k, len(k), longestEntityWithoutSemicolon) 22 | } 23 | } 24 | for k, v := range entity2 { 25 | if 1+len(k) < utf8.RuneLen(v[0])+utf8.RuneLen(v[1]) { 26 | t.Error("escaped entity &" + k + " is shorter than its UTF-8 encoding " + string(v[0]) + string(v[1])) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This example demonstrates parsing HTML data and walking the resulting tree. 6 | package html_test 7 | 8 | import ( 9 | "fmt" 10 | "log" 11 | "strings" 12 | 13 | "golang.org/x/net/html" 14 | ) 15 | 16 | func ExampleParse() { 17 | s := `
Links:
` 18 | doc, err := html.Parse(strings.NewReader(s)) 19 | if err != nil { 20 | log.Fatal(err) 21 | } 22 | var f func(*html.Node) 23 | f = func(n *html.Node) { 24 | if n.Type == html.ElementNode && n.Data == "a" { 25 | for _, a := range n.Attr { 26 | if a.Key == "href" { 27 | fmt.Println(a.Val) 28 | break 29 | } 30 | } 31 | } 32 | for c := n.FirstChild; c != nil; c = c.NextSibling { 33 | f(c) 34 | } 35 | } 36 | f(doc) 37 | // Output: 38 | // foo 39 | // /bar/baz 40 | } 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/testdata/webkit/adoption02.dat: -------------------------------------------------------------------------------- 1 | #data 2 | 1234 3 | #errors 4 | #document 5 | | 6 | |
7 | | 8 | | 9 | | "1" 10 | | 11 | | "2" 12 | | 13 | |