diff --git a/padlkrng.cpp b/padlkrng.cpp index 13a90b75..d4b494da 100644 --- a/padlkrng.cpp +++ b/padlkrng.cpp @@ -16,7 +16,7 @@ NAMESPACE_BEGIN(CryptoPP) PadlockRNG::PadlockRNG(word32 divisor) : m_divisor(DivisorHelper(divisor)) { -#if CRYPTOPP_X86_ASM_AVAILABLE +#if defined(CRYPTOPP_X86_ASM_AVAILABLE) if (!HasPadlockRNG()) throw PadlockRNG_Err("PadlockRNG", "PadlockRNG generator not available"); #else diff --git a/padlkrng.h b/padlkrng.h index f62dc5dd..1c83bff2 100644 --- a/padlkrng.h +++ b/padlkrng.h @@ -26,7 +26,9 @@ public: : Exception(OTHER_ERROR, component + ": " + message) {} }; -//! \brief Hardware generated random numbers using PadlockRNG instruction +//! \brief Hardware generated random numbers using VIA XSTORE +//! \details Some VIA processors provide a Security Engine called Padlock. The Padlock +//! Security Engine provides AES, SHA and a RNG. PadlockRNG provides access to the RNG. //! \details The PadlockRNG uses an 8 byte FIFO buffer for random numbers. The //! generator can be configured to discard bits from the buffer to resist analysis. //! The divisor controls the number of bytes discarded. The formula for @@ -53,6 +55,8 @@ public: //! \brief Construct a PadlockRNG generator //! \param divisor the XSTORE divisor + //! \details Some VIA processors provide a Security Engine called Padlock. The Padlock + //! Security Engine provides AES, SHA and a RNG. PadlockRNG provides access to the RNG. //! \details The PadlockRNG uses an 8 byte FIFO buffer for random numbers. The //! generator can be configured to discard bits from the buffer to resist analysis. //! The divisor controls the number of bytes discarded. The formula for