Security Software—Using the Intel
®
QuickAssist Technology Cryptographic API
Intel
®
EP80579 Software for Security Applications on Intel
®
QuickAssist Technology
PG August 2009
60 Order Number: 320183-004US
12.2.1 Modes of Operation
The Cryptographic API may be called in asynchronous or synchronous modes.
Note: Asynchronous mode is preferred for optimal performance.
12.2.1.1 Asynchronous Operation
In asynchronous mode, the user supplies a callback function to the API. Control returns
to the client after the message has been sent to the SSU and the callback gets invoked
when the SSU completes the operation. There is no blocking. This mode is preferred for
optimal performance.
12.2.1.2 Synchronous Operation
In synchronous mode, the client supplies no callback function pointer (NULL) and the
point of execution is held by a semaphore wait internally after a message is
successfully passed to the SSU. Upon the completion of the operation, an internal
callback function posts to the waiting semaphore and execution will resume.
Synchronous mode is therefore blocking and should not be used when invoking the
function from a context in which sleeping is not allowed, for example, in interrupt
context on Linux. To achieve optimal performance from the API, asynchronous mode is
preferred.
12.2.2 Interrupt Operation
The functions in the Cryptographic API may be invoked in both asynchronous mode and
synchronous mode. In either case, when the response data is available from the SSU,
hardware will inform the system via an interrupt. The QAT-AL component will receive
the interrupt and inform the Cryptographic API Library.
Response processing will be performed in a standard OS bottom half (for Linux, this will
be a tasklet); this will defer much of the work load into a kernel managed bottom half
mechanism without locking the system up by holding the interrupt.
In asynchronous mode, the callback function will be invoked in the context of a tasklet.
In synchronous mode, the work queue is de-queued and the client process resumes.
Table 20. Cryptographic Asymmetric Large Numbers Interface Summary (cpa_cy_ln.h)
Method Description
cpaCyLnModExp
Accelerate modular exponentiation. It calculates:
result = (base ^ exponent) mod modulus.
cpaCyLnModInv
Accelerate modular Inversion. It calculates:
result = (1/A) mod B.
cpaCyLnStatsQuery Query statistics for Large Number operations.
Table 21. Cryptographic Asymmetric Prime Interface Summary (cpa_cy_prime.h)
Method Description
cpaCyPrimeTest Test probabilistically if a number is a prime number.
cpaCyPrimeQueryStats Query statistics for prime number operations.