This is an automated email from the ASF dual-hosted git repository. kmccusker pushed a commit to branch issue16 in repository https://gitbox.apache.org/repos/asf/incubator-milagro-crypto-c.git
commit e6aeb5cdabc3e26e66bf8341c1684973d54dc130 Author: Kealan McCusker <[email protected]> AuthorDate: Wed Jun 26 15:45:39 2019 +0100 rename examples and use BLS381 for example_all --- config.mk | 6 +- examples/CMakeLists.txt | 42 ++++++------ examples/{testall.c => example_all.c} | 76 +++++++++++----------- .../{testbls_ZZZ.c.in => example_bls_ZZZ.c.in} | 6 +- .../{testdvs_ZZZ.c.in => example_dvs_ZZZ.c.in} | 0 .../{testecdh_ZZZ.c.in => example_ecdh_ZZZ.c.in} | 0 .../{testmpin_ZZZ.c.in => example_mpin_ZZZ.c.in} | 8 +-- .../{testrsa_WWW.c.in => example_rsa_WWW.c.in} | 0 .../{testwcc_ZZZ.c.in => example_wcc_ZZZ.c.in} | 0 ...stwcc_dta_ZZZ.c.in => example_wcc_dta_ZZZ.c.in} | 0 examples/{testx509.c => example_x509.c} | 0 scripts/buildMulti.sh | 2 +- test/test_bls_ZZZ.c.in | 6 +- 13 files changed, 73 insertions(+), 73 deletions(-) diff --git a/config.mk b/config.mk index 13941ce..6191947 100644 --- a/config.mk +++ b/config.mk @@ -4,7 +4,7 @@ WORD_SIZE:=64 # Current choice of Elliptic Curve ANSSI C25519 NIST521 BLS24 C41417 NUMS256E BLS381 ED25519 NUMS256W BLS383 FP256BN NUMS384E BLS461 FP512BN NUMS384W BLS48 GOLDILOCKS NUMS512E BN254 HIFIVE NUMS512W BN254CX NIST256 SECP256K1 BRAINPOOL NIST384 -AMCL_CURVE:=ED25519,NIST256,GOLDILOCKS,BLS383 +AMCL_CURVE:=ED25519,NIST256,GOLDILOCKS,BLS381 # RSA security level: 2048 3072 4096 AMCL_RSA:=2048,3072 @@ -13,7 +13,7 @@ AMCL_RSA:=2048,3072 CMAKE_BUILD_TYPE:=Release # Install path -CMAKE_INSTALL_PATH:= +CMAKE_INSTALL_PATH:=/usr/local # Run tests AMCL_TEST:=ON @@ -22,7 +22,7 @@ AMCL_TEST:=ON AMCL_BUILD_SHARED_LIBS:=ON # Build Python wrapper ON/OFF -AMCL_BUILD_PYTHON:=OFF +AMCL_BUILD_PYTHON:=ON # Build MPIN ON/OFF AMCL_BUILD_MPIN:=ON diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 14c2e10..d81e923 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -22,34 +22,34 @@ foreach(curve ${AMCL_CURVE}) amcl_curve_field(TC "${curve}") amcl_curve_field(CS "${curve}") - amcl_configure_file_curve(testecdh_ZZZ.c.in testecdh_${TC}.c "${curve}" testecdh_${TC}_GEN_SRCS) - add_executable(testecdh_${TC} ${testecdh_${TC}_GEN_SRCS}) - target_link_libraries(testecdh_${TC} PRIVATE amcl_curve_${TC}) + amcl_configure_file_curve(example_ecdh_ZZZ.c.in example_ecdh_${TC}.c "${curve}" example_ecdh_${TC}_GEN_SRCS) + add_executable(example_ecdh_${TC} ${example_ecdh_${TC}_GEN_SRCS}) + target_link_libraries(example_ecdh_${TC} PRIVATE amcl_curve_${TC}) if(TARGET amcl_mpin_${TC}) - amcl_configure_file_curve(testmpin_ZZZ.c.in testmpin_${TC}.c "${curve}" testmpin_${TC}_GEN_SRCS) - add_executable(testmpin_${TC} ${testmpin_${TC}_GEN_SRCS}) - target_link_libraries(testmpin_${TC} PRIVATE amcl_mpin_${TC}) + amcl_configure_file_curve(example_mpin_ZZZ.c.in example_mpin_${TC}.c "${curve}" example_mpin_${TC}_GEN_SRCS) + add_executable(example_mpin_${TC} ${example_mpin_${TC}_GEN_SRCS}) + target_link_libraries(example_mpin_${TC} PRIVATE amcl_mpin_${TC}) - amcl_configure_file_curve(testdvs_ZZZ.c.in testdvs_${TC}.c "${curve}" testdvs_${TC}_GEN_SRCS) - add_executable(testdvs_${TC} ${testdvs_${TC}_GEN_SRCS}) - target_link_libraries(testdvs_${TC} PRIVATE amcl_mpin_${TC}) + amcl_configure_file_curve(example_dvs_ZZZ.c.in example_dvs_${TC}.c "${curve}" example_dvs_${TC}_GEN_SRCS) + add_executable(example_dvs_${TC} ${example_dvs_${TC}_GEN_SRCS}) + target_link_libraries(example_dvs_${TC} PRIVATE amcl_mpin_${TC}) endif() if(TARGET amcl_wcc_${TC}) - amcl_configure_file_curve(testwcc_ZZZ.c.in testwcc_${TC}.c "${curve}" testwcc_${TC}_GEN_SRCS) - add_executable(testwcc_${TC} ${testwcc_${TC}_GEN_SRCS}) - target_link_libraries(testwcc_${TC} PRIVATE amcl_wcc_${TC}) + amcl_configure_file_curve(example_wcc_ZZZ.c.in example_wcc_${TC}.c "${curve}" example_wcc_${TC}_GEN_SRCS) + add_executable(example_wcc_${TC} ${example_wcc_${TC}_GEN_SRCS}) + target_link_libraries(example_wcc_${TC} PRIVATE amcl_wcc_${TC}) - amcl_configure_file_curve(testwcc_dta_ZZZ.c.in testwcc_dta_${TC}.c "${curve}" testwcc_dta_${TC}_GEN_SRCS) - add_executable(testwcc_dta_${TC} ${testwcc_dta_${TC}_GEN_SRCS}) - target_link_libraries(testwcc_dta_${TC} PRIVATE amcl_wcc_${TC}) + amcl_configure_file_curve(example_wcc_dta_ZZZ.c.in example_wcc_dta_${TC}.c "${curve}" example_wcc_dta_${TC}_GEN_SRCS) + add_executable(example_wcc_dta_${TC} ${example_wcc_dta_${TC}_GEN_SRCS}) + target_link_libraries(example_wcc_dta_${TC} PRIVATE amcl_wcc_${TC}) endif() if(TARGET amcl_bls_${TC}) - amcl_configure_file_curve(testbls_ZZZ.c.in testbls_${TC}.c "${curve}" testbls_${TC}_GEN_SRCS) - add_executable(testbls_${TC} ${testbls_${TC}_GEN_SRCS}) - target_link_libraries(testbls_${TC} PRIVATE amcl_bls_${TC}) + amcl_configure_file_curve(example_bls_ZZZ.c.in example_bls_${TC}.c "${curve}" example_bls_${TC}_GEN_SRCS) + add_executable(example_bls_${TC} ${example_bls_${TC}_GEN_SRCS}) + target_link_libraries(example_bls_${TC} PRIVATE amcl_bls_${TC}) endif() endforeach() @@ -57,8 +57,8 @@ endforeach() foreach(level ${AMCL_RSA}) amcl_rsa_field(TFF "${level}") - amcl_configure_file_rsa(testrsa_WWW.c.in testrsa_${TFF}.c "${level}" testrsa_${TFF}_GEN_SRCS) - add_executable(testrsa_${TFF} ${testrsa_${TFF}_GEN_SRCS}) - target_link_libraries(testrsa_${TFF} PRIVATE amcl_rsa_${TFF}) + amcl_configure_file_rsa(example_rsa_WWW.c.in example_rsa_${TFF}.c "${level}" example_rsa_${TFF}_GEN_SRCS) + add_executable(example_rsa_${TFF} ${example_rsa_${TFF}_GEN_SRCS}) + target_link_libraries(example_rsa_${TFF} PRIVATE amcl_rsa_${TFF}) endforeach() diff --git a/examples/testall.c b/examples/example_all.c similarity index 90% rename from examples/testall.c rename to examples/example_all.c index 8719cf2..4a46756 100644 --- a/examples/testall.c +++ b/examples/example_all.c @@ -24,7 +24,7 @@ under the License. #include <string.h> #include <time.h> #include "ecdh_ED25519.h" -#include "mpin_BLS383.h" +#include "mpin_BLS381.h" #include "rsa_2048.h" #include "rsa_3072.h" #include "randapi.h" @@ -505,7 +505,7 @@ int ecdh_GOLDILOCKS(csprng *RNG) #define PINERROR // For PIN ERROR detection ON or OFF #define FULL // for M-Pin Full or M-Pin regular -int mpin_BLS383(csprng *RNG) +int mpin_BLS381(csprng *RNG) { int i,pin,rtn,err; #ifdef PERMITS @@ -514,11 +514,11 @@ int mpin_BLS383(csprng *RNG) int date=0; #endif unsigned long ran; - char x[PGS_BLS383],s[PGS_BLS383],y[PGS_BLS383],client_id[100],sst[4*PFS_BLS383],token[2*PFS_BLS383+1],sec[2*PFS_BLS383+1],permit[2*PFS_BLS383+1],xcid[2*PFS_BLS383+1],xid[2*PFS_BLS383+1],e[12*PFS_BLS383],f[12*PFS_BLS383]; - char hcid[PFS_BLS383],hsid[PFS_BLS383],hid[2*PFS_BLS383+1],htid[2*PFS_BLS383+1],h[PGS_BLS383]; + char x[PGS_BLS381],s[PGS_BLS381],y[PGS_BLS381],client_id[100],sst[4*PFS_BLS381],token[2*PFS_BLS381+1],sec[2*PFS_BLS381+1],permit[2*PFS_BLS381+1],xcid[2*PFS_BLS381+1],xid[2*PFS_BLS381+1],e[12*PFS_BLS381],f[12*PFS_BLS381]; + char hcid[PFS_BLS381],hsid[PFS_BLS381],hid[2*PFS_BLS381+1],htid[2*PFS_BLS381+1],h[PGS_BLS381]; #ifdef FULL - char r[PGS_BLS383],z[2*PFS_BLS383+1],w[PGS_BLS383],t[2*PFS_BLS383+1]; - char g1[12*PFS_BLS383],g2[12*PFS_BLS383]; + char r[PGS_BLS381],z[2*PFS_BLS381+1],w[PGS_BLS381],t[2*PFS_BLS381+1]; + char g1[12*PFS_BLS381],g2[12*PFS_BLS381]; char ck[MPIN_PAS],sk[MPIN_PAS]; #endif octet S= {0,sizeof(s),s}; @@ -552,13 +552,13 @@ int mpin_BLS383(csprng *RNG) char idhex[100]; // Trusted Authority set-up - MPIN_BLS383_RANDOM_GENERATE(RNG,&S); + MPIN_BLS381_RANDOM_GENERATE(RNG,&S); printf("Master Secret= "); OCT_output(&S); // Create Client Identity OCT_jstring(&CLIENT_ID,"[email protected]"); - HASH_ID(HASH_TYPE_BLS383,&CLIENT_ID,&HCID); // Either Client or TA calculates Hash(ID) - you decide! + HASH_ID(HASH_TYPE_BLS381,&CLIENT_ID,&HCID); // Either Client or TA calculates Hash(ID) - you decide! printf("Client ID Hash= "); OCT_output(&HCID); @@ -567,12 +567,12 @@ int mpin_BLS383(csprng *RNG) OCT_toHex(&CLIENT_ID,idhex); printf("Client ID= %s\n",idhex);// OCT_toHex(&CLIENT_ID); printf("\n"); - MPIN_BLS383_GET_CLIENT_SECRET(&S,&HCID,&TOKEN); + MPIN_BLS381_GET_CLIENT_SECRET(&S,&HCID,&TOKEN); printf("Client Secret= "); OCT_output(&TOKEN); // Client and Server are issued secrets by DTA - MPIN_BLS383_GET_SERVER_SECRET(&S,&SST); + MPIN_BLS381_GET_SERVER_SECRET(&S,&SST); printf("Server Secret= "); OCT_output(&SST); @@ -581,26 +581,26 @@ int mpin_BLS383(csprng *RNG) // Client extracts PIN from secret to create Token pin=1234; printf("Client extracts PIN= %d\n",pin); - MPIN_BLS383_EXTRACT_PIN(HASH_TYPE_BLS383,&CLIENT_ID,pin,&TOKEN); + MPIN_BLS381_EXTRACT_PIN(HASH_TYPE_BLS381,&CLIENT_ID,pin,&TOKEN); printf("Client Token= "); OCT_output(&TOKEN); #ifdef FULL - MPIN_BLS383_PRECOMPUTE(&TOKEN,&HCID,NULL,&G1,&G2); + MPIN_BLS381_PRECOMPUTE(&TOKEN,&HCID,NULL,&G1,&G2); #endif #ifdef PERMITS // Client gets "Time Permit" from DTA printf("Client gets Time Permit\n"); - MPIN_BLS383_GET_CLIENT_PERMIT(HASH_TYPE_BLS383,date,&S,&HCID,&PERMIT); + MPIN_BLS381_GET_CLIENT_PERMIT(HASH_TYPE_BLS381,date,&S,&HCID,&PERMIT); printf("Time Permit= "); OCT_output(&PERMIT); // This encoding makes Time permit look random - if (MPIN_BLS383_ENCODING(RNG,&PERMIT)!=0) printf("Encoding error\n"); + if (MPIN_BLS381_ENCODING(RNG,&PERMIT)!=0) printf("Encoding error\n"); // printf("Encoded Time Permit= "); OCT_output(&PERMIT); - if (MPIN_BLS383_DECODING(&PERMIT)!=0) printf("Decoding error\n"); + if (MPIN_BLS381_DECODING(&PERMIT)!=0) printf("Decoding error\n"); // printf("Decoded Time Permit= "); OCT_output(&PERMIT); #endif @@ -665,31 +665,31 @@ int mpin_BLS383(csprng *RNG) #ifdef SINGLE_PASS int timeValue; printf("MPIN Single Pass\n"); - timeValue = MPIN_BLS383_GET_TIME(); + timeValue = MPIN_BLS381_GET_TIME(); - rtn=MPIN_BLS383_CLIENT(HASH_TYPE_BLS383,date,&CLIENT_ID,RNG,&X,pin,&TOKEN,&SEC,pxID,pxCID,pPERMIT,NULL,timeValue,&Y); + rtn=MPIN_BLS381_CLIENT(HASH_TYPE_BLS381,date,&CLIENT_ID,RNG,&X,pin,&TOKEN,&SEC,pxID,pxCID,pPERMIT,NULL,timeValue,&Y); if (rtn != 0) { - printf("MPIN_BLS383_CLIENT ERROR %d\n", rtn); + printf("MPIN_BLS381_CLIENT ERROR %d\n", rtn); return 1; } #ifdef FULL - MPIN_BLS383_GET_G1_MULTIPLE(RNG,1,&R,&HCID,&Z); // Also Send Z=r.ID to Server, remember random r + MPIN_BLS381_GET_G1_MULTIPLE(RNG,1,&R,&HCID,&Z); // Also Send Z=r.ID to Server, remember random r #endif - rtn=MPIN_BLS383_SERVER(HASH_TYPE_BLS383,date,pHID,pHTID,&Y,&SST,pxID,pxCID,&SEC,pE,pF,pID,NULL,timeValue); + rtn=MPIN_BLS381_SERVER(HASH_TYPE_BLS381,date,pHID,pHTID,&Y,&SST,pxID,pxCID,&SEC,pE,pF,pID,NULL,timeValue); #ifdef FULL - HASH_ID(HASH_TYPE_BLS383,&CLIENT_ID,&HSID); // new - MPIN_BLS383_GET_G1_MULTIPLE(RNG,0,&W,prHID,&T); // Also send T=w.ID to client, remember random w + HASH_ID(HASH_TYPE_BLS381,&CLIENT_ID,&HSID); // new + MPIN_BLS381_GET_G1_MULTIPLE(RNG,0,&W,prHID,&T); // Also send T=w.ID to client, remember random w #endif #else // SINGLE_PASS printf("MPIN Multi Pass\n"); - if (MPIN_BLS383_CLIENT_1(HASH_TYPE_BLS383,date,&CLIENT_ID,RNG,&X,pin,&TOKEN,&SEC,pxID,pxCID,pPERMIT)!=0) + if (MPIN_BLS381_CLIENT_1(HASH_TYPE_BLS381,date,&CLIENT_ID,RNG,&X,pin,&TOKEN,&SEC,pxID,pxCID,pPERMIT)!=0) { printf("Error from Client side - First Pass\n"); return 0; @@ -698,23 +698,23 @@ int mpin_BLS383(csprng *RNG) // Send U=x.ID to server, and recreate secret from token and pin #ifdef FULL - HASH_ID(HASH_TYPE_BLS383,&CLIENT_ID,&HCID); - MPIN_BLS383_GET_G1_MULTIPLE(RNG,1,&R,&HCID,&Z); // Also Send Z=r.ID to Server, remember random r, DH component + HASH_ID(HASH_TYPE_BLS381,&CLIENT_ID,&HCID); + MPIN_BLS381_GET_G1_MULTIPLE(RNG,1,&R,&HCID,&Z); // Also Send Z=r.ID to Server, remember random r, DH component #endif // Server calculates H(ID) and H(ID)+H(T|H(ID)) (if time permits enabled), and maps them to points on the curve HID and HTID resp. - MPIN_BLS383_SERVER_1(HASH_TYPE_BLS383,date,pID,pHID,pHTID); + MPIN_BLS381_SERVER_1(HASH_TYPE_BLS381,date,pID,pHID,pHTID); // Server generates Random number Y and sends it to Client - MPIN_BLS383_RANDOM_GENERATE(RNG,&Y); + MPIN_BLS381_RANDOM_GENERATE(RNG,&Y); #ifdef FULL - HASH_ID(HASH_TYPE_BLS383,&CLIENT_ID,&HSID); //new - MPIN_BLS383_GET_G1_MULTIPLE(RNG,0,&W,prHID,&T); // Also send T=w.ID to client, remember random w, DH component + HASH_ID(HASH_TYPE_BLS381,&CLIENT_ID,&HSID); //new + MPIN_BLS381_GET_G1_MULTIPLE(RNG,0,&W,prHID,&T); // Also send T=w.ID to client, remember random w, DH component #endif // Client Second Pass: Inputs Client secret SEC, x and y. Outputs -(x+y)*SEC - if (MPIN_BLS383_CLIENT_2(&X,&Y,&SEC)!=0) + if (MPIN_BLS381_CLIENT_2(&X,&Y,&SEC)!=0) { printf("Error from Client side - Second Pass\n"); return 1; @@ -722,7 +722,7 @@ int mpin_BLS383(csprng *RNG) // Server Second phase. Inputs hashed client id, random Y, -(x+y)*SEC, xID and xCID and Server secret SST. E and F help kangaroos to find error. // If PIN error not required, set E and F = NULL - rtn=MPIN_BLS383_SERVER_2(date,pHID,pHTID,&Y,&SST,pxID,pxCID,&SEC,pE,pF,NULL); + rtn=MPIN_BLS381_SERVER_2(date,pHID,pHTID,&Y,&SST,pxID,pxCID,&SEC,pE,pF,NULL); #endif // SINGLE_PASS if (rtn!=0) @@ -730,7 +730,7 @@ int mpin_BLS383(csprng *RNG) printf("Server says - Bad Pin.\n"); #ifdef PINERROR - err=MPIN_BLS383_KANGAROO(&E,&F); + err=MPIN_BLS381_KANGAROO(&E,&F); if (err) printf("(Client PIN is out by %d)\n",err); #endif @@ -745,13 +745,13 @@ int mpin_BLS383(csprng *RNG) #ifdef FULL - HASH_ALL(HASH_TYPE_BLS383,&HCID,pxID,pxCID,&SEC,&Y,&Z,&T,&H); // new - MPIN_BLS383_CLIENT_KEY(HASH_TYPE_BLS383,&G1,&G2,pin,&R,&X,&H,&T,&CK); // new H + HASH_ALL(HASH_TYPE_BLS381,&HCID,pxID,pxCID,&SEC,&Y,&Z,&T,&H); // new + MPIN_BLS381_CLIENT_KEY(HASH_TYPE_BLS381,&G1,&G2,pin,&R,&X,&H,&T,&CK); // new H printf("Client Key = "); OCT_output(&CK); - HASH_ALL(HASH_TYPE_BLS383,&HSID,pxID,pxCID,&SEC,&Y,&Z,&T,&H); - MPIN_BLS383_SERVER_KEY(HASH_TYPE_BLS383,&Z,&SST,&W,&H,pHID,pxID,pxCID,&SK); // new H,pHID + HASH_ALL(HASH_TYPE_BLS381,&HSID,pxID,pxCID,&SEC,&Y,&Z,&T,&H); + MPIN_BLS381_SERVER_KEY(HASH_TYPE_BLS381,&Z,&SST,&W,&H,pHID,pxID,pxCID,&SK); // new H,pHID printf("Server Key = "); OCT_output(&SK); #endif @@ -890,8 +890,8 @@ int main() CREATE_CSPRNG(&RNG,&RAW); // initialise strong RNG - printf("\nTesting MPIN protocols for curve BLS383\n"); - mpin_BLS383(&RNG); + printf("\nTesting MPIN protocols for curve BLS381\n"); + mpin_BLS381(&RNG); printf("\nTesting ECDH protocols for curve ED25519\n"); ecdh_ED25519(&RNG); #if CHUNK!=16 diff --git a/examples/testbls_ZZZ.c.in b/examples/example_bls_ZZZ.c.in similarity index 100% rename from examples/testbls_ZZZ.c.in rename to examples/example_bls_ZZZ.c.in index 481cf2c..bc7cdd0 100644 --- a/examples/testbls_ZZZ.c.in +++ b/examples/example_bls_ZZZ.c.in @@ -254,15 +254,15 @@ int main() char* seedHex = "78d0fb6705ce77dee47d03eb5b9c5d30"; char seed[16] = {0}; octet SEED = {sizeof(seed),sizeof(seed),seed}; - printf("SEED: "); - OCT_output(&SEED); - printf("\n"); // CSPRNG csprng RNG; // fake random source OCT_fromHex(&SEED,seedHex); + printf("SEED: "); + OCT_output(&SEED); + printf("\n"); // initialise strong RNG CREATE_CSPRNG(&RNG,&SEED); diff --git a/examples/testdvs_ZZZ.c.in b/examples/example_dvs_ZZZ.c.in similarity index 100% rename from examples/testdvs_ZZZ.c.in rename to examples/example_dvs_ZZZ.c.in diff --git a/examples/testecdh_ZZZ.c.in b/examples/example_ecdh_ZZZ.c.in similarity index 100% rename from examples/testecdh_ZZZ.c.in rename to examples/example_ecdh_ZZZ.c.in diff --git a/examples/testmpin_ZZZ.c.in b/examples/example_mpin_ZZZ.c.in similarity index 99% rename from examples/testmpin_ZZZ.c.in rename to examples/example_mpin_ZZZ.c.in index d87135a..ed0b96a 100644 --- a/examples/testmpin_ZZZ.c.in +++ b/examples/example_mpin_ZZZ.c.in @@ -347,15 +347,15 @@ int main() char* seedHex = "78d0fb6705ce77dee47d03eb5b9c5d30"; char seed[16] = {0}; octet SEED = {sizeof(seed),sizeof(seed),seed}; - printf("SEED: "); - OCT_output(&SEED); - printf("\n"); - + // CSPRNG csprng RNG; // fake random source OCT_fromHex(&SEED,seedHex); + printf("SEED: "); + OCT_output(&SEED); + printf("\n"); // initialise strong RNG CREATE_CSPRNG(&RNG,&SEED); diff --git a/examples/testrsa_WWW.c.in b/examples/example_rsa_WWW.c.in similarity index 100% rename from examples/testrsa_WWW.c.in rename to examples/example_rsa_WWW.c.in diff --git a/examples/testwcc_ZZZ.c.in b/examples/example_wcc_ZZZ.c.in similarity index 100% rename from examples/testwcc_ZZZ.c.in rename to examples/example_wcc_ZZZ.c.in diff --git a/examples/testwcc_dta_ZZZ.c.in b/examples/example_wcc_dta_ZZZ.c.in similarity index 100% rename from examples/testwcc_dta_ZZZ.c.in rename to examples/example_wcc_dta_ZZZ.c.in diff --git a/examples/testx509.c b/examples/example_x509.c similarity index 100% rename from examples/testx509.c rename to examples/example_x509.c diff --git a/scripts/buildMulti.sh b/scripts/buildMulti.sh index 3d6ab5b..b2afb0e 100755 --- a/scripts/buildMulti.sh +++ b/scripts/buildMulti.sh @@ -13,7 +13,7 @@ make clean make # Build example with multiple curves and RSA security level -gcc -O2 -std=c99 ./examples/testall.c -I./include/ -I./target/default/include/ -L./target/default/lib/ -lamcl_core -lamcl_curve_BN254CX -lamcl_curve_ED25519 -lamcl_curve_GOLDILOCKS -lamcl_curve_NIST256 -lamcl_mpin_BN254CX -lamcl_pairing_BN254CX -lamcl_rsa_2048 -lamcl_rsa_3072 -lamcl_wcc_BN254CX -lamcl_x509 -o testall +gcc -O2 -std=c99 ./examples/testall.c -I./include/ -I./target/default/include/ -L./target/default/lib/ -lamcl_core -lamcl_curve_BLS381 -lamcl_curve_ED25519 -lamcl_curve_GOLDILOCKS -lamcl_curve_NIST256 -lamcl_mpin_BLS381 -lamcl_pairing_BLS381 -lamcl_rsa_2048 -lamcl_rsa_3072 -lamcl_wcc_BLS381 -lamcl_x509 -o testall # Run code export LD_LIBRARY_PATH=./target/default/lib diff --git a/test/test_bls_ZZZ.c.in b/test/test_bls_ZZZ.c.in index 4375588..8afa54a 100644 --- a/test/test_bls_ZZZ.c.in +++ b/test/test_bls_ZZZ.c.in @@ -252,15 +252,15 @@ int main() char* seedHex = "78d0fb6705ce77dee47d03eb5b9c5d30"; char seed[16] = {0}; octet SEED = {sizeof(seed),sizeof(seed),seed}; - printf("SEED: "); - OCT_output(&SEED); - printf("\n"); // CSPRNG csprng RNG; // fake random source OCT_fromHex(&SEED,seedHex); + printf("SEED: "); + OCT_output(&SEED); + printf("\n"); // initialise strong RNG CREATE_CSPRNG(&RNG,&SEED);
