iota-ruby 1.1.0 → 1.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 +4 -4
- data/README.md +1 -1
- data/ext/ccurl/ccurl.c +13 -12
- data/lib/iota/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c32740331750eaf99d815b46b70e295edeac4ab4
|
4
|
+
data.tar.gz: 229099a8efc82398f840dd6a997a4262aefeaf2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd529fd2768766e1e41b99a96bc270273c4a49b0c374fe3ea1c404193dcfa4e9ea8e1a60e510c68705f4e69bab70d812dec7c84cd1e8ff2ac3b6d850c65b7ea3
|
7
|
+
data.tar.gz: 1bee6775b242bf06712cd45dbf7c3834169d2529d6f4615674525250e06595d659bd902ea2b22d8b7ffc0ffc46fcff9a1025f16a70ac64ad3dd34dfb43058daf
|
data/README.md
CHANGED
data/ext/ccurl/ccurl.c
CHANGED
@@ -40,17 +40,17 @@ static VALUE ccurl_init(VALUE self, VALUE rounds) {
|
|
40
40
|
}
|
41
41
|
|
42
42
|
static VALUE ccurl_absorb(VALUE self, VALUE data) {
|
43
|
-
Curl *ctx;
|
44
|
-
Data_Get_Struct(self, Curl, ctx);
|
45
|
-
|
46
43
|
trit_t *trits;
|
47
|
-
|
48
44
|
int offset = 0;
|
45
|
+
int i;
|
49
46
|
int length = NUM2INT(rb_funcall(data, rb_intern("length"), 0, 0));
|
50
47
|
|
48
|
+
Curl *ctx;
|
49
|
+
Data_Get_Struct(self, Curl, ctx);
|
50
|
+
|
51
51
|
trits = (trit_t*)malloc(length * sizeof(trit_t));
|
52
52
|
|
53
|
-
for (
|
53
|
+
for (i = 0; i < length; ++i) {
|
54
54
|
trits[i] = (trit_t)(NUM2LONG(rb_ary_entry(data, i)));
|
55
55
|
}
|
56
56
|
|
@@ -66,16 +66,17 @@ static VALUE ccurl_absorb(VALUE self, VALUE data) {
|
|
66
66
|
}
|
67
67
|
|
68
68
|
static VALUE ccurl_squeeze(VALUE self, VALUE data) {
|
69
|
+
int length = NUM2INT(rb_funcall(data, rb_intern("length"), 0, 0));
|
70
|
+
int i;
|
71
|
+
|
69
72
|
Curl *ctx;
|
70
73
|
Data_Get_Struct(self, Curl, ctx);
|
71
74
|
|
72
|
-
|
73
|
-
|
74
|
-
for(incoming_count = length; length < HASH_LENGTH; length++) {
|
75
|
+
for(; length < HASH_LENGTH; length++) {
|
75
76
|
rb_ary_push(data, LONG2NUM(0));
|
76
77
|
}
|
77
78
|
|
78
|
-
for (
|
79
|
+
for (i = 0; i < HASH_LENGTH; i++) {
|
79
80
|
rb_ary_store(data, i, LONG2NUM(ctx->state[i]));
|
80
81
|
}
|
81
82
|
|
@@ -85,12 +86,12 @@ static VALUE ccurl_squeeze(VALUE self, VALUE data) {
|
|
85
86
|
}
|
86
87
|
|
87
88
|
static VALUE ccurl_transform(VALUE self) {
|
88
|
-
Curl *ctx;
|
89
|
-
Data_Get_Struct(self, Curl, ctx);
|
90
|
-
|
91
89
|
trit_t scratchpad[STATE_LENGTH];
|
92
90
|
int round, scratchpadIndex=0, scratchpadIndexSave, stateIndex;
|
93
91
|
|
92
|
+
Curl *ctx;
|
93
|
+
Data_Get_Struct(self, Curl, ctx);
|
94
|
+
|
94
95
|
for (round = 0; round < NUMBER_OF_ROUNDS; round++) {
|
95
96
|
memcpy(scratchpad, ctx->state, STATE_LENGTH * sizeof(trit_t));
|
96
97
|
|
data/lib/iota/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iota-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vivek Marakana
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|