aboutsummaryrefslogtreecommitdiff
path: root/cryptobyte/cryptobyte_test.go
AgeCommit message (Collapse)Author
2023-09-07cryptobyte: add uint48 methodsDaniel Mangum
Adds uint48 methods for cryptobyte.Builder and cryptobyte.String. Supporting 48-bit unsigned integers is useful for working with protocols that use them for sequence numbers, such as DTLS. Fixes golang/go#61275 Change-Id: Ibe49422d37644b9212b28b123dc5e01850f7b05b GitHub-Last-Rev: 11b388c240109c8f4ac23880645c901ce6d2f093 GitHub-Pull-Request: golang/crypto#265 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/508675 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: qiulaidongfeng <2645477756@qq.com> Run-TryBot: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-24cryptobyte: add ReadUint64 and AddUint64hopehook
Fixes golang/go#53481. Change-Id: Ic00eef498d1d3b5b0ca5c9c526fac7c26de30cf2 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/421014 TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Filippo Valsorda <filippo@golang.org> Run-TryBot: hopehook <hopehook@qq.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
2018-11-26cryptobyte: fix typo in testPhilipp
Change-Id: I03178eca962c29ad03fd9b2fb57ad35c53c99860 GitHub-Last-Rev: 21a7a751920a5d3e650d1f91d17177f33e477ff1 GitHub-Pull-Request: golang/crypto#66 Reviewed-on: https://go-review.googlesource.com/c/151277 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-11-12cryptobyte: don't ignore bytes added to BuilderContinuations of fixed-size ↵Filippo Valsorda
Builders Builders created with NewFixedBuilder were broken when used with BuilderContinuations. The length of the bytes written to the continuation would get added correctly to the parent, but the actual content would be discarded. For example, the BytesOrPanic() in TestFixedBuilderLengthPrefixed would return [00 08] instead of [00 08 ff ff ff ff ff ff ff ff]. Change-Id: I80837a9bf3562751addcb827274649d9f52fc79a Reviewed-on: https://go-review.googlesource.com/c/148882 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
2018-10-29cryptobyte: add (*Builder).Unwrite and (*Builder).SetErrorFilippo Valsorda
Unwrite allows programs to rollback builders more reliably and efficiently than by copying a Builder (which might waste an allocation and depends on internal behavior). This is useful for example to remove a length-prefixed field if it ends up being empty. SetError allows simple Builder extensions to set errors without making MarshalingValue wrappers. Based on the experience of CL 144115. Change-Id: I9a785b81b51b15af49418b5bdb71c4ef222ccc46 Reviewed-on: https://go-review.googlesource.com/c/145317 Reviewed-by: Adam Langley <agl@golang.org>
2017-09-12cryptobyte: various API and documentation updates.Adam Langley
Change-Id: I83236ecea0774d4ec49e978a391eb3ff5dabdeb6 Reviewed-on: https://go-review.googlesource.com/57810 Reviewed-by: Martin Kreichgauer <martinkr@google.com> Reviewed-by: Adam Langley <agl@golang.org>
2017-03-07cryptobyte: new package.Martin Kreichgauer
cryptobyte is a helper library for building and parsing byte strings, specifically for TLS and ASN.1. Change-Id: I046b94773f6781153784c79f3d81e6d464eaebe0 Reviewed-on: https://go-review.googlesource.com/36123 Reviewed-by: Adam Langley <agl@golang.org> Run-TryBot: Adam Langley <agl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>