OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

pkcs11 message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [pkcs11] Ones Complement versus Twos Complement - RE: Use CK_UNAVAILABLE_INFORMATION


On 13.06.2013 01:07, Tim Hudson wrote:
> Here is a proposal for consideration:
> 
> For PKCS11 v2.40 change the current definition of:
>     #define CK_UNAVAILABLE_INFORMATION (~0UL)
> To the following:
>     #define CK_UNAVAILABLE_INFORMATION ((CK_ULONG)-1) 
> 
> I believe this actually matches the original intent of the define - and
> that allowance for a ones-complement representation of negative numbers
> was simply overlooked.

Was the original intent to have a CK_ULONG with all bits set to one?
Because to me "(CK_ULONG)-1" seems meaningless without making such an
assumption. If that's the case, then ~OUL represents exactly that: an
unsigned long with all bits set to 1.

So unless I'm wrong above, I would be in favor of keeping the current
definition. As Wan-Teh said, it's clearer.

Cheers,

Stef



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]