readBigUInt and readBigNInt assume (https://github.com/well-typed/cborg/blob/master/cborg/src/Codec/CBOR/Read.hs#L2660) that the payload is a definite-length bytestring, although as far as I can see the specification merely says it his a "byte string data item", which I think means both definite and indefinite length bytestrings should be allowed.
Example (bigint tag, and then a random indefinite-length bytestring I got the library to make for me):
> let y :: Term = deserialise $ BSL.fromStrict (BS.pack [0xc2, 0x5f, 0x43, 0x6c, 0x6f, 0x6c, 0xff])
> y
*** Exception: DeserialiseFailure 0 "expected integer"
readBigUInt
andreadBigNInt
assume (https://github.com/well-typed/cborg/blob/master/cborg/src/Codec/CBOR/Read.hs#L2660) that the payload is a definite-length bytestring, although as far as I can see the specification merely says it his a "byte string data item", which I think means both definite and indefinite length bytestrings should be allowed.Example (bigint tag, and then a random indefinite-length bytestring I got the library to make for me):