addBytesWithLength appends a sequence of bytes to the cryptobyte.Builder. If the length of the sequence is not the value specified, it produces an error.
(b *cryptobyte.Builder, v []byte, n int)
| 24 | // addBytesWithLength appends a sequence of bytes to the cryptobyte.Builder. If |
| 25 | // the length of the sequence is not the value specified, it produces an error. |
| 26 | func addBytesWithLength(b *cryptobyte.Builder, v []byte, n int) { |
| 27 | b.AddValue(marshalingFunction(func(b *cryptobyte.Builder) error { |
| 28 | if len(v) != n { |
| 29 | return fmt.Errorf("invalid value length: expected %d, got %d", n, len(v)) |
| 30 | } |
| 31 | b.AddBytes(v) |
| 32 | return nil |
| 33 | })) |
| 34 | } |
| 35 | |
| 36 | // addUint64 appends a big-endian, 64-bit value to the cryptobyte.Builder. |
| 37 | func addUint64(b *cryptobyte.Builder, v uint64) { |
no test coverage detected
searching dependent graphs…