bls12-381 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95b1304731e27153c9b59faab3d27f52e89c58fcdb8f2263d107cf0b21cb915c
4
- data.tar.gz: ccca64aef75aa32d6eed757ebbe3b9a8b2ad196922fe0a7d13e5ea5d758b379f
3
+ metadata.gz: 952b53216e9eeccf529ec7547cc4dc21e6a666fdc200f49172f09050967de278
4
+ data.tar.gz: 60b3f46b0bd8c94cf25bfffa0fa9da003b9df30bc740bb604bcb3f2386500125
5
5
  SHA512:
6
- metadata.gz: 9d4bc380176d29f8e74a89ff0d7dc4977a7de0dbbd068e073af840c4090de72a9625a9d4f020567ac3261a07becae025fc69409e4b69e384c933c849f24fc72d
7
- data.tar.gz: f2821558b405f4191a0a1bfe25f26b62e5dfd2af059f22e4e719433caf4117b34113de7a3f84bc0562fcc228d1b43b0ffec45acb7f67abd314fe72501095c43b
6
+ metadata.gz: 80e3701fff445cdc50c6445fedf6cb67577a5e5ef4916fb4f97293666563474962c84ac8d757b18d53e5608075d8373c4fb3a89cd6e2bbb96cfb5ef608ebc124
7
+ data.tar.gz: f1e23e6abf7d5c17a1b7b7ea0413e2ff18d0ca8901f10a854f63b8043fa0b1ceb4598c8897d17830445b0574ef8b3cdbe1bf9fbac5b455d3c673dcb3c683fc62
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # BLS12::381 for Ruby [![Build Status](https://github.com/azuchi/bls12-381/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/azuchi/bls12-381/actions/workflows/main.yml/badge.svg?branch=main) [![Gem Version](https://badge.fury.io/rb/bls12-381.svg)](https://badge.fury.io/rb/bls12-381) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
1
+ # BLS12-381 for Ruby [![Build Status](https://github.com/azuchi/bls12-381/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/azuchi/bls12-381/actions/workflows/main.yml/badge.svg?branch=main) [![Gem Version](https://badge.fury.io/rb/bls12-381.svg)](https://badge.fury.io/rb/bls12-381) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
2
2
 
3
3
  This library is a Ruby BLS12-381 implementation based on the JavaScript implementation [noble-bls12-381](https://github.com/paulmillr/noble-bls12-381).
4
4
 
data/lib/bls/point.rb CHANGED
@@ -341,6 +341,14 @@ module BLS
341
341
  point
342
342
  end
343
343
 
344
+ # Parse Point from private key.
345
+ # @param [String|Integer] private_key a private key with hex or number.
346
+ # @return [PointG1] G1Point corresponding to private keys.
347
+ # @raise [BLS::Error] Occur when the private key is zero.
348
+ def self.from_private_key(private_key)
349
+ BASE * BLS.normalize_priv_key(private_key)
350
+ end
351
+
344
352
  # Convert hash to PointG2
345
353
  # @param [String] message a hash with hex format.
346
354
  # @return [BLS::PointG2] point.
data/lib/bls/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BLS
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bls12-381
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shigeyuki Azuchi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-08 00:00:00.000000000 Z
11
+ date: 2022-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler