pairing_c.c uses BLS12-381

update-fork
MITSUNARI Shigeo 5 years ago
parent 33bfcf4ac5
commit 1257ac7e36
  1. 4
      Makefile
  2. 5
      sample/pairing_c.c

@ -294,8 +294,8 @@ $(EXE_DIR)/bn_c384_256_test.exe: $(OBJ_DIR)/bn_c384_256_test.o $(BN384_256_LIB)
$(EXE_DIR)/bn_c512_test.exe: $(OBJ_DIR)/bn_c512_test.o $(BN512_LIB) $(MCL_LIB) $(EXE_DIR)/bn_c512_test.exe: $(OBJ_DIR)/bn_c512_test.o $(BN512_LIB) $(MCL_LIB)
$(PRE)$(CXX) $< -o $@ $(BN512_LIB) $(MCL_LIB) $(LDFLAGS) $(PRE)$(CXX) $< -o $@ $(BN512_LIB) $(MCL_LIB) $(LDFLAGS)
$(EXE_DIR)/pairing_c.exe: $(OBJ_DIR)/pairing_c.o $(BN256_LIB) $(MCL_LIB) $(EXE_DIR)/pairing_c.exe: $(OBJ_DIR)/pairing_c.o $(BN384_256_LIB) $(MCL_LIB)
$(PRE)$(CC) $< -o $@ $(BN256_LIB) $(MCL_LIB) $(LDFLAGS) -lstdc++ $(PRE)$(CC) $< -o $@ $(BN384_256_LIB) $(MCL_LIB) $(LDFLAGS) -lstdc++
$(EXE_DIR)/she_c256_test.exe: $(OBJ_DIR)/she_c256_test.o $(SHE256_LIB) $(MCL_LIB) $(EXE_DIR)/she_c256_test.exe: $(OBJ_DIR)/she_c256_test.o $(SHE256_LIB) $(MCL_LIB)
$(PRE)$(CXX) $< -o $@ $(SHE256_LIB) $(MCL_LIB) $(LDFLAGS) $(PRE)$(CXX) $< -o $@ $(SHE256_LIB) $(MCL_LIB) $(LDFLAGS)

@ -1,7 +1,6 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#define MCLBN_FP_UNIT_SIZE 4 #include <mcl/bn_c384_256.h>
#include <mcl/bn.h>
int g_err = 0; int g_err = 0;
#define ASSERT(x) { if (!(x)) { printf("err %s:%d\n", __FILE__, __LINE__); g_err++; } } #define ASSERT(x) { if (!(x)) { printf("err %s:%d\n", __FILE__, __LINE__); g_err++; } }
@ -11,7 +10,7 @@ int main()
char buf[1024]; char buf[1024];
const char *aStr = "123"; const char *aStr = "123";
const char *bStr = "456"; const char *bStr = "456";
int ret = mclBn_init(MCL_BN254, MCLBN_COMPILED_TIME_VAR); int ret = mclBn_init(MCL_BLS12_381, MCLBN_COMPILED_TIME_VAR);
if (ret != 0) { if (ret != 0) {
printf("err ret=%d\n", ret); printf("err ret=%d\n", ret);
return 1; return 1;

Loading…
Cancel
Save