aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi/ffi.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Split up ffi.cpp into several filesJack Lloyd2017-07-311-2301/+6
| | | | | It was getting pretty big and would get worse over time, eg whenver I get around to adding TLS support.
* Merge GH #1128 Improve FFI exception safetyJack Lloyd2017-07-311-701/+347
|\
| * Add missing return in ffi_delete_objectJack Lloyd2017-07-251-4/+5
| | | | | | | | | | Somehow this still passed all the tests, downside of 0 as the success return I suppose.
| * In FFI, check the object magic before deletingJack Lloyd2017-07-251-30/+42
| | | | | | | | | | Previously any X_destroy function would just delete its arg regardless of whatever the application passed in.
| * Better exception guarding in FFIJack Lloyd2017-07-251-671/+304
| | | | | | | | | | Based on PR #1097 but I wanted to decrease the verbosity of the resulting code.
* | Merge GH #1135 Add RFC 3394 keywrap to FFIJack Lloyd2017-07-311-0/+46
|\ \ | |/ |/|
| * FFI: Add interface for key wrapping with RFC 3394Krzysztof Kwiatkowski2017-06-291-0/+46
| |
* | Add SM2 signature schemeJack Lloyd2017-06-291-0/+56
| | | | | | | | | | | | From https://tools.ietf.org/html/draft-shen-sm2-ecdsa-02 This is a contribution from Ribose Inc (@riboseinc).
* | ffi: Catch exceptions in botan_mp_initDaniel Wyatt2017-06-281-3/+23
|/
* FFI: Comments from code review #1074Krzysztof Kwiatkowski2017-06-121-28/+65
|
* FFI: privkey_load_ec and pubkey_load_ec should be available only if ECDSA or ↵Krzysztof Kwiatkowski2017-06-101-2/+2
| | | | ECDH is compiled
* FFI: ECDSA an ECDH keys loading from mpi. CleanupKrzysztof Kwiatkowski2017-06-101-77/+90
| | | | | * Be more C++ and use templates instead of string comparision * Move private functions to namespace at the top of the file
* FFI: Add functions specific to ECDSA and ECDHKrzysztof Kwiatkowski2017-06-101-9/+62
|
* FFI: Posibility to load EC pubkeyKrzysztof Kwiatkowski2017-06-101-1/+27
|
* FFI: Posibility to load EC privkeyKrzysztof Kwiatkowski2017-06-101-0/+24
|
* Merge GH #1066 Add Ed25519 signature schemeJack Lloyd2017-06-091-0/+98
|\
| * Fix FFI build when Ed25519 disabledJack Lloyd2017-06-091-1/+11
| |
| * Add FFI test and test data from PGP draftJack Lloyd2017-06-081-1/+1
| |
| * Ed25519 FFIJack Lloyd2017-06-081-0/+88
| |
* | Fix compile error in FFI when RSA disabledJack Lloyd2017-06-091-1/+1
|/ | | | [ci skip]
* Add FFI func botan_scrub_memJack Lloyd2017-05-291-0/+6
|
* Add botan_hash_copy_state FFI function.Daniel Wyatt2017-05-251-0/+6
|
* Merge GH #1051 Extensions for PKCSv1.5 signature formattingJack Lloyd2017-05-191-0/+21
|\
| * Add botan_pkcs_hash_id to FFIJack Lloyd2017-05-181-0/+21
| | | | | | | | | | | | Extend EMSA_PKCS1v15_Raw to optionally take a hash function for which the PKCS hash id is prefixed to the message as usual. This allows signing a message using PKCSv1.5 padding where the hash is provided externally.
* | Maintainer mode fixesJack Lloyd2017-05-181-4/+4
|/
* Fix botan_privkey_load_rsa misleading parameter names.Daniel Wyatt2017-05-131-3/+3
| | | | RSA_PrivateKey's constructor take p,q,e,d,n.
* Merge GH #1036 Add FFI botan_hash_block_sizeJack Lloyd2017-05-031-0/+5
|\
| * Add FFI botan_hash_block_size.Daniel Wyatt2017-04-301-0/+5
| |
* | Fix botan_bcrypt_is_valid return code.Daniel Wyatt2017-04-291-2/+1
|/ | | | | Currently it returns 0 on success and BOTAN_FFI_ERROR_EXCEPTION_THROWN otherwise, which is a bit inaccurate and not consistent with the rest of the FFI interface.
* Add explicit return to FFI botan_mp_to_str.Daniel Wyatt2017-04-261-1/+1
| | | | This way we know if the buffer is insufficient.
* Fix Clang warning in ffiJack Lloyd2017-04-191-121/+117
| | | | | | | The do_get_field functions had C linkage but returned BigInt, which is a warning under Clang at least. Move these functions up outside of the extern "C" block, and rename them to not match the FFI function since these are not publically accessible APIs, just helper functions.
* Mark correct variables unused in FFI botan_{pub,priv}key_load_elgamalSimon Warta2017-04-161-7/+2
| | | | Closes #1011
* Improve unused handling in ffi methodsSimon Warta2017-04-161-16/+8
| | | | | Make sure `key` is not touched when method is not implemented. Use one line UNUSED statements
* Merge GH #1006 Fix FFI cipher interface (see also GH #1003)Jack Lloyd2017-04-151-0/+2
|\
| * Fix FFI cipher interfaceJack Lloyd2017-04-141-0/+2
| | | | | | | | | | | | Was totally broken, when not encrypting in one shot. (GH #1003) Enable the test, which had been commented out :(
* | Guard include of ElGamal headerJack Lloyd2017-04-151-1/+4
| |
* | Support for ElGamal in FFI interfaceKrzysztof Kwiatkowski2017-04-141-0/+52
|/ | | | | | * Adds `botan_pubkey_load_elgamal' and `botan_privkey_load_elgamal' functions to FFI interface. * Adds test `ffi_test_elgamal'
* Small ffi fixesJack Lloyd2017-04-081-1/+1
| | | | | | | | | Constify arg to botan_pk_op_decrypt, and correct comment on botan_mp_is_positive, which returns true even for zero. Considered changing botan_mp_is_positive to match the comment, and return false for zero, but we already test that botan_mp_is_positive(0) == 1, so I left it as is and fixed the comment.
* Add block cipher interface to C APIJack Lloyd2017-04-041-0/+77
|
* Merge GH #964 Add various useful FFI functions for public key cryptoJack Lloyd2017-04-041-81/+275
|\
| * Implement botan_pubkey_loadJack Lloyd2017-04-031-0/+24
| | | | | | | | Declared in header, but was not defined. :(
| * Fix botan_privkey_create if the desired algorithm was not available in buildJack Lloyd2017-04-031-8/+27
| | | | | | | | | | | | If DSA was disabled, caused memory corruption/crashes due to combination of uninitialized object and the tests not checking return values as carefully as they should.
| * Add generic getters for PK parameters in C interfaceJack Lloyd2017-04-021-75/+226
| | | | | | | | Supporting RSA, DSA, and ECC. Add also DSA specific loading functions.
* | Add some more useful bigint functions to C interfaceJack Lloyd2017-03-311-24/+84
|/
* Merge GH #899 Add ability to specify iterations when encrypting a private keyJack Lloyd2017-03-291-4/+78
|\
| * Add ability to specify iterations when encrypting a private keyJack Lloyd2017-02-261-4/+78
| | | | | | | | GH #896
* | Expose BigInt API subset to C APIJack Lloyd2017-03-281-5/+382
| | | | | | | | Also adds RSA key constructors using BN
* | Expose PK::check_key functions in C interfaceJack Lloyd2017-03-271-0/+15
| |
* | Remove duplicate include GH #928Jack Lloyd2017-03-221-1/+0
|/
* Fix various SunCC and Solaris warnings and build problems.Jack Lloyd2017-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Based on build output sent by @noloader. If RLIMIT_MEMLOCK is not defined, assume regular user is not able to call mlock. This probably also affected Clang/GCC on Solaris. Work around resolution issue in SIMD_4x32 where it finds ambiguity between arg taking uint32_t and __m128i. This is probably some artifact of how SunCC represents vector types, and seems highly bogus in general but is easy to work around here. Change constructor taking a single value to instead be `SIMD_4x32::splat` function. The SIMD class is internal, so no API implications. Fix various warnings about lambda functions that were missing return types and which were not a single return statement. AIUI C++11 doesn't guarantee that lambda return type will be deduced in that situation, though in practice every compiler including SunCC seems to handle it. Disable AVX2 usage, since SunCC's intrinsics seem to be broken - its _mm_loadu_si256 takes non-const pointer. Rename a few variables in the tests to avoid shadowed var warnings.