linuxでのビルドを通す その4

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_eFuse@18 ff987cc8-cf2f-4642-8568-d52cce064691
This commit is contained in:
kubodera_yuichi 2009-12-22 05:20:29 +00:00
parent 3e1e11c1fa
commit 6e530397d8
2 changed files with 10 additions and 4 deletions

View File

@ -117,6 +117,8 @@
#include <sys/time.h>
#include <string.h>
#include "cr_generate_id.h"
#ifdef USE_HSM
#include "cr_hsm_code.h"
@ -156,6 +158,8 @@ M_ByteBlock *hsmBlobptr = NULL;
// init HSM
int hsm_initialize( void )
{
int ret_code = 0;
// init HSM
ret_code = NFastApp_InitEx( &hsmHandle, NULL, NULL );
if ( ret_code != CR_GENID_SUCCESS )
@ -376,8 +380,8 @@ int hsm_aes_encrypt( unsigned char *dst_buf, unsigned char *org_buf, int size )
// iv set
enc_iv.mech = Mech_RijndaelmCBCpNONE;
memset( enc_iv.iv.generic128.iv.bytes, 0, sizeof( enc_iv.generic128.iv.bytes ) );
printf( "enc_iv.---.bytes : %d bytes\n", sizeof( enc_iv.generic128.iv.bytes ) );
memset( enc_iv.iv.generic128.iv.bytes, 0, sizeof( enc_iv.iv.generic128.iv.bytes ) );
printf( "enc_iv.---.bytes : %d bytes\n", sizeof( enc_iv.iv.generic128.iv.bytes ) );
// encrypt command set
cmd.cmd = Cmd_Encrypt;
@ -425,8 +429,8 @@ int hsm_aes_decrypt( unsigned char *dst_buf, unsigned char *org_buf, int size )
// iv set
dec_iv.mech = Mech_RijndaelmCBCpNONE;
memset( dec_iv.iv.generic128.iv.bytes, 0, sizeof( dec_iv.generic128.iv.bytes ) );
printf( "dec_iv.---.bytes : %d bytes\n", sizeof( dec_iv.generic128.iv.bytes ) );
memset( dec_iv.iv.generic128.iv.bytes, 0, sizeof( dec_iv.iv.generic128.iv.bytes ) );
printf( "dec_iv.---.bytes : %d bytes\n", sizeof( dec_iv.iv.generic128.iv.bytes ) );
// decyrpt
cmd.cmd = Cmd_Decrypt;

View File

@ -116,6 +116,8 @@
extern "C" {
#endif
#define HSM_MODULE_ID ( 1)
// functions
int hsm_initialize( void );
void hsm_finalize( void );