Commit Graph

30 Commits

Author SHA1 Message Date
Gleb Kozyrev 5fafe4fc60 Hasher: static contract checking, context reuse
- Store EVP_MD_CTX in a separate struct.
- Add with_context() constructor that uses an existing context.
- Switch to EVP_Digest(Init|Final)_ex for efficient context reuse.
- Make update() borrow &mut self.
- Make finalize() consume self. Add finalize_reuse() that also returns the
context which can be passed to from_context() constructor for reuse.

These changes let the type system prevent illegal calls to update() and
finalize().
2014-11-26 21:38:06 +02:00
Steven Fackler 9996f5874e Fix test build 2014-11-19 12:36:32 -08:00
James Hurst f02d8c22ec Fixed compilation errors related to namedspaced enums 2014-11-17 19:16:51 -05:00
Steven Fackler 5258ce6ece Move AES XTS support to a feature 2014-11-16 14:01:24 -08:00
Corey Ford 287d402042 Add XTS-AES mode 2014-11-14 12:22:34 -08:00
Steven Fackler 952fef7971 Merge pull request #89 from pyrho/aes-256-cbc-decrypt-test
Aes 256 cbc decrypt test
2014-11-10 12:20:00 -05:00
Cody P Schafer 3cbc518249 Hasher::write(): add basic test 2014-11-07 16:58:30 -05:00
Cody P Schafer b9f95b4ce4 crypto/hash: impl Writer for Hasher to allow use of Reader-Writer convenience functions 2014-11-07 16:56:18 -05:00
Michael Gehring 1eb79df25a fail! -> panic! 2014-10-30 09:58:22 +01:00
pyrho 42e9438e4f Replaced vector of bytes with bytes string literal for expected output of AES_256_CBC deciphering unit test 2014-10-28 14:15:13 +01:00
pyrho d10c552af6 AES 256 CBC unit test 2014-10-28 02:15:31 +01:00
Valerii Hiora e47a3cf7e2 Cert loading from PEM & restructuring
- Added cert loading

- Extracted X509 tests
2014-10-15 09:24:08 +03:00
Valerii Hiora dd46d1922e Correct init mutexes and locking function
`libcrypto` uses locks quite intensively even without SSL. 
So they should be initialized before everything else to 
function properly in multi-threaded apps in which SSL 
operations are absent or delayed.

Finishes #79
2014-10-14 08:31:42 +03:00
Samuel Fredrickson 95b9cf39c9 "final" is now a reserved word, so change occurrences to "finalize". 2014-10-09 01:05:41 -07:00
Alex Crichton be0e83c978 Add bindings to CRYPTO_memcmp
This should help other projects use a constant-time memory comparison.
2014-10-01 13:28:56 -07:00
Valerii Hiora a154ceeed2 Unification and explicity in FFI type decls 2014-09-30 09:39:21 +03:00
Valerii Hiora 02637ec7d4 single `ffi` module 2014-09-30 08:21:31 +03:00
Valerii Hiora 4fd169a1e5 Certificate/pkey generation & PEM export
Required quite a lot of refactoring
2014-09-26 10:39:08 +03:00
Michael Gehring da125b3a95 Fix deprecation warnings 2014-09-23 20:27:37 +02:00
Michael Gehring 6802216f79 Update for rust rfc 52 changes 2014-09-17 17:21:17 +02:00
Mathijs van de Nes 7685a8349c Switch to the more sane RSA PUBKEY function
For differences, see:
http://openssl.6102.n7.nabble.com/difference-between-i2d-PUBKEY-and-i2d-PublicKey-td43869.html

This will break loading of *public* keys generated before this commit
2014-09-12 15:36:00 +02:00
Mathijs van de Nes 759feedb04 Switch PKey load/save functions to RSA specific 2014-09-12 15:30:09 +02:00
Andrew Dunham 1579173a10 Fix lints for non snake-case functions 2014-09-04 17:55:35 -07:00
Eunchong Yu 11c44d3b88 Fix the ambiguous integer literal error
This commit fixes this:

> src/crypto/symm.rs:95:25: 95:52 error: cannot determine a type for
> this expression: cannot determine the type of this integer; add a
> suffix to specify the type explicitly [E0101]
> src/crypto/symm.rs:95                 let v = if padding { 1 } else { 0 } as c_int;
2014-08-27 15:40:09 +09:00
Michael Gehring c4a275dc37 Add repr(C) to C structs 2014-08-22 17:16:16 +02:00
Jeremy Ruten 9f2a9c8524 Add new HashType RIPEMD160 2014-08-04 15:20:49 -06:00
Steven Fackler 203bdd076e Shift directory structure 2014-08-03 19:16:09 -07:00
Steven Fackler 53e11b08f5 Prepare rustcrypto to merge into rust-openssl 2013-12-28 17:09:18 -07:00
Erick Tryzelaar 85e6d1db12 update to rust 0.9-pre (a5fa1d9) 2013-12-27 22:02:38 -05:00
Erick Tryzelaar a9ce2a36d5 Switch over to rustpkg 2013-12-18 08:51:10 -08:00