Git Product home page Git Product logo

Comments (4)

jesili avatar jesili commented on September 28, 2024 1

Thank you very much, i read the test file and find the reason of my wrong. Now i have my code works, and it's very fast than using JPBC.

from mcl.

jesili avatar jesili commented on September 28, 2024

And i try the serialize function as follows, i found the result is wrong

    G1 g1 = new G1();
    G1 g = new G1();
    g.deserialize(g1.serialize());

the value of g is not equal to g1
1 5599143398083935610374186532129481627143475178919331168509268578950374510890 5294742852547101856655570981746608842116104296916941421017505945925887545842
1 5599143398083935610374186532129481627143475178919331168509268578950374510890 11421454753289275224544372032360862587343389120178789031181440418017766282028

from mcl.

herumi avatar herumi commented on September 28, 2024

new G1() is an undefined value, so you must set a correct one.

from mcl.

herumi avatar herumi commented on September 28, 2024

I tested the following code, and it runs well.

import java.io.*;
import com.herumi.mcl.*;

public class Test {
    static {
        String lib = "mcljava";
        String libName = System.mapLibraryName(lib);
        System.out.println("libName : " + libName);
        System.loadLibrary(lib);
    }
    public static void main(String argv[]) {
        Mcl.SystemInit(Mcl.BN254);
        Fr p = new Fr();
        p.setByCSPRNG();
        G1 g1 = new G1();
        Mcl.hashAndMapToG1(g1, p.serialize());
        G1 g2 = new G1();
        g2.deserialize(g1.serialize());
        System.out.println(g1.toString());
        System.out.println(g2.toString());
    }
}
1 14718852485654364492067555047143452070543907868063243005495748641434978195525 5910875915294437084092313525811835145506598652254003876466078788996519963173
1 14718852485654364492067555047143452070543907868063243005495748641434978195525 5910875915294437084092313525811835145506598652254003876466078788996519963173

from mcl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.