Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

h2c

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

h2c

  • 0.2.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Hashing to Elliptic Curves for Ruby

This is a Ruby implementation of the Hash to Curves proposed by the IETF.

It has been tested using the Test Vector provided, but the code has not been audited to ensure functional specification and safety. Also It is under development and is subject to change without backward compatibility.

The following cipher suites are currently supported:

  • secp256k1_XMD:SHA-256_SSWU_NU_
  • secp256k1_XMD:SHA-256_SSWU_RO_
  • BLS12381G1_XMD:SHA-256_SSWU_NU_
  • BLS12381G1_XMD:SHA-256_SSWU_RO_
  • P256_XMD:SHA-256_SSWU_NU_
  • P256_XMD:SHA-256_SSWU_RO_
  • P384_XMD:SHA-384_SSWU_NU_
  • P384_XMD:SHA-384_SSWU_RO_
  • P521_XMD:SHA-512_SSWU_NU_
  • P521_XMD:SHA-512_SSWU_RO_

Installation

Add this line to your application's Gemfile:

gem 'h2c'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install h2c

Usage

require 'h2c'

dst = "QUUX-V01-CS02-with-secp256k1_XMD:SHA-256_SSWU_RO_"

h2c = H2C.get(H2C::Suite::SECP256K1_XMDSHA256_SSWU_RO_, dst)

msg = "abc"

result = h2c.digest(msg)
puts result.inspect
#<ECDSA::Point: secp256k1, 0x3377e01eab42db296b512293120c6cee72b6ecf9f9205760bd9ff11fb3cb2c4b, 0x7f95890f33efebd1044d382a01b1bee0900fb6116f94688d487c6c7b9c8371f6>

FAQs

Package last updated on 06 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc