/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <stdio.h>
#include <security/cryptoki.h>
#include "softMAC.h"
#define _AES_FIPS_POST
#define _DES_FIPS_POST
#include "softCrypt.h"
#define _DSA_FIPS_POST
#include <dsa/dsa_impl.h>
#define _RSA_FIPS_POST
#include <rsa/rsa_impl.h>
#include <sha1/sha1_impl.h>
#include <sha2/sha2_impl.h>
#include <rng/fips_random.h>
extern int fips_ecdsa_post(void);
/*
* FIPS Power-on SelfTest for the supported FIPS ciphers and
* components.
*/
soft_fips_post(void)
{
/*
* SHA-1 Power-On SelfTest.
*
* 1. SHA-1 POST
* 2. HMAC SHA-1 POST
*/
rv = fips_sha1_post();
return (rv);
/*
* SHA-2 Power-On SelfTest.
*
* 1. SHA-256 POST
* 2. SHA-384 POST
* 3. SHA-512 POST
* 4. HMAC SHA-256 POST
* 5. HMAC SHA-384 POST
* 6. HMAC SHA-512 POST
*/
rv = fips_sha2_post();
return (rv);
/*
* Triple DES Power-On SelfTest.
*
* 1. DES3 ECB Encryption/Decryption
* 2. DES3 CBC Encryption/Decryption
*/
rv = fips_des3_post();
return (rv);
/* AES Power-On SelfTest for 128-bit key. */
return (rv);
/* AES Power-On SelfTest for 192-bit key. */
return (rv);
/* AES Power-On SelfTest for 256-bit key. */
return (rv);
/*
* ECDSA Power-Up SelfTest
*
* 1. ECC Signature
* 2. ECC Verification
*/
rv = fips_ecdsa_post();
return (rv);
/*
* RSA Power-On SelfTest
*
* 1. RSA Encryption
* 2. RSA Decryption
*
*/
rv = fips_rsa_post();
return (rv);
/*
* DSA Power-On SelfTest
*
* 1. DSA Sign on SHA-1 digest
* 2. DSA Verification
*/
rv = fips_dsa_post();
return (rv);
/* RNG Power-On SelfTest. */
rv = fips_rng_post();
return (rv);
/* Passed Power-On SelfTest. */
return (CKR_OK);
}