Giter Site home page Giter Site logo

sander / hashtocurve-kotlin Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 80 KB

Implementation of RFC 9380 algorithms for encoding or hashing an arbitrary byte array to a point on an elliptic curve

Home Page: https://sanderdijkhuis.nl/2023/hashtocurve-kotlin/

License: MIT License

Kotlin 100.00%
hash-to-curve kotlin

hashtocurve-kotlin's Introduction

Hashing to Elliptic Curves for Kotlin

Hashing to Elliptic Curves for Kotlin implements RFC 9380 algorithms for encoding or hashing an arbitrary byte array to a point on an elliptic curve.

Warning

This project has not been independently audited. Help is welcome to increase security or to make risks explicit. Also see the Security policy.

How to build

Run the tests. On POSIX:

./gradlew test

On Windows:

gradlew test

Instead of test, use jar to create a JAR in build/libs.

How to use in an application

Add the hashtocurve-kotlin dependency to your project.

Select a HashToCurve suite and configure a domain separation tag (see Domain Separation Requirements). With the resulting function, you can hash any byte array to the related elliptic curve. The result is encoded as a Point(x: ByteArray, y: ByteArray) with components that contain the big-endian encoding of affine curve point coordinates.

See HashToCurveSpec for example usage.

Test vectors

Some test vectors from RFC 9380 are used.

Related resources

hashtocurve-kotlin's People

Contributors

sander avatar

Watchers

 avatar

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.