schnorrkel_rb 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ef372bbee013a28eaaff737011c2e6d14192ed9eb3a60d118a12ed6b44eea5f
4
- data.tar.gz: cbaff3a51228d6f5779950694fdc1dd33760955cb63713d71328d4c600365ed7
3
+ metadata.gz: 4060d9b92831275160cdc567835e0eaa6b54b9a8c7c4240b53ea0551b97295e0
4
+ data.tar.gz: a872603a75729ba0da58c9b8c7da830313ea1a448f5617c74b61fa8e0125b33c
5
5
  SHA512:
6
- metadata.gz: ae0f806894055ef26f8d9ebd03185150bacfe9bd606ac72ddaf3e0406dc57e6c3aab3d873daaaf66ef2137fecb476a0ae788b3de59f2884bd5f20320d8e173cc
7
- data.tar.gz: bb2e4b4e384e738ceb4208e6af9a1b7e7ad9778ee17c95d8f8bc3713577ed80c0251652314fdfaa07fe1c7ba1c741e35355f930007439e14fb3fc1e179a8fd8f
6
+ metadata.gz: e049214a3b9832713218dabb866f14359daf6e9e834ecbfaf590f45adbf1f4acc75666f8b14404ee09403841031e26de35ae83e5ea21c9f210a20ac2b8b2d24a
7
+ data.tar.gz: 7e6450f279acf4a99d38bff37ccee70fff8defe33d60096aebeff18de67eef84737fd7268386b2e619deaf5866378f845e57cb164bdbdd5183dd032f2a073929
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- schnorrkel_rb (0.1.0)
4
+ schnorrkel_rb (0.1.1)
5
5
  ffi (~> 1.0)
6
6
  thermite (~> 0)
7
7
 
data/README.md CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ see test
24
24
 
25
25
  ## Development
26
26
 
data/Rakefile CHANGED
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
4
+ require "thermite/tasks"
5
5
 
6
- RSpec::Core::RakeTask.new(:spec)
6
+ Thermite::Tasks.new
7
7
 
8
- require "rubocop/rake_task"
8
+ task default: %w[thermite:build]
9
9
 
10
- RuboCop::RakeTask.new
11
-
12
- task default: %i[spec rubocop]
10
+ desc "Run Rust & Ruby testsuites"
11
+ task test: ["thermite:build", "thermite:test"] do
12
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SchnorrkelRb
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/schnorrkel_rb.rb CHANGED
@@ -9,7 +9,7 @@ class Str < FFI::AutoPointer
9
9
  end
10
10
 
11
11
  def to_s
12
- @str ||= self.read_string.force_encoding('UTF-8')
12
+ @str ||= read_string.force_encoding("UTF-8")
13
13
  end
14
14
  end
15
15
 
@@ -23,15 +23,15 @@ module SchnorrkelRb
23
23
  attach_function :free, :free_s, [Str], :void
24
24
 
25
25
  def self.sr25519_sign(seed, message)
26
- message = message[2..] if message.start_with?('0x')
27
- seed = seed[2..] if seed.start_with?('0x')
28
- self.sign_by_seed(message, seed).to_s
26
+ message = message[2..] if message.start_with?("0x")
27
+ seed = seed[2..] if seed.start_with?("0x")
28
+ sign_by_seed(message, seed).to_s
29
29
  end
30
30
 
31
31
  def self.sr25519_verify(signature, message, pubkey)
32
- pubkey = pubkey[2..] if pubkey.start_with?('0x')
33
- message = message[2..] if message.start_with?('0x')
34
- signature = signature[2..] if signature.start_with?('0x')
35
- self.verify(signature, message, pubkey)
32
+ pubkey = pubkey[2..] if pubkey.start_with?("0x")
33
+ message = message[2..] if message.start_with?("0x")
34
+ signature = signature[2..] if signature.start_with?("0x")
35
+ verify(signature, message, pubkey)
36
36
  end
37
37
  end
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.extensions << 'ext/Rakefile'
34
- spec.add_runtime_dependency 'thermite', '~> 0'
33
+ spec.extensions << "ext/Rakefile"
34
+ spec.add_runtime_dependency "thermite", "~> 0"
35
35
  spec.add_dependency "ffi", "~> 1.0"
36
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schnorrkel_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aki Wu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-27 00:00:00.000000000 Z
11
+ date: 2022-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thermite