self_crypto 0.0.5 → 0.0.6

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: b7a8f7e0fb6490f4040cdecd12888337ffdd95c10480778f98cecfb3d237a54c
4
- data.tar.gz: 24a9be93ee329e968ea7bf2ff00908c88f3bca4f1eb064050c2b65fb4fe303be
3
+ metadata.gz: 73eca72eccdafd451e608539b1b3ca79e344ff359f6b4665ccb400bcd8228a96
4
+ data.tar.gz: 80b460665fb84005612a6236eca92dc99c640c1750f0cce282c31ff5acdafce9
5
5
  SHA512:
6
- metadata.gz: 53c8d036727f82688846ac9e6c64ec117d1644a9d4ef89d5616c30cb977eca0c812dce63edddc588d9e4ef702c5593418f01ce301e309f5c63e78f66422fb9c2
7
- data.tar.gz: 488aea160170a83fa3f52d7a64d0dc84e7ae9c88fe03baec3f8123561a62f7e168f64774f61bdd2cf86ad8cd5ca40398cdd6918d1f659b9ddf440802294c5630
6
+ metadata.gz: 85eeecb3fc6132ce712648f4490513ce4ee03e833c6eeeb6ae90211158bb6d576492c931f3f67f863fdd682f99a02a89709966c5ab4dfd34ea917bf9cc803efc
7
+ data.tar.gz: 1a6bd6df98128d36ce74225fcb83c17db9e3eb19a315ad0570760a2835248ecbea876e6d4408ecfd5940290829ea2f0c24311514aa7b36e7fd5ee6cf4fc7f4b7
@@ -48,12 +48,12 @@ static VALUE ed25519_pk_to_curve25519(VALUE self, VALUE ed25519_pk)
48
48
  NULL,
49
49
  &dec_sz,
50
50
  NULL,
51
- sodium_base64_VARIANT_ORIGINAL_NO_PADDING
51
+ sodium_base64_VARIANT_URLSAFE_NO_PADDING
52
52
  );
53
53
 
54
54
  if(success != 0) {
55
55
  free(dec_ptr);
56
- rb_raise(rb_eTypeError, "could not convert ed25519 public key");
56
+ rb_raise(rb_eTypeError, "could not decode ed25519 public key");
57
57
  }
58
58
 
59
59
  if((pk_ptr = malloc(pk_sz)) == NULL){
@@ -1,5 +1,5 @@
1
1
  module SelfCrypto
2
2
 
3
- VERSION="0.0.5"
3
+ VERSION="0.0.6"
4
4
 
5
5
  end
@@ -0,0 +1,17 @@
1
+ require 'minitest/autorun'
2
+ require 'minitest/reporters'
3
+ require 'self_crypto'
4
+
5
+ reporter_options = { color: true }
6
+ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(reporter_options)]
7
+
8
+ describe "Util" do
9
+
10
+ describe "ed25519_pk_to_curve25519" do
11
+ account = SelfCrypto::Account.from_seed("pA0H92i1hsp1/egmS/tuEho5PpsAaQYrBd0Tj7bvAPI")
12
+ ed25519_pk = Base64.urlsafe_encode64(Base64.decode64(account.ik['ed25519']), padding: false)
13
+ curve25519_pk = SelfCrypto::Util.ed25519_pk_to_curve25519(ed25519_pk)
14
+ it("should convert"){ _(account.ik['curve25519']).must_equal curve25519_pk }
15
+ end
16
+
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: self_crypto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Bevan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-06-22 00:00:00.000000000 Z
12
+ date: 2020-10-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
@@ -103,6 +103,7 @@ files:
103
103
  - test/examples/test_bob_no_answer.rb
104
104
  - test/examples/test_exchange.rb
105
105
  - test/spec/test_account.rb
106
+ - test/spec/test_util.rb
106
107
  - test/unit/test_account_methods.rb
107
108
  homepage: https://github.com/aldgate-ventures/self-crypto-ruby
108
109
  licenses:
@@ -131,4 +132,5 @@ test_files:
131
132
  - test/unit/test_account_methods.rb
132
133
  - test/examples/test_exchange.rb
133
134
  - test/examples/test_bob_no_answer.rb
135
+ - test/spec/test_util.rb
134
136
  - test/spec/test_account.rb