static PRUint8 dsa_G[] = {
static const PRUint8 dsa_G[] = {
pk11_fips_DSA_PowerUpSelfTest( void ){    /* DSA Known P (512-bits), Q (160-bits), and G (512-bits) Values. */    static PRUint8 dsa_P[] = {                           0x8d,0xf2,0xa4,0x94,0x49,0x22,0x76,0xaa,                           0x3d,0x25,0x75,0x9b,0xb0,0x68,0x69,0xcb,                           0xea,0xc0,0xd8,0x3a,0xfb,0x8d,0x0c,0xf7,                           0xcb,0xb8,0x32,0x4f,0x0d,0x78,0x82,0xe5,                           0xd0,0x76,0x2f,0xc5,0xb7,0x21,0x0e,0xaf,                           0xc2,0xe9,0xad,0xac,0x32,0xab,0x7a,0xac,                           0x49,0x69,0x3d,0xfb,0xf8,0x37,0x24,0xc2,                           0xec,0x07,0x36,0xee,0x31,0xc8,0x02,0x91};    static PRUint8 dsa_Q[] = {                           0xc7,0x73,0x21,0x8c,0x73,0x7e,0xc8,0xee,                           0x99,0x3b,0x4f,0x2d,0xed,0x30,0xf4,0x8e,                           0xda,0xce,0x91,0x5f};    static PRUint8 dsa_G[] = {                           0x62,0x6d,0x02,0x78,0x39,0xea,0x0a,0x13,                           0x41,0x31,0x63,0xa5,0x5b,0x4c,0xb5,0x00,                           0x29,0x9d,0x55,0x22,0x95,0x6c,0xef,0xcb,                           0x3b,0xff,0x10,0xf3,0x99,0xce,0x2c,0x2e,                           0x71,0xcb,0x9d,0xe5,0xfa,0x24,0xba,0xbf,                           0x58,0xe5,0xb7,0x95,0x21,0x92,0x5c,0x9c,                           0xc4,0x2e,0x9f,0x6f,0x46,0x4b,0x08,0x8c,                           0xc5,0x72,0xaf,0x53,0xe6,0xd7,0x88,0x02};    /* DSA Known Random Values (known random key block       is 160-bits)  */    /*                     and (known random signature block is 160-bits). */    static PRUint8 dsa_known_random_key_block[] = {                                                      "Mozilla Rules World!"};    static PRUint8 dsa_known_random_signature_block[] = {                                                      "Random DSA Signature"};    /* DSA Known Digest (160-bits) */    static PRUint8 dsa_known_digest[] = { "DSA Signature Digest" };    /* DSA Known Signature (320-bits). */    static PRUint8 dsa_known_signature[] = {			     0x39,0x0d,0x84,0xb1,0xf7,0x52,0x89,0xba,			     0xec,0x1e,0xa8,0xe2,0x00,0x8e,0x37,0x8f,			     0xc2,0xf5,0xf8,0x70,0x11,0xa8,0xc7,0x02,			     0x0e,0x75,0xcf,0x6b,0x54,0x4a,0x52,0xe8,			     0xd8,0x6d,0x4a,0xe8,0xee,0x56,0x8e,0x59};    /* DSA variables. */    DSAPrivateKey *        dsa_private_key;    SECStatus              dsa_status;    SECItem                dsa_signature_item;    SECItem                dsa_digest_item;    DSAPublicKey           dsa_public_key;    PRUint8                dsa_computed_signature[FIPS_DSA_SIGNATURE_LENGTH];    static PQGParams       dsa_pqg = { NULL,			    { FIPS_DSA_TYPE, dsa_P, FIPS_DSA_PRIME_LENGTH },			    { FIPS_DSA_TYPE, dsa_Q, FIPS_DSA_SUBPRIME_LENGTH },			    { FIPS_DSA_TYPE, dsa_G, FIPS_DSA_BASE_LENGTH }};    /*******************************************/    /* Generate a DSA public/private key pair. */    /*******************************************/    /* Generate a DSA public/private key pair. */    dsa_status = DSA_NewKeyFromSeed(&dsa_pqg, dsa_known_random_key_block,                                    &dsa_private_key);    if( dsa_status != SECSuccess )	return( CKR_HOST_MEMORY );    /* construct public key from private key. */    dsa_public_key.params      = dsa_private_key->params;    dsa_public_key.publicValue = dsa_private_key->publicValue;    /*************************************************/    /* DSA Single-Round Known Answer Signature Test. */    /*************************************************/    dsa_signature_item.data = dsa_computed_signature;    dsa_signature_item.len  = sizeof dsa_computed_signature;    dsa_digest_item.data    = dsa_known_digest;    dsa_digest_item.len     = SHA1_LENGTH;    /* Perform DSA signature process. */    dsa_status = DSA_SignDigestWithSeed( dsa_private_key,                                          &dsa_signature_item,					 &dsa_digest_item,					 dsa_known_random_signature_block );    if( ( dsa_status != SECSuccess ) ||        ( dsa_signature_item.len != FIPS_DSA_SIGNATURE_LENGTH ) ||        ( PORT_Memcmp( dsa_computed_signature, dsa_known_signature,                       FIPS_DSA_SIGNATURE_LENGTH ) != 0 ) ) {        dsa_status = SECFailure;    } else {    /****************************************************/    /* DSA Single-Round Known Answer Verification Test. */    /****************************************************/    /* Perform DSA verification process. */    dsa_status = DSA_VerifyDigest( &dsa_public_key,                                    &dsa_signature_item,				   &dsa_digest_item);    }    PORT_FreeArena(dsa_private_key->params.arena, PR_TRUE);    /* Don't free public key, it uses same arena as private key */    /* Verify DSA signature. */    if( dsa_status != SECSuccess )        return( CKR_DEVICE_ERROR );    return( CKR_OK );}