forked from harmony-one/harmony
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request harmony-one#2 from herumi/master
Bring fork up to date with original
- Loading branch information
Showing
58 changed files
with
2,656 additions
and
541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package mcl | ||
|
||
/* | ||
#cgo bn256 CFLAGS:-DMCLBN_FP_UNIT_SIZE=4 | ||
#cgo bn384 CFLAGS:-DMCLBN_FP_UNIT_SIZE=6 | ||
#cgo bn384_256 CFLAGS:-DMCLBN_FP_UNIT_SIZE=6 -DMCLBN_FR_UNIT_SIZE=4 | ||
#cgo bn256 LDFLAGS:-lmclbn256 -lmcl | ||
#cgo bn384 LDFLAGS:-lmclbn384 -lmcl | ||
#cgo bn384_256 LDFLAGS:-lmclbn384_256 -lmcl | ||
#include <mcl/bn.h> | ||
*/ | ||
import "C" | ||
import "fmt" | ||
// Init -- | ||
// call this function before calling all the other operations | ||
// this function is not thread safe | ||
func Init(curve int) error { | ||
err := C.mclBn_init(C.int(curve), C.MCLBN_COMPILED_TIME_VAR) | ||
if err != 0 { | ||
return fmt.Errorf("ERR mclBn_init curve=%d", curve) | ||
} | ||
return nil | ||
} | ||
|
||
|
Oops, something went wrong.