in cborl/parse.go [619:645]
func (p *Parser) stepNeg(in []byte) (b []byte, done bool, err error) {
b = in
switch p.state.current.minor {
case len8b:
b, done, err = b[1:], true, p.visitor.OnInt8(int8(^b[0]))
case len16b:
var v uint16
if b, done, v = p.getUint16(b); done {
err = p.visitor.OnInt16(int16(^v))
}
case len32b:
var v uint32
if b, done, v = p.getUint32(b); done {
err = p.visitor.OnInt32(int32(^v))
}
case len64b:
var v uint64
if b, done, v = p.getUint64(b); done {
err = p.visitor.OnInt64(int64(^v))
}
}
if done && err == nil {
done, err = p.popState()
}
return
}