Did you *really* zeroize that key?

Perry E. Metzger perry at piermont.com
Wed Nov 6 11:58:45 EST 2002


Someone wrote to me:
> According to K&R 2nd Ed. p. 211, compilers may ignore
> "volatile"; volatile objects have no implementation-
> independent semantics.

K&R is not the C standard. Quoting the C99 standard, section 6.7.3.6:

     An object that has volatile-qualified type may be modified in
     ways unknown to the implementation or have other unknown side
     effects. Therefore any expression referring to such an object
     shall be evaluated strictly according to the rules of the
     abstract machine, as described in 5.1.2.3. Furthermore, at every
     sequence point the value last stored in the object shall agree
     with that prescribed by the abstract machine, except as modified
     by the unknown factors mentioned previously.

In other words: no, "volatile" is mandatory and in fact will be
guaranteed to be implemented as expected. This is very important --
virtually every operating system requires "volatile" for purposes like
writing device drivers.

-- 
Perry E. Metzger		perry at piermont.com

---------------------------------------------------------------------
The Cryptography Mailing List
Unsubscribe by sending "unsubscribe cryptography" to majordomo at wasabisystems.com



More information about the cryptography mailing list