rbnacl-libsodium 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +4 -0
  3. data/lib/rbnacl/libsodium/version.rb +1 -1
  4. data/vendor/libsodium/ChangeLog +15 -0
  5. data/vendor/libsodium/Makefile.am +2 -2
  6. data/vendor/libsodium/Makefile.in +6 -8
  7. data/vendor/libsodium/aclocal.m4 +0 -1
  8. data/vendor/libsodium/autom4te.cache/output.1 +47 -158
  9. data/vendor/libsodium/autom4te.cache/output.3 +17354 -0
  10. data/vendor/libsodium/autom4te.cache/requests +321 -92
  11. data/vendor/libsodium/autom4te.cache/traces.1 +371 -390
  12. data/vendor/libsodium/autom4te.cache/traces.3 +2832 -0
  13. data/vendor/libsodium/builds/msvc/properties/Debug.props +1 -1
  14. data/vendor/libsodium/builds/msvc/properties/DebugLIB.props +1 -0
  15. data/vendor/libsodium/builds/msvc/properties/DebugLTCG.props +1 -0
  16. data/vendor/libsodium/builds/msvc/resource.rc +0 -0
  17. data/vendor/libsodium/builds/msvc/version.h +2 -2
  18. data/vendor/libsodium/builds/msvc/vs2010/libsodium.import.props +1 -1
  19. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +1 -1
  20. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +1 -1
  21. data/vendor/libsodium/builds/msvc/vs2010/test/test.vcxproj +0 -6
  22. data/vendor/libsodium/builds/msvc/vs2010/test/test.vcxproj.filters +0 -6
  23. data/vendor/libsodium/builds/msvc/vs2012/libsodium.import.props +1 -1
  24. data/vendor/libsodium/builds/msvc/vs2012/test/test.vcxproj +0 -6
  25. data/vendor/libsodium/builds/msvc/vs2012/test/test.vcxproj.filters +0 -6
  26. data/vendor/libsodium/builds/msvc/vs2013/libsodium.import.props +1 -1
  27. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +1 -1
  28. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +1 -1
  29. data/vendor/libsodium/builds/msvc/vs2013/test/test.vcxproj +0 -6
  30. data/vendor/libsodium/builds/msvc/vs2013/test/test.vcxproj.filters +0 -6
  31. data/vendor/libsodium/configure +47 -158
  32. data/vendor/libsodium/configure.ac +18 -7
  33. data/vendor/libsodium/dist-build/Makefile.in +1 -5
  34. data/vendor/libsodium/dist-build/emscripten.sh +4 -3
  35. data/vendor/libsodium/msvc-scripts/Makefile.in +1 -5
  36. data/vendor/libsodium/msvc-scripts/process.bat +2 -2
  37. data/vendor/libsodium/packaging/nuget/package.config +1 -1
  38. data/vendor/libsodium/packaging/nuget/package.nuspec +27 -25
  39. data/vendor/libsodium/packaging/nuget/package.targets +21 -21
  40. data/vendor/libsodium/src/Makefile.in +1 -5
  41. data/vendor/libsodium/src/libsodium/Makefile.am +49 -45
  42. data/vendor/libsodium/src/libsodium/Makefile.in +488 -488
  43. data/vendor/libsodium/src/libsodium/crypto_sign/crypto_sign.c +15 -0
  44. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/api.h +2 -0
  45. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +63 -35
  46. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c +61 -33
  47. data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes-table-be.h +4 -5
  48. data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes-table-le.h +4 -4
  49. data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes-table.h +7 -1
  50. data/vendor/libsodium/src/libsodium/include/Makefile.in +1 -5
  51. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign.h +10 -0
  52. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_ed25519.h +13 -0
  53. data/vendor/libsodium/test/Makefile.in +1 -5
  54. data/vendor/libsodium/test/default/Makefile.am +6 -2
  55. data/vendor/libsodium/test/default/Makefile.in +26 -72
  56. data/vendor/libsodium/test/default/box_easy2.c +17 -2
  57. data/vendor/libsodium/test/default/box_easy2.exp +1 -0
  58. data/vendor/libsodium/test/default/secretbox_easy2.c +7 -0
  59. data/vendor/libsodium/test/default/sign.c +28 -0
  60. metadata +4 -2
@@ -12,10 +12,12 @@ unsigned char alicepk[crypto_box_PUBLICKEYBYTES];
12
12
  unsigned char alicesk[crypto_box_SECRETKEYBYTES];
13
13
  unsigned char bobpk[crypto_box_PUBLICKEYBYTES];
14
14
  unsigned char bobsk[crypto_box_SECRETKEYBYTES];
15
+ unsigned char mac[crypto_box_MACBYTES];
15
16
 
16
17
  int main(void)
17
18
  {
18
19
  unsigned long long mlen;
20
+ unsigned long long i;
19
21
 
20
22
  crypto_box_keypair(alicepk, alicesk);
21
23
  crypto_box_keypair(bobpk, bobsk);
@@ -23,8 +25,21 @@ int main(void)
23
25
  randombytes_buf(m, mlen);
24
26
  randombytes_buf(nonce, sizeof nonce);
25
27
  crypto_box_easy(c, m, mlen, nonce, bobpk, alicesk);
26
- crypto_box_open_easy(m2, c, mlen + crypto_box_MACBYTES,
27
- nonce, alicepk, bobsk);
28
+ if (crypto_box_open_easy(m2, c, mlen + crypto_box_MACBYTES,
29
+ nonce, alicepk, bobsk) != 0) {
30
+ printf("open() failed");
31
+ return 1;
32
+ }
33
+ printf("%d\n", memcmp(m, m2, mlen));
34
+
35
+ for (i = 0; i < mlen + crypto_box_MACBYTES - 1; i++) {
36
+ if (crypto_box_open_easy(m2, c, i, nonce, alicepk, bobsk) == 0) {
37
+ printf("short open() should have failed");
38
+ return 1;
39
+ }
40
+ }
41
+ crypto_box_detached(c, mac, m, mlen, nonce, bobsk, alicepk);
42
+ crypto_box_open_detached(m2, c, mac, mlen, nonce, alicepk, bobsk);
28
43
  printf("%d\n", memcmp(m, m2, mlen));
29
44
 
30
45
  return 0;
@@ -14,6 +14,7 @@ unsigned char mac[crypto_secretbox_MACBYTES];
14
14
  int main(void)
15
15
  {
16
16
  unsigned long long mlen;
17
+ unsigned long long i;
17
18
 
18
19
  randombytes_buf(k, sizeof k);
19
20
  mlen = (unsigned long long) randombytes_uniform((uint32_t) sizeof m);
@@ -24,6 +25,12 @@ int main(void)
24
25
  nonce, k);
25
26
  printf("%d\n", memcmp(m, m2, mlen));
26
27
 
28
+ for (i = 0; i < mlen + crypto_secretbox_MACBYTES - 1; i++) {
29
+ if (crypto_secretbox_open_easy(m2, c, i, nonce, k) == 0) {
30
+ printf("short open() should have failed");
31
+ return 1;
32
+ }
33
+ }
27
34
  crypto_secretbox_detached(c, mac, m, mlen, nonce, k);
28
35
  crypto_secretbox_open_detached(m2, c, mac, mlen, nonce, k);
29
36
  printf("%d\n", memcmp(m, m2, mlen));
@@ -1052,6 +1052,7 @@ static TestData test_data[] = {
1052
1052
 
1053
1053
  int main(void)
1054
1054
  {
1055
+ unsigned char sig[crypto_sign_BYTES];
1055
1056
  unsigned char sm[1024 + crypto_sign_BYTES];
1056
1057
  unsigned char m[1024];
1057
1058
  unsigned char skpk[crypto_sign_SECRETKEYBYTES +
@@ -1060,6 +1061,7 @@ int main(void)
1060
1061
  unsigned char sk[crypto_sign_SECRETKEYBYTES];
1061
1062
  char pk_hex[crypto_sign_PUBLICKEYBYTES * 2 + 1];
1062
1063
  char sk_hex[crypto_sign_SECRETKEYBYTES * 2 + 1];
1064
+ unsigned long long siglen;
1063
1065
  unsigned long long smlen;
1064
1066
  unsigned long long mlen;
1065
1067
  unsigned int i;
@@ -1090,6 +1092,32 @@ int main(void)
1090
1092
  printf("message can be forged: [%u]\n", i);
1091
1093
  continue;
1092
1094
  }
1095
+ if (crypto_sign_open(m, &mlen, sm, i % crypto_sign_BYTES,
1096
+ test_data[i].pk) == 0) {
1097
+ printf("short signed message verifies: [%u]\n",
1098
+ i % crypto_sign_BYTES);
1099
+ continue;
1100
+ }
1101
+ if (crypto_sign_detached(sig, &siglen,
1102
+ (const unsigned char *) test_data[i].m, i,
1103
+ test_data[i].sk) != 0) {
1104
+ printf("detached signature failed: [%u]\n", i);
1105
+ continue;
1106
+ }
1107
+ if (siglen == 0U || siglen > crypto_sign_BYTES) {
1108
+ printf("detached signature has an unexpected length");
1109
+ continue;
1110
+ }
1111
+ if (memcmp(test_data[i].sig, sig, crypto_sign_BYTES) != 0) {
1112
+ printf("detached signature failure: [%u]\n", i);
1113
+ continue;
1114
+ }
1115
+ if (crypto_sign_verify_detached(sig,
1116
+ (const unsigned char *) test_data[i].m,
1117
+ i, test_data[i].pk) != 0) {
1118
+ printf("detached signature verification failed: [%u]\n", i);
1119
+ continue;
1120
+ }
1093
1121
  }
1094
1122
  printf("%u tests\n", i);
1095
1123
 
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: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artiom Di
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-03 00:00:00.000000000 Z
11
+ date: 2014-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbnacl
@@ -90,10 +90,12 @@ files:
90
90
  - vendor/libsodium/autom4te.cache/output.0
91
91
  - vendor/libsodium/autom4te.cache/output.1
92
92
  - vendor/libsodium/autom4te.cache/output.2
93
+ - vendor/libsodium/autom4te.cache/output.3
93
94
  - vendor/libsodium/autom4te.cache/requests
94
95
  - vendor/libsodium/autom4te.cache/traces.0
95
96
  - vendor/libsodium/autom4te.cache/traces.1
96
97
  - vendor/libsodium/autom4te.cache/traces.2
98
+ - vendor/libsodium/autom4te.cache/traces.3
97
99
  - vendor/libsodium/builds/msvc/build/buildall.bat
98
100
  - vendor/libsodium/builds/msvc/build/buildbase.bat
99
101
  - vendor/libsodium/builds/msvc/properties/Common.props