Hi Peter,
Agreed.
Note also that the X680 standard (from 1994 I think) allow the use of
'identifiers' only and it is the compiler work to allocate the appropriate
number values (distinct non negative integer starting from zero). It is
simple to define : T ::= ENUMERATED {a, b, c}.
Bruno
> -----Message d'origine-----
> De : [email protected] [mailto:[email protected]] De la part de
Peter
> Gutmann
> Envoyé : mercredi 23 janvier 2013 10:48
> À : [email protected]
> Objet : Re: [Asn1] Choice and Enumerated questions
>
> 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
_______________________________________________
Asn1 mailing list
[email protected]
http://lists.asn1.org/mailman/listinfo/asn1