IBM 4765 PCIe Cryptographic Coprocessor

IBM sample programs for CCA API

IBM provides a Common Cryptographic Architecture (CCA) for its cryptographic coprocessors. CCA includes an application programming interface (API) which is intended for systems analysts, applications analysts, and application programmers to evaluate or create programs that employ the CCA API. Users of the CCA API should refer to the IBM CCA Basic Services Reference and Guide for the IBM 4765 PCIe and IBM 4764 PCI-X Cryptographic Coprocessors. The latest edition of this manual is available on the Library page. Note: Linux on System z users should refer to the Secure Key Solution with the Common Cryptographic Architecture: Application Programmer's Guide.

Table 1 below provides examples for a subset of the CCA API. The following sample programs are provided as examples on how to use and code the CCA API.

Table 1. IBM sample programs for CCA API

Description of sample program Source files of sample program Where sample program was run

CCA sample source files tarball
Provides a tar archive of all the CCA sample source files to simplify downloading of samples.

IBM4765_cca_samples_source_20121002.tar

O/S: SLES 11 Service Pack 1

Compiler level: gcc 4.3.4

CCA Release: 4.2.5

Coprocessor firmware level: 4.2.5

makefile
Compile and link source files of sample program.
Makefile

O/S: SLES 11 Service Pack 1

Compiler level: gcc 4.3.4

CCA Release: 4.2.5

Coprocessor firmware level: 4.2.5

DES encipher and decipher
Generate a random DES key and use the key to encipher and decipher some data.
cca_des_keygen_encrypt_decrypt.c
cca_des_keygen_encrypt_decrypt.h

O/S: SLES 11 Service Pack 1

Compiler level: gcc 4.3.4

CCA Release: 4.2.5

Coprocessor firmware level: 4.2.5

Calculate and verify MAC using HMAC key
Generate a random HMAC key, then calculate and verify a MAC on a predetermined string of data.

cca_hmac_generate_verify.c

cca_hmac_generate_verify.h

O/S: SLES 11 Service Pack 1

Compiler level: gcc 4.3.4

CCA Release: 4.2.5

Coprocessor firmware level: 4.2.5

Generate and verify a digital signature
Generate a random RSA public/private key pair, then use that key pair to sign and verify some sample data.

cca_rsa_keygen_sign_verify.c

cca_rsa_keygen_sign_verify.h

O/S: SLES 11 Service Pack 1

Compiler level: gcc 4.3.4

CCA Release: 4.2.5

Coprocessor firmware level: 4.2.5

Set up a CCA node
Set up a CCA node for use as a development and test platform using various CCA API calls.

cca_setup_adapter_as_test_platform.c

cca_setup_adapter_as_test_platform.h

O/S: SLES 11 Service Pack 1

Compiler level: gcc 4.3.4

CCA Release: 4.2.5

Coprocessor firmware level: 4.2.5

Use TR-31 to export and import a DES key
Export a DES key that is in a CCA key-token into a TR-31 key-token, and import that DES key from the TR-31 key-token back into a CCA key-token.

cca_tr31_key_export_import_validate.c

cca_tr31_key_export_import_validate.h

O/S: SLES 11 Service Pack 1

Compiler level: gcc 4.3.4

CCA Release: 4.2.5

Coprocessor firmware level: 4.2.5