VIA Padlock

From Crypto++ Wiki
Jump to navigation Jump to search

The VIA Padlock Security Engine provides crypto acceleration on some VIA chipsets. It is one of the earliest examples of security functions for a commodity processor. The on-die security engine provides access to a random number generator, AES in ECB, CBC and OFB modes, SHA1 and SHA2 acceleration, and a Montgomery multiplier. AES and the RNG were available in VIA processor Eden models from 2003, while Esther added SHA and Montgomery Multiplier in 2006.

VIA provides an SDK to interface with the processor and its features. The SDK provides C/C++ example code for using the security services, and provides the ASM to opcodes to interface with the processor. The VIA Padlock Security Engine SDK can be downloaded from VIA's site at x86 Software Engineering Services.

The page VIA C3 page archived in the Wayback Machine should help you find useful documentation, like the Programming Guides and the Cryptographic Research Inc evaluation of the RNG. You can download the documents below via padlock-evaluation.zip and padlock-programming-guides.zip.

You can access the Padlock_RNG using the standard RandomNumberGenerator interface.

Padlock RNG

The Padlock RNG was added to the library at Commit 7fb5953055d1 for Crypto++ 6.0. The files of interest are padlkrng.h and padlkrng.cpp. The Padlock RNG inherits from RandomNumberGenerator so you can use it like any other generator.

Here's how the generator performs on a 1.8 GHz VIA C7-D with XSTORE divisor=1 on Linux.

Algorithm MiB/Second Cycles Per Byte
NonblockingRng 3 628.1
AutoSeededRandomPool 13 126.6
AutoSeededX917RNG(AES) 4 404.6
MT19937 135 12.1
PadlockRNG 4 404.1
AES/OFB RNG 26 62.6
Hash_DRBG(SHA1) 12 131.1
Hash_DRBG(SHA256) 15 109.7
HMAC_DRBG(SHA1) 3 504.2
HMAC_DRBG(SHA256) 4 426.1

Downloads

PadlockSDK_3.1_Release_20090121.zip - VIA Padlock 3.1 SDK. The SDK provides C/C++ example code for using the security services, and provides the ASM to opcodes to interface with the processor.

padlock-evaluation.zip - Cryptographic Research Inc evaluation of the Padlock Engine including the RNG from the VIA C3 page dated February 2004.