Comments (5)
If the value of G2 is the form (x, y), set "1 " where and are in Fp2, then they are two elements of Fp.
see https://github.com/herumi/mcl/blob/master/api.md#string-conversion
The string length you want to set is 192, so it is a concatenation of 4 elements of Fp.
So you should split the string into 4 elements x1, x2, x3 and x4, and set "1 ".
But I don't know the original string format so that it may be "1 " or so.
from mcl.
If the string format is big-endian, you must reverse each Fp element.
e.g., 0x123456 => 0x563412 .
from mcl.
If you get the string from the other library, and if the library supports ETH specification, then it is better to use Deserialize() for the other library output of serialize() after calling ETHmode() once.
from mcl.
The PKhexstring is a compressed PK form (bigendian)
from mcl.
Then, could you use PK.Deserialize
to the data by the following FromHexStr
, for example?
public static byte[] FromHexStr(string s)
{
if (s.Length % 2 == 1) {
throw new ArgumentException("s.Length is odd." + s.Length);
}
int n = s.Length / 2;
var buf = new byte[n];
for (int i = 0; i < n; i++) {
buf[i] = Convert.ToByte(s.Substring(i * 2, 2), 16);
}
return buf;
}
from mcl.
Related Issues (20)
- mclBnG1_setDst not exist in C# version HOT 1
- op_ not initialized HOT 1
- Is there a user manual? HOT 2
- pairing method missing e: G1 x G1 -> G2 HOT 1
- efficiency of scalar-field multiplication HOT 6
- Invalid result when using BLS12-381 HOT 14
- constructing a field from __int128 HOT 2
- Inquiry about Fr::mulSmall HOT 2
- Serialize G1 in Java implement HOT 4
- I have an issue on pairing equality, i want to compute a non-witness of an accumulator. HOT 5
- Current git version fails to compile HOT 2
- Dose it support SGX(Software Guard Extensions)? HOT 7
- Cmake in MinGW HOT 2
- Which MaptoCurve used for BN254 HOT 1
- compile in SGX(Software Guard Extensions) HOT 10
- Build issues with libmcl.a HOT 8
- run bin/ecdsa_c_test.exe error HOT 2
- use libmclecdsa.a in SGX HOT 4
- test with libmclecdsa.a error in Ubuntu 20.04 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcl.