Git Product home page Git Product logo

Comments (5)

CryptoMathician avatar CryptoMathician commented on July 2, 2024

Maybe as an additional comment. My goal was to produce a base64 string from the ECP2 object.

from core.

mcarrickscott avatar mcarrickscott commented on July 2, 2024

from core.

CryptoMathician avatar CryptoMathician commented on July 2, 2024

Hi Mike,

exactly. The internal format in hex is in both implementation the same and that is why I assume that both ECP2 objects are the same (or is it possible that the objects are not the same with the same internal hex representation?). Unfortunately, the JavaScript implementation (second array of decimals) of ECP2 gives me not the same byte array as the Java implementation it does (first array of decimals) when I call toBytes(). Do I miss something? I think it is not because of the 12*ctx.BIG.MODBYTES or maybe I didn't get the point.

From my point of view of my understanding the ECP2 implementation in JavaScript should give me the same result when I call toBytes() or is the internal hex representation not enough to check if both objects are the same?

My question is, could you help me to figure out the problem why I not getting the same byte array in both implementations? I am not sure if I missed something or if it exist a bug in the implementation (or similar).
I tried also if this is my fault because of the type of the array, but I don't get the correct bytes (decimals) when I use Uint8Array, Array or Int8Array.
My goal was to produce a base64 string from the byte array which is representing ("flattened") the ECP2 object in signed/unsigned decimals.

Not entirely sure what the point is here. The first array is an ECP2 instance, in its internal format, in hex. The second is the same data "flattened" into a single array of signed bytes in decimal. Which is what tobytes() should do. It should however be of size 4ctx.BIG.MODBYTES, not 12 - maybe that is the problem?? I couldn't relate the other arrays to these ones.. Mike

from core.

mcarrickscott avatar mcarrickscott commented on July 2, 2024

from core.

CryptoMathician avatar CryptoMathician commented on July 2, 2024

I found the issue. I did a mistake.

from core.

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.