Skip to content
Snippets Groups Projects
  1. Apr 11, 2019
  2. Apr 04, 2019
  3. Apr 03, 2019
  4. Mar 25, 2019
    • Andrey Petrov's avatar
      ssh/terminal: Use move-N sequences for >1 cursor moves · a5d413f7
      Andrey Petrov authored
      Before, we emitted N single-move sequences on a cursor move. For
      example, "move 4 left" would emit "^[[D^[[D^[[D^[[D". With this change,
      it would emit "^[[4D".
      
      Using variable move sequences when possible reduces the amount of
      rendering output that the terminal implementation produces. This can
      have some low-level performance benefits, but also helps consumers
      reason through the produced output.
      
      Includes a test with a couple of cases.
      
      Note: The old implementation used ^[[D instead of ^[D which is also
      valid. This is true in several unrelated places, so this implementation
      continues to use ^[[D for consistency.
      
      Change-Id: If38eaaed8fb4075499fdda54c06681dc34c3ad70
      GitHub-Last-Rev: 92ef2538d33a9493f3df09984c277dfd8bf0abf4
      GitHub-Pull-Request: golang/crypto#82
      Reviewed-on: https://go-review.googlesource.com/c/crypto/+/169077
      
      
      Reviewed-by: default avatarAdam Langley <agl@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      a5d413f7
  5. Mar 20, 2019
  6. Mar 13, 2019
  7. Mar 08, 2019
  8. Feb 28, 2019
  9. Feb 27, 2019
  10. Feb 25, 2019
  11. Feb 22, 2019
    • lukechampine's avatar
      xts: reduce tweak allocations · ffb98f73
      lukechampine authored
      The call to k2.Encrypt causes tweak to escape to the heap, resulting
      in a 16-byte allocation for each call to Encrypt/Decrypt. Moving
      tweak into the Cipher struct would allow it to be reused, but this
      is ruled out by the Cipher docstring, which states that it is safe
      for concurrent use. Instead, manage tweak arrays with a sync.Pool.
      Benchmarks indicate that this amortizes allocation cost without
      impacting performance.
      
      benchmark          old ns/op     new ns/op     delta
      BenchmarkXTS-4     234           245           +4.70%
      
      benchmark          old allocs    new allocs    delta
      BenchmarkXTS-4     2             0             -100.00%
      
      benchmark          old bytes     new bytes     delta
      BenchmarkXTS-4     32            0             -100.00%
      
      Change-Id: I5e0dd8c2e1a1078a151bbeb1d0760936b6b56216
      GitHub-Last-Rev: 14d81f589f3ada2b19511d592000657af3410a51
      GitHub-Pull-Request: golang/crypto#51
      Reviewed-on: https://go-review.googlesource.com/c/118535
      
      
      Reviewed-by: default avatarFilippo Valsorda <filippo@golang.org>
      Run-TryBot: Filippo Valsorda <filippo@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      ffb98f73
    • Sad Pencil's avatar
      bn256: fix String methods when g.p == nil · 6635ad99
      Sad Pencil authored
      Previously, when g.p == nil, String() crashed. In other method like Add(),
      a point with g.p == nil is treated as an identity element.
      
      Besides, the following code is the only way to get an identity element
      outside the library: g := bn256.G1{}. In this situation, g.p == nil.
      
      For example, the following code will crash:
      
      package main
      
      import (
      	"fmt"
      	"golang.org/x/crypto/bn256"
      )
      
      func main() {
      	g := bn256.G1{}
      	fmt.Println(g.String())
      }
      
      Change-Id: Ied6f7c8197e7b79b0913c000a9cf1cf68f8188a9
      GitHub-Last-Rev: 23246486a982ea54d6023726e048c74f02089f25
      GitHub-Pull-Request: golang/crypto#75
      Reviewed-on: https://go-review.googlesource.com/c/163118
      
      
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarFilippo Valsorda <filippo@golang.org>
      Run-TryBot: Filippo Valsorda <filippo@golang.org>
      6635ad99
    • Filippo Valsorda's avatar
      all: deprecate broken and legacy packages · a5739832
      Filippo Valsorda authored
      Fixes golang/go#30141
      
      Change-Id: I76f8eae31cfd6d106440114685cc0d9abba374f8
      Reviewed-on: https://go-review.googlesource.com/c/163537
      
      
      Reviewed-by: default avatarAdam Langley <agl@golang.org>
      a5739832
  12. Feb 19, 2019
  13. Feb 11, 2019
    • Meng Zhuo's avatar
      internal/chacha20: add SIMD implementation on arm64 · 74369b46
      Meng Zhuo authored
      Inspired by Vectorization of ChaCha Stream Cipher
      https://eprint.iacr.org/2013/759.pdf
      
      name            old time/op    new time/op    delta
      ChaCha20/32        690ns ± 0%     872ns ± 0%   +26.38%  (p=0.000 n=10+10)
      ChaCha20/63        750ns ± 0%     987ns ± 0%   +31.53%  (p=0.000 n=10+10)
      ChaCha20/64        674ns ± 0%     879ns ± 0%   +30.42%  (p=0.000 n=8+10)
      ChaCha20/256      2.28µs ± 0%    0.82µs ± 0%   -64.13%  (p=0.000 n=10+10)
      ChaCha20/1024     8.64µs ± 0%    2.92µs ± 0%   -66.15%  (p=0.000 n=9+9)
      ChaCha20/1350     11.9µs ± 0%     4.5µs ± 0%   -62.51%  (p=0.000 n=10+8)
      ChaCha20/65536     554µs ± 0%     181µs ± 0%   -67.33%  (p=0.000 n=10+10)
      
      name            old speed      new speed      delta
      ChaCha20/32     46.3MB/s ± 0%  36.7MB/s ± 0%   -20.87%  (p=0.000 n=10+9)
      ChaCha20/63     83.9MB/s ± 0%  63.8MB/s ± 0%   -23.97%  (p=0.000 n=10+10)
      ChaCha20/64     94.9MB/s ± 0%  72.8MB/s ± 0%   -23.31%  (p=0.000 n=10+10)
      ChaCha20/256     112MB/s ± 0%   312MB/s ± 0%  +178.74%  (p=0.000 n=10+10)
      ChaCha20/1024    119MB/s ± 0%   350MB/s ± 0%  +195.31%  (p=0.000 n=10+9)
      ChaCha20/1350    114MB/s ± 0%   303MB/s ± 0%  +166.73%  (p=0.000 n=8+8)
      ChaCha20/65536   118MB/s ± 0%   362MB/s ± 0%  +206.12%  (p=0.000 n=10+10)
      
      Updates golang/go#22809
      Change-Id: I487487faa2ae4ff29de6fd8eb1317740c2939c10
      Reviewed-on: https://go-review.googlesource.com/c/107628
      
      
      Reviewed-by: default avatarFilippo Valsorda <filippo@golang.org>
      74369b46
  14. Feb 08, 2019
    • Michael McLoughlin's avatar
      curve25519: mask high bit when loading group point · 193df9c0
      Michael McLoughlin authored
      Comparison against BoringSSL-generated test vectors showed mismatches
      with the pure Go implementation of curve25519. The problem was narrowed
      down to a missing mask in feFromBytes(). This diff adds the mask,
      bringing this back in line with the reference implementation and
      RFC 7748:
      
          When receiving such an array, implementations of X25519 (but not
          X448) MUST mask the most significant bit in the final byte.  This is
          done to preserve compatibility with point formats that reserve the
          sign bit for use in other protocols and to increase resistance to
          implementation fingerprinting.
      
      Fixes golang/go#30095
      
      Change-Id: If7efc0e2acd6efb761d6e3cb89cec359d7d81cb1
      Reviewed-on: https://go-review.googlesource.com/c/161257
      
      
      Run-TryBot: Filippo Valsorda <filippo@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarFilippo Valsorda <filippo@golang.org>
      193df9c0
  15. Jan 31, 2019
  16. Jan 30, 2019
  17. Jan 29, 2019
  18. Jan 28, 2019
  19. Jan 23, 2019
  20. Jan 22, 2019
  21. Jan 03, 2019
  22. Jan 02, 2019
    • kc1212's avatar
      bn256: fix gfp12 MulScalar · 8d7daa0c
      kc1212 authored
      Previously MulScalar was ignoring the first parameter, which was inconsistent with gfp6 and gfp2.
      
      Change-Id: I4f4a4ca2f07a25176ab159be684a02696f1580ba
      GitHub-Last-Rev: ec40c0403614ed56cf329102eb274dc776fa3be8
      GitHub-Pull-Request: golang/crypto#67
      Reviewed-on: https://go-review.googlesource.com/c/154457
      
      
      Reviewed-by: default avatarAdam Langley <agl@golang.org>
      Run-TryBot: Adam Langley <agl@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      8d7daa0c
  23. Dec 03, 2018
  24. Nov 27, 2018
  25. Nov 26, 2018
Loading