diff options
author | erikdejong <erikdejong@gmail.com> | 2017-03-06 22:01:39 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2017-03-10 02:54:51 +0000 |
commit | fe285c640b6279fdb9920bb79b0494ac87cb0e32 (patch) | |
tree | 85d71f80358f486494368fab9fde765562363eb9 /wsutil/wsgcrypt.h | |
parent | 9e0251f2187388ce03b4afde91df2528e313afd8 (diff) |
Replace aes.c and des.c by Libgcrypt
Follow-up of https://code.wireshark.org/review/20095
Rewritten functions:
- crypt_des_ecb
crypt_des_ecb verified against previous crypt_des_ecb implementation with
4294967295 random keys and input buffers from /dev/random as I cannot find a
suitable pcap which uses DES
Change-Id: I21ec2572451e0ded4299ffadd8dd687817bc6318
Reviewed-on: https://code.wireshark.org/review/20429
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'wsutil/wsgcrypt.h')
-rw-r--r-- | wsutil/wsgcrypt.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/wsutil/wsgcrypt.h b/wsutil/wsgcrypt.h index 6a5ef8290e..90ad24081d 100644 --- a/wsutil/wsgcrypt.h +++ b/wsutil/wsgcrypt.h @@ -29,6 +29,7 @@ #include <ws_diag_control.h> #include "ws_symbol_export.h" +#include <glib.h> DIAG_OFF(deprecated-declarations) @@ -46,4 +47,8 @@ DIAG_ON(deprecated-declarations) algorithm. */ WS_DLL_PUBLIC gcry_error_t ws_hmac_buffer(int algo, void *digest, const void *buffer, size_t length, const void *key, size_t keylen); +/* Convenience function to encrypt 8 bytes in BUFFER with DES using the 56 bits KEY expanded to + 64 bits as key, encrypted data is returned in OUTPUT which must be at least 8 bytes large */ +WS_DLL_PUBLIC void crypt_des_ecb(guint8 *output, const guint8 *buffer, const guint8 *key56); + #endif /* __WSGCRYPT_H__ */ |