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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e15da20a0b19ab615e650922f5e5182d0ccae186
4
- data.tar.gz: a6749e1c32299500485799903b203e9d6688960f
3
+ metadata.gz: c32740331750eaf99d815b46b70e295edeac4ab4
4
+ data.tar.gz: 229099a8efc82398f840dd6a997a4262aefeaf2b
5
5
  SHA512:
6
- metadata.gz: 2e9495318e52b2b1d1c5279a5c572819c59a3408f27794e9aa4f2bf3a24b2cc3acd8e454b0c6e0cf287745b8d0b8d04a6d391b88dd6ba709fbcb9495a7564261
7
- data.tar.gz: 7185c56ed47281120f6ddba2d39c29d7f6d437b2331b871f97ac678e8c4a45d776b96a7bc2f456416b949a89df0b1620277b19ab1ed7901b3739e3e44f9324a6
6
+ metadata.gz: bd529fd2768766e1e41b99a96bc270273c4a49b0c374fe3ea1c404193dcfa4e9ea8e1a60e510c68705f4e69bab70d812dec7c84cd1e8ff2ac3b6d850c65b7ea3
7
+ data.tar.gz: 1bee6775b242bf06712cd45dbf7c3834169d2529d6f4615674525250e06595d659bd902ea2b22d8b7ffc0ffc46fcff9a1025f16a70ac64ad3dd34dfb43058daf
data/README.md CHANGED
@@ -13,7 +13,7 @@ This gem is a **beta release**. If you find any bug or face issue, please [post
13
13
  Add this line to your application's Gemfile:
14
14
 
15
15
  ```ruby
16
- gem 'iota-ruby', require: 'iota'
16
+ gem 'iota-ruby', '~> 1.1.1', require: 'iota'
17
17
  ```
18
18
 
19
19
  And then execute:
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 (int i = 0; i < length; ++i) {
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
- int incoming_count, length = NUM2INT(rb_funcall(data, rb_intern("length"), 0, 0));
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 (int i = 0; i < HASH_LENGTH; i++) {
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
@@ -1,3 +1,3 @@
1
1
  module IOTA
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
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.0
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-12 00:00:00.000000000 Z
11
+ date: 2017-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler