aboutsummaryrefslogtreecommitdiff
path: root/cryptobyte/builder.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>
2023-02-03cryptobyte: reject negative Unwrite argumentAlexander Yastrebov
Fixes golang/go#57112 Change-Id: I7a533046a6451d7ae3704eb81e6ddeec8442cf06 GitHub-Last-Rev: 3b088d95a2feca197cc4ebd1d9d34cb28008349f GitHub-Pull-Request: golang/crypto#249 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/464338 TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
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>
2022-04-11all: gofmtRuss Cox
Gofmt to update doc comments to the new formatting. For golang/go#51082. Change-Id: I076031b6613691eefbb0f21739366e3fd2011ec9 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/399356 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
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>
2018-10-29all: fix typosIgor Zhilianin
Change-Id: I62cbcfcd0be5f6a74d93b85b24ff7607533bb239 GitHub-Last-Rev: 9967869e706e9fe7d13964bb32b30a44ba640869 GitHub-Pull-Request: golang/crypto#64 Reviewed-on: https://go-review.googlesource.com/c/145240 Reviewed-by: Brad Fitzpatrick <bradfitz@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>