static PRUint8 des3_cbc_known_ciphertext[] = {
static const PRUint8 des3_cbc_known_ciphertext[] = {
pk11_fips_DES3_PowerUpSelfTest( void ){    /* DES3 Known Key (56-bits). */    static PRUint8 des3_known_key[] = { "ANSI Triple-DES Key Data" };    /* DES3-CBC Known Initialization Vector (64-bits). */    static PRUint8 des3_cbc_known_initialization_vector[] = { "Security" };    /* DES3 Known Plaintext (64-bits). */    static PRUint8 des3_ecb_known_plaintext[] = { "Netscape" };    static PRUint8 des3_cbc_known_plaintext[] = { "Netscape" };    /* DES3 Known Ciphertext (64-bits). */    static PRUint8 des3_ecb_known_ciphertext[] = {			   0x55,0x8e,0xad,0x3c,0xee,0x49,0x69,0xbe};    static PRUint8 des3_cbc_known_ciphertext[] = {			   0x43,0xdc,0x6a,0xc1,0xaf,0xa6,0x32,0xf5};    /* DES3 variables. */    PRUint8        des3_computed_ciphertext[FIPS_DES3_ENCRYPT_LENGTH];    PRUint8        des3_computed_plaintext[FIPS_DES3_DECRYPT_LENGTH];    DESContext *   des3_context;    unsigned int   des3_bytes_encrypted;    unsigned int   des3_bytes_decrypted;    SECStatus      des3_status;    /*******************************************************/    /* DES3-ECB Single-Round Known Answer Encryption Test. */    /*******************************************************/    des3_context = DES_CreateContext( des3_known_key, NULL,                                     NSS_DES_EDE3, PR_TRUE );    if( des3_context == NULL )        return( CKR_HOST_MEMORY );    des3_status = DES_Encrypt( des3_context, des3_computed_ciphertext,                               &des3_bytes_encrypted, FIPS_DES3_ENCRYPT_LENGTH,                               des3_ecb_known_plaintext,                               FIPS_DES3_DECRYPT_LENGTH );    DES_DestroyContext( des3_context, PR_TRUE );    if( ( des3_status != SECSuccess ) ||        ( des3_bytes_encrypted != FIPS_DES3_ENCRYPT_LENGTH ) ||        ( PORT_Memcmp( des3_computed_ciphertext, des3_ecb_known_ciphertext,                       FIPS_DES3_ENCRYPT_LENGTH ) != 0 ) )        return( CKR_DEVICE_ERROR );    /*******************************************************/    /* DES3-ECB Single-Round Known Answer Decryption Test. */    /*******************************************************/    des3_context = DES_CreateContext( des3_known_key, NULL,                                     NSS_DES_EDE3, PR_FALSE );    if( des3_context == NULL )        return( CKR_HOST_MEMORY );    des3_status = DES_Decrypt( des3_context, des3_computed_plaintext,                               &des3_bytes_decrypted, FIPS_DES3_DECRYPT_LENGTH,                               des3_ecb_known_ciphertext,                               FIPS_DES3_ENCRYPT_LENGTH );    DES_DestroyContext( des3_context, PR_TRUE );    if( ( des3_status != SECSuccess ) ||        ( des3_bytes_decrypted != FIPS_DES3_DECRYPT_LENGTH ) ||        ( PORT_Memcmp( des3_computed_plaintext, des3_ecb_known_plaintext,                       FIPS_DES3_DECRYPT_LENGTH ) != 0 ) )        return( CKR_DEVICE_ERROR );    /*******************************************************/    /* DES3-CBC Single-Round Known Answer Encryption Test. */    /*******************************************************/    des3_context = DES_CreateContext( des3_known_key,                                      des3_cbc_known_initialization_vector,                                      NSS_DES_EDE3_CBC, PR_TRUE );    if( des3_context == NULL )        return( CKR_HOST_MEMORY );    des3_status = DES_Encrypt( des3_context, des3_computed_ciphertext,                               &des3_bytes_encrypted, FIPS_DES3_ENCRYPT_LENGTH,                               des3_cbc_known_plaintext,                               FIPS_DES3_DECRYPT_LENGTH );    DES_DestroyContext( des3_context, PR_TRUE );    if( ( des3_status != SECSuccess ) ||        ( des3_bytes_encrypted != FIPS_DES3_ENCRYPT_LENGTH ) ||        ( PORT_Memcmp( des3_computed_ciphertext, des3_cbc_known_ciphertext,                       FIPS_DES3_ENCRYPT_LENGTH ) != 0 ) )        return( CKR_DEVICE_ERROR );    /*******************************************************/    /* DES3-CBC Single-Round Known Answer Decryption Test. */    /*******************************************************/    des3_context = DES_CreateContext( des3_known_key,                                      des3_cbc_known_initialization_vector,                                      NSS_DES_EDE3_CBC, PR_FALSE );    if( des3_context == NULL )        return( CKR_HOST_MEMORY );    des3_status = DES_Decrypt( des3_context, des3_computed_plaintext,                               &des3_bytes_decrypted, FIPS_DES3_DECRYPT_LENGTH,                               des3_cbc_known_ciphertext,                               FIPS_DES3_ENCRYPT_LENGTH );    DES_DestroyContext( des3_context, PR_TRUE );    if( ( des3_status != SECSuccess ) ||        ( des3_bytes_decrypted != FIPS_DES3_DECRYPT_LENGTH ) ||        ( PORT_Memcmp( des3_computed_plaintext, des3_cbc_known_plaintext,                       FIPS_DES3_DECRYPT_LENGTH ) != 0 ) )        return( CKR_DEVICE_ERROR );    return( CKR_OK );}