Skip to content

x/crypto/cryptobyte: add ReadUint64 and AddUint64 #53481

Closed
@AGWA

Description

@AGWA

cryptobyte.String has ReadUint8, ReadUint16, ReadUint24, and ReadUint32 but no ReadUint64.

Likewise, cryptobyte.Builder has AddUint8, AddUint16, AddUint24, and AddUint32 but no AddUint64.

I ran into the omission when writing a parser for a Certificate Transparency Merkle Tree Leaf which uses 64 bit integers for timestamps.

I propose adding:

// ReadUint64 decodes a big-endian, 64-bit value into out and advances over it.
// It reports whether the read was successful. 
func (s *String) ReadUint64(out *uint64) bool

// AddUint64 appends a big-endian, 64-bit value to the byte string.  
func (b *Builder) AddUint64(v uint64)

cc @rolandshoemaker

(edited to add AddUint64)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions