ring-native 0.0.0 → 0.1.0

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.
Files changed (267) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGES.md +7 -0
  4. data/Makefile +5 -0
  5. data/README.md +12 -5
  6. data/Rakefile +4 -0
  7. data/ext/ring/extconf.rb +4 -5
  8. data/lib/ring/native.rb +3 -1
  9. data/lib/ring/native/version.rb +5 -1
  10. data/ring-native.gemspec +6 -6
  11. data/vendor/ring-ffi/Cargo.lock +26 -0
  12. data/vendor/ring-ffi/Cargo.toml +45 -0
  13. data/vendor/ring-ffi/LICENSE +16 -0
  14. data/vendor/ring-ffi/README.md +59 -0
  15. data/vendor/ring-ffi/src/lib.rs +79 -0
  16. metadata +10 -255
  17. data/vendor/ring/BUILDING.md +0 -40
  18. data/vendor/ring/Cargo.toml +0 -43
  19. data/vendor/ring/LICENSE +0 -185
  20. data/vendor/ring/Makefile +0 -35
  21. data/vendor/ring/PORTING.md +0 -163
  22. data/vendor/ring/README.md +0 -113
  23. data/vendor/ring/STYLE.md +0 -197
  24. data/vendor/ring/appveyor.yml +0 -27
  25. data/vendor/ring/build.rs +0 -108
  26. data/vendor/ring/crypto/aes/aes.c +0 -1142
  27. data/vendor/ring/crypto/aes/aes_test.Windows.vcxproj +0 -25
  28. data/vendor/ring/crypto/aes/aes_test.cc +0 -93
  29. data/vendor/ring/crypto/aes/asm/aes-586.pl +0 -2368
  30. data/vendor/ring/crypto/aes/asm/aes-armv4.pl +0 -1249
  31. data/vendor/ring/crypto/aes/asm/aes-x86_64.pl +0 -2246
  32. data/vendor/ring/crypto/aes/asm/aesni-x86.pl +0 -1318
  33. data/vendor/ring/crypto/aes/asm/aesni-x86_64.pl +0 -2084
  34. data/vendor/ring/crypto/aes/asm/aesv8-armx.pl +0 -675
  35. data/vendor/ring/crypto/aes/asm/bsaes-armv7.pl +0 -1364
  36. data/vendor/ring/crypto/aes/asm/bsaes-x86_64.pl +0 -1565
  37. data/vendor/ring/crypto/aes/asm/vpaes-x86.pl +0 -841
  38. data/vendor/ring/crypto/aes/asm/vpaes-x86_64.pl +0 -1116
  39. data/vendor/ring/crypto/aes/internal.h +0 -87
  40. data/vendor/ring/crypto/aes/mode_wrappers.c +0 -61
  41. data/vendor/ring/crypto/bn/add.c +0 -394
  42. data/vendor/ring/crypto/bn/asm/armv4-mont.pl +0 -694
  43. data/vendor/ring/crypto/bn/asm/armv8-mont.pl +0 -1503
  44. data/vendor/ring/crypto/bn/asm/bn-586.pl +0 -774
  45. data/vendor/ring/crypto/bn/asm/co-586.pl +0 -287
  46. data/vendor/ring/crypto/bn/asm/rsaz-avx2.pl +0 -1882
  47. data/vendor/ring/crypto/bn/asm/x86-mont.pl +0 -592
  48. data/vendor/ring/crypto/bn/asm/x86_64-gcc.c +0 -599
  49. data/vendor/ring/crypto/bn/asm/x86_64-mont.pl +0 -1393
  50. data/vendor/ring/crypto/bn/asm/x86_64-mont5.pl +0 -3507
  51. data/vendor/ring/crypto/bn/bn.c +0 -352
  52. data/vendor/ring/crypto/bn/bn_asn1.c +0 -74
  53. data/vendor/ring/crypto/bn/bn_test.Windows.vcxproj +0 -25
  54. data/vendor/ring/crypto/bn/bn_test.cc +0 -1696
  55. data/vendor/ring/crypto/bn/cmp.c +0 -200
  56. data/vendor/ring/crypto/bn/convert.c +0 -433
  57. data/vendor/ring/crypto/bn/ctx.c +0 -311
  58. data/vendor/ring/crypto/bn/div.c +0 -594
  59. data/vendor/ring/crypto/bn/exponentiation.c +0 -1335
  60. data/vendor/ring/crypto/bn/gcd.c +0 -711
  61. data/vendor/ring/crypto/bn/generic.c +0 -1019
  62. data/vendor/ring/crypto/bn/internal.h +0 -316
  63. data/vendor/ring/crypto/bn/montgomery.c +0 -516
  64. data/vendor/ring/crypto/bn/mul.c +0 -888
  65. data/vendor/ring/crypto/bn/prime.c +0 -829
  66. data/vendor/ring/crypto/bn/random.c +0 -334
  67. data/vendor/ring/crypto/bn/rsaz_exp.c +0 -262
  68. data/vendor/ring/crypto/bn/rsaz_exp.h +0 -53
  69. data/vendor/ring/crypto/bn/shift.c +0 -276
  70. data/vendor/ring/crypto/bytestring/bytestring_test.Windows.vcxproj +0 -25
  71. data/vendor/ring/crypto/bytestring/bytestring_test.cc +0 -421
  72. data/vendor/ring/crypto/bytestring/cbb.c +0 -399
  73. data/vendor/ring/crypto/bytestring/cbs.c +0 -227
  74. data/vendor/ring/crypto/bytestring/internal.h +0 -46
  75. data/vendor/ring/crypto/chacha/chacha_generic.c +0 -140
  76. data/vendor/ring/crypto/chacha/chacha_vec.c +0 -323
  77. data/vendor/ring/crypto/chacha/chacha_vec_arm.S +0 -1447
  78. data/vendor/ring/crypto/chacha/chacha_vec_arm_generate.go +0 -153
  79. data/vendor/ring/crypto/cipher/cipher_test.Windows.vcxproj +0 -25
  80. data/vendor/ring/crypto/cipher/e_aes.c +0 -390
  81. data/vendor/ring/crypto/cipher/e_chacha20poly1305.c +0 -208
  82. data/vendor/ring/crypto/cipher/internal.h +0 -173
  83. data/vendor/ring/crypto/cipher/test/aes_128_gcm_tests.txt +0 -543
  84. data/vendor/ring/crypto/cipher/test/aes_128_key_wrap_tests.txt +0 -9
  85. data/vendor/ring/crypto/cipher/test/aes_256_gcm_tests.txt +0 -475
  86. data/vendor/ring/crypto/cipher/test/aes_256_key_wrap_tests.txt +0 -23
  87. data/vendor/ring/crypto/cipher/test/chacha20_poly1305_old_tests.txt +0 -422
  88. data/vendor/ring/crypto/cipher/test/chacha20_poly1305_tests.txt +0 -484
  89. data/vendor/ring/crypto/cipher/test/cipher_test.txt +0 -100
  90. data/vendor/ring/crypto/constant_time_test.Windows.vcxproj +0 -25
  91. data/vendor/ring/crypto/constant_time_test.c +0 -304
  92. data/vendor/ring/crypto/cpu-arm-asm.S +0 -32
  93. data/vendor/ring/crypto/cpu-arm.c +0 -199
  94. data/vendor/ring/crypto/cpu-intel.c +0 -261
  95. data/vendor/ring/crypto/crypto.c +0 -151
  96. data/vendor/ring/crypto/curve25519/asm/x25519-arm.S +0 -2118
  97. data/vendor/ring/crypto/curve25519/curve25519.c +0 -4888
  98. data/vendor/ring/crypto/curve25519/x25519_test.cc +0 -128
  99. data/vendor/ring/crypto/digest/md32_common.h +0 -181
  100. data/vendor/ring/crypto/ec/asm/p256-x86_64-asm.pl +0 -2725
  101. data/vendor/ring/crypto/ec/ec.c +0 -193
  102. data/vendor/ring/crypto/ec/ec_curves.c +0 -61
  103. data/vendor/ring/crypto/ec/ec_key.c +0 -228
  104. data/vendor/ring/crypto/ec/ec_montgomery.c +0 -114
  105. data/vendor/ring/crypto/ec/example_mul.Windows.vcxproj +0 -25
  106. data/vendor/ring/crypto/ec/internal.h +0 -243
  107. data/vendor/ring/crypto/ec/oct.c +0 -253
  108. data/vendor/ring/crypto/ec/p256-64.c +0 -1794
  109. data/vendor/ring/crypto/ec/p256-x86_64-table.h +0 -9548
  110. data/vendor/ring/crypto/ec/p256-x86_64.c +0 -509
  111. data/vendor/ring/crypto/ec/simple.c +0 -1007
  112. data/vendor/ring/crypto/ec/util-64.c +0 -183
  113. data/vendor/ring/crypto/ec/wnaf.c +0 -508
  114. data/vendor/ring/crypto/ecdh/ecdh.c +0 -155
  115. data/vendor/ring/crypto/ecdsa/ecdsa.c +0 -304
  116. data/vendor/ring/crypto/ecdsa/ecdsa_asn1.c +0 -193
  117. data/vendor/ring/crypto/ecdsa/ecdsa_test.Windows.vcxproj +0 -25
  118. data/vendor/ring/crypto/ecdsa/ecdsa_test.cc +0 -327
  119. data/vendor/ring/crypto/header_removed.h +0 -17
  120. data/vendor/ring/crypto/internal.h +0 -495
  121. data/vendor/ring/crypto/libring.Windows.vcxproj +0 -101
  122. data/vendor/ring/crypto/mem.c +0 -98
  123. data/vendor/ring/crypto/modes/asm/aesni-gcm-x86_64.pl +0 -1045
  124. data/vendor/ring/crypto/modes/asm/ghash-armv4.pl +0 -517
  125. data/vendor/ring/crypto/modes/asm/ghash-x86.pl +0 -1393
  126. data/vendor/ring/crypto/modes/asm/ghash-x86_64.pl +0 -1741
  127. data/vendor/ring/crypto/modes/asm/ghashv8-armx.pl +0 -422
  128. data/vendor/ring/crypto/modes/ctr.c +0 -226
  129. data/vendor/ring/crypto/modes/gcm.c +0 -1206
  130. data/vendor/ring/crypto/modes/gcm_test.Windows.vcxproj +0 -25
  131. data/vendor/ring/crypto/modes/gcm_test.c +0 -348
  132. data/vendor/ring/crypto/modes/internal.h +0 -299
  133. data/vendor/ring/crypto/perlasm/arm-xlate.pl +0 -170
  134. data/vendor/ring/crypto/perlasm/readme +0 -100
  135. data/vendor/ring/crypto/perlasm/x86_64-xlate.pl +0 -1164
  136. data/vendor/ring/crypto/perlasm/x86asm.pl +0 -292
  137. data/vendor/ring/crypto/perlasm/x86gas.pl +0 -263
  138. data/vendor/ring/crypto/perlasm/x86masm.pl +0 -200
  139. data/vendor/ring/crypto/perlasm/x86nasm.pl +0 -187
  140. data/vendor/ring/crypto/poly1305/poly1305.c +0 -331
  141. data/vendor/ring/crypto/poly1305/poly1305_arm.c +0 -301
  142. data/vendor/ring/crypto/poly1305/poly1305_arm_asm.S +0 -2015
  143. data/vendor/ring/crypto/poly1305/poly1305_test.Windows.vcxproj +0 -25
  144. data/vendor/ring/crypto/poly1305/poly1305_test.cc +0 -80
  145. data/vendor/ring/crypto/poly1305/poly1305_test.txt +0 -52
  146. data/vendor/ring/crypto/poly1305/poly1305_vec.c +0 -892
  147. data/vendor/ring/crypto/rand/asm/rdrand-x86_64.pl +0 -75
  148. data/vendor/ring/crypto/rand/internal.h +0 -32
  149. data/vendor/ring/crypto/rand/rand.c +0 -189
  150. data/vendor/ring/crypto/rand/urandom.c +0 -219
  151. data/vendor/ring/crypto/rand/windows.c +0 -56
  152. data/vendor/ring/crypto/refcount_c11.c +0 -66
  153. data/vendor/ring/crypto/refcount_lock.c +0 -53
  154. data/vendor/ring/crypto/refcount_test.Windows.vcxproj +0 -25
  155. data/vendor/ring/crypto/refcount_test.c +0 -58
  156. data/vendor/ring/crypto/rsa/blinding.c +0 -462
  157. data/vendor/ring/crypto/rsa/internal.h +0 -108
  158. data/vendor/ring/crypto/rsa/padding.c +0 -300
  159. data/vendor/ring/crypto/rsa/rsa.c +0 -450
  160. data/vendor/ring/crypto/rsa/rsa_asn1.c +0 -261
  161. data/vendor/ring/crypto/rsa/rsa_impl.c +0 -944
  162. data/vendor/ring/crypto/rsa/rsa_test.Windows.vcxproj +0 -25
  163. data/vendor/ring/crypto/rsa/rsa_test.cc +0 -437
  164. data/vendor/ring/crypto/sha/asm/sha-armv8.pl +0 -436
  165. data/vendor/ring/crypto/sha/asm/sha-x86_64.pl +0 -2390
  166. data/vendor/ring/crypto/sha/asm/sha256-586.pl +0 -1275
  167. data/vendor/ring/crypto/sha/asm/sha256-armv4.pl +0 -735
  168. data/vendor/ring/crypto/sha/asm/sha256-armv8.pl +0 -14
  169. data/vendor/ring/crypto/sha/asm/sha256-x86_64.pl +0 -14
  170. data/vendor/ring/crypto/sha/asm/sha512-586.pl +0 -911
  171. data/vendor/ring/crypto/sha/asm/sha512-armv4.pl +0 -666
  172. data/vendor/ring/crypto/sha/asm/sha512-armv8.pl +0 -14
  173. data/vendor/ring/crypto/sha/asm/sha512-x86_64.pl +0 -14
  174. data/vendor/ring/crypto/sha/sha1.c +0 -271
  175. data/vendor/ring/crypto/sha/sha256.c +0 -204
  176. data/vendor/ring/crypto/sha/sha512.c +0 -355
  177. data/vendor/ring/crypto/test/file_test.cc +0 -326
  178. data/vendor/ring/crypto/test/file_test.h +0 -181
  179. data/vendor/ring/crypto/test/malloc.cc +0 -150
  180. data/vendor/ring/crypto/test/scoped_types.h +0 -95
  181. data/vendor/ring/crypto/test/test.Windows.vcxproj +0 -35
  182. data/vendor/ring/crypto/test/test_util.cc +0 -46
  183. data/vendor/ring/crypto/test/test_util.h +0 -41
  184. data/vendor/ring/crypto/thread_none.c +0 -55
  185. data/vendor/ring/crypto/thread_pthread.c +0 -165
  186. data/vendor/ring/crypto/thread_test.Windows.vcxproj +0 -25
  187. data/vendor/ring/crypto/thread_test.c +0 -200
  188. data/vendor/ring/crypto/thread_win.c +0 -282
  189. data/vendor/ring/examples/checkdigest.rs +0 -103
  190. data/vendor/ring/include/openssl/aes.h +0 -121
  191. data/vendor/ring/include/openssl/arm_arch.h +0 -129
  192. data/vendor/ring/include/openssl/base.h +0 -156
  193. data/vendor/ring/include/openssl/bn.h +0 -794
  194. data/vendor/ring/include/openssl/buffer.h +0 -18
  195. data/vendor/ring/include/openssl/bytestring.h +0 -235
  196. data/vendor/ring/include/openssl/chacha.h +0 -37
  197. data/vendor/ring/include/openssl/cmac.h +0 -76
  198. data/vendor/ring/include/openssl/cpu.h +0 -184
  199. data/vendor/ring/include/openssl/crypto.h +0 -43
  200. data/vendor/ring/include/openssl/curve25519.h +0 -88
  201. data/vendor/ring/include/openssl/ec.h +0 -225
  202. data/vendor/ring/include/openssl/ec_key.h +0 -129
  203. data/vendor/ring/include/openssl/ecdh.h +0 -110
  204. data/vendor/ring/include/openssl/ecdsa.h +0 -156
  205. data/vendor/ring/include/openssl/err.h +0 -201
  206. data/vendor/ring/include/openssl/mem.h +0 -101
  207. data/vendor/ring/include/openssl/obj_mac.h +0 -71
  208. data/vendor/ring/include/openssl/opensslfeatures.h +0 -68
  209. data/vendor/ring/include/openssl/opensslv.h +0 -18
  210. data/vendor/ring/include/openssl/ossl_typ.h +0 -18
  211. data/vendor/ring/include/openssl/poly1305.h +0 -51
  212. data/vendor/ring/include/openssl/rand.h +0 -70
  213. data/vendor/ring/include/openssl/rsa.h +0 -399
  214. data/vendor/ring/include/openssl/thread.h +0 -133
  215. data/vendor/ring/include/openssl/type_check.h +0 -71
  216. data/vendor/ring/mk/Common.props +0 -63
  217. data/vendor/ring/mk/Windows.props +0 -42
  218. data/vendor/ring/mk/WindowsTest.props +0 -18
  219. data/vendor/ring/mk/appveyor.bat +0 -62
  220. data/vendor/ring/mk/bottom_of_makefile.mk +0 -54
  221. data/vendor/ring/mk/ring.mk +0 -266
  222. data/vendor/ring/mk/top_of_makefile.mk +0 -214
  223. data/vendor/ring/mk/travis.sh +0 -40
  224. data/vendor/ring/mk/update-travis-yml.py +0 -229
  225. data/vendor/ring/ring.sln +0 -153
  226. data/vendor/ring/src/aead.rs +0 -682
  227. data/vendor/ring/src/agreement.rs +0 -248
  228. data/vendor/ring/src/c.rs +0 -129
  229. data/vendor/ring/src/constant_time.rs +0 -37
  230. data/vendor/ring/src/der.rs +0 -96
  231. data/vendor/ring/src/digest.rs +0 -690
  232. data/vendor/ring/src/digest_tests.txt +0 -57
  233. data/vendor/ring/src/ecc.rs +0 -28
  234. data/vendor/ring/src/ecc_build.rs +0 -279
  235. data/vendor/ring/src/ecc_curves.rs +0 -117
  236. data/vendor/ring/src/ed25519_tests.txt +0 -2579
  237. data/vendor/ring/src/exe_tests.rs +0 -46
  238. data/vendor/ring/src/ffi.rs +0 -29
  239. data/vendor/ring/src/file_test.rs +0 -187
  240. data/vendor/ring/src/hkdf.rs +0 -153
  241. data/vendor/ring/src/hkdf_tests.txt +0 -59
  242. data/vendor/ring/src/hmac.rs +0 -414
  243. data/vendor/ring/src/hmac_tests.txt +0 -97
  244. data/vendor/ring/src/input.rs +0 -312
  245. data/vendor/ring/src/lib.rs +0 -41
  246. data/vendor/ring/src/pbkdf2.rs +0 -265
  247. data/vendor/ring/src/pbkdf2_tests.txt +0 -113
  248. data/vendor/ring/src/polyfill.rs +0 -57
  249. data/vendor/ring/src/rand.rs +0 -28
  250. data/vendor/ring/src/signature.rs +0 -314
  251. data/vendor/ring/third-party/NIST/README.md +0 -9
  252. data/vendor/ring/third-party/NIST/SHAVS/SHA1LongMsg.rsp +0 -263
  253. data/vendor/ring/third-party/NIST/SHAVS/SHA1Monte.rsp +0 -309
  254. data/vendor/ring/third-party/NIST/SHAVS/SHA1ShortMsg.rsp +0 -267
  255. data/vendor/ring/third-party/NIST/SHAVS/SHA224LongMsg.rsp +0 -263
  256. data/vendor/ring/third-party/NIST/SHAVS/SHA224Monte.rsp +0 -309
  257. data/vendor/ring/third-party/NIST/SHAVS/SHA224ShortMsg.rsp +0 -267
  258. data/vendor/ring/third-party/NIST/SHAVS/SHA256LongMsg.rsp +0 -263
  259. data/vendor/ring/third-party/NIST/SHAVS/SHA256Monte.rsp +0 -309
  260. data/vendor/ring/third-party/NIST/SHAVS/SHA256ShortMsg.rsp +0 -267
  261. data/vendor/ring/third-party/NIST/SHAVS/SHA384LongMsg.rsp +0 -519
  262. data/vendor/ring/third-party/NIST/SHAVS/SHA384Monte.rsp +0 -309
  263. data/vendor/ring/third-party/NIST/SHAVS/SHA384ShortMsg.rsp +0 -523
  264. data/vendor/ring/third-party/NIST/SHAVS/SHA512LongMsg.rsp +0 -519
  265. data/vendor/ring/third-party/NIST/SHAVS/SHA512Monte.rsp +0 -309
  266. data/vendor/ring/third-party/NIST/SHAVS/SHA512ShortMsg.rsp +0 -523
  267. data/vendor/ring/third-party/NIST/sha256sums.txt +0 -1
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env perl
2
- #
3
- # ====================================================================
4
- # Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
5
- # project. Rights for redistribution and usage in source and binary
6
- # forms are granted according to the OpenSSL license.
7
- # ====================================================================
8
-
9
- push @ARGV, 'sha512';
10
-
11
- $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
12
- push(@INC,"${dir}");
13
-
14
- do "sha-x86_64.pl" or die "failed to run sha-armv8.pl: $@";
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env perl
2
- #
3
- # ====================================================================
4
- # Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
5
- # project. Rights for redistribution and usage in source and binary
6
- # forms are granted according to the OpenSSL license.
7
- # ====================================================================
8
-
9
- push @ARGV, 'sha512';
10
-
11
- $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
12
- push(@INC,"${dir}");
13
-
14
- do "sha-x86_64.pl" or die "failed to run sha-x86_64.pl: $@";
@@ -1,271 +0,0 @@
1
- /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
2
- * All rights reserved.
3
- *
4
- * This package is an SSL implementation written
5
- * by Eric Young (eay@cryptsoft.com).
6
- * The implementation was written so as to conform with Netscapes SSL.
7
- *
8
- * This library is free for commercial and non-commercial use as long as
9
- * the following conditions are aheared to. The following conditions
10
- * apply to all code found in this distribution, be it the RC4, RSA,
11
- * lhash, DES, etc., code; not just the SSL code. The SSL documentation
12
- * included with this distribution is covered by the same copyright terms
13
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
14
- *
15
- * Copyright remains Eric Young's, and as such any Copyright notices in
16
- * the code are not to be removed.
17
- * If this package is used in a product, Eric Young should be given attribution
18
- * as the author of the parts of the library used.
19
- * This can be in the form of a textual message at program startup or
20
- * in documentation (online or textual) provided with the package.
21
- *
22
- * Redistribution and use in source and binary forms, with or without
23
- * modification, are permitted provided that the following conditions
24
- * are met:
25
- * 1. Redistributions of source code must retain the copyright
26
- * notice, this list of conditions and the following disclaimer.
27
- * 2. Redistributions in binary form must reproduce the above copyright
28
- * notice, this list of conditions and the following disclaimer in the
29
- * documentation and/or other materials provided with the distribution.
30
- * 3. All advertising materials mentioning features or use of this software
31
- * must display the following acknowledgement:
32
- * "This product includes cryptographic software written by
33
- * Eric Young (eay@cryptsoft.com)"
34
- * The word 'cryptographic' can be left out if the rouines from the library
35
- * being used are not cryptographic related :-).
36
- * 4. If you include any Windows specific code (or a derivative thereof) from
37
- * the apps directory (application code) you must include an acknowledgement:
38
- * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
39
- *
40
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
41
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
44
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50
- * SUCH DAMAGE.
51
- *
52
- * The licence and distribution terms for any publically available version or
53
- * derivative of this code cannot be changed. i.e. this code cannot simply be
54
- * copied and put under another distribution licence
55
- * [including the GNU Public Licence.] */
56
-
57
- #include "openssl/base.h"
58
-
59
-
60
- #define DATA_ORDER_IS_BIG_ENDIAN /* Required by md32_common.h. */
61
- #define HASH_CBLOCK 64
62
-
63
- #define Xupdate(a, ix, ia, ib, ic, id) \
64
- ((a) = (ia ^ ib ^ ic ^ id), ix = (a) = ROTATE((a), 1))
65
-
66
- #include "../digest/md32_common.h"
67
-
68
- #define K_00_19 0x5a827999UL
69
- #define K_20_39 0x6ed9eba1UL
70
- #define K_40_59 0x8f1bbcdcUL
71
- #define K_60_79 0xca62c1d6UL
72
-
73
- /* As pointed out by Wei Dai <weidai@eskimo.com>, F() below can be simplified
74
- * to the code in F_00_19. Wei attributes these optimisations to Peter
75
- * Gutmann's SHS code, and he attributes it to Rich Schroeppel. #define
76
- * F(x,y,z) (((x) & (y)) | ((~(x)) & (z))) I've just become aware of another
77
- * tweak to be made, again from Wei Dai, in F_40_59, (x&a)|(y&a) -> (x|y)&a */
78
- #define F_00_19(b, c, d) ((((c) ^ (d)) & (b)) ^ (d))
79
- #define F_20_39(b, c, d) ((b) ^ (c) ^ (d))
80
- #define F_40_59(b, c, d) (((b) & (c)) | (((b) | (c)) & (d)))
81
- #define F_60_79(b, c, d) F_20_39(b, c, d)
82
-
83
- #define BODY_00_15(i, a, b, c, d, e, f, xi) \
84
- (f) = xi + (e) + K_00_19 + ROTATE((a), 5) + F_00_19((b), (c), (d)); \
85
- (b) = ROTATE((b), 30);
86
-
87
- #define BODY_16_19(i, a, b, c, d, e, f, xi, xa, xb, xc, xd) \
88
- Xupdate(f, xi, xa, xb, xc, xd); \
89
- (f) += (e) + K_00_19 + ROTATE((a), 5) + F_00_19((b), (c), (d)); \
90
- (b) = ROTATE((b), 30);
91
-
92
- #define BODY_20_31(i, a, b, c, d, e, f, xi, xa, xb, xc, xd) \
93
- Xupdate(f, xi, xa, xb, xc, xd); \
94
- (f) += (e) + K_20_39 + ROTATE((a), 5) + F_20_39((b), (c), (d)); \
95
- (b) = ROTATE((b), 30);
96
-
97
- #define BODY_32_39(i, a, b, c, d, e, f, xa, xb, xc, xd) \
98
- Xupdate(f, xa, xa, xb, xc, xd); \
99
- (f) += (e) + K_20_39 + ROTATE((a), 5) + F_20_39((b), (c), (d)); \
100
- (b) = ROTATE((b), 30);
101
-
102
- #define BODY_40_59(i, a, b, c, d, e, f, xa, xb, xc, xd) \
103
- Xupdate(f, xa, xa, xb, xc, xd); \
104
- (f) += (e) + K_40_59 + ROTATE((a), 5) + F_40_59((b), (c), (d)); \
105
- (b) = ROTATE((b), 30);
106
-
107
- #define BODY_60_79(i, a, b, c, d, e, f, xa, xb, xc, xd) \
108
- Xupdate(f, xa, xa, xb, xc, xd); \
109
- (f) = xa + (e) + K_60_79 + ROTATE((a), 5) + F_60_79((b), (c), (d)); \
110
- (b) = ROTATE((b), 30);
111
-
112
- #ifdef X
113
- #undef X
114
- #endif
115
-
116
- /* Originally X was an array. As it's automatic it's natural
117
- * to expect RISC compiler to accomodate at least part of it in
118
- * the register bank, isn't it? Unfortunately not all compilers
119
- * "find" this expectation reasonable:-( On order to make such
120
- * compilers generate better code I replace X[] with a bunch of
121
- * X0, X1, etc. See the function body below...
122
- * <appro@fy.chalmers.se> */
123
- #define X(i) XX##i
124
-
125
- void sha1_block_data_order(uint32_t *state, const uint8_t *data, size_t num) {
126
- register uint32_t A, B, C, D, E, T, l;
127
- uint32_t XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, XX8, XX9, XX10,
128
- XX11, XX12, XX13, XX14, XX15;
129
-
130
- A = state[0];
131
- B = state[1];
132
- C = state[2];
133
- D = state[3];
134
- E = state[4];
135
-
136
- for (;;) {
137
- (void)HOST_c2l(data, l);
138
- X(0) = l;
139
- (void)HOST_c2l(data, l);
140
- X(1) = l;
141
- BODY_00_15(0, A, B, C, D, E, T, X(0));
142
- (void)HOST_c2l(data, l);
143
- X(2) = l;
144
- BODY_00_15(1, T, A, B, C, D, E, X(1));
145
- (void)HOST_c2l(data, l);
146
- X(3) = l;
147
- BODY_00_15(2, E, T, A, B, C, D, X(2));
148
- (void)HOST_c2l(data, l);
149
- X(4) = l;
150
- BODY_00_15(3, D, E, T, A, B, C, X(3));
151
- (void)HOST_c2l(data, l);
152
- X(5) = l;
153
- BODY_00_15(4, C, D, E, T, A, B, X(4));
154
- (void)HOST_c2l(data, l);
155
- X(6) = l;
156
- BODY_00_15(5, B, C, D, E, T, A, X(5));
157
- (void)HOST_c2l(data, l);
158
- X(7) = l;
159
- BODY_00_15(6, A, B, C, D, E, T, X(6));
160
- (void)HOST_c2l(data, l);
161
- X(8) = l;
162
- BODY_00_15(7, T, A, B, C, D, E, X(7));
163
- (void)HOST_c2l(data, l);
164
- X(9) = l;
165
- BODY_00_15(8, E, T, A, B, C, D, X(8));
166
- (void)HOST_c2l(data, l);
167
- X(10) = l;
168
- BODY_00_15(9, D, E, T, A, B, C, X(9));
169
- (void)HOST_c2l(data, l);
170
- X(11) = l;
171
- BODY_00_15(10, C, D, E, T, A, B, X(10));
172
- (void)HOST_c2l(data, l);
173
- X(12) = l;
174
- BODY_00_15(11, B, C, D, E, T, A, X(11));
175
- (void)HOST_c2l(data, l);
176
- X(13) = l;
177
- BODY_00_15(12, A, B, C, D, E, T, X(12));
178
- (void)HOST_c2l(data, l);
179
- X(14) = l;
180
- BODY_00_15(13, T, A, B, C, D, E, X(13));
181
- (void)HOST_c2l(data, l);
182
- X(15) = l;
183
- BODY_00_15(14, E, T, A, B, C, D, X(14));
184
- BODY_00_15(15, D, E, T, A, B, C, X(15));
185
-
186
- BODY_16_19(16, C, D, E, T, A, B, X(0), X(0), X(2), X(8), X(13));
187
- BODY_16_19(17, B, C, D, E, T, A, X(1), X(1), X(3), X(9), X(14));
188
- BODY_16_19(18, A, B, C, D, E, T, X(2), X(2), X(4), X(10), X(15));
189
- BODY_16_19(19, T, A, B, C, D, E, X(3), X(3), X(5), X(11), X(0));
190
-
191
- BODY_20_31(20, E, T, A, B, C, D, X(4), X(4), X(6), X(12), X(1));
192
- BODY_20_31(21, D, E, T, A, B, C, X(5), X(5), X(7), X(13), X(2));
193
- BODY_20_31(22, C, D, E, T, A, B, X(6), X(6), X(8), X(14), X(3));
194
- BODY_20_31(23, B, C, D, E, T, A, X(7), X(7), X(9), X(15), X(4));
195
- BODY_20_31(24, A, B, C, D, E, T, X(8), X(8), X(10), X(0), X(5));
196
- BODY_20_31(25, T, A, B, C, D, E, X(9), X(9), X(11), X(1), X(6));
197
- BODY_20_31(26, E, T, A, B, C, D, X(10), X(10), X(12), X(2), X(7));
198
- BODY_20_31(27, D, E, T, A, B, C, X(11), X(11), X(13), X(3), X(8));
199
- BODY_20_31(28, C, D, E, T, A, B, X(12), X(12), X(14), X(4), X(9));
200
- BODY_20_31(29, B, C, D, E, T, A, X(13), X(13), X(15), X(5), X(10));
201
- BODY_20_31(30, A, B, C, D, E, T, X(14), X(14), X(0), X(6), X(11));
202
- BODY_20_31(31, T, A, B, C, D, E, X(15), X(15), X(1), X(7), X(12));
203
-
204
- BODY_32_39(32, E, T, A, B, C, D, X(0), X(2), X(8), X(13));
205
- BODY_32_39(33, D, E, T, A, B, C, X(1), X(3), X(9), X(14));
206
- BODY_32_39(34, C, D, E, T, A, B, X(2), X(4), X(10), X(15));
207
- BODY_32_39(35, B, C, D, E, T, A, X(3), X(5), X(11), X(0));
208
- BODY_32_39(36, A, B, C, D, E, T, X(4), X(6), X(12), X(1));
209
- BODY_32_39(37, T, A, B, C, D, E, X(5), X(7), X(13), X(2));
210
- BODY_32_39(38, E, T, A, B, C, D, X(6), X(8), X(14), X(3));
211
- BODY_32_39(39, D, E, T, A, B, C, X(7), X(9), X(15), X(4));
212
-
213
- BODY_40_59(40, C, D, E, T, A, B, X(8), X(10), X(0), X(5));
214
- BODY_40_59(41, B, C, D, E, T, A, X(9), X(11), X(1), X(6));
215
- BODY_40_59(42, A, B, C, D, E, T, X(10), X(12), X(2), X(7));
216
- BODY_40_59(43, T, A, B, C, D, E, X(11), X(13), X(3), X(8));
217
- BODY_40_59(44, E, T, A, B, C, D, X(12), X(14), X(4), X(9));
218
- BODY_40_59(45, D, E, T, A, B, C, X(13), X(15), X(5), X(10));
219
- BODY_40_59(46, C, D, E, T, A, B, X(14), X(0), X(6), X(11));
220
- BODY_40_59(47, B, C, D, E, T, A, X(15), X(1), X(7), X(12));
221
- BODY_40_59(48, A, B, C, D, E, T, X(0), X(2), X(8), X(13));
222
- BODY_40_59(49, T, A, B, C, D, E, X(1), X(3), X(9), X(14));
223
- BODY_40_59(50, E, T, A, B, C, D, X(2), X(4), X(10), X(15));
224
- BODY_40_59(51, D, E, T, A, B, C, X(3), X(5), X(11), X(0));
225
- BODY_40_59(52, C, D, E, T, A, B, X(4), X(6), X(12), X(1));
226
- BODY_40_59(53, B, C, D, E, T, A, X(5), X(7), X(13), X(2));
227
- BODY_40_59(54, A, B, C, D, E, T, X(6), X(8), X(14), X(3));
228
- BODY_40_59(55, T, A, B, C, D, E, X(7), X(9), X(15), X(4));
229
- BODY_40_59(56, E, T, A, B, C, D, X(8), X(10), X(0), X(5));
230
- BODY_40_59(57, D, E, T, A, B, C, X(9), X(11), X(1), X(6));
231
- BODY_40_59(58, C, D, E, T, A, B, X(10), X(12), X(2), X(7));
232
- BODY_40_59(59, B, C, D, E, T, A, X(11), X(13), X(3), X(8));
233
-
234
- BODY_60_79(60, A, B, C, D, E, T, X(12), X(14), X(4), X(9));
235
- BODY_60_79(61, T, A, B, C, D, E, X(13), X(15), X(5), X(10));
236
- BODY_60_79(62, E, T, A, B, C, D, X(14), X(0), X(6), X(11));
237
- BODY_60_79(63, D, E, T, A, B, C, X(15), X(1), X(7), X(12));
238
- BODY_60_79(64, C, D, E, T, A, B, X(0), X(2), X(8), X(13));
239
- BODY_60_79(65, B, C, D, E, T, A, X(1), X(3), X(9), X(14));
240
- BODY_60_79(66, A, B, C, D, E, T, X(2), X(4), X(10), X(15));
241
- BODY_60_79(67, T, A, B, C, D, E, X(3), X(5), X(11), X(0));
242
- BODY_60_79(68, E, T, A, B, C, D, X(4), X(6), X(12), X(1));
243
- BODY_60_79(69, D, E, T, A, B, C, X(5), X(7), X(13), X(2));
244
- BODY_60_79(70, C, D, E, T, A, B, X(6), X(8), X(14), X(3));
245
- BODY_60_79(71, B, C, D, E, T, A, X(7), X(9), X(15), X(4));
246
- BODY_60_79(72, A, B, C, D, E, T, X(8), X(10), X(0), X(5));
247
- BODY_60_79(73, T, A, B, C, D, E, X(9), X(11), X(1), X(6));
248
- BODY_60_79(74, E, T, A, B, C, D, X(10), X(12), X(2), X(7));
249
- BODY_60_79(75, D, E, T, A, B, C, X(11), X(13), X(3), X(8));
250
- BODY_60_79(76, C, D, E, T, A, B, X(12), X(14), X(4), X(9));
251
- BODY_60_79(77, B, C, D, E, T, A, X(13), X(15), X(5), X(10));
252
- BODY_60_79(78, A, B, C, D, E, T, X(14), X(0), X(6), X(11));
253
- BODY_60_79(79, T, A, B, C, D, E, X(15), X(1), X(7), X(12));
254
-
255
- state[0] = (state[0] + E) & 0xffffffffL;
256
- state[1] = (state[1] + T) & 0xffffffffL;
257
- state[2] = (state[2] + A) & 0xffffffffL;
258
- state[3] = (state[3] + B) & 0xffffffffL;
259
- state[4] = (state[4] + C) & 0xffffffffL;
260
-
261
- if (--num == 0) {
262
- break;
263
- }
264
-
265
- A = state[0];
266
- B = state[1];
267
- C = state[2];
268
- D = state[3];
269
- E = state[4];
270
- }
271
- }
@@ -1,204 +0,0 @@
1
- /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
2
- * All rights reserved.
3
- *
4
- * This package is an SSL implementation written
5
- * by Eric Young (eay@cryptsoft.com).
6
- * The implementation was written so as to conform with Netscapes SSL.
7
- *
8
- * This library is free for commercial and non-commercial use as long as
9
- * the following conditions are aheared to. The following conditions
10
- * apply to all code found in this distribution, be it the RC4, RSA,
11
- * lhash, DES, etc., code; not just the SSL code. The SSL documentation
12
- * included with this distribution is covered by the same copyright terms
13
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
14
- *
15
- * Copyright remains Eric Young's, and as such any Copyright notices in
16
- * the code are not to be removed.
17
- * If this package is used in a product, Eric Young should be given attribution
18
- * as the author of the parts of the library used.
19
- * This can be in the form of a textual message at program startup or
20
- * in documentation (online or textual) provided with the package.
21
- *
22
- * Redistribution and use in source and binary forms, with or without
23
- * modification, are permitted provided that the following conditions
24
- * are met:
25
- * 1. Redistributions of source code must retain the copyright
26
- * notice, this list of conditions and the following disclaimer.
27
- * 2. Redistributions in binary form must reproduce the above copyright
28
- * notice, this list of conditions and the following disclaimer in the
29
- * documentation and/or other materials provided with the distribution.
30
- * 3. All advertising materials mentioning features or use of this software
31
- * must display the following acknowledgement:
32
- * "This product includes cryptographic software written by
33
- * Eric Young (eay@cryptsoft.com)"
34
- * The word 'cryptographic' can be left out if the rouines from the library
35
- * being used are not cryptographic related :-).
36
- * 4. If you include any Windows specific code (or a derivative thereof) from
37
- * the apps directory (application code) you must include an acknowledgement:
38
- * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
39
- *
40
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
41
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
44
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50
- * SUCH DAMAGE.
51
- *
52
- * The licence and distribution terms for any publically available version or
53
- * derivative of this code cannot be changed. i.e. this code cannot simply be
54
- * copied and put under another distribution licence
55
- * [including the GNU Public Licence.] */
56
-
57
- #include "openssl/base.h"
58
-
59
-
60
- #if !defined(OPENSSL_NO_ASM) && \
61
- (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \
62
- defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64))
63
- #define SHA256_ASM
64
- #endif
65
-
66
- #define DATA_ORDER_IS_BIG_ENDIAN /* Required by md32_common.h */
67
- #define HASH_CBLOCK 64
68
-
69
- #include "../digest/md32_common.h"
70
-
71
- #ifndef SHA256_ASM
72
- static const uint32_t K256[64] = {
73
- 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL,
74
- 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL,
75
- 0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL,
76
- 0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL,
77
- 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL,
78
- 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL,
79
- 0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL,
80
- 0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL,
81
- 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL,
82
- 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL,
83
- 0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL,
84
- 0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL,
85
- 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL};
86
-
87
- /* FIPS specification refers to right rotations, while our ROTATE macro
88
- * is left one. This is why you might notice that rotation coefficients
89
- * differ from those observed in FIPS document by 32-N... */
90
- #define Sigma0(x) (ROTATE((x), 30) ^ ROTATE((x), 19) ^ ROTATE((x), 10))
91
- #define Sigma1(x) (ROTATE((x), 26) ^ ROTATE((x), 21) ^ ROTATE((x), 7))
92
- #define sigma0(x) (ROTATE((x), 25) ^ ROTATE((x), 14) ^ ((x) >> 3))
93
- #define sigma1(x) (ROTATE((x), 15) ^ ROTATE((x), 13) ^ ((x) >> 10))
94
-
95
- #define Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z)))
96
- #define Maj(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
97
-
98
- #define ROUND_00_15(i, a, b, c, d, e, f, g, h) \
99
- do { \
100
- T1 += h + Sigma1(e) + Ch(e, f, g) + K256[i]; \
101
- h = Sigma0(a) + Maj(a, b, c); \
102
- d += T1; \
103
- h += T1; \
104
- } while (0)
105
-
106
- #define ROUND_16_63(i, a, b, c, d, e, f, g, h, X) \
107
- do { \
108
- s0 = X[(i + 1) & 0x0f]; \
109
- s0 = sigma0(s0); \
110
- s1 = X[(i + 14) & 0x0f]; \
111
- s1 = sigma1(s1); \
112
- T1 = X[(i) & 0x0f] += s0 + s1 + X[(i + 9) & 0x0f]; \
113
- ROUND_00_15(i, a, b, c, d, e, f, g, h); \
114
- } while (0)
115
-
116
- void sha256_block_data_order(uint32_t *state, const uint8_t *data, size_t num) {
117
- uint32_t a, b, c, d, e, f, g, h, s0, s1, T1;
118
- uint32_t X[16];
119
- int i;
120
-
121
- while (num--) {
122
- a = state[0];
123
- b = state[1];
124
- c = state[2];
125
- d = state[3];
126
- e = state[4];
127
- f = state[5];
128
- g = state[6];
129
- h = state[7];
130
-
131
- uint32_t l;
132
-
133
- HOST_c2l(data, l);
134
- T1 = X[0] = l;
135
- ROUND_00_15(0, a, b, c, d, e, f, g, h);
136
- HOST_c2l(data, l);
137
- T1 = X[1] = l;
138
- ROUND_00_15(1, h, a, b, c, d, e, f, g);
139
- HOST_c2l(data, l);
140
- T1 = X[2] = l;
141
- ROUND_00_15(2, g, h, a, b, c, d, e, f);
142
- HOST_c2l(data, l);
143
- T1 = X[3] = l;
144
- ROUND_00_15(3, f, g, h, a, b, c, d, e);
145
- HOST_c2l(data, l);
146
- T1 = X[4] = l;
147
- ROUND_00_15(4, e, f, g, h, a, b, c, d);
148
- HOST_c2l(data, l);
149
- T1 = X[5] = l;
150
- ROUND_00_15(5, d, e, f, g, h, a, b, c);
151
- HOST_c2l(data, l);
152
- T1 = X[6] = l;
153
- ROUND_00_15(6, c, d, e, f, g, h, a, b);
154
- HOST_c2l(data, l);
155
- T1 = X[7] = l;
156
- ROUND_00_15(7, b, c, d, e, f, g, h, a);
157
- HOST_c2l(data, l);
158
- T1 = X[8] = l;
159
- ROUND_00_15(8, a, b, c, d, e, f, g, h);
160
- HOST_c2l(data, l);
161
- T1 = X[9] = l;
162
- ROUND_00_15(9, h, a, b, c, d, e, f, g);
163
- HOST_c2l(data, l);
164
- T1 = X[10] = l;
165
- ROUND_00_15(10, g, h, a, b, c, d, e, f);
166
- HOST_c2l(data, l);
167
- T1 = X[11] = l;
168
- ROUND_00_15(11, f, g, h, a, b, c, d, e);
169
- HOST_c2l(data, l);
170
- T1 = X[12] = l;
171
- ROUND_00_15(12, e, f, g, h, a, b, c, d);
172
- HOST_c2l(data, l);
173
- T1 = X[13] = l;
174
- ROUND_00_15(13, d, e, f, g, h, a, b, c);
175
- HOST_c2l(data, l);
176
- T1 = X[14] = l;
177
- ROUND_00_15(14, c, d, e, f, g, h, a, b);
178
- HOST_c2l(data, l);
179
- T1 = X[15] = l;
180
- ROUND_00_15(15, b, c, d, e, f, g, h, a);
181
-
182
- for (i = 16; i < 64; i += 8) {
183
- ROUND_16_63(i + 0, a, b, c, d, e, f, g, h, X);
184
- ROUND_16_63(i + 1, h, a, b, c, d, e, f, g, X);
185
- ROUND_16_63(i + 2, g, h, a, b, c, d, e, f, X);
186
- ROUND_16_63(i + 3, f, g, h, a, b, c, d, e, X);
187
- ROUND_16_63(i + 4, e, f, g, h, a, b, c, d, X);
188
- ROUND_16_63(i + 5, d, e, f, g, h, a, b, c, X);
189
- ROUND_16_63(i + 6, c, d, e, f, g, h, a, b, X);
190
- ROUND_16_63(i + 7, b, c, d, e, f, g, h, a, X);
191
- }
192
-
193
- state[0] += a;
194
- state[1] += b;
195
- state[2] += c;
196
- state[3] += d;
197
- state[4] += e;
198
- state[5] += f;
199
- state[6] += g;
200
- state[7] += h;
201
- }
202
- }
203
-
204
- #endif /* SHA256_ASM */