static PRUint8 rc2_ecb_known_ciphertext[] = {
static const PRUint8 rc2_ecb_known_ciphertext[] = {
pk11_fips_RC2_PowerUpSelfTest( void ){    /* RC2 Known Key (40-bits). */    static PRUint8 rc2_known_key[] = { "RSARC" };    /* RC2-CBC Known Initialization Vector (64-bits). */    static PRUint8 rc2_cbc_known_initialization_vector[] = {"Security"};    /* RC2 Known Plaintext (64-bits). */    static PRUint8 rc2_ecb_known_plaintext[] = {"Netscape"};    static PRUint8 rc2_cbc_known_plaintext[] = {"Netscape"};    /* RC2 Known Ciphertext (64-bits). */    static PRUint8 rc2_ecb_known_ciphertext[] = {				  0x1a,0x71,0x33,0x54,0x8d,0x5c,0xd2,0x30};    static PRUint8 rc2_cbc_known_ciphertext[] = {				  0xff,0x41,0xdb,0x94,0x8a,0x4c,0x33,0xb3};    /* RC2 variables. */    PRUint8        rc2_computed_ciphertext[FIPS_RC2_ENCRYPT_LENGTH];    PRUint8        rc2_computed_plaintext[FIPS_RC2_DECRYPT_LENGTH];    RC2Context *   rc2_context;    unsigned int   rc2_bytes_encrypted;    unsigned int   rc2_bytes_decrypted;    SECStatus      rc2_status;    /******************************************************/    /* RC2-ECB Single-Round Known Answer Encryption Test: */    /******************************************************/    rc2_context = RC2_CreateContext( rc2_known_key, FIPS_RC2_KEY_LENGTH,                                     NULL, NSS_RC2,                                     FIPS_RC2_KEY_LENGTH );    if( rc2_context == NULL )        return( CKR_HOST_MEMORY );    rc2_status = RC2_Encrypt( rc2_context, rc2_computed_ciphertext,                              &rc2_bytes_encrypted, FIPS_RC2_ENCRYPT_LENGTH,                              rc2_ecb_known_plaintext,                              FIPS_RC2_DECRYPT_LENGTH );    RC2_DestroyContext( rc2_context, PR_TRUE );    if( ( rc2_status != SECSuccess ) ||        ( rc2_bytes_encrypted != FIPS_RC2_ENCRYPT_LENGTH ) ||        ( PORT_Memcmp( rc2_computed_ciphertext, rc2_ecb_known_ciphertext,                       FIPS_RC2_ENCRYPT_LENGTH ) != 0 ) )        return( CKR_DEVICE_ERROR );    /******************************************************/    /* RC2-ECB Single-Round Known Answer Decryption Test: */    /******************************************************/    rc2_context = RC2_CreateContext( rc2_known_key, FIPS_RC2_KEY_LENGTH,                                     NULL, NSS_RC2,                                     FIPS_RC2_KEY_LENGTH );    if( rc2_context == NULL )        return( CKR_HOST_MEMORY );    rc2_status = RC2_Decrypt( rc2_context, rc2_computed_plaintext,                              &rc2_bytes_decrypted, FIPS_RC2_DECRYPT_LENGTH,                              rc2_ecb_known_ciphertext,                              FIPS_RC2_ENCRYPT_LENGTH );    RC2_DestroyContext( rc2_context, PR_TRUE );    if( ( rc2_status != SECSuccess ) ||        ( rc2_bytes_decrypted != FIPS_RC2_DECRYPT_LENGTH ) ||        ( PORT_Memcmp( rc2_computed_plaintext, rc2_ecb_known_plaintext,                       FIPS_RC2_DECRYPT_LENGTH ) != 0 ) )        return( CKR_DEVICE_ERROR );    /******************************************************/    /* RC2-CBC Single-Round Known Answer Encryption Test: */    /******************************************************/    rc2_context = RC2_CreateContext( rc2_known_key, FIPS_RC2_KEY_LENGTH,                                     rc2_cbc_known_initialization_vector,                                     NSS_RC2_CBC, FIPS_RC2_KEY_LENGTH );    if( rc2_context == NULL )        return( CKR_HOST_MEMORY );    rc2_status = RC2_Encrypt( rc2_context, rc2_computed_ciphertext,                              &rc2_bytes_encrypted, FIPS_RC2_ENCRYPT_LENGTH,                              rc2_cbc_known_plaintext,                              FIPS_RC2_DECRYPT_LENGTH );    RC2_DestroyContext( rc2_context, PR_TRUE );    if( ( rc2_status != SECSuccess ) ||        ( rc2_bytes_encrypted != FIPS_RC2_ENCRYPT_LENGTH ) ||        ( PORT_Memcmp( rc2_computed_ciphertext, rc2_cbc_known_ciphertext,                       FIPS_RC2_ENCRYPT_LENGTH ) != 0 ) )        return( CKR_DEVICE_ERROR );    /******************************************************/    /* RC2-CBC Single-Round Known Answer Decryption Test: */    /******************************************************/    rc2_context = RC2_CreateContext( rc2_known_key, FIPS_RC2_KEY_LENGTH,                                     rc2_cbc_known_initialization_vector,                                     NSS_RC2_CBC, FIPS_RC2_KEY_LENGTH );    if( rc2_context == NULL )        return( CKR_HOST_MEMORY );    rc2_status = RC2_Decrypt( rc2_context, rc2_computed_plaintext,                              &rc2_bytes_decrypted, FIPS_RC2_DECRYPT_LENGTH,                              rc2_cbc_known_ciphertext,                              FIPS_RC2_ENCRYPT_LENGTH );    RC2_DestroyContext( rc2_context, PR_TRUE );    if( ( rc2_status != SECSuccess ) ||        ( rc2_bytes_decrypted != FIPS_RC2_DECRYPT_LENGTH ) ||        ( PORT_Memcmp( rc2_computed_plaintext, rc2_ecb_known_plaintext,                       FIPS_RC2_DECRYPT_LENGTH ) != 0 ) )        return( CKR_DEVICE_ERROR );    return( CKR_OK );}