hsm_utils:mybignumに伴うsimple*の廃止

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_eFuse@103 ff987cc8-cf2f-4642-8568-d52cce064691
This commit is contained in:
kubodera_yuichi 2009-12-27 05:12:16 +00:00
parent 48e0a29c65
commit 6d45ca9014
4 changed files with 23 additions and 24 deletions

View File

@ -82,9 +82,11 @@ XLDLIBS= $(LIBPATH_SWORLD)/librqcard.a \
$(LIBPATH_NFLOG)/libnflog.a \ $(LIBPATH_NFLOG)/libnflog.a \
$(LIBPATH_CUTILS)/libcutils.a -lm $(LIBPATH_CUTILS)/libcutils.a -lm
COMMON_OBJECTS = $(REFPATH)/simplecmd.o $(REFPATH)/simplebignum.o $(REFPATH)/nfutil.o $(REFPATH)/nfopt.o $(REFPATH)/getdate.o $(REFPATH)/report.o $(REFPATH)/report-usage.o $(REFPATH)/nftypes.o $(REFPATH)/tokenise.o mybignum.o COMMON_OBJECTS = $(REFPATH)/nfutil.o $(REFPATH)/nfopt.o $(REFPATH)/getdate.o $(REFPATH)/report.o $(REFPATH)/report-usage.o $(REFPATH)/nftypes.o $(REFPATH)/tokenise.o
COMMON_HEADERS= $(REFPATH)/simplecmd.h $(REFPATH)/simplebignum.h $(REFPATH)/nfutil.h $(REFPATH)/nfopt.h $(REFPATH)/nftypes.h $(REFPATH)/tokenise.h EXTRA_OBJECTS = mybignum.o
COMMON_HEADERS= $(REFPATH)/nfutil.h $(REFPATH)/nfopt.h $(REFPATH)/nftypes.h $(REFPATH)/tokenise.h
# We supply an up-to-date getdate.c in the cutils component. Prevent it # We supply an up-to-date getdate.c in the cutils component. Prevent it
# from being automatically rebuilt in the case where getdate.y's mtime # from being automatically rebuilt in the case where getdate.y's mtime
@ -97,11 +99,11 @@ $(SRCPATH)/getdate.c: ;
mybignum.o: mybignum.c mybignum.o: mybignum.c
$(CC) $(CFLAGS) $(CPPFLAGS) -o mybignum.o -c mybignum.c $(CC) $(CFLAGS) $(CPPFLAGS) -o mybignum.o -c mybignum.c
import_common_key: import_common_key.c import_common_key: import_common_key.c $(EXTRA_OBJECTS)
$(CC) $(CFLAGS) $(CPPFLAGS) -o import_common_key import_common_key.c $(COMMON_OBJECTS) $(LDLIBS) $(CC) $(CFLAGS) $(CPPFLAGS) -o import_common_key import_common_key.c $(COMMON_OBJECTS) $(EXTRA_OBJECTS) $(LDLIBS)
import_rsa_keypair: import_rsa_keypair.c import_rsa_keypair: import_rsa_keypair.c $(EXTRA_OBJECTS)
$(CC) $(CFLAGS) $(CPPFLAGS) -o import_rsa_keypair import_rsa_keypair.c $(COMMON_OBJECTS) $(LDLIBS) $(CC) $(CFLAGS) $(CPPFLAGS) -o import_rsa_keypair import_rsa_keypair.c $(COMMON_OBJECTS) $(EXTRA_OBJECTS) $(LDLIBS)
# All single-threaded targets # All single-threaded targets

View File

@ -11,11 +11,10 @@
#include "rqcard-applic.h" #include "rqcard-applic.h"
#include "rqcard-fips.h" #include "rqcard-fips.h"
#include "simplebignum.h"
#include "ncthread-upcalls.h" #include "ncthread-upcalls.h"
//#include "picky-upcalls.h" //#include "picky-upcalls.h"
#include "simplecmd.h" #include "mybignum.h"
#define MODULE_ID 1 #define MODULE_ID 1
#define DATA_LEN 256 // bytes #define DATA_LEN 256 // bytes
@ -94,7 +93,7 @@ int main( int argc, char *argv[] )
memset( &app_init_args, 0, sizeof( app_init_args ) ); memset( &app_init_args, 0, sizeof( app_init_args ) );
app_init_args.flags = NFAPP_IF_MALLOC | NFAPP_IF_BIGNUM; app_init_args.flags = NFAPP_IF_MALLOC | NFAPP_IF_BIGNUM;
app_init_args.mallocupcalls = &my_malloc_upcalls; app_init_args.mallocupcalls = &my_malloc_upcalls;
app_init_args.bignumupcalls = &sbn_upcalls; app_init_args.bignumupcalls = &my_upcalls;
//app_init_args.newthreadupcalls = &newthread_upcalls; //app_init_args.newthreadupcalls = &newthread_upcalls;
result = NFastApp_InitEx( &handle, &app_init_args, NULL ); result = NFastApp_InitEx( &handle, &app_init_args, NULL );
if ( result != Status_OK ) if ( result != Status_OK )
@ -108,15 +107,15 @@ int main( int argc, char *argv[] )
{ {
printf( "error(%d) : NFastApp_Connect\n", result ); printf( "error(%d) : NFastApp_Connect\n", result );
} }
// set bignum upcalls setting // set bignum upcalls setting
result = NFastApp_SetBignumUpcalls( result = NFastApp_SetBignumUpcalls(
handle, handle,
sbn_bignumreceiveupcall, my_bignumreceiveupcall,
sbn_bignumsendlenupcall, my_bignumsendlenupcall,
sbn_bignumsendupcall, my_bignumsendupcall,
sbn_bignumfreeupcall, my_bignumfreeupcall,
sbn_bignumformatupcall, my_bignumformatupcall,
NULL ); NULL );
// NFKM getinfo // NFKM getinfo

View File

@ -20,10 +20,8 @@
#include "rqcard-applic.h" #include "rqcard-applic.h"
#include "rqcard-fips.h" #include "rqcard-fips.h"
#include "simplebignum.h"
#include "ncthread-upcalls.h" #include "ncthread-upcalls.h"
//#include "picky-upcalls.h" //#include "picky-upcalls.h"
//#include "simplecmd.h"
#include "mybignum.h" #include "mybignum.h"

View File

@ -118,12 +118,12 @@ int my_bignumformatupcall(struct NFast_Application *app,
return Status_OK; return Status_OK;
} }
NFast_BignumUpcalls sbn_upcalls = { NFast_BignumUpcalls my_upcalls = {
sbn_bignumreceiveupcall, my_bignumreceiveupcall,
sbn_bignumsendlenupcall, my_bignumsendlenupcall,
sbn_bignumsendupcall, my_bignumsendupcall,
sbn_bignumfreeupcall, my_bignumfreeupcall,
sbn_bignumformatupcall my_bignumformatupcall
}; };
/* --------------------- */ /* --------------------- */
@ -253,7 +253,7 @@ void my_printbignum ( FILE *f, const char *prefix, const struct NFast_Bignum *pB
char buf[MAXBIGNUMBITS/4+1]; char buf[MAXBIGNUMBITS/4+1];
int rc; int rc;
rc=sbn_bignum2char(buf, sizeof(buf), pBN, NULL, NULL, NULL); rc = my_bignum2char(buf, sizeof(buf), pBN, NULL, NULL, NULL);
if ( rc != Status_OK ) strcpy(buf, "<invalid length>"); if ( rc != Status_OK ) strcpy(buf, "<invalid length>");
fprintf( f, "%s=\n %s\n", prefix, buf ); fprintf( f, "%s=\n %s\n", prefix, buf );
} }