6117 Commits

Author SHA1 Message Date
Brian Smith
6180cc902e Don't set charset in .editorconfig to work around VS2017 bug. 2017-03-22 17:45:08 -10:00
Brian Smith
9431db2a8f Add .editorconfig. 2017-03-21 21:32:40 -10:00
Brian Smith
538a61b205 Remove irrelevant BIGNUM tests.
This is a step towards replacing bn_test.cc with Rust code for tests.
These scenerios are not relevant to *ring* as it details with only
positive inputs to the tested functions.
2017-03-19 12:07:15 -10:00
Brian Smith
8b026c93f2 Replace C code for serializing Elems with Rust code. 2017-03-19 11:48:57 -10:00
Brian Smith
3e4a207c13 Allow input to big_endian_from_limbs_padded() to be shorter than output.
This is temporarily needed in order to have the function work with the
`BIGNUM`-based RSA code.
2017-03-19 11:44:50 -10:00
Brian Smith
60009e385b Parameterize Montgomery encoding level in ECC. 2017-03-19 11:16:49 -10:00
Brian Smith
7b918bef02 Move big_endian_from_limbs_padded() to ring::limb.
This is a step towards sharing code between RSA and ECC.
2017-03-19 11:16:49 -10:00
Brian Smith
5a71633599 Share more big-endian value parsing logic between RSA and ECC. 2017-03-19 11:16:47 -10:00
Brian Smith
63fa579c72 Move parsing of big-endian values into ring::limb.
This will facilitate sharing the code between RSA and ECC.
2017-03-19 11:15:54 -10:00
Brian Smith
c68607bfd4 Use limb::limbs_less_than_limbs_constant_time in ring::ec. 2017-03-19 10:44:37 -10:00
Brian Smith
8a46eb57b8 0.7.3. 2017-03-19 10:15:07 -10:00
Brian Smith
42f2413633 Add a note about docs.rs limitations to ring::signature docs. 2017-03-19 10:14:23 -10:00
Brian Smith
4461ba9059 Fix formatting of RSAKeyPair documentation. 2017-03-19 10:14:09 -10:00
Pietro Monteiro
d048e1e818 Use armv7 for android build on travis.
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2017-03-19 09:38:26 -10:00
Brian Smith
0c4b60048f Update BUILDING.md to account for recent changes. 2017-03-19 09:24:14 -10:00
Brian Smith
8195f740da Package test input files. 2017-03-19 08:49:21 -10:00
Brian Smith
2f7ad58965 0.7.2. 2017-03-19 08:02:21 -10:00
Brian Smith
e20bdbe0cc 0.7.2-alpha2 2017-03-18 22:57:09 -10:00
Brian Smith
819ad75b4e Disable bn_test.cc on macOS/iOS to avoid worrying about libc++ vs libstdc++. 2017-03-18 22:56:36 -10:00
Brian Smith
16ad542987 Restore some MSVC flags that were used in the MSBuild-based builds.
"/Ox" implies a lot of the other flags that were passed explicitly.
2017-03-18 17:37:53 -10:00
Brian Smith
ad39dd1623 Enable debug assertions based on $DEBUG, not $PROFILE. 2017-03-18 17:37:51 -10:00
Brian Smith
855d4986a0 0.7.2-alpha1. 2017-03-18 15:33:12 -10:00
Brian Smith
f7f1fb7773 Remove unused crypto/perlasm/x86masm.pl. 2017-03-18 15:31:16 -10:00
Brian Smith
d46aaf15bd Match output filename more precisely/carefully in sha512-{armv8, x86_64}.pl.
The output path is usually in a directory with a (hex) numerical name, and
it is very possible that that name may contain the substring "512". If so,
the old regex will do the wrong thing, generating the SHA-512 code twice
instead of generating one copy of the SHA-256 code and one copy of the
SHA-512 code. This has actually happened on Travis CI.
2017-03-18 15:31:16 -10:00
Brian Smith
dd659d2994 Improve Perlasm machinery for SHA-2 on X86-64 and ARMv8.
Rename sha-{x86_64, armv8}.pl back to sha512-{x86_64, armv8}.pl. This
will simplify copmarisons between BoringSSL and *ring*.

Replace the *ring*-specific hacky logic done in Perl with hacky logic
done in Rust. The purpose of this hack is to deal with the fact that
sha512-{x86_64, armv8}.pl need to be run twice, once with "512" in the
output file path to generate
`GFp_sha512_block_data_order`, and again with "256" in the output file
path to generate `GFp_sha256_block_data_order`.
2017-03-18 15:31:15 -10:00
Brian Smith
2dddb44ff0 Pregenerate assembly language object files for Windows on crates.io. 2017-03-18 15:31:14 -10:00
Brian Smith
e757460bed Generalize some library-building logic in buid.rs. 2017-03-18 15:31:14 -10:00
Brian Smith
3cbb4ece26 Simplify asm_path() in build.rs. 2017-03-18 15:31:13 -10:00
Brian Smith
c4698ae457 Use Path instead of PathBuf in build.rs's compile(). 2017-03-18 15:31:13 -10:00
Brian Smith
25add85a54 Use pregenerated asm files when not building from Git. 2017-03-18 15:31:12 -10:00
Brian Smith
495d25f930 Incorporate perlasm format into generated assembly source file names.
This is a step towards supporting builds from crates.io without needing
Perl, by pregenerating the assembly language as part of the packaging
process.
2017-03-18 14:55:01 -10:00
Brian Smith
3ed9cd8f0f Abstract mapping of OS and architecture to PerlAsm target.
This is a step towards pregenerating PerlAsm outputs for use in
crates.io builds.
2017-03-18 14:54:59 -10:00
Brian Smith
ac8999da4d Remove currently-unused crypto/perlasm/ppc-xlate.pl. 2017-03-17 14:29:08 -10:00
Brian Smith
d73b4768e3 Sort file lists in build.rs. 2017-03-17 14:29:07 -10:00
Brian Smith
37ecc31659 Simplify the tracking of #includes in buid.rs. 2017-03-17 14:29:07 -10:00
Brian Smith
acd422c4ce Refactor mapping of source files to architectures in build.rs.
Have one list of source files, instead of a bunch of separate
architecture-specific lists that need to be combined together. This
will simplify the work on pregenerating assembly language sources.
2017-03-17 14:29:06 -10:00
Brian Smith
805c8db797 Remove currently-unused PowerPC source files imported from BoringSSL. 2017-03-16 15:45:40 -10:00
Brian Smith
70e8d3473d Build ring-core and ring-test in parallel instead of sequentially. 2017-03-16 11:25:54 -10:00
Brian Smith
1166b3e19d Use weight_max() for include file modification checking.
I'm not sure this helps but it is consistent with other uses of
parallel iterators in build.rs.
2017-03-16 11:23:53 -10:00
Brian Smith
a69b5198d0 Remove the "cargo:rerun-if-changed" logic from build.rs.
I don't see a significant difference with or without this. If running
the build script is slow at all then we should speed it up.
2017-03-16 10:24:52 -10:00
Brian Smith
f6b58c61ca Always pass ring-core and ring-test to linker, even if only one changed.
Previously build.rs was relying on gcc.rs to output the link metadata
to link ring-core and ring-test. But, if only one of the libraries
changed, then we won't run gcc.rs on the one that didn't change, and
the linker metadata for that unchanged library wouldn't be output,
causing linking to fail due to missing symbols. Fix that by having
build.rs output the linker metadata itself.
2017-03-16 10:16:34 -10:00
Brian Smith
4c1d224821 Improve include file modification checks.
Treat a missing source file as an error, whereas before we were
treating it as indicating that the target needs to be rebuilt. Because
we do dependency checking bottom-up, not top-down, the source file
always exists. If it doesn't, then that's an error. In particular, it
probably means that build.rs lists some source files that have been
removed. (See the previous commit.)

Also, the original purpose of this commit is to memoize the
modification time of the most recently modified include file, instead
of `stat()`ing each include file over and over again for each source
file. So do that too.

Finally, in the name of simplicity, don't bother tracking test vs.
non-test includes separately. It's rare when any include file changes,
and we don't save much by separating things, so K.I.S.S. to reduce the
chance that things get screwed up.
2017-03-16 10:14:22 -10:00
Brian Smith
7bc92063d5 Remove references to non-existent header files.
These entries would cause recompilation to recompile all the C code,
since an error retrieving the files' metadata would trigger a rebuild
of every file. (See the next commit.)
2017-03-16 10:07:04 -10:00
Brian Smith
d9d662fced Move webpki's bit_string_with_no_unused_bits to ring::der.
This will be used for SPKI parsing in *ring*.
2017-03-15 13:07:59 -10:00
Brian Smith
d320231ccb Move target-specific dependency to dependencies section of Cargo.toml. 2017-03-15 13:07:58 -10:00
Pietro Monteiro
70ca967455 Remove option that breaks newer android emulators.
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2017-03-14 10:00:45 -10:00
Brian Smith
e6f97fa1f5 Revert "Revert "Fix Android NDK caching. This is a directory.""
This reverts commit 39982f81c761595b57945cd9b75181b687251e4f, i.e.
it re-applies the fix from 2ca8cba8795091c2bcd6945f99b2036807a6883b.
This change can be made independently of the switch to clang.
2017-03-14 09:44:54 -10:00
Brian Smith
0b8d1ebb78 Update README.md to mention that NDK 14 is being used on Travis CI. 2017-03-14 09:40:01 -10:00
Brian Smith
63691d4245 Revert "Use clang on android."
This reverts commit de8a1636a13f45aaff159ebf041c08e46fb16fd1 because
switching to clang broke something.
2017-03-14 09:36:15 -10:00
Brian Smith
39982f81c7 Revert "Fix Android NDK caching. This is a directory."
This reverts commit 2ca8cba8795091c2bcd6945f99b2036807a6883b, as part
of rolling back the switch to clang.
2017-03-14 09:34:58 -10:00