Bruno.Konik <[email protected]> writes: >> -----Message d'origine----- >> 2) the Enumerated can contain also negative numbers. >> I.e. T ::=3D ENUMERATED {a(-10), b(-20), ..., c(-5), c(-4)} is valid. Is it >> right? > >Yes it can contain negative numbers but...
There's a second but: Historically many encoders have gotten the signedness of integers wrong, which means that (a) if you get a negative number (at least in the area of crypto, which I'm most familiar with) it's always an encoding error and never a deliberate use of a negative value, and (b) because of the widespread use of incorrect encoders, many decoders treat all integer values as unsigned. So while you can use negative values in theory, it's not a good idea in practice. Peter. _______________________________________________ Asn1 mailing list [email protected] http://lists.asn1.org/mailman/listinfo/asn1
