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 +4 -4
- data/ext/self_crypto/utility.c +2 -2
- data/lib/self_crypto/version.rb +1 -1
- data/test/spec/test_util.rb +17 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73eca72eccdafd451e608539b1b3ca79e344ff359f6b4665ccb400bcd8228a96
|
4
|
+
data.tar.gz: 80b460665fb84005612a6236eca92dc99c640c1750f0cce282c31ff5acdafce9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85eeecb3fc6132ce712648f4490513ce4ee03e833c6eeeb6ae90211158bb6d576492c931f3f67f863fdd682f99a02a89709966c5ab4dfd34ea917bf9cc803efc
|
7
|
+
data.tar.gz: 1a6bd6df98128d36ce74225fcb83c17db9e3eb19a315ad0570760a2835248ecbea876e6d4408ecfd5940290829ea2f0c24311514aa7b36e7fd5ee6cf4fc7f4b7
|
data/ext/self_crypto/utility.c
CHANGED
@@ -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
|
-
|
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
|
56
|
+
rb_raise(rb_eTypeError, "could not decode ed25519 public key");
|
57
57
|
}
|
58
58
|
|
59
59
|
if((pk_ptr = malloc(pk_sz)) == NULL){
|
data/lib/self_crypto/version.rb
CHANGED
@@ -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.
|
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-
|
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
|