-
Notifications
You must be signed in to change notification settings - Fork 18k
x/crypto: cryptobyte: encode int64 with context-specific tags #24973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
These are implicitly tagged values, right? (Which is why the existing functions aren't so great?) If so, then adding some more helper functions seems perfectly reasonable. (Most of the stuff I come across is explicitly tagged, thus I haven't hit this much.) But I'd name the Likewise with |
Yes, they are implicitly tagged. I'll add the changes. Do you want me to do the same for uint64? |
If you expect to need uint64 too, then sure. |
I will leave uints until the need arises to keep things simple. Thanks for the quick response. I've created https://go-review.googlesource.com/c/crypto/+/108456 |
Change https://golang.org/cl/108456 mentions this issue: |
This change adds two functions to cryptobyte to encode and decode int64 with tags supplied by the user. This change also modifies a documentation comment which was outdated. Fixes golang/go#24973 Change-Id: I2e3ca475891ba62df902f33085719f94e87a27cc GitHub-Last-Rev: cd0300d9bfbd4e38f22503a046ea18f9ddd37676 GitHub-Pull-Request: golang/crypto#42 Reviewed-on: https://go-review.googlesource.com/108456 Reviewed-by: Adam Langley <agl@golang.org>
This change adds two functions to cryptobyte to encode and decode int64 with tags supplied by the user. This change also modifies a documentation comment which was outdated. Fixes golang/go#24973 Change-Id: I2e3ca475891ba62df902f33085719f94e87a27cc GitHub-Last-Rev: cd0300d9bfbd4e38f22503a046ea18f9ddd37676 GitHub-Pull-Request: golang/crypto#42 Reviewed-on: https://go-review.googlesource.com/108456 Reviewed-by: Adam Langley <agl@golang.org>
This change adds two functions to cryptobyte to encode and decode int64 with tags supplied by the user. This change also modifies a documentation comment which was outdated. Fixes golang/go#24973 Change-Id: I2e3ca475891ba62df902f33085719f94e87a27cc GitHub-Last-Rev: cd0300d9bfbd4e38f22503a046ea18f9ddd37676 GitHub-Pull-Request: golang/crypto#42 Reviewed-on: https://go-review.googlesource.com/108456 Reviewed-by: Adam Langley <agl@golang.org>
This change adds two functions to cryptobyte to encode and decode int64 with tags supplied by the user. This change also modifies a documentation comment which was outdated. Fixes golang/go#24973 Change-Id: I2e3ca475891ba62df902f33085719f94e87a27cc GitHub-Last-Rev: cd0300d9bfbd4e38f22503a046ea18f9ddd37676 GitHub-Pull-Request: golang/crypto#42 Reviewed-on: https://go-review.googlesource.com/108456 Reviewed-by: Adam Langley <agl@golang.org>
This change adds two functions to cryptobyte to encode and decode int64 with tags supplied by the user. This change also modifies a documentation comment which was outdated. Fixes golang/go#24973 Change-Id: I2e3ca475891ba62df902f33085719f94e87a27cc GitHub-Last-Rev: cd0300d GitHub-Pull-Request: golang#42 Reviewed-on: https://go-review.googlesource.com/108456 Reviewed-by: Adam Langley <agl@golang.org>
This change adds two functions to cryptobyte to encode and decode int64 with tags supplied by the user. This change also modifies a documentation comment which was outdated. Fixes golang/go#24973 Change-Id: I2e3ca475891ba62df902f33085719f94e87a27cc GitHub-Last-Rev: cd0300d9bfbd4e38f22503a046ea18f9ddd37676 GitHub-Pull-Request: golang/crypto#42 Reviewed-on: https://go-review.googlesource.com/108456 Reviewed-by: Adam Langley <agl@golang.org>
We frequently have to deal with asn.1 formatted with context-specific
tags even for things like integers, for example:
http://lapo.it/asn1js/#A0108004010203048102050682040708090A
To do that efficiently with cryptobyte I've added two additional
functions to marshal such values to and from int64:
func (b *Builder) AddInt64(tag asn1.Tag, v int64)
func (s *String) ReadASN1Int64(out *int64, tag asn1.Tag) bool
I assume versions for uint64 will also be required.
Does it make sense to add those to the cryptobyte API or is there a workaround?
The text was updated successfully, but these errors were encountered: