mirror of
https://github.com/rvtr/ctr_eFuse.git
synced 2025-11-02 00:11:04 -04:00
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:
parent
48e0a29c65
commit
6d45ca9014
@ -82,9 +82,11 @@ XLDLIBS= $(LIBPATH_SWORLD)/librqcard.a \
|
||||
$(LIBPATH_NFLOG)/libnflog.a \
|
||||
$(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
|
||||
# from being automatically rebuilt in the case where getdate.y's mtime
|
||||
@ -97,11 +99,11 @@ $(SRCPATH)/getdate.c: ;
|
||||
mybignum.o: mybignum.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -o mybignum.o -c mybignum.c
|
||||
|
||||
import_common_key: import_common_key.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -o import_common_key import_common_key.c $(COMMON_OBJECTS) $(LDLIBS)
|
||||
import_common_key: import_common_key.c $(EXTRA_OBJECTS)
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -o import_common_key import_common_key.c $(COMMON_OBJECTS) $(EXTRA_OBJECTS) $(LDLIBS)
|
||||
|
||||
import_rsa_keypair: import_rsa_keypair.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -o import_rsa_keypair import_rsa_keypair.c $(COMMON_OBJECTS) $(LDLIBS)
|
||||
import_rsa_keypair: import_rsa_keypair.c $(EXTRA_OBJECTS)
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -o import_rsa_keypair import_rsa_keypair.c $(COMMON_OBJECTS) $(EXTRA_OBJECTS) $(LDLIBS)
|
||||
|
||||
# All single-threaded targets
|
||||
|
||||
|
||||
@ -11,11 +11,10 @@
|
||||
#include "rqcard-applic.h"
|
||||
#include "rqcard-fips.h"
|
||||
|
||||
#include "simplebignum.h"
|
||||
#include "ncthread-upcalls.h"
|
||||
//#include "picky-upcalls.h"
|
||||
|
||||
#include "simplecmd.h"
|
||||
#include "mybignum.h"
|
||||
|
||||
#define MODULE_ID 1
|
||||
#define DATA_LEN 256 // bytes
|
||||
@ -94,7 +93,7 @@ int main( int argc, char *argv[] )
|
||||
memset( &app_init_args, 0, sizeof( app_init_args ) );
|
||||
app_init_args.flags = NFAPP_IF_MALLOC | NFAPP_IF_BIGNUM;
|
||||
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;
|
||||
result = NFastApp_InitEx( &handle, &app_init_args, NULL );
|
||||
if ( result != Status_OK )
|
||||
@ -108,15 +107,15 @@ int main( int argc, char *argv[] )
|
||||
{
|
||||
printf( "error(%d) : NFastApp_Connect\n", result );
|
||||
}
|
||||
|
||||
|
||||
// set bignum upcalls setting
|
||||
result = NFastApp_SetBignumUpcalls(
|
||||
handle,
|
||||
sbn_bignumreceiveupcall,
|
||||
sbn_bignumsendlenupcall,
|
||||
sbn_bignumsendupcall,
|
||||
sbn_bignumfreeupcall,
|
||||
sbn_bignumformatupcall,
|
||||
my_bignumreceiveupcall,
|
||||
my_bignumsendlenupcall,
|
||||
my_bignumsendupcall,
|
||||
my_bignumfreeupcall,
|
||||
my_bignumformatupcall,
|
||||
NULL );
|
||||
|
||||
// NFKM getinfo
|
||||
|
||||
@ -20,10 +20,8 @@
|
||||
#include "rqcard-applic.h"
|
||||
#include "rqcard-fips.h"
|
||||
|
||||
#include "simplebignum.h"
|
||||
#include "ncthread-upcalls.h"
|
||||
//#include "picky-upcalls.h"
|
||||
//#include "simplecmd.h"
|
||||
|
||||
#include "mybignum.h"
|
||||
|
||||
|
||||
@ -118,12 +118,12 @@ int my_bignumformatupcall(struct NFast_Application *app,
|
||||
return Status_OK;
|
||||
}
|
||||
|
||||
NFast_BignumUpcalls sbn_upcalls = {
|
||||
sbn_bignumreceiveupcall,
|
||||
sbn_bignumsendlenupcall,
|
||||
sbn_bignumsendupcall,
|
||||
sbn_bignumfreeupcall,
|
||||
sbn_bignumformatupcall
|
||||
NFast_BignumUpcalls my_upcalls = {
|
||||
my_bignumreceiveupcall,
|
||||
my_bignumsendlenupcall,
|
||||
my_bignumsendupcall,
|
||||
my_bignumfreeupcall,
|
||||
my_bignumformatupcall
|
||||
};
|
||||
|
||||
/* --------------------- */
|
||||
@ -253,7 +253,7 @@ void my_printbignum ( FILE *f, const char *prefix, const struct NFast_Bignum *pB
|
||||
char buf[MAXBIGNUMBITS/4+1];
|
||||
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>");
|
||||
fprintf( f, "%s=\n %s\n", prefix, buf );
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user