rbnacl-libsodium 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rbnacl/libsodium/version.rb +1 -1
  3. data/vendor/libsodium/ChangeLog +7 -0
  4. data/vendor/libsodium/autom4te.cache/output.1 +11 -11
  5. data/vendor/libsodium/autom4te.cache/output.5 +11 -11
  6. data/vendor/libsodium/autom4te.cache/requests +919 -919
  7. data/vendor/libsodium/autom4te.cache/traces.1 +1 -1
  8. data/vendor/libsodium/builds/msvc/version.h +1 -1
  9. data/vendor/libsodium/configure +11 -11
  10. data/vendor/libsodium/configure.ac +2 -2
  11. data/vendor/libsodium/dist-build/emscripten.sh +3 -3
  12. data/vendor/libsodium/msvc-scripts/process.bat +1 -1
  13. data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +2 -2
  14. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2.h +12 -3
  15. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_cswap_curve25519_ref10.c +1 -1
  16. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_cmov.c +1 -1
  17. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_frombytes.c +10 -10
  18. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_mul.c +12 -12
  19. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sq.c +12 -12
  20. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sq2.c +12 -12
  21. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc_muladd.c +70 -70
  22. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc_reduce.c +47 -47
  23. data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h +12 -2
  24. data/vendor/libsodium/src/libsodium/include/sodium/export.h +5 -1
  25. data/vendor/libsodium/src/libsodium/randombytes/randombytes.c +3 -3
  26. data/vendor/libsodium/test/default/generichash.c +4 -4
  27. metadata +2 -2
@@ -124,18 +124,18 @@ void sc_reduce(unsigned char *s)
124
124
  s11 -= s18 * 683901;
125
125
 
126
126
 
127
- carry6 = (s6 + (1<<20)) >> 21; s7 += carry6; s6 -= carry6 << 21;
128
- carry8 = (s8 + (1<<20)) >> 21; s9 += carry8; s8 -= carry8 << 21;
129
- carry10 = (s10 + (1<<20)) >> 21; s11 += carry10; s10 -= carry10 << 21;
130
- carry12 = (s12 + (1<<20)) >> 21; s13 += carry12; s12 -= carry12 << 21;
131
- carry14 = (s14 + (1<<20)) >> 21; s15 += carry14; s14 -= carry14 << 21;
132
- carry16 = (s16 + (1<<20)) >> 21; s17 += carry16; s16 -= carry16 << 21;
133
-
134
- carry7 = (s7 + (1<<20)) >> 21; s8 += carry7; s7 -= carry7 << 21;
135
- carry9 = (s9 + (1<<20)) >> 21; s10 += carry9; s9 -= carry9 << 21;
136
- carry11 = (s11 + (1<<20)) >> 21; s12 += carry11; s11 -= carry11 << 21;
137
- carry13 = (s13 + (1<<20)) >> 21; s14 += carry13; s13 -= carry13 << 21;
138
- carry15 = (s15 + (1<<20)) >> 21; s16 += carry15; s15 -= carry15 << 21;
127
+ carry6 = (s6 + (1L << 20)) >> 21; s7 += carry6; s6 -= carry6 * (1L << 21);
128
+ carry8 = (s8 + (1L << 20)) >> 21; s9 += carry8; s8 -= carry8 * (1L << 21);
129
+ carry10 = (s10 + (1L << 20)) >> 21; s11 += carry10; s10 -= carry10 * (1L << 21);
130
+ carry12 = (s12 + (1L << 20)) >> 21; s13 += carry12; s12 -= carry12 * (1L << 21);
131
+ carry14 = (s14 + (1L << 20)) >> 21; s15 += carry14; s14 -= carry14 * (1L << 21);
132
+ carry16 = (s16 + (1L << 20)) >> 21; s17 += carry16; s16 -= carry16 * (1L << 21);
133
+
134
+ carry7 = (s7 + (1L << 20)) >> 21; s8 += carry7; s7 -= carry7 * (1L << 21);
135
+ carry9 = (s9 + (1L << 20)) >> 21; s10 += carry9; s9 -= carry9 * (1L << 21);
136
+ carry11 = (s11 + (1L << 20)) >> 21; s12 += carry11; s11 -= carry11 * (1L << 21);
137
+ carry13 = (s13 + (1L << 20)) >> 21; s14 += carry13; s13 -= carry13 * (1L << 21);
138
+ carry15 = (s15 + (1L << 20)) >> 21; s16 += carry15; s15 -= carry15 * (1L << 21);
139
139
 
140
140
  s5 += s17 * 666643;
141
141
  s6 += s17 * 470296;
@@ -185,19 +185,19 @@ void sc_reduce(unsigned char *s)
185
185
  s5 -= s12 * 683901;
186
186
  s12 = 0;
187
187
 
188
- carry0 = (s0 + (1<<20)) >> 21; s1 += carry0; s0 -= carry0 << 21;
189
- carry2 = (s2 + (1<<20)) >> 21; s3 += carry2; s2 -= carry2 << 21;
190
- carry4 = (s4 + (1<<20)) >> 21; s5 += carry4; s4 -= carry4 << 21;
191
- carry6 = (s6 + (1<<20)) >> 21; s7 += carry6; s6 -= carry6 << 21;
192
- carry8 = (s8 + (1<<20)) >> 21; s9 += carry8; s8 -= carry8 << 21;
193
- carry10 = (s10 + (1<<20)) >> 21; s11 += carry10; s10 -= carry10 << 21;
188
+ carry0 = (s0 + (1L << 20)) >> 21; s1 += carry0; s0 -= carry0 * (1L << 21);
189
+ carry2 = (s2 + (1L << 20)) >> 21; s3 += carry2; s2 -= carry2 * (1L << 21);
190
+ carry4 = (s4 + (1L << 20)) >> 21; s5 += carry4; s4 -= carry4 * (1L << 21);
191
+ carry6 = (s6 + (1L << 20)) >> 21; s7 += carry6; s6 -= carry6 * (1L << 21);
192
+ carry8 = (s8 + (1L << 20)) >> 21; s9 += carry8; s8 -= carry8 * (1L << 21);
193
+ carry10 = (s10 + (1L << 20)) >> 21; s11 += carry10; s10 -= carry10 * (1L << 21);
194
194
 
195
- carry1 = (s1 + (1<<20)) >> 21; s2 += carry1; s1 -= carry1 << 21;
196
- carry3 = (s3 + (1<<20)) >> 21; s4 += carry3; s3 -= carry3 << 21;
197
- carry5 = (s5 + (1<<20)) >> 21; s6 += carry5; s5 -= carry5 << 21;
198
- carry7 = (s7 + (1<<20)) >> 21; s8 += carry7; s7 -= carry7 << 21;
199
- carry9 = (s9 + (1<<20)) >> 21; s10 += carry9; s9 -= carry9 << 21;
200
- carry11 = (s11 + (1<<20)) >> 21; s12 += carry11; s11 -= carry11 << 21;
195
+ carry1 = (s1 + (1L << 20)) >> 21; s2 += carry1; s1 -= carry1 * (1L << 21);
196
+ carry3 = (s3 + (1L << 20)) >> 21; s4 += carry3; s3 -= carry3 * (1L << 21);
197
+ carry5 = (s5 + (1L << 20)) >> 21; s6 += carry5; s5 -= carry5 * (1L << 21);
198
+ carry7 = (s7 + (1L << 20)) >> 21; s8 += carry7; s7 -= carry7 * (1L << 21);
199
+ carry9 = (s9 + (1L << 20)) >> 21; s10 += carry9; s9 -= carry9 * (1L << 21);
200
+ carry11 = (s11 + (1L << 20)) >> 21; s12 += carry11; s11 -= carry11 * (1L << 21);
201
201
 
202
202
  s0 += s12 * 666643;
203
203
  s1 += s12 * 470296;
@@ -207,18 +207,18 @@ void sc_reduce(unsigned char *s)
207
207
  s5 -= s12 * 683901;
208
208
  s12 = 0;
209
209
 
210
- carry0 = s0 >> 21; s1 += carry0; s0 -= carry0 << 21;
211
- carry1 = s1 >> 21; s2 += carry1; s1 -= carry1 << 21;
212
- carry2 = s2 >> 21; s3 += carry2; s2 -= carry2 << 21;
213
- carry3 = s3 >> 21; s4 += carry3; s3 -= carry3 << 21;
214
- carry4 = s4 >> 21; s5 += carry4; s4 -= carry4 << 21;
215
- carry5 = s5 >> 21; s6 += carry5; s5 -= carry5 << 21;
216
- carry6 = s6 >> 21; s7 += carry6; s6 -= carry6 << 21;
217
- carry7 = s7 >> 21; s8 += carry7; s7 -= carry7 << 21;
218
- carry8 = s8 >> 21; s9 += carry8; s8 -= carry8 << 21;
219
- carry9 = s9 >> 21; s10 += carry9; s9 -= carry9 << 21;
220
- carry10 = s10 >> 21; s11 += carry10; s10 -= carry10 << 21;
221
- carry11 = s11 >> 21; s12 += carry11; s11 -= carry11 << 21;
210
+ carry0 = s0 >> 21; s1 += carry0; s0 -= carry0 * (1L << 21);
211
+ carry1 = s1 >> 21; s2 += carry1; s1 -= carry1 * (1L << 21);
212
+ carry2 = s2 >> 21; s3 += carry2; s2 -= carry2 * (1L << 21);
213
+ carry3 = s3 >> 21; s4 += carry3; s3 -= carry3 * (1L << 21);
214
+ carry4 = s4 >> 21; s5 += carry4; s4 -= carry4 * (1L << 21);
215
+ carry5 = s5 >> 21; s6 += carry5; s5 -= carry5 * (1L << 21);
216
+ carry6 = s6 >> 21; s7 += carry6; s6 -= carry6 * (1L << 21);
217
+ carry7 = s7 >> 21; s8 += carry7; s7 -= carry7 * (1L << 21);
218
+ carry8 = s8 >> 21; s9 += carry8; s8 -= carry8 * (1L << 21);
219
+ carry9 = s9 >> 21; s10 += carry9; s9 -= carry9 * (1L << 21);
220
+ carry10 = s10 >> 21; s11 += carry10; s10 -= carry10 * (1L << 21);
221
+ carry11 = s11 >> 21; s12 += carry11; s11 -= carry11 * (1L << 21);
222
222
 
223
223
  s0 += s12 * 666643;
224
224
  s1 += s12 * 470296;
@@ -228,17 +228,17 @@ void sc_reduce(unsigned char *s)
228
228
  s5 -= s12 * 683901;
229
229
 
230
230
 
231
- carry0 = s0 >> 21; s1 += carry0; s0 -= carry0 << 21;
232
- carry1 = s1 >> 21; s2 += carry1; s1 -= carry1 << 21;
233
- carry2 = s2 >> 21; s3 += carry2; s2 -= carry2 << 21;
234
- carry3 = s3 >> 21; s4 += carry3; s3 -= carry3 << 21;
235
- carry4 = s4 >> 21; s5 += carry4; s4 -= carry4 << 21;
236
- carry5 = s5 >> 21; s6 += carry5; s5 -= carry5 << 21;
237
- carry6 = s6 >> 21; s7 += carry6; s6 -= carry6 << 21;
238
- carry7 = s7 >> 21; s8 += carry7; s7 -= carry7 << 21;
239
- carry8 = s8 >> 21; s9 += carry8; s8 -= carry8 << 21;
240
- carry9 = s9 >> 21; s10 += carry9; s9 -= carry9 << 21;
241
- carry10 = s10 >> 21; s11 += carry10; s10 -= carry10 << 21;
231
+ carry0 = s0 >> 21; s1 += carry0; s0 -= carry0 * (1L << 21);
232
+ carry1 = s1 >> 21; s2 += carry1; s1 -= carry1 * (1L << 21);
233
+ carry2 = s2 >> 21; s3 += carry2; s2 -= carry2 * (1L << 21);
234
+ carry3 = s3 >> 21; s4 += carry3; s3 -= carry3 * (1L << 21);
235
+ carry4 = s4 >> 21; s5 += carry4; s4 -= carry4 * (1L << 21);
236
+ carry5 = s5 >> 21; s6 += carry5; s5 -= carry5 * (1L << 21);
237
+ carry6 = s6 >> 21; s7 += carry6; s6 -= carry6 * (1L << 21);
238
+ carry7 = s7 >> 21; s8 += carry7; s7 -= carry7 * (1L << 21);
239
+ carry8 = s8 >> 21; s9 += carry8; s8 -= carry8 * (1L << 21);
240
+ carry9 = s9 >> 21; s10 += carry9; s9 -= carry9 * (1L << 21);
241
+ carry10 = s10 >> 21; s11 += carry10; s10 -= carry10 * (1L << 21);
242
242
 
243
243
  s[0] = s0 >> 0;
244
244
  s[1] = s0 >> 8;
@@ -14,7 +14,12 @@
14
14
  extern "C" {
15
15
  #endif
16
16
 
17
- #pragma pack(push, 1)
17
+ #ifdef __SUNPRO_C
18
+ # pragma pack(1)
19
+ #else
20
+ # pragma pack(push, 1)
21
+ #endif
22
+
18
23
  typedef CRYPTO_ALIGN(64) struct crypto_generichash_blake2b_state {
19
24
  uint64_t h[8];
20
25
  uint64_t t[2];
@@ -23,7 +28,12 @@ typedef CRYPTO_ALIGN(64) struct crypto_generichash_blake2b_state {
23
28
  size_t buflen;
24
29
  uint8_t last_node;
25
30
  } crypto_generichash_blake2b_state;
26
- #pragma pack(pop)
31
+
32
+ #ifdef __SUNPRO_C
33
+ # pragma pack()
34
+ #else
35
+ # pragma pack(pop)
36
+ #endif
27
37
 
28
38
  #define crypto_generichash_blake2b_BYTES_MIN 16U
29
39
  SODIUM_EXPORT
@@ -20,7 +20,11 @@
20
20
  # endif
21
21
  # else
22
22
  # if defined(__SUNPRO_C)
23
- # define SODIUM_EXPORT __attribute__ __global
23
+ # ifndef __GNU_C__
24
+ # define SODIUM_EXPORT __attribute__(visibility(__global))
25
+ # else
26
+ # define SODIUM_EXPORT __attribute__ __global
27
+ # endif
24
28
  # elif defined(_MSG_VER)
25
29
  # define SODIUM_EXPORT extern __declspec(dllexport)
26
30
  # else
@@ -81,12 +81,12 @@ randombytes_stir(void)
81
81
  } catch (e) {
82
82
  try {
83
83
  var crypto = require('crypto'),
84
- randomValueIOJS = function() {
84
+ randomValueNodeJS = function() {
85
85
  var buf = crypto.randomBytes(4);
86
86
  return (buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3]) >>> 0;
87
87
  };
88
- randomValueIOJS();
89
- Module.getRandomValue = randomValueIOJS;
88
+ randomValueNodeJS();
89
+ Module.getRandomValue = randomValueNodeJS;
90
90
  } catch (e) {
91
91
  throw 'No secure random number generator found';
92
92
  }
@@ -1301,9 +1301,9 @@ tv(void)
1301
1301
  size_t i = 0U;
1302
1302
  size_t in_len;
1303
1303
 
1304
- key = sodium_malloc(crypto_generichash_KEYBYTES_MAX);
1305
- out = sodium_malloc(crypto_generichash_BYTES_MAX);
1306
- expected_out = sodium_malloc(crypto_generichash_BYTES_MAX);
1304
+ key = (unsigned char *) sodium_malloc(crypto_generichash_KEYBYTES_MAX);
1305
+ out = (unsigned char *) sodium_malloc(crypto_generichash_BYTES_MAX);
1306
+ expected_out = (unsigned char *) sodium_malloc(crypto_generichash_BYTES_MAX);
1307
1307
  do {
1308
1308
  assert(strlen(tests[i].key_hex) == 2 * crypto_generichash_KEYBYTES_MAX);
1309
1309
  sodium_hex2bin(key, crypto_generichash_KEYBYTES_MAX,
@@ -1314,7 +1314,7 @@ tv(void)
1314
1314
  tests[i].out_hex, strlen(tests[i].out_hex),
1315
1315
  NULL, NULL, NULL);
1316
1316
  in_len = strlen(tests[i].in_hex) / 2;
1317
- in = sodium_malloc(in_len);
1317
+ in = (unsigned char *) sodium_malloc(in_len);
1318
1318
  sodium_hex2bin(in, in_len, tests[i].in_hex, strlen(tests[i].in_hex),
1319
1319
  NULL, NULL, NULL);
1320
1320
  crypto_generichash(out, crypto_generichash_BYTES_MAX,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbnacl-libsodium
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artiom Di
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-18 00:00:00.000000000 Z
11
+ date: 2015-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbnacl