5106 Commits

Author SHA1 Message Date
Brian Smith
f1000c73f3 Normalize formatting of RSA code with rustfmt.
There are still some manual exceptions.
2016-09-12 09:47:06 -10:00
Brian Smith
ec56f3fb27 Remove duplicate definition of pkcs1_digestinfo_prefix!.
This was apparently the result of a mis-merge.
2016-09-12 09:35:20 -10:00
Dirkjan Ochtman
1fe852c10c 0.4.3: Allow unused_unsafe (until Rust 1.13 goes stable).
See changes in 8b7bb0cf6b649870bdf3150a3122e6ebe2962d24 for more info.

I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2016-09-11 10:23:50 -10:00
Brian Smith
8b7bb0cf6b 0.4.2: Fix build breakaged caused by Rust language change.
Rust Nightly now doesn't allow using an extern "C" static value unless
the reference is wrapped in `unsafe { }`, so do that.
2016-09-11 09:18:05 -10:00
Brian Smith
5778edbb5a 0.4.1 release. 2016-09-10 22:26:48 -10:00
Brian Smith
771dbdaecf Clarify encoding of n and e in verify_rsa. 2016-09-10 22:20:22 -10:00
Brian Smith
c1ad0baf71 PositiveInteger::from_be_bytes: Add minimal tests; reject empty inputs.
Also minimize use of slices in favor of more use of `untrusted`.
2016-09-10 19:11:45 -10:00
Dirkjan Ochtman
4637a96946 Add tests for zero-padding public key components with primitive verification.
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2016-09-10 19:11:44 -10:00
Dirkjan Ochtman
15cd1d0777 Test misuse-resistance for signature::primitive::verify_rsa().
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2016-09-10 19:11:44 -10:00
Dirkjan Ochtman
0f5cfd56fd Use rsa::PositiveInteger for public key parts in verification.
Moves the conversion from untrusted::Input (via slice) to BIGNUM from C to
Rust using the PositiveInteger struct we already use for signing. Adds a
check to error out when encountering a number that starts with zero.

I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2016-09-10 19:11:43 -10:00
Brian Smith
931800bcfb Expand historical context of testing of verify_rsa. 2016-09-10 19:11:43 -10:00
Dirkjan Ochtman
f3452ef077 Expose rsa::verify as ring::signature::verify_rsa.
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2016-09-10 19:11:42 -10:00
Brian Smith
09484b1973 Fix indention in src/rsa/rsa.rs. 2016-09-10 19:10:49 -10:00
Dirkjan Ochtman
80e96e0197 Change rsa::parse_public_key to return components as Input.
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2016-09-09 14:53:29 -10:00
Dirkjan Ochtman
9c85dfde6d Extract rsa::verify_rsa function from RSAParameters impl.
This is a step towards exposing it for direct use as `verify_rsa`.

I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2016-09-09 14:51:40 -10:00
Brian Smith
e8a3a452a1 Use array references instead of pointers in X25519 FFI. 2016-09-08 17:34:22 -10:00
Brian Smith
43598f8945 Fix indention in src/aead/chacha20_poly1305.rs. 2016-09-07 16:18:51 -10:00
Brian Smith
31eb1bb604 Use array references instead of pointers in AES-GCM FFI interface.
This improves the type safety.
2016-09-07 16:15:09 -10:00
Brian Smith
e13cea410f Add *.bk to .gitignore. 2016-09-07 15:22:54 -10:00
Alex Gaynor
cbfd9fb72c Replace the fill_from_slice polyfill with copy_from_slice.
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2016-09-07 15:22:45 -10:00
Brian Smith
fcbf905619 Use the GFp_ prefix for nistz384 externs. 2016-08-28 18:26:33 -10:00
Brian Smith
c378a2ee89 Use the GFp_ prefix for nistz256 externs. 2016-08-28 17:33:08 -10:00
Brian Smith
dd0865aeed Use the GFp_ prefix for digest externs. 2016-08-28 17:33:07 -10:00
Brian Smith
02602de552 Use the "GFp_" prefix C integer type metrics & simplify them.
They were previously functions so that they worked when *ring* was
built as a DLL on Windows, but that's not a supported configuration, so
thats unnecessary.
2016-08-28 17:33:07 -10:00
Brian Smith
e6b9b97f43 Use the "GFp_" prefix for Curve25519 functions.
Also, make many Curve25519 extern functions static, and remove some
dead code.
2016-08-28 17:33:07 -10:00
Brian Smith
7900e986f7 Use the "GFp_" prefix for RSA externs. 2016-08-28 17:33:06 -10:00
Brian Smith
5ec28f5138 Use the "GFp_" prefix for ChaCha20 externs. 2016-08-28 17:33:06 -10:00
Brian Smith
05f2c8364c Use the "GFp_" prefix for poly1305 functions. 2016-08-28 17:33:04 -10:00
Brian Smith
5eb9ac9a3a Use the "GFp_" prefix for CPU capabilities externs. 2016-08-28 17:32:58 -10:00
Brian Smith
e95806f0ed Use the "GFp_" prefix for BIGNUM externs. 2016-08-28 17:32:58 -10:00
Brian Smith
6c8a344f6c Use the "GFp_" prefix for AES externs. 2016-08-28 17:32:57 -10:00
Brian Smith
3456cdd511 Remove dead benchmarking code for bitsliced AES. 2016-08-28 17:32:56 -10:00
Brian Smith
279bd0a2e9 Reformat based on suggestions from rustfmt.
This is a first step toward fully-automated formatting. A custom format
is used, primarily to tell rustfmt to wrap at column 80(-ish) instead of
column 100(-ish), and to use more compact styles.

Many rustfmt suggestions for rewrapping function calls were ignored
because they did not result in the minimum number of lines and/or
because I'm still unsure the best way to format a long chain. Some
suggestions for reformatting macros were ignored because they ruined
the indention. Some other suggestions were ignored because they seemed
like bugs and/or seemed to make things clearly worse.

Further work is planned, in order to make the formatting fully
automatic.
2016-08-28 17:32:32 -10:00
Sam Scott
f5be9c34b1 Replace ChaCha20 tests with Rust code.
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2016-08-27 11:55:02 -10:00
Brian Smith
5b75fb123f Refactor RSA signing API to allow concurrent use of RSAKeyPair. 2016-08-27 10:50:49 -10:00
Brian Smith
d478370db3 Remove unnecssary boxing of RSA within RSAKeyPair. 2016-08-27 10:47:01 -10:00
Brian Smith
bf6ccac2db Split RSA verification- & signing- specific code into submodules. 2016-08-27 10:47:01 -10:00
Brian Smith
5212701f46 Fix build breakage with Rust Nightly.
`drop_with_repr_extern` was removed when Drop flags were removed.
2016-08-26 23:15:24 -10:00
Andre Bogus
89ab6d265c Simplify test code by using while let.
Found by Clippy.
2016-08-25 18:44:59 -10:00
Andre Bogus
3db3bf48e9 Use compound assignment operator when possible.
Found by Clippy.
2016-08-25 18:44:59 -10:00
Andre Bogus
789cb41bfa Use characters instead of strings for single-character comparisons.
Found by Clippy.
2016-08-25 18:44:58 -10:00
Andre Bogus
c260b3599f Avoid explicit specificiation of lifetimes unless necessary.
These were found by Clippy.
2016-08-25 18:44:58 -10:00
Andre Bogus
80b72639c7 use x.is_empty() instead of x.len() == 0. 2016-08-25 18:44:57 -10:00
Andre Bogus
26e73097fc Use implicit return instead of explicit return. 2016-08-25 18:44:53 -10:00
Andre Bogus
9b042331f4 Add backticks in doc comments to appease Clippy. 2016-08-25 18:44:44 -10:00
Brian Smith
48bb3edca4 Remove else after return. 2016-08-25 18:44:44 -10:00
Brian Smith
19d0d794b4 Drop mention of function name in SHA512_4 documentation.
Clippy complains about this unless "SHA512_4" is enclosed in backticks.
2016-08-25 18:44:43 -10:00
Andre Bogus
57505cd4b9 Remove unnecessary uses of & on references.
Found by Clippy.
2016-08-25 18:44:38 -10:00
pravic
a6aa30189a Fix strawberryperl link in BUILDING.md. 2016-08-24 09:50:17 -10:00
Brian Smith
b9962664ea Remove AES decryption.
AES-GCM only uses the encrypt function, even for decryption.
2016-08-24 01:40:38 -10:00