-
Notifications
You must be signed in to change notification settings - Fork 108
Crypto & Sign #802
Comments
For TLS/DTLS, OpenBSD's libtls API is quite simple; it's a wrapper around {Open/Libre/Boring}SSL, and could either be used directly, or serve as inspiration: http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man3/tls_accept_fds.3?query=tls_init&sec=3 |
Linux kernel seems to provide some of it to userspace, the benefit of not requiring an extra library and being hardware accelerated:
I just tried |
I did a test with kernel's crypto API That said, before I go and write the // although they are all handled similarly in Linux, I'd keep encrypt/decrypt and hasher (digest) algorithms separated handlers
struct sol_crypto_hasher_config {
const char *algorithm; /* use Linux names to start, such as md5, sha1, hmac(sha1), crc32... */
struct sol_str_slice key; /* if len > 0, a key to be used in the hash algorithm */
void (*on_hash_ready)(void *data, struct sol_crypto_hasher *hasher, const struct sol_blob *output); /* must be valid */
void (*on_feed_done)(void *data, struct sol_crypto_hasher *hasher, struct sol_blob *input); /* may be NULL */
const void *data;
};
struct sol_crypto_hasher *sol_crypto_hasher_new(const struct sol_crypto_hasher_config *cfg);
void sol_crypto_hasher_del(struct sol_crypto_hasher *hasher);
int sol_crypto_hasher_feed(struct sol_crypto_hasher *hasher, struct sol_blob *input, bool is_final); Rationale:
Opens:
Implementation details:
|
message digest was done using both linux kernel crypto api (kcapi) and openssl, already in master. To do is encrypt/decrypt and transport layers such as ssl/tls/dtls. |
closing, further work in #2009. |
Soletta should provide cryptographic and sign functions to be used in multiple subsystems:
Multiple backends should be supported, since different OS have different support libraries (ie: OpenSSL/GnuTLS on Linux, PolarSSL on MBed, etc).
NOTE: This is a macro-ticket. Split it into more fine grained tasks before implementing.
The text was updated successfully, but these errors were encountered: