Skip to content

Instantly share code, notes, and snippets.

@mzpqnxow
Created September 8, 2020 18:04
Show Gist options
  • Select an option

  • Save mzpqnxow/fb4048ec8b8cb82722cf8cb5f7a9828c to your computer and use it in GitHub Desktop.

Select an option

Save mzpqnxow/fb4048ec8b8cb82722cf8cb5f7a9828c to your computer and use it in GitHub Desktop.
Configure mbedtls for aes-gcm ONLY as a static library
#ifndef MBEDTLS_CONFIG_H
// Build mbtedtls with this as your configuration file and you'll have only what you need
// for AES GCM. You'll find a pretty small statically linked exe, at least when compared
// with WolfSL, OpenSSL, etc, etc. which (to be fair) are really meant to always have some
// amount of SSL/TLS support enabled
#define MBEDTLS_CONFIG_H
#define MBEDTLS_AES_FEWER_TABLES
#define MBEDTLS_NO_UDBL_DIVISION
#define MBEDTLS_AES_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_GCM_C
#include "check_config.h"
#endif /* MBEDTLS_CONFIG_H */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment