ring-native 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/Gemfile +3 -0
- data/README.md +22 -0
- data/Rakefile +1 -0
- data/ext/ring/extconf.rb +29 -0
- data/lib/ring/native.rb +8 -0
- data/lib/ring/native/version.rb +5 -0
- data/ring-native.gemspec +25 -0
- data/vendor/ring/BUILDING.md +40 -0
- data/vendor/ring/Cargo.toml +43 -0
- data/vendor/ring/LICENSE +185 -0
- data/vendor/ring/Makefile +35 -0
- data/vendor/ring/PORTING.md +163 -0
- data/vendor/ring/README.md +113 -0
- data/vendor/ring/STYLE.md +197 -0
- data/vendor/ring/appveyor.yml +27 -0
- data/vendor/ring/build.rs +108 -0
- data/vendor/ring/crypto/aes/aes.c +1142 -0
- data/vendor/ring/crypto/aes/aes_test.Windows.vcxproj +25 -0
- data/vendor/ring/crypto/aes/aes_test.cc +93 -0
- data/vendor/ring/crypto/aes/asm/aes-586.pl +2368 -0
- data/vendor/ring/crypto/aes/asm/aes-armv4.pl +1249 -0
- data/vendor/ring/crypto/aes/asm/aes-x86_64.pl +2246 -0
- data/vendor/ring/crypto/aes/asm/aesni-x86.pl +1318 -0
- data/vendor/ring/crypto/aes/asm/aesni-x86_64.pl +2084 -0
- data/vendor/ring/crypto/aes/asm/aesv8-armx.pl +675 -0
- data/vendor/ring/crypto/aes/asm/bsaes-armv7.pl +1364 -0
- data/vendor/ring/crypto/aes/asm/bsaes-x86_64.pl +1565 -0
- data/vendor/ring/crypto/aes/asm/vpaes-x86.pl +841 -0
- data/vendor/ring/crypto/aes/asm/vpaes-x86_64.pl +1116 -0
- data/vendor/ring/crypto/aes/internal.h +87 -0
- data/vendor/ring/crypto/aes/mode_wrappers.c +61 -0
- data/vendor/ring/crypto/bn/add.c +394 -0
- data/vendor/ring/crypto/bn/asm/armv4-mont.pl +694 -0
- data/vendor/ring/crypto/bn/asm/armv8-mont.pl +1503 -0
- data/vendor/ring/crypto/bn/asm/bn-586.pl +774 -0
- data/vendor/ring/crypto/bn/asm/co-586.pl +287 -0
- data/vendor/ring/crypto/bn/asm/rsaz-avx2.pl +1882 -0
- data/vendor/ring/crypto/bn/asm/x86-mont.pl +592 -0
- data/vendor/ring/crypto/bn/asm/x86_64-gcc.c +599 -0
- data/vendor/ring/crypto/bn/asm/x86_64-mont.pl +1393 -0
- data/vendor/ring/crypto/bn/asm/x86_64-mont5.pl +3507 -0
- data/vendor/ring/crypto/bn/bn.c +352 -0
- data/vendor/ring/crypto/bn/bn_asn1.c +74 -0
- data/vendor/ring/crypto/bn/bn_test.Windows.vcxproj +25 -0
- data/vendor/ring/crypto/bn/bn_test.cc +1696 -0
- data/vendor/ring/crypto/bn/cmp.c +200 -0
- data/vendor/ring/crypto/bn/convert.c +433 -0
- data/vendor/ring/crypto/bn/ctx.c +311 -0
- data/vendor/ring/crypto/bn/div.c +594 -0
- data/vendor/ring/crypto/bn/exponentiation.c +1335 -0
- data/vendor/ring/crypto/bn/gcd.c +711 -0
- data/vendor/ring/crypto/bn/generic.c +1019 -0
- data/vendor/ring/crypto/bn/internal.h +316 -0
- data/vendor/ring/crypto/bn/montgomery.c +516 -0
- data/vendor/ring/crypto/bn/mul.c +888 -0
- data/vendor/ring/crypto/bn/prime.c +829 -0
- data/vendor/ring/crypto/bn/random.c +334 -0
- data/vendor/ring/crypto/bn/rsaz_exp.c +262 -0
- data/vendor/ring/crypto/bn/rsaz_exp.h +53 -0
- data/vendor/ring/crypto/bn/shift.c +276 -0
- data/vendor/ring/crypto/bytestring/bytestring_test.Windows.vcxproj +25 -0
- data/vendor/ring/crypto/bytestring/bytestring_test.cc +421 -0
- data/vendor/ring/crypto/bytestring/cbb.c +399 -0
- data/vendor/ring/crypto/bytestring/cbs.c +227 -0
- data/vendor/ring/crypto/bytestring/internal.h +46 -0
- data/vendor/ring/crypto/chacha/chacha_generic.c +140 -0
- data/vendor/ring/crypto/chacha/chacha_vec.c +323 -0
- data/vendor/ring/crypto/chacha/chacha_vec_arm.S +1447 -0
- data/vendor/ring/crypto/chacha/chacha_vec_arm_generate.go +153 -0
- data/vendor/ring/crypto/cipher/cipher_test.Windows.vcxproj +25 -0
- data/vendor/ring/crypto/cipher/e_aes.c +390 -0
- data/vendor/ring/crypto/cipher/e_chacha20poly1305.c +208 -0
- data/vendor/ring/crypto/cipher/internal.h +173 -0
- data/vendor/ring/crypto/cipher/test/aes_128_gcm_tests.txt +543 -0
- data/vendor/ring/crypto/cipher/test/aes_128_key_wrap_tests.txt +9 -0
- data/vendor/ring/crypto/cipher/test/aes_256_gcm_tests.txt +475 -0
- data/vendor/ring/crypto/cipher/test/aes_256_key_wrap_tests.txt +23 -0
- data/vendor/ring/crypto/cipher/test/chacha20_poly1305_old_tests.txt +422 -0
- data/vendor/ring/crypto/cipher/test/chacha20_poly1305_tests.txt +484 -0
- data/vendor/ring/crypto/cipher/test/cipher_test.txt +100 -0
- data/vendor/ring/crypto/constant_time_test.Windows.vcxproj +25 -0
- data/vendor/ring/crypto/constant_time_test.c +304 -0
- data/vendor/ring/crypto/cpu-arm-asm.S +32 -0
- data/vendor/ring/crypto/cpu-arm.c +199 -0
- data/vendor/ring/crypto/cpu-intel.c +261 -0
- data/vendor/ring/crypto/crypto.c +151 -0
- data/vendor/ring/crypto/curve25519/asm/x25519-arm.S +2118 -0
- data/vendor/ring/crypto/curve25519/curve25519.c +4888 -0
- data/vendor/ring/crypto/curve25519/x25519_test.cc +128 -0
- data/vendor/ring/crypto/digest/md32_common.h +181 -0
- data/vendor/ring/crypto/ec/asm/p256-x86_64-asm.pl +2725 -0
- data/vendor/ring/crypto/ec/ec.c +193 -0
- data/vendor/ring/crypto/ec/ec_curves.c +61 -0
- data/vendor/ring/crypto/ec/ec_key.c +228 -0
- data/vendor/ring/crypto/ec/ec_montgomery.c +114 -0
- data/vendor/ring/crypto/ec/example_mul.Windows.vcxproj +25 -0
- data/vendor/ring/crypto/ec/internal.h +243 -0
- data/vendor/ring/crypto/ec/oct.c +253 -0
- data/vendor/ring/crypto/ec/p256-64.c +1794 -0
- data/vendor/ring/crypto/ec/p256-x86_64-table.h +9548 -0
- data/vendor/ring/crypto/ec/p256-x86_64.c +509 -0
- data/vendor/ring/crypto/ec/simple.c +1007 -0
- data/vendor/ring/crypto/ec/util-64.c +183 -0
- data/vendor/ring/crypto/ec/wnaf.c +508 -0
- data/vendor/ring/crypto/ecdh/ecdh.c +155 -0
- data/vendor/ring/crypto/ecdsa/ecdsa.c +304 -0
- data/vendor/ring/crypto/ecdsa/ecdsa_asn1.c +193 -0
- data/vendor/ring/crypto/ecdsa/ecdsa_test.Windows.vcxproj +25 -0
- data/vendor/ring/crypto/ecdsa/ecdsa_test.cc +327 -0
- data/vendor/ring/crypto/header_removed.h +17 -0
- data/vendor/ring/crypto/internal.h +495 -0
- data/vendor/ring/crypto/libring.Windows.vcxproj +101 -0
- data/vendor/ring/crypto/mem.c +98 -0
- data/vendor/ring/crypto/modes/asm/aesni-gcm-x86_64.pl +1045 -0
- data/vendor/ring/crypto/modes/asm/ghash-armv4.pl +517 -0
- data/vendor/ring/crypto/modes/asm/ghash-x86.pl +1393 -0
- data/vendor/ring/crypto/modes/asm/ghash-x86_64.pl +1741 -0
- data/vendor/ring/crypto/modes/asm/ghashv8-armx.pl +422 -0
- data/vendor/ring/crypto/modes/ctr.c +226 -0
- data/vendor/ring/crypto/modes/gcm.c +1206 -0
- data/vendor/ring/crypto/modes/gcm_test.Windows.vcxproj +25 -0
- data/vendor/ring/crypto/modes/gcm_test.c +348 -0
- data/vendor/ring/crypto/modes/internal.h +299 -0
- data/vendor/ring/crypto/perlasm/arm-xlate.pl +170 -0
- data/vendor/ring/crypto/perlasm/readme +100 -0
- data/vendor/ring/crypto/perlasm/x86_64-xlate.pl +1164 -0
- data/vendor/ring/crypto/perlasm/x86asm.pl +292 -0
- data/vendor/ring/crypto/perlasm/x86gas.pl +263 -0
- data/vendor/ring/crypto/perlasm/x86masm.pl +200 -0
- data/vendor/ring/crypto/perlasm/x86nasm.pl +187 -0
- data/vendor/ring/crypto/poly1305/poly1305.c +331 -0
- data/vendor/ring/crypto/poly1305/poly1305_arm.c +301 -0
- data/vendor/ring/crypto/poly1305/poly1305_arm_asm.S +2015 -0
- data/vendor/ring/crypto/poly1305/poly1305_test.Windows.vcxproj +25 -0
- data/vendor/ring/crypto/poly1305/poly1305_test.cc +80 -0
- data/vendor/ring/crypto/poly1305/poly1305_test.txt +52 -0
- data/vendor/ring/crypto/poly1305/poly1305_vec.c +892 -0
- data/vendor/ring/crypto/rand/asm/rdrand-x86_64.pl +75 -0
- data/vendor/ring/crypto/rand/internal.h +32 -0
- data/vendor/ring/crypto/rand/rand.c +189 -0
- data/vendor/ring/crypto/rand/urandom.c +219 -0
- data/vendor/ring/crypto/rand/windows.c +56 -0
- data/vendor/ring/crypto/refcount_c11.c +66 -0
- data/vendor/ring/crypto/refcount_lock.c +53 -0
- data/vendor/ring/crypto/refcount_test.Windows.vcxproj +25 -0
- data/vendor/ring/crypto/refcount_test.c +58 -0
- data/vendor/ring/crypto/rsa/blinding.c +462 -0
- data/vendor/ring/crypto/rsa/internal.h +108 -0
- data/vendor/ring/crypto/rsa/padding.c +300 -0
- data/vendor/ring/crypto/rsa/rsa.c +450 -0
- data/vendor/ring/crypto/rsa/rsa_asn1.c +261 -0
- data/vendor/ring/crypto/rsa/rsa_impl.c +944 -0
- data/vendor/ring/crypto/rsa/rsa_test.Windows.vcxproj +25 -0
- data/vendor/ring/crypto/rsa/rsa_test.cc +437 -0
- data/vendor/ring/crypto/sha/asm/sha-armv8.pl +436 -0
- data/vendor/ring/crypto/sha/asm/sha-x86_64.pl +2390 -0
- data/vendor/ring/crypto/sha/asm/sha256-586.pl +1275 -0
- data/vendor/ring/crypto/sha/asm/sha256-armv4.pl +735 -0
- data/vendor/ring/crypto/sha/asm/sha256-armv8.pl +14 -0
- data/vendor/ring/crypto/sha/asm/sha256-x86_64.pl +14 -0
- data/vendor/ring/crypto/sha/asm/sha512-586.pl +911 -0
- data/vendor/ring/crypto/sha/asm/sha512-armv4.pl +666 -0
- data/vendor/ring/crypto/sha/asm/sha512-armv8.pl +14 -0
- data/vendor/ring/crypto/sha/asm/sha512-x86_64.pl +14 -0
- data/vendor/ring/crypto/sha/sha1.c +271 -0
- data/vendor/ring/crypto/sha/sha256.c +204 -0
- data/vendor/ring/crypto/sha/sha512.c +355 -0
- data/vendor/ring/crypto/test/file_test.cc +326 -0
- data/vendor/ring/crypto/test/file_test.h +181 -0
- data/vendor/ring/crypto/test/malloc.cc +150 -0
- data/vendor/ring/crypto/test/scoped_types.h +95 -0
- data/vendor/ring/crypto/test/test.Windows.vcxproj +35 -0
- data/vendor/ring/crypto/test/test_util.cc +46 -0
- data/vendor/ring/crypto/test/test_util.h +41 -0
- data/vendor/ring/crypto/thread_none.c +55 -0
- data/vendor/ring/crypto/thread_pthread.c +165 -0
- data/vendor/ring/crypto/thread_test.Windows.vcxproj +25 -0
- data/vendor/ring/crypto/thread_test.c +200 -0
- data/vendor/ring/crypto/thread_win.c +282 -0
- data/vendor/ring/examples/checkdigest.rs +103 -0
- data/vendor/ring/include/openssl/aes.h +121 -0
- data/vendor/ring/include/openssl/arm_arch.h +129 -0
- data/vendor/ring/include/openssl/base.h +156 -0
- data/vendor/ring/include/openssl/bn.h +794 -0
- data/vendor/ring/include/openssl/buffer.h +18 -0
- data/vendor/ring/include/openssl/bytestring.h +235 -0
- data/vendor/ring/include/openssl/chacha.h +37 -0
- data/vendor/ring/include/openssl/cmac.h +76 -0
- data/vendor/ring/include/openssl/cpu.h +184 -0
- data/vendor/ring/include/openssl/crypto.h +43 -0
- data/vendor/ring/include/openssl/curve25519.h +88 -0
- data/vendor/ring/include/openssl/ec.h +225 -0
- data/vendor/ring/include/openssl/ec_key.h +129 -0
- data/vendor/ring/include/openssl/ecdh.h +110 -0
- data/vendor/ring/include/openssl/ecdsa.h +156 -0
- data/vendor/ring/include/openssl/err.h +201 -0
- data/vendor/ring/include/openssl/mem.h +101 -0
- data/vendor/ring/include/openssl/obj_mac.h +71 -0
- data/vendor/ring/include/openssl/opensslfeatures.h +68 -0
- data/vendor/ring/include/openssl/opensslv.h +18 -0
- data/vendor/ring/include/openssl/ossl_typ.h +18 -0
- data/vendor/ring/include/openssl/poly1305.h +51 -0
- data/vendor/ring/include/openssl/rand.h +70 -0
- data/vendor/ring/include/openssl/rsa.h +399 -0
- data/vendor/ring/include/openssl/thread.h +133 -0
- data/vendor/ring/include/openssl/type_check.h +71 -0
- data/vendor/ring/mk/Common.props +63 -0
- data/vendor/ring/mk/Windows.props +42 -0
- data/vendor/ring/mk/WindowsTest.props +18 -0
- data/vendor/ring/mk/appveyor.bat +62 -0
- data/vendor/ring/mk/bottom_of_makefile.mk +54 -0
- data/vendor/ring/mk/ring.mk +266 -0
- data/vendor/ring/mk/top_of_makefile.mk +214 -0
- data/vendor/ring/mk/travis.sh +40 -0
- data/vendor/ring/mk/update-travis-yml.py +229 -0
- data/vendor/ring/ring.sln +153 -0
- data/vendor/ring/src/aead.rs +682 -0
- data/vendor/ring/src/agreement.rs +248 -0
- data/vendor/ring/src/c.rs +129 -0
- data/vendor/ring/src/constant_time.rs +37 -0
- data/vendor/ring/src/der.rs +96 -0
- data/vendor/ring/src/digest.rs +690 -0
- data/vendor/ring/src/digest_tests.txt +57 -0
- data/vendor/ring/src/ecc.rs +28 -0
- data/vendor/ring/src/ecc_build.rs +279 -0
- data/vendor/ring/src/ecc_curves.rs +117 -0
- data/vendor/ring/src/ed25519_tests.txt +2579 -0
- data/vendor/ring/src/exe_tests.rs +46 -0
- data/vendor/ring/src/ffi.rs +29 -0
- data/vendor/ring/src/file_test.rs +187 -0
- data/vendor/ring/src/hkdf.rs +153 -0
- data/vendor/ring/src/hkdf_tests.txt +59 -0
- data/vendor/ring/src/hmac.rs +414 -0
- data/vendor/ring/src/hmac_tests.txt +97 -0
- data/vendor/ring/src/input.rs +312 -0
- data/vendor/ring/src/lib.rs +41 -0
- data/vendor/ring/src/pbkdf2.rs +265 -0
- data/vendor/ring/src/pbkdf2_tests.txt +113 -0
- data/vendor/ring/src/polyfill.rs +57 -0
- data/vendor/ring/src/rand.rs +28 -0
- data/vendor/ring/src/signature.rs +314 -0
- data/vendor/ring/third-party/NIST/README.md +9 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA1LongMsg.rsp +263 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA1Monte.rsp +309 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA1ShortMsg.rsp +267 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA224LongMsg.rsp +263 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA224Monte.rsp +309 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA224ShortMsg.rsp +267 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA256LongMsg.rsp +263 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA256Monte.rsp +309 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA256ShortMsg.rsp +267 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA384LongMsg.rsp +519 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA384Monte.rsp +309 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA384ShortMsg.rsp +523 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA512LongMsg.rsp +519 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA512Monte.rsp +309 -0
- data/vendor/ring/third-party/NIST/SHAVS/SHA512ShortMsg.rsp +523 -0
- data/vendor/ring/third-party/NIST/sha256sums.txt +1 -0
- metadata +333 -0
@@ -0,0 +1,266 @@
|
|
1
|
+
# Copyright 2015 Brian Smith.
|
2
|
+
#
|
3
|
+
# Permission to use, copy, modify, and/or distribute this software for any
|
4
|
+
# purpose with or without fee is hereby granted, provided that the above
|
5
|
+
# copyright notice and this permission notice appear in all copies.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND BRIAN SMITH AND THE AUTHORS DISCLAIM
|
8
|
+
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
9
|
+
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL BRIAN SMITH OR THE AUTHORS
|
10
|
+
# BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
|
11
|
+
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
12
|
+
# AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
|
+
|
15
|
+
RING_PREFIX ?= ring/
|
16
|
+
|
17
|
+
RING_CPPFLAGS = $(RING_THREAD_FLAGS) -I$(RING_PREFIX)include -I$(GENERATED_CODE_DIR) -D_XOPEN_SOURCE=700
|
18
|
+
|
19
|
+
RING_LDLIBS = $(RING_THREAD_FLAGS) -L$(dir $(RING_LIB)) -lring-core
|
20
|
+
|
21
|
+
RING_SRCS = $(addprefix $(RING_PREFIX), \
|
22
|
+
crypto/aes/aes.c \
|
23
|
+
crypto/aes/mode_wrappers.c \
|
24
|
+
crypto/bn/add.c \
|
25
|
+
crypto/bn/asm/x86_64-gcc.c \
|
26
|
+
crypto/bn/bn.c \
|
27
|
+
crypto/bn/bn_asn1.c \
|
28
|
+
crypto/bn/cmp.c \
|
29
|
+
crypto/bn/convert.c \
|
30
|
+
crypto/bn/ctx.c \
|
31
|
+
crypto/bn/div.c \
|
32
|
+
crypto/bn/exponentiation.c \
|
33
|
+
crypto/bn/gcd.c \
|
34
|
+
crypto/bn/generic.c \
|
35
|
+
crypto/bn/montgomery.c \
|
36
|
+
crypto/bn/mul.c \
|
37
|
+
crypto/bn/prime.c \
|
38
|
+
crypto/bn/random.c \
|
39
|
+
crypto/bn/rsaz_exp.c \
|
40
|
+
crypto/bn/shift.c \
|
41
|
+
crypto/bytestring/cbb.c \
|
42
|
+
crypto/bytestring/cbs.c \
|
43
|
+
crypto/chacha/chacha_generic.c \
|
44
|
+
crypto/chacha/chacha_vec.c \
|
45
|
+
crypto/cipher/e_aes.c \
|
46
|
+
crypto/cipher/e_chacha20poly1305.c \
|
47
|
+
crypto/cpu-arm.c \
|
48
|
+
crypto/cpu-intel.c \
|
49
|
+
crypto/crypto.c \
|
50
|
+
crypto/curve25519/curve25519.c \
|
51
|
+
crypto/ec/ec.c \
|
52
|
+
crypto/ec/ec_curves.c \
|
53
|
+
crypto/ec/ec_key.c \
|
54
|
+
crypto/ec/ec_montgomery.c \
|
55
|
+
crypto/ec/oct.c \
|
56
|
+
crypto/ec/p256-64.c \
|
57
|
+
crypto/ec/p256-x86_64.c \
|
58
|
+
crypto/ec/simple.c \
|
59
|
+
crypto/ec/util-64.c \
|
60
|
+
crypto/ec/wnaf.c \
|
61
|
+
crypto/ecdh/ecdh.c \
|
62
|
+
crypto/ecdsa/ecdsa.c \
|
63
|
+
crypto/ecdsa/ecdsa_asn1.c \
|
64
|
+
crypto/mem.c \
|
65
|
+
crypto/modes/ctr.c \
|
66
|
+
crypto/modes/gcm.c \
|
67
|
+
crypto/poly1305/poly1305.c \
|
68
|
+
crypto/poly1305/poly1305_arm.c \
|
69
|
+
crypto/poly1305/poly1305_vec.c \
|
70
|
+
crypto/rand/rand.c \
|
71
|
+
crypto/rand/urandom.c \
|
72
|
+
crypto/refcount_c11.c \
|
73
|
+
crypto/refcount_lock.c \
|
74
|
+
crypto/rsa/blinding.c \
|
75
|
+
crypto/rsa/padding.c \
|
76
|
+
crypto/rsa/rsa.c \
|
77
|
+
crypto/rsa/rsa_asn1.c \
|
78
|
+
crypto/rsa/rsa_impl.c \
|
79
|
+
crypto/sha/sha1.c \
|
80
|
+
crypto/sha/sha256.c \
|
81
|
+
crypto/sha/sha512.c \
|
82
|
+
$(NULL))
|
83
|
+
|
84
|
+
# TODO: make all .a files depend on these too.
|
85
|
+
RING_x86_SRCS = $(addprefix $(RING_PREFIX), \
|
86
|
+
crypto/aes/asm/aes-586.pl \
|
87
|
+
crypto/aes/asm/aesni-x86.pl \
|
88
|
+
crypto/aes/asm/vpaes-x86.pl \
|
89
|
+
crypto/bn/asm/bn-586.pl \
|
90
|
+
crypto/bn/asm/co-586.pl \
|
91
|
+
crypto/bn/asm/x86-mont.pl \
|
92
|
+
crypto/modes/asm/ghash-x86.pl \
|
93
|
+
crypto/sha/asm/sha256-586.pl \
|
94
|
+
crypto/sha/asm/sha512-586.pl \
|
95
|
+
$(NULL))
|
96
|
+
|
97
|
+
RING_x86_64_SRCS = $(addprefix $(RING_PREFIX), \
|
98
|
+
crypto/aes/asm/aes-x86_64.pl \
|
99
|
+
crypto/aes/asm/aesni-x86_64.pl \
|
100
|
+
crypto/aes/asm/bsaes-x86_64.pl \
|
101
|
+
crypto/aes/asm/vpaes-x86_64.pl \
|
102
|
+
crypto/bn/asm/rsaz-avx2.pl \
|
103
|
+
crypto/bn/asm/x86_64-mont.pl \
|
104
|
+
crypto/bn/asm/x86_64-mont5.pl \
|
105
|
+
crypto/ec/asm/p256-x86_64-asm.pl \
|
106
|
+
crypto/modes/asm/aesni-gcm-x86_64.pl \
|
107
|
+
crypto/modes/asm/ghash-x86_64.pl \
|
108
|
+
crypto/rand/asm/rdrand-x86_64.pl \
|
109
|
+
crypto/sha/asm/sha256-x86_64.pl \
|
110
|
+
crypto/sha/asm/sha512-x86_64.pl \
|
111
|
+
$(NULL))
|
112
|
+
|
113
|
+
RING_ARM_SHARED_SRCS = \
|
114
|
+
crypto/aes/asm/aesv8-armx.pl \
|
115
|
+
crypto/cpu-arm-asm.S \
|
116
|
+
$(NULL)
|
117
|
+
|
118
|
+
RING_arm_SRCS = $(addprefix $(RING_PREFIX), \
|
119
|
+
crypto/aes/asm/aes-armv4.pl \
|
120
|
+
crypto/aes/asm/bsaes-armv7.pl \
|
121
|
+
crypto/bn/asm/armv4-mont.pl \
|
122
|
+
crypto/modes/asm/ghash-armv4.pl \
|
123
|
+
crypto/sha/asm/sha256-armv4.pl \
|
124
|
+
crypto/sha/asm/sha512-armv4.pl \
|
125
|
+
$(RING_ARM_SHARED_SRCS) \
|
126
|
+
$(NULL))
|
127
|
+
|
128
|
+
# TODO
|
129
|
+
RING_CPPFLAGS += -D__ARM_MAX_ARCH__=7
|
130
|
+
|
131
|
+
RING_arm_SRCS += $(addprefix $(RING_PREFIX), \
|
132
|
+
crypto/chacha/chacha_vec_arm.S \
|
133
|
+
crypto/poly1305/poly1305_arm_asm.S \
|
134
|
+
$(NULL))
|
135
|
+
|
136
|
+
RING_aarch64_SRCS = $(addprefix $(RING_PREFIX), \
|
137
|
+
crypto/bn/asm/armv8-mont.pl \
|
138
|
+
crypto/modes/asm/ghashv8-armx.pl \
|
139
|
+
crypto/sha/asm/sha256-armv8.pl \
|
140
|
+
crypto/sha/asm/sha512-armv8.pl \
|
141
|
+
$(RING_ARM_SHARED_SRCS) \
|
142
|
+
$(NULL))
|
143
|
+
|
144
|
+
ifeq ($(TARGET_SYS),none)
|
145
|
+
RING_THREAD_FLAGS += -DOPENSSL_TRUSTY=1 -DOPENSSL_NO_THREADS=1
|
146
|
+
RING_SRCS += $(addprefix $(RING_PREFIX), crypto/thread_none.c)
|
147
|
+
else
|
148
|
+
RING_THREAD_FLAGS += -pthread
|
149
|
+
RING_SRCS += $(addprefix $(RING_PREFIX), crypto/thread_pthread.c)
|
150
|
+
endif
|
151
|
+
|
152
|
+
RING_ASM_OBJS = \
|
153
|
+
$(addprefix $(OBJ_PREFIX), \
|
154
|
+
$(patsubst %.pl, %.o, \
|
155
|
+
$(patsubst %.S, %.o, $(RING_$(TARGET_ARCH_NORMAL)_SRCS))))
|
156
|
+
|
157
|
+
$(RING_ASM_OBJS): CPPFLAGS += -I$(RING_PREFIX)crypto
|
158
|
+
|
159
|
+
RING_OBJS = $(addprefix $(OBJ_PREFIX), $(patsubst %.c, %.o, $(RING_SRCS)))
|
160
|
+
|
161
|
+
ifeq ($(NO_ASM),)
|
162
|
+
RING_OBJS += $(RING_ASM_OBJS)
|
163
|
+
else
|
164
|
+
RING_CPPFLAGS += -DOPENSSL_NO_ASM=1
|
165
|
+
endif
|
166
|
+
|
167
|
+
RING_LIB = $(LIB_PREFIX)libring-core.a
|
168
|
+
|
169
|
+
# Recent versions of Linux have the D flag for deterministic builds, but Darwin
|
170
|
+
# (at least) doesn't. Accroding to Debian's documentation, binutils is built
|
171
|
+
# with --enable-determnistic-archives by default and we shouldn't need to
|
172
|
+
# worry about it.
|
173
|
+
$(RING_LIB): ARFLAGS = crs
|
174
|
+
$(RING_LIB): $(RING_OBJS) $(RING_PREFIX)mk/ring.mk
|
175
|
+
$(RM) $@
|
176
|
+
$(AR) $(ARFLAGS) $@ $(filter-out $(RING_PREFIX)mk/ring.mk, $^)
|
177
|
+
|
178
|
+
RING_TEST_LIB_SRCS = \
|
179
|
+
crypto/test/file_test.cc \
|
180
|
+
crypto/test/malloc.cc \
|
181
|
+
crypto/test/test_util.cc \
|
182
|
+
$(NULL)
|
183
|
+
|
184
|
+
RING_TEST_LIB_OBJS = $(addprefix $(OBJ_PREFIX), \
|
185
|
+
$(patsubst %.c, %.o, \
|
186
|
+
$(patsubst %.cc, %.o, \
|
187
|
+
$(RING_TEST_LIB_SRCS))))
|
188
|
+
|
189
|
+
RING_TEST_MAIN_SRCS = $(addprefix $(RING_PREFIX), \
|
190
|
+
crypto/aes/aes_test.cc \
|
191
|
+
crypto/bn/bn_test.cc \
|
192
|
+
crypto/bytestring/bytestring_test.cc \
|
193
|
+
crypto/constant_time_test.c \
|
194
|
+
crypto/ecdsa/ecdsa_test.cc \
|
195
|
+
crypto/modes/gcm_test.c \
|
196
|
+
crypto/poly1305/poly1305_test.cc \
|
197
|
+
crypto/refcount_test.c \
|
198
|
+
crypto/rsa/rsa_test.cc \
|
199
|
+
crypto/thread_test.c \
|
200
|
+
$(NULL))
|
201
|
+
|
202
|
+
RING_TEST_MAIN_OBJS = $(addprefix $(OBJ_PREFIX), \
|
203
|
+
$(patsubst %.c, %.o, \
|
204
|
+
$(patsubst %.cc, %.o, \
|
205
|
+
$(RING_TEST_MAIN_SRCS))))
|
206
|
+
|
207
|
+
RING_TEST_EXES = $(RING_TEST_MAIN_OBJS:$(OBJ_PREFIX)%.o=$(EXE_PREFIX)%)
|
208
|
+
|
209
|
+
ifeq ($(TARGET_SYS),none)
|
210
|
+
$(RING_TEST_EXES): LDLIBS += --specs=rdimon.specs
|
211
|
+
endif
|
212
|
+
$(RING_TEST_EXES): LDLIBS += $(RING_LDLIBS)
|
213
|
+
$(RING_TEST_EXES): $(EXE_PREFIX)% : \
|
214
|
+
$(OBJ_PREFIX)%.o \
|
215
|
+
$(RING_LIB) \
|
216
|
+
$(RING_TEST_LIB_OBJS) \
|
217
|
+
$(NULL)
|
218
|
+
$(CXX) $(filter-out $(RING_LIB),$^) $(LDFLAGS) $(LDLIBS) $(TARGET_ARCH) -o $@
|
219
|
+
|
220
|
+
# TODO: Fix the code so -Wno- overrides are not needed.
|
221
|
+
$(RING_OBJS) \
|
222
|
+
$(RING_TEST_LIB_OBJS) \
|
223
|
+
$(RING_TEST_MAIN_OBJS) \
|
224
|
+
$(NULL): CPPFLAGS += $(RING_CPPFLAGS) \
|
225
|
+
-DBORINGSSL_IMPLEMENTATION \
|
226
|
+
-Wno-cast-qual \
|
227
|
+
-Wno-pedantic \
|
228
|
+
-Wno-sign-compare \
|
229
|
+
-Wno-unused-parameter \
|
230
|
+
-Wno-cast-align \
|
231
|
+
-Wno-format \
|
232
|
+
-Wno-format-nonliteral \
|
233
|
+
-Wno-type-limits \
|
234
|
+
$(NULL)
|
235
|
+
$(RING_OBJS) \
|
236
|
+
$(RING_TEST_LIB_OBJS) \
|
237
|
+
$(RING_TEST_MAIN_OBJS) \
|
238
|
+
$(NULL): CFLAGS += -Wno-bad-function-cast \
|
239
|
+
-Wno-nested-externs \
|
240
|
+
$(NULL)
|
241
|
+
|
242
|
+
|
243
|
+
PERLASM_LIB_SRCS = $(addprefix $(RING_PREFIX), \
|
244
|
+
crypto/perlasm/arm-xlate.pl \
|
245
|
+
crypto/perlasm/x86asm.pl \
|
246
|
+
crypto/perlasm/x86gas.pl \
|
247
|
+
crypto/perlasm/x86masm.pl \
|
248
|
+
crypto/perlasm/x86nasm.pl \
|
249
|
+
crypto/perlasm/x86_64-xlate.pl \
|
250
|
+
$(NULL))
|
251
|
+
|
252
|
+
PERL_EXECUTABLE ?= perl
|
253
|
+
|
254
|
+
# The British spelling "flavour" is used for consistency with perlasm's code.
|
255
|
+
ifeq ($(findstring darwin,$(TARGET_SYS)),darwin)
|
256
|
+
PERLASM_FLAVOUR ?= macosx
|
257
|
+
else
|
258
|
+
PERLASM_FLAVOUR ?= elf
|
259
|
+
endif
|
260
|
+
|
261
|
+
PERLASM_x86_ARGS = $(PERLASM_FLAVOUR) -fPIC -DOPENSSL_IA32_SSE2
|
262
|
+
PERLASM_x86_64_ARGS = $(PERLASM_FLAVOUR)
|
263
|
+
PERLASM_ARGS = $(PERLASM_$(TARGET_ARCH_NORMAL)_ARGS)
|
264
|
+
|
265
|
+
$(OBJ_PREFIX)%.S: %.pl $(PERLASM_LIB_SRCS)
|
266
|
+
${PERL_EXECUTABLE} $< $(PERLASM_ARGS) > $@
|
@@ -0,0 +1,214 @@
|
|
1
|
+
# Copyright 2015 Brian Smith.
|
2
|
+
#
|
3
|
+
# Permission to use, copy, modify, and/or distribute this software for any
|
4
|
+
# purpose with or without fee is hereby granted, provided that the above
|
5
|
+
# copyright notice and this permission notice appear in all copies.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND BRIAN SMITH AND THE AUTHORS DISCLAIM
|
8
|
+
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
9
|
+
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL BRIAN SMITH OR THE AUTHORS
|
10
|
+
# BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
|
11
|
+
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
12
|
+
# AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
|
+
|
15
|
+
.DEFAULT_GOAL := all
|
16
|
+
|
17
|
+
# $(TARGET) must be of the form <arch>-<vendor>-<sys>-<abi>, except <abi> can
|
18
|
+
# omitted on Mac OS X (Darwin).
|
19
|
+
TARGET_WORDS = $(subst -, ,$(TARGET))
|
20
|
+
TARGET_ARCH_BASE = $(word 1,$(TARGET_WORDS))
|
21
|
+
TARGET_ARCH_NORMAL = \
|
22
|
+
$(strip $(if $(findstring arm, $(TARGET_ARCH_BASE)),arm, \
|
23
|
+
$(if $(filter i386 i486 i586 i686, \
|
24
|
+
$(TARGET_ARCH_BASE)),x86,$(TARGET_ARCH_BASE))))
|
25
|
+
|
26
|
+
TARGET_VENDOR = $(word 2,$(TARGET_WORDS))
|
27
|
+
TARGET_SYS = $(word 3,$(TARGET_WORDS))
|
28
|
+
TARGET_ABI = $(word 4,$(TARGET_WORDS))
|
29
|
+
|
30
|
+
# Cargo doesn't pass the ABI as part of TARGET on Mac OS X.
|
31
|
+
ifeq ($(TARGET_ABI),)
|
32
|
+
ifeq ($(findstring apple-darwin,$(TARGET_VENDOR)-$(TARGET_SYS)),apple-darwin)
|
33
|
+
TARGET_ABI = macho
|
34
|
+
else
|
35
|
+
define NEWLINE
|
36
|
+
|
37
|
+
|
38
|
+
endef
|
39
|
+
$(error TARGET must be of the form \
|
40
|
+
<arch>[<sub>]-<vendor>-<sys>-<abi>.$(NEWLINE)\
|
41
|
+
\
|
42
|
+
\ Exceptions: <abi> defaults to "macho" on Mac OS X.\
|
43
|
+
\
|
44
|
+
Linux x86 example: TARGET=i586-pc-linux-gnu $(NEWLINE)\
|
45
|
+
Mac OS X x64 example: TARGET=x86_64-apple-darwin $(NEWLINE)\
|
46
|
+
\
|
47
|
+
NOTE: Use "i586" instead of "x86".)
|
48
|
+
endif
|
49
|
+
endif
|
50
|
+
|
51
|
+
# XXX: Apple's toolchain fails to link when the |-target| arch is "x86_64",
|
52
|
+
# so just skip -target on Darwin for now.
|
53
|
+
ifneq ($(TARGET_ARCH_NORMAL)-$(findstring darwin,$(TARGET_SYS)),x86_64-darwin)
|
54
|
+
ifeq ($(findstring clang,$(CC)),clang)
|
55
|
+
DEFAULT_TARGET_ARCH = -target "$(TARGET)"
|
56
|
+
endif
|
57
|
+
endif
|
58
|
+
|
59
|
+
ifeq ($(TARGET_ARCH_NORMAL),x86)
|
60
|
+
MARCH = pentium
|
61
|
+
MINSTR = 32
|
62
|
+
else ifeq ($(TARGET_ARCH_NORMAL),x86_64)
|
63
|
+
MARCH = x86-64
|
64
|
+
MINSTR = 64
|
65
|
+
else
|
66
|
+
MARCH = $(subst _,-,$(TARGET_ARCH_BASE))
|
67
|
+
endif
|
68
|
+
|
69
|
+
ifeq ($(TARGET_ABI),eabi)
|
70
|
+
MABI = aapcs
|
71
|
+
endif
|
72
|
+
|
73
|
+
# Cortex-M0, Cortex-M0+, Cortex-M1: armv6_m
|
74
|
+
# Cortex-M3: armv7_m
|
75
|
+
# Cortex-M4, Cortex-M7: armv7e_m
|
76
|
+
ifeq ($(filter-out armv6_m armv7_m armv7e_m,$(TARGET_ARCH_BASE)),)
|
77
|
+
MINSTR = thumb
|
78
|
+
endif
|
79
|
+
|
80
|
+
# Although it isn't mentioned in the GNU Make manual, GNU Make passes
|
81
|
+
# $(TARGET_ARCH) in its implicit rules.
|
82
|
+
TARGET_ARCH += $(if $(MCPU),-mcpu=$(MCPU)) \
|
83
|
+
$(if $(MARCH),-march=$(MARCH)) \
|
84
|
+
$(if $(MABI),-mabi=$(MABI)) \
|
85
|
+
$(if $(MINSTR),-m$(MINSTR)) \
|
86
|
+
$(NULL)
|
87
|
+
|
88
|
+
ifeq ($(CC),)
|
89
|
+
$(error You must specify CC)
|
90
|
+
endif
|
91
|
+
ifeq ($(CXX),)
|
92
|
+
$(error You must specify CXX)
|
93
|
+
endif
|
94
|
+
|
95
|
+
# e.g. "clang-3.6"
|
96
|
+
COMPILER_NAME ?= $(notdir $(CC))
|
97
|
+
|
98
|
+
# Generate output to a directory like build/x86_64-unknown-linux-elf-clang-3.6.
|
99
|
+
BUILD_PREFIX_PRIMARY ?= build
|
100
|
+
BUILD_PREFIX_SUB ?= $(TARGET)-$(COMPILER_NAME)
|
101
|
+
BUILD_PREFIX ?= $(BUILD_PREFIX_PRIMARY)/$(BUILD_PREFIX_SUB)/
|
102
|
+
|
103
|
+
EXE_PREFIX ?= $(BUILD_PREFIX)test/ring/
|
104
|
+
OBJ_PREFIX ?= $(BUILD_PREFIX)obj/
|
105
|
+
LIB_PREFIX ?= $(BUILD_PREFIX)lib/
|
106
|
+
|
107
|
+
CFLAGS_STD ?= -std=c11
|
108
|
+
CXXFLAGS_STD ?= -std=c++11
|
109
|
+
|
110
|
+
CFLAGS += $(CFLAGS_STD)
|
111
|
+
CXXFLAGS += $(CXXFLAGS_STD)
|
112
|
+
|
113
|
+
# Always add full debug info and strip dead code.
|
114
|
+
CPPFLAGS += -fpic -fdata-sections -ffunction-sections
|
115
|
+
ifeq ($(findstring darwin,$(TARGET_SYS)),darwin)
|
116
|
+
# |-gfull| is required for Darwin's |-dead_strip|.
|
117
|
+
CPPFLAGS += -gfull
|
118
|
+
LDFLAGS += -fPIC -Wl,-dead_strip
|
119
|
+
else
|
120
|
+
CPPFLAGS += -g3
|
121
|
+
LDFLAGS += -Wl,--gc-sections
|
122
|
+
endif
|
123
|
+
|
124
|
+
# TODO: link-time optimization.
|
125
|
+
|
126
|
+
# Warnings
|
127
|
+
|
128
|
+
# TODO:
|
129
|
+
# -Wconversion \
|
130
|
+
# -Weverything -Wpessimizing-move, etc. \
|
131
|
+
# -Wsuggest-attribute \
|
132
|
+
# -Wstack-usage=n \
|
133
|
+
# -Wformat-signedness \
|
134
|
+
# -fsanitize=undefined \
|
135
|
+
# -Wnormalized \
|
136
|
+
# -fsized-deallocation \
|
137
|
+
# -Wmisleading-indentation \
|
138
|
+
# -Wmissing-declarations \
|
139
|
+
# -Wshadow \
|
140
|
+
# -Wsized-deallocation \
|
141
|
+
# -Wsuggest-final-types \
|
142
|
+
# -Wsuggest-final-methods \
|
143
|
+
# -Wsuggest-override \
|
144
|
+
# -Wzero-as-null-pointer-constant \
|
145
|
+
# -Wunsafe-loop-optimizations \
|
146
|
+
# -Wsign-conversion\
|
147
|
+
# -Wstrict-overflow=5 \
|
148
|
+
# -Wundef \
|
149
|
+
|
150
|
+
# TODO: clang-specific warnings
|
151
|
+
|
152
|
+
# TODO (not in clang):
|
153
|
+
# -Wmaybe-uninitialized \
|
154
|
+
# -Wtrampolines \
|
155
|
+
# -Wlogical-op \
|
156
|
+
|
157
|
+
# TODO (GCC 4.9+):
|
158
|
+
# -Wconditionally-supported
|
159
|
+
# -Wdate-time
|
160
|
+
|
161
|
+
CPPFLAGS += \
|
162
|
+
-pedantic -pedantic-errors \
|
163
|
+
\
|
164
|
+
-Wall -Werror \
|
165
|
+
-Wextra \
|
166
|
+
\
|
167
|
+
-Wcast-align \
|
168
|
+
-Wcast-qual \
|
169
|
+
-Wenum-compare \
|
170
|
+
-Wfloat-equal \
|
171
|
+
-Wformat=2 \
|
172
|
+
-Winvalid-pch \
|
173
|
+
-Wmissing-field-initializers \
|
174
|
+
-Wmissing-include-dirs \
|
175
|
+
-Wredundant-decls \
|
176
|
+
-Wsign-compare \
|
177
|
+
-Wuninitialized \
|
178
|
+
-Wwrite-strings \
|
179
|
+
$(NULL)
|
180
|
+
|
181
|
+
# XXX: Stack protector causes linking failures for armv7-*-none-eabi and
|
182
|
+
# it's use seems questionable for that kind of target anyway.
|
183
|
+
# The launchpad.net arm-none-eabi-gcc toolchain (at least) uses -fshort-enums.
|
184
|
+
ifneq ($(TARGET_SYS),none)
|
185
|
+
CPPFLAGS += -fstack-protector
|
186
|
+
endif
|
187
|
+
|
188
|
+
|
189
|
+
# TODO (not in clang):
|
190
|
+
# -Wjump-misses-init
|
191
|
+
# -Wold-style-declaration \
|
192
|
+
# -Wold-style-definition
|
193
|
+
CFLAGS += \
|
194
|
+
-Wbad-function-cast \
|
195
|
+
-Wmissing-field-initializers \
|
196
|
+
-Wnested-externs \
|
197
|
+
-Wstrict-prototypes \
|
198
|
+
$(NULL)
|
199
|
+
|
200
|
+
CMAKE_BUILD_TYPE ?= RELWITHDEBINFO
|
201
|
+
|
202
|
+
# Although we don't use CMake, we use a variable CMAKE_BUILD_TYPE with similar
|
203
|
+
# semantics to the CMake variable of that name.
|
204
|
+
ifeq ($(CMAKE_BUILD_TYPE),MINSIZEREL)
|
205
|
+
CPPFLAGS += -DNDEBUG -Os
|
206
|
+
else ifeq ($(CMAKE_BUILD_TYPE),RELEASE)
|
207
|
+
CPPFLAGS += -DNDEBUG -O3
|
208
|
+
else ifeq ($(CMAKE_BUILD_TYPE),RELWITHDEBINFO)
|
209
|
+
CPPFLAGS += -DNDEBUG -O3
|
210
|
+
else ifeq ($(CMAKE_BUILD_TYPE),DEBUG)
|
211
|
+
# Do nothing
|
212
|
+
else
|
213
|
+
$(error invalid value for CMAKE_BUILD_TYPE: $(CMAKE_BUILD_TYPE))
|
214
|
+
endif
|