You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by st...@apache.org on 2016/09/28 00:44:17 UTC

[51/51] [abbrv] [partial] incubator-mynewt-core git commit: directory re-org, part 1

directory re-org, part 1


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/0216c73e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/0216c73e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/0216c73e

Branch: refs/heads/develop
Commit: 0216c73e5ed24b39d04908801f88410d6eab7cbb
Parents: 514bffa
Author: Sterling Hughes <st...@apache.org>
Authored: Tue Sep 27 17:41:39 2016 -0700
Committer: Sterling Hughes <st...@apache.org>
Committed: Tue Sep 27 17:43:14 2016 -0700

----------------------------------------------------------------------
 apps/sblinky/pkg.yml                            |    2 +-
 apps/test/pkg.yml                               |    2 +-
 crypto/mbedtls/LICENSE                          |    2 +
 crypto/mbedtls/apache-2.0.txt                   |  202 +
 crypto/mbedtls/include/.gitignore               |    4 +
 crypto/mbedtls/include/mbedtls/aes.h            |  297 +
 crypto/mbedtls/include/mbedtls/aesni.h          |  111 +
 crypto/mbedtls/include/mbedtls/arc4.h           |  113 +
 crypto/mbedtls/include/mbedtls/asn1.h           |  342 +
 crypto/mbedtls/include/mbedtls/asn1write.h      |  239 +
 crypto/mbedtls/include/mbedtls/base64.h         |   88 +
 crypto/mbedtls/include/mbedtls/bignum.h         |  717 ++
 crypto/mbedtls/include/mbedtls/blowfish.h       |  203 +
 crypto/mbedtls/include/mbedtls/bn_mul.h         |  876 ++
 crypto/mbedtls/include/mbedtls/camellia.h       |  235 +
 crypto/mbedtls/include/mbedtls/ccm.h            |  141 +
 crypto/mbedtls/include/mbedtls/certs.h          |   99 +
 crypto/mbedtls/include/mbedtls/check_config.h   |  540 ++
 crypto/mbedtls/include/mbedtls/cipher.h         |  698 ++
 .../mbedtls/include/mbedtls/cipher_internal.h   |  109 +
 crypto/mbedtls/include/mbedtls/cmac.h           |  141 +
 crypto/mbedtls/include/mbedtls/compat-1.3.h     | 2634 ++++++
 crypto/mbedtls/include/mbedtls/config.h         | 2523 ++++++
 crypto/mbedtls/include/mbedtls/config_mynewt.h  |  139 +
 crypto/mbedtls/include/mbedtls/ctr_drbg.h       |  290 +
 crypto/mbedtls/include/mbedtls/debug.h          |  125 +
 crypto/mbedtls/include/mbedtls/des.h            |  306 +
 crypto/mbedtls/include/mbedtls/dhm.h            |  305 +
 crypto/mbedtls/include/mbedtls/ecdh.h           |  214 +
 crypto/mbedtls/include/mbedtls/ecdsa.h          |  248 +
 crypto/mbedtls/include/mbedtls/ecjpake.h        |  238 +
 crypto/mbedtls/include/mbedtls/ecp.h            |  672 ++
 crypto/mbedtls/include/mbedtls/entropy.h        |  252 +
 crypto/mbedtls/include/mbedtls/entropy_poll.h   |   89 +
 crypto/mbedtls/include/mbedtls/error.h          |  108 +
 crypto/mbedtls/include/mbedtls/gcm.h            |  220 +
 crypto/mbedtls/include/mbedtls/havege.h         |   74 +
 crypto/mbedtls/include/mbedtls/hmac_drbg.h      |  299 +
 crypto/mbedtls/include/mbedtls/mbedtls_test.h   |   24 +
 crypto/mbedtls/include/mbedtls/md.h             |  353 +
 crypto/mbedtls/include/mbedtls/md2.h            |  136 +
 crypto/mbedtls/include/mbedtls/md4.h            |  136 +
 crypto/mbedtls/include/mbedtls/md5.h            |  136 +
 crypto/mbedtls/include/mbedtls/md_internal.h    |  114 +
 .../include/mbedtls/memory_buffer_alloc.h       |  146 +
 crypto/mbedtls/include/mbedtls/net.h            |  225 +
 crypto/mbedtls/include/mbedtls/oid.h            |  570 ++
 crypto/mbedtls/include/mbedtls/padlock.h        |  107 +
 crypto/mbedtls/include/mbedtls/pem.h            |  129 +
 crypto/mbedtls/include/mbedtls/pk.h             |  615 ++
 crypto/mbedtls/include/mbedtls/pk_internal.h    |  114 +
 crypto/mbedtls/include/mbedtls/pkcs11.h         |  173 +
 crypto/mbedtls/include/mbedtls/pkcs12.h         |  119 +
 crypto/mbedtls/include/mbedtls/pkcs5.h          |   94 +
 crypto/mbedtls/include/mbedtls/platform.h       |  214 +
 crypto/mbedtls/include/mbedtls/ripemd160.h      |  138 +
 crypto/mbedtls/include/mbedtls/rsa.h            |  652 ++
 crypto/mbedtls/include/mbedtls/sha1.h           |  136 +
 crypto/mbedtls/include/mbedtls/sha256.h         |  141 +
 crypto/mbedtls/include/mbedtls/sha512.h         |  141 +
 crypto/mbedtls/include/mbedtls/ssl.h            | 2393 ++++++
 crypto/mbedtls/include/mbedtls/ssl_cache.h      |  143 +
 .../mbedtls/include/mbedtls/ssl_ciphersuites.h  |  321 +
 crypto/mbedtls/include/mbedtls/ssl_cookie.h     |  108 +
 crypto/mbedtls/include/mbedtls/ssl_internal.h   |  495 ++
 crypto/mbedtls/include/mbedtls/ssl_ticket.h     |  135 +
 crypto/mbedtls/include/mbedtls/threading.h      |  104 +
 crypto/mbedtls/include/mbedtls/timing.h         |  141 +
 crypto/mbedtls/include/mbedtls/version.h        |  111 +
 crypto/mbedtls/include/mbedtls/x509.h           |  331 +
 crypto/mbedtls/include/mbedtls/x509_crl.h       |  173 +
 crypto/mbedtls/include/mbedtls/x509_crt.h       |  645 ++
 crypto/mbedtls/include/mbedtls/x509_csr.h       |  292 +
 crypto/mbedtls/include/mbedtls/xtea.h           |  139 +
 crypto/mbedtls/pkg.yml                          |   29 +
 crypto/mbedtls/src/.gitignore                   |    4 +
 crypto/mbedtls/src/aes.c                        | 1490 ++++
 crypto/mbedtls/src/aesni.c                      |  464 ++
 crypto/mbedtls/src/arc4.c                       |  205 +
 crypto/mbedtls/src/asn1parse.c                  |  392 +
 crypto/mbedtls/src/asn1write.c                  |  361 +
 crypto/mbedtls/src/base64.c                     |  289 +
 crypto/mbedtls/src/bignum.c                     | 2433 ++++++
 crypto/mbedtls/src/blowfish.c                   |  656 ++
 crypto/mbedtls/src/camellia.c                   | 1072 +++
 crypto/mbedtls/src/ccm.c                        |  464 ++
 crypto/mbedtls/src/certs.c                      |  351 +
 crypto/mbedtls/src/cipher.c                     |  886 ++
 crypto/mbedtls/src/cipher_wrap.c                | 1451 ++++
 crypto/mbedtls/src/cmac.c                       |  529 ++
 crypto/mbedtls/src/ctr_drbg.c                   |  593 ++
 crypto/mbedtls/src/debug.c                      |  367 +
 crypto/mbedtls/src/des.c                        | 1061 +++
 crypto/mbedtls/src/dhm.c                        |  624 ++
 crypto/mbedtls/src/ecdh.c                       |  264 +
 crypto/mbedtls/src/ecdsa.c                      |  448 ++
 crypto/mbedtls/src/ecjpake.c                    | 1103 +++
 crypto/mbedtls/src/ecp.c                        | 2090 +++++
 crypto/mbedtls/src/ecp_curves.c                 | 1345 ++++
 crypto/mbedtls/src/entropy.c                    |  493 ++
 crypto/mbedtls/src/entropy_poll.c               |  216 +
 crypto/mbedtls/src/error.c                      |  711 ++
 crypto/mbedtls/src/gcm.c                        |  953 +++
 crypto/mbedtls/src/havege.c                     |  243 +
 crypto/mbedtls/src/hmac_drbg.c                  |  529 ++
 crypto/mbedtls/src/md.c                         |  471 ++
 crypto/mbedtls/src/md2.c                        |  288 +
 crypto/mbedtls/src/md4.c                        |  384 +
 crypto/mbedtls/src/md5.c                        |  404 +
 crypto/mbedtls/src/md_wrap.c                    |  575 ++
 crypto/mbedtls/src/memory_buffer_alloc.c        |  750 ++
 crypto/mbedtls/src/net.c                        |  575 ++
 crypto/mbedtls/src/oid.c                        |  650 ++
 crypto/mbedtls/src/padlock.c                    |  170 +
 crypto/mbedtls/src/pem.c                        |  447 +
 crypto/mbedtls/src/pk.c                         |  374 +
 crypto/mbedtls/src/pk_wrap.c                    |  495 ++
 crypto/mbedtls/src/pkcs11.c                     |  240 +
 crypto/mbedtls/src/pkcs12.c                     |  365 +
 crypto/mbedtls/src/pkcs5.c                      |  405 +
 crypto/mbedtls/src/pkparse.c                    | 1293 +++
 crypto/mbedtls/src/pkwrite.c                    |  439 +
 crypto/mbedtls/src/platform.c                   |  193 +
 crypto/mbedtls/src/ripemd160.c                  |  464 ++
 crypto/mbedtls/src/rsa.c                        | 1705 ++++
 crypto/mbedtls/src/sha1.c                       |  448 ++
 crypto/mbedtls/src/sha256.c                     |  445 +
 crypto/mbedtls/src/sha512.c                     |  500 ++
 crypto/mbedtls/src/ssl_cache.c                  |  326 +
 crypto/mbedtls/src/ssl_ciphersuites.c           | 1852 +++++
 crypto/mbedtls/src/ssl_cli.c                    | 3390 ++++++++
 crypto/mbedtls/src/ssl_cookie.c                 |  260 +
 crypto/mbedtls/src/ssl_srv.c                    | 3881 +++++++++
 crypto/mbedtls/src/ssl_ticket.c                 |  489 ++
 crypto/mbedtls/src/ssl_tls.c                    | 7602 ++++++++++++++++++
 crypto/mbedtls/src/threading.c                  |  136 +
 crypto/mbedtls/src/timing.c                     |  520 ++
 crypto/mbedtls/src/version.c                    |   50 +
 crypto/mbedtls/src/version_features.c           |  638 ++
 crypto/mbedtls/src/x509.c                       | 1024 +++
 crypto/mbedtls/src/x509_create.c                |  340 +
 crypto/mbedtls/src/x509_crl.c                   |  722 ++
 crypto/mbedtls/src/x509_crt.c                   | 2372 ++++++
 crypto/mbedtls/src/x509_csr.c                   |  417 +
 crypto/mbedtls/src/x509write_crt.c              |  456 ++
 crypto/mbedtls/src/x509write_csr.c              |  256 +
 crypto/mbedtls/src/xtea.c                       |  281 +
 crypto/mbedtls/test/pkg.yml                     |   30 +
 crypto/mbedtls/test/src/mbedtls_test.c          |  228 +
 crypto/tinycrypt/README                         |   47 +
 crypto/tinycrypt/include/tinycrypt/aes.h        |  133 +
 crypto/tinycrypt/include/tinycrypt/cbc_mode.h   |  151 +
 crypto/tinycrypt/include/tinycrypt/ccm_mode.h   |  201 +
 crypto/tinycrypt/include/tinycrypt/cmac_mode.h  |  194 +
 crypto/tinycrypt/include/tinycrypt/constants.h  |   59 +
 crypto/tinycrypt/include/tinycrypt/ctr_mode.h   |  108 +
 crypto/tinycrypt/include/tinycrypt/ecc.h        |  320 +
 crypto/tinycrypt/include/tinycrypt/ecc_dh.h     |  144 +
 crypto/tinycrypt/include/tinycrypt/ecc_dsa.h    |  135 +
 crypto/tinycrypt/include/tinycrypt/hmac.h       |  140 +
 crypto/tinycrypt/include/tinycrypt/hmac_prng.h  |  164 +
 crypto/tinycrypt/include/tinycrypt/sha256.h     |  131 +
 crypto/tinycrypt/include/tinycrypt/utils.h      |   99 +
 crypto/tinycrypt/pkg.yml                        |   27 +
 crypto/tinycrypt/src/aes_decrypt.c              |  164 +
 crypto/tinycrypt/src/aes_encrypt.c              |  191 +
 crypto/tinycrypt/src/cbc_mode.c                 |  113 +
 crypto/tinycrypt/src/ccm_mode.c                 |  262 +
 crypto/tinycrypt/src/cmac_mode.c                |  254 +
 crypto/tinycrypt/src/ctr_mode.c                 |   85 +
 crypto/tinycrypt/src/ecc.c                      |  604 ++
 crypto/tinycrypt/src/ecc_dh.c                   |  123 +
 crypto/tinycrypt/src/ecc_dsa.c                  |  117 +
 crypto/tinycrypt/src/hmac.c                     |  149 +
 crypto/tinycrypt/src/hmac_prng.c                |  210 +
 crypto/tinycrypt/src/sha256.c                   |  219 +
 crypto/tinycrypt/src/utils.c                    |   78 +
 .../adc/adc_nrf51/include/adc_nrf51/adc_nrf51.h |   30 -
 drivers/adc/adc_nrf51/pkg.yml                   |   28 -
 drivers/adc/adc_nrf51/src/adc_nrf51.c           |  400 -
 .../adc/adc_nrf52/include/adc_nrf52/adc_nrf52.h |   30 -
 drivers/adc/adc_nrf52/pkg.yml                   |   28 -
 drivers/adc/adc_nrf52/src/adc_nrf52.c           |  398 -
 drivers/adc/include/adc/adc.h                   |  277 -
 drivers/adc/pkg.yml                             |   26 -
 drivers/adc/src/adc.c                           |   89 -
 drivers/nimble/native/include/ble/xcvr.h        |   38 -
 drivers/nimble/native/pkg.yml                   |   30 -
 drivers/nimble/native/src/ble_hw.c              |  225 -
 drivers/nimble/native/src/ble_phy.c             |  603 --
 drivers/nimble/nrf51/include/ble/xcvr.h         |   38 -
 drivers/nimble/nrf51/pkg.yml                    |   31 -
 drivers/nimble/nrf51/src/ble_hw.c               |  432 -
 drivers/nimble/nrf51/src/ble_phy.c              | 1204 ---
 drivers/nimble/nrf52/include/ble/xcvr.h         |   38 -
 drivers/nimble/nrf52/pkg.yml                    |   31 -
 drivers/nimble/nrf52/src/ble_hw.c               |  434 -
 drivers/nimble/nrf52/src/ble_phy.c              | 1170 ---
 drivers/uart/include/uart/uart.h                |  139 -
 drivers/uart/pkg.yml                            |   27 -
 drivers/uart/src/uart.c                         |   18 -
 .../include/uart_bitbang/uart_bitbang.h         |   32 -
 drivers/uart/uart_bitbang/pkg.yml               |   29 -
 drivers/uart/uart_bitbang/src/uart_bitbang.c    |  346 -
 .../uart/uart_hal/include/uart_hal/uart_hal.h   |   26 -
 drivers/uart/uart_hal/pkg.yml                   |   29 -
 drivers/uart/uart_hal/src/uart_hal.c            |  143 -
 hw/bsp/arduino_primo_nrf52/pkg.yml              |    8 +-
 hw/bsp/bmd300eval/pkg.yml                       |    8 +-
 hw/bsp/native/pkg.yml                           |    4 +-
 hw/bsp/nrf51-arduino_101/pkg.yml                |    8 +-
 hw/bsp/nrf51-blenano/pkg.yml                    |    8 +-
 hw/bsp/nrf51dk-16kbram/pkg.yml                  |    8 +-
 hw/bsp/nrf51dk/pkg.yml                          |    8 +-
 hw/bsp/nrf52dk/pkg.yml                          |    8 +-
 hw/bsp/nrf52pdk/pkg.yml                         |    8 +-
 hw/bsp/olimex_stm32-e407_devboard/pkg.yml       |   10 +-
 .../adc/adc_nrf51/include/adc_nrf51/adc_nrf51.h |   30 +
 hw/drivers/adc/adc_nrf51/pkg.yml                |   28 +
 hw/drivers/adc/adc_nrf51/src/adc_nrf51.c        |  400 +
 .../adc/adc_nrf52/include/adc_nrf52/adc_nrf52.h |   30 +
 hw/drivers/adc/adc_nrf52/pkg.yml                |   28 +
 hw/drivers/adc/adc_nrf52/src/adc_nrf52.c        |  398 +
 hw/drivers/adc/include/adc/adc.h                |  277 +
 hw/drivers/adc/pkg.yml                          |   26 +
 hw/drivers/adc/src/adc.c                        |   89 +
 hw/drivers/nimble/native/include/ble/xcvr.h     |   38 +
 hw/drivers/nimble/native/pkg.yml                |   30 +
 hw/drivers/nimble/native/src/ble_hw.c           |  225 +
 hw/drivers/nimble/native/src/ble_phy.c          |  603 ++
 hw/drivers/nimble/nrf51/include/ble/xcvr.h      |   38 +
 hw/drivers/nimble/nrf51/pkg.yml                 |   31 +
 hw/drivers/nimble/nrf51/src/ble_hw.c            |  432 +
 hw/drivers/nimble/nrf51/src/ble_phy.c           | 1204 +++
 hw/drivers/nimble/nrf52/include/ble/xcvr.h      |   38 +
 hw/drivers/nimble/nrf52/pkg.yml                 |   31 +
 hw/drivers/nimble/nrf52/src/ble_hw.c            |  434 +
 hw/drivers/nimble/nrf52/src/ble_phy.c           | 1170 +++
 hw/drivers/uart/include/uart/uart.h             |  139 +
 hw/drivers/uart/pkg.yml                         |   27 +
 hw/drivers/uart/src/uart.c                      |   18 +
 .../include/uart_bitbang/uart_bitbang.h         |   32 +
 hw/drivers/uart/uart_bitbang/pkg.yml            |   29 +
 hw/drivers/uart/uart_bitbang/src/uart_bitbang.c |  346 +
 .../uart/uart_hal/include/uart_hal/uart_hal.h   |   26 +
 hw/drivers/uart/uart_hal/pkg.yml                |   29 +
 hw/drivers/uart/uart_hal/src/uart_hal.c         |  143 +
 libs/bootutil/pkg.yml                           |    2 +-
 libs/console/full/pkg.yml                       |    2 +-
 .../include/inet_def_service/inet_def_service.h |   25 -
 libs/inet_def_service/pkg.yml                   |   35 -
 libs/inet_def_service/src/inet_def_service.c    |  333 -
 libs/mbedtls/LICENSE                            |    2 -
 libs/mbedtls/apache-2.0.txt                     |  202 -
 libs/mbedtls/include/.gitignore                 |    4 -
 libs/mbedtls/include/mbedtls/aes.h              |  297 -
 libs/mbedtls/include/mbedtls/aesni.h            |  111 -
 libs/mbedtls/include/mbedtls/arc4.h             |  113 -
 libs/mbedtls/include/mbedtls/asn1.h             |  342 -
 libs/mbedtls/include/mbedtls/asn1write.h        |  239 -
 libs/mbedtls/include/mbedtls/base64.h           |   88 -
 libs/mbedtls/include/mbedtls/bignum.h           |  717 --
 libs/mbedtls/include/mbedtls/blowfish.h         |  203 -
 libs/mbedtls/include/mbedtls/bn_mul.h           |  876 --
 libs/mbedtls/include/mbedtls/camellia.h         |  235 -
 libs/mbedtls/include/mbedtls/ccm.h              |  141 -
 libs/mbedtls/include/mbedtls/certs.h            |   99 -
 libs/mbedtls/include/mbedtls/check_config.h     |  540 --
 libs/mbedtls/include/mbedtls/cipher.h           |  698 --
 libs/mbedtls/include/mbedtls/cipher_internal.h  |  109 -
 libs/mbedtls/include/mbedtls/cmac.h             |  141 -
 libs/mbedtls/include/mbedtls/compat-1.3.h       | 2634 ------
 libs/mbedtls/include/mbedtls/config.h           | 2523 ------
 libs/mbedtls/include/mbedtls/config_mynewt.h    |  139 -
 libs/mbedtls/include/mbedtls/ctr_drbg.h         |  290 -
 libs/mbedtls/include/mbedtls/debug.h            |  125 -
 libs/mbedtls/include/mbedtls/des.h              |  306 -
 libs/mbedtls/include/mbedtls/dhm.h              |  305 -
 libs/mbedtls/include/mbedtls/ecdh.h             |  214 -
 libs/mbedtls/include/mbedtls/ecdsa.h            |  248 -
 libs/mbedtls/include/mbedtls/ecjpake.h          |  238 -
 libs/mbedtls/include/mbedtls/ecp.h              |  672 --
 libs/mbedtls/include/mbedtls/entropy.h          |  252 -
 libs/mbedtls/include/mbedtls/entropy_poll.h     |   89 -
 libs/mbedtls/include/mbedtls/error.h            |  108 -
 libs/mbedtls/include/mbedtls/gcm.h              |  220 -
 libs/mbedtls/include/mbedtls/havege.h           |   74 -
 libs/mbedtls/include/mbedtls/hmac_drbg.h        |  299 -
 libs/mbedtls/include/mbedtls/mbedtls_test.h     |   24 -
 libs/mbedtls/include/mbedtls/md.h               |  353 -
 libs/mbedtls/include/mbedtls/md2.h              |  136 -
 libs/mbedtls/include/mbedtls/md4.h              |  136 -
 libs/mbedtls/include/mbedtls/md5.h              |  136 -
 libs/mbedtls/include/mbedtls/md_internal.h      |  114 -
 .../include/mbedtls/memory_buffer_alloc.h       |  146 -
 libs/mbedtls/include/mbedtls/net.h              |  225 -
 libs/mbedtls/include/mbedtls/oid.h              |  570 --
 libs/mbedtls/include/mbedtls/padlock.h          |  107 -
 libs/mbedtls/include/mbedtls/pem.h              |  129 -
 libs/mbedtls/include/mbedtls/pk.h               |  615 --
 libs/mbedtls/include/mbedtls/pk_internal.h      |  114 -
 libs/mbedtls/include/mbedtls/pkcs11.h           |  173 -
 libs/mbedtls/include/mbedtls/pkcs12.h           |  119 -
 libs/mbedtls/include/mbedtls/pkcs5.h            |   94 -
 libs/mbedtls/include/mbedtls/platform.h         |  214 -
 libs/mbedtls/include/mbedtls/ripemd160.h        |  138 -
 libs/mbedtls/include/mbedtls/rsa.h              |  652 --
 libs/mbedtls/include/mbedtls/sha1.h             |  136 -
 libs/mbedtls/include/mbedtls/sha256.h           |  141 -
 libs/mbedtls/include/mbedtls/sha512.h           |  141 -
 libs/mbedtls/include/mbedtls/ssl.h              | 2393 ------
 libs/mbedtls/include/mbedtls/ssl_cache.h        |  143 -
 libs/mbedtls/include/mbedtls/ssl_ciphersuites.h |  321 -
 libs/mbedtls/include/mbedtls/ssl_cookie.h       |  108 -
 libs/mbedtls/include/mbedtls/ssl_internal.h     |  495 --
 libs/mbedtls/include/mbedtls/ssl_ticket.h       |  135 -
 libs/mbedtls/include/mbedtls/threading.h        |  104 -
 libs/mbedtls/include/mbedtls/timing.h           |  141 -
 libs/mbedtls/include/mbedtls/version.h          |  111 -
 libs/mbedtls/include/mbedtls/x509.h             |  331 -
 libs/mbedtls/include/mbedtls/x509_crl.h         |  173 -
 libs/mbedtls/include/mbedtls/x509_crt.h         |  645 --
 libs/mbedtls/include/mbedtls/x509_csr.h         |  292 -
 libs/mbedtls/include/mbedtls/xtea.h             |  139 -
 libs/mbedtls/pkg.yml                            |   29 -
 libs/mbedtls/src/.gitignore                     |    4 -
 libs/mbedtls/src/aes.c                          | 1490 ----
 libs/mbedtls/src/aesni.c                        |  464 --
 libs/mbedtls/src/arc4.c                         |  205 -
 libs/mbedtls/src/asn1parse.c                    |  392 -
 libs/mbedtls/src/asn1write.c                    |  361 -
 libs/mbedtls/src/base64.c                       |  289 -
 libs/mbedtls/src/bignum.c                       | 2433 ------
 libs/mbedtls/src/blowfish.c                     |  656 --
 libs/mbedtls/src/camellia.c                     | 1072 ---
 libs/mbedtls/src/ccm.c                          |  464 --
 libs/mbedtls/src/certs.c                        |  351 -
 libs/mbedtls/src/cipher.c                       |  886 --
 libs/mbedtls/src/cipher_wrap.c                  | 1451 ----
 libs/mbedtls/src/cmac.c                         |  529 --
 libs/mbedtls/src/ctr_drbg.c                     |  593 --
 libs/mbedtls/src/debug.c                        |  367 -
 libs/mbedtls/src/des.c                          | 1061 ---
 libs/mbedtls/src/dhm.c                          |  624 --
 libs/mbedtls/src/ecdh.c                         |  264 -
 libs/mbedtls/src/ecdsa.c                        |  448 --
 libs/mbedtls/src/ecjpake.c                      | 1103 ---
 libs/mbedtls/src/ecp.c                          | 2090 -----
 libs/mbedtls/src/ecp_curves.c                   | 1345 ----
 libs/mbedtls/src/entropy.c                      |  493 --
 libs/mbedtls/src/entropy_poll.c                 |  216 -
 libs/mbedtls/src/error.c                        |  711 --
 libs/mbedtls/src/gcm.c                          |  953 ---
 libs/mbedtls/src/havege.c                       |  243 -
 libs/mbedtls/src/hmac_drbg.c                    |  529 --
 libs/mbedtls/src/md.c                           |  471 --
 libs/mbedtls/src/md2.c                          |  288 -
 libs/mbedtls/src/md4.c                          |  384 -
 libs/mbedtls/src/md5.c                          |  404 -
 libs/mbedtls/src/md_wrap.c                      |  575 --
 libs/mbedtls/src/memory_buffer_alloc.c          |  750 --
 libs/mbedtls/src/net.c                          |  575 --
 libs/mbedtls/src/oid.c                          |  650 --
 libs/mbedtls/src/padlock.c                      |  170 -
 libs/mbedtls/src/pem.c                          |  447 -
 libs/mbedtls/src/pk.c                           |  374 -
 libs/mbedtls/src/pk_wrap.c                      |  495 --
 libs/mbedtls/src/pkcs11.c                       |  240 -
 libs/mbedtls/src/pkcs12.c                       |  365 -
 libs/mbedtls/src/pkcs5.c                        |  405 -
 libs/mbedtls/src/pkparse.c                      | 1293 ---
 libs/mbedtls/src/pkwrite.c                      |  439 -
 libs/mbedtls/src/platform.c                     |  193 -
 libs/mbedtls/src/ripemd160.c                    |  464 --
 libs/mbedtls/src/rsa.c                          | 1705 ----
 libs/mbedtls/src/sha1.c                         |  448 --
 libs/mbedtls/src/sha256.c                       |  445 -
 libs/mbedtls/src/sha512.c                       |  500 --
 libs/mbedtls/src/ssl_cache.c                    |  326 -
 libs/mbedtls/src/ssl_ciphersuites.c             | 1852 -----
 libs/mbedtls/src/ssl_cli.c                      | 3390 --------
 libs/mbedtls/src/ssl_cookie.c                   |  260 -
 libs/mbedtls/src/ssl_srv.c                      | 3881 ---------
 libs/mbedtls/src/ssl_ticket.c                   |  489 --
 libs/mbedtls/src/ssl_tls.c                      | 7602 ------------------
 libs/mbedtls/src/threading.c                    |  136 -
 libs/mbedtls/src/timing.c                       |  520 --
 libs/mbedtls/src/version.c                      |   50 -
 libs/mbedtls/src/version_features.c             |  638 --
 libs/mbedtls/src/x509.c                         | 1024 ---
 libs/mbedtls/src/x509_create.c                  |  340 -
 libs/mbedtls/src/x509_crl.c                     |  722 --
 libs/mbedtls/src/x509_crt.c                     | 2372 ------
 libs/mbedtls/src/x509_csr.c                     |  417 -
 libs/mbedtls/src/x509write_crt.c                |  456 --
 libs/mbedtls/src/x509write_csr.c                |  256 -
 libs/mbedtls/src/xtea.c                         |  281 -
 libs/mbedtls/test/pkg.yml                       |   30 -
 libs/mbedtls/test/src/mbedtls_test.c            |  228 -
 libs/tinycrypt/README                           |   47 -
 libs/tinycrypt/include/tinycrypt/aes.h          |  133 -
 libs/tinycrypt/include/tinycrypt/cbc_mode.h     |  151 -
 libs/tinycrypt/include/tinycrypt/ccm_mode.h     |  201 -
 libs/tinycrypt/include/tinycrypt/cmac_mode.h    |  194 -
 libs/tinycrypt/include/tinycrypt/constants.h    |   59 -
 libs/tinycrypt/include/tinycrypt/ctr_mode.h     |  108 -
 libs/tinycrypt/include/tinycrypt/ecc.h          |  320 -
 libs/tinycrypt/include/tinycrypt/ecc_dh.h       |  144 -
 libs/tinycrypt/include/tinycrypt/ecc_dsa.h      |  135 -
 libs/tinycrypt/include/tinycrypt/hmac.h         |  140 -
 libs/tinycrypt/include/tinycrypt/hmac_prng.h    |  164 -
 libs/tinycrypt/include/tinycrypt/sha256.h       |  131 -
 libs/tinycrypt/include/tinycrypt/utils.h        |   99 -
 libs/tinycrypt/pkg.yml                          |   27 -
 libs/tinycrypt/src/aes_decrypt.c                |  164 -
 libs/tinycrypt/src/aes_encrypt.c                |  191 -
 libs/tinycrypt/src/cbc_mode.c                   |  113 -
 libs/tinycrypt/src/ccm_mode.c                   |  262 -
 libs/tinycrypt/src/cmac_mode.c                  |  254 -
 libs/tinycrypt/src/ctr_mode.c                   |   85 -
 libs/tinycrypt/src/ecc.c                        |  604 --
 libs/tinycrypt/src/ecc_dh.c                     |  123 -
 libs/tinycrypt/src/ecc_dsa.c                    |  117 -
 libs/tinycrypt/src/hmac.c                       |  149 -
 libs/tinycrypt/src/hmac_prng.c                  |  210 -
 libs/tinycrypt/src/sha256.c                     |  219 -
 libs/tinycrypt/src/utils.c                      |   78 -
 libs/wifi_mgmt/include/wifi_mgmt/wifi_mgmt.h    |   82 -
 libs/wifi_mgmt/include/wifi_mgmt/wifi_mgmt_if.h |   47 -
 libs/wifi_mgmt/pkg.yml                          |   34 -
 libs/wifi_mgmt/src/wifi.c                       |  348 -
 libs/wifi_mgmt/src/wifi_cli.c                   |   96 -
 libs/wifi_mgmt/src/wifi_priv.h                  |   29 -
 .../include/inet_def_service/inet_def_service.h |   25 +
 net/ip/inet_def_service/pkg.yml                 |   35 +
 net/ip/inet_def_service/src/inet_def_service.c  |  333 +
 net/nimble/host/pkg.yml                         |    4 +-
 .../wifi_mgmt/include/wifi_mgmt/wifi_mgmt.h     |   82 +
 .../wifi_mgmt/include/wifi_mgmt/wifi_mgmt_if.h  |   47 +
 net/wifi/wifi_mgmt/pkg.yml                      |   34 +
 net/wifi/wifi_mgmt/src/wifi.c                   |  348 +
 net/wifi/wifi_mgmt/src/wifi_cli.c               |   96 +
 net/wifi/wifi_mgmt/src/wifi_priv.h              |   29 +
 443 files changed, 95568 insertions(+), 95568 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0216c73e/apps/sblinky/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/sblinky/pkg.yml b/apps/sblinky/pkg.yml
index a1bab7e..54f7508 100644
--- a/apps/sblinky/pkg.yml
+++ b/apps/sblinky/pkg.yml
@@ -26,7 +26,7 @@ pkg.keywords:
 
 pkg.deps:
     - libs/newtmgr
-    - drivers/adc
+    - hw/drivers/adc
     - fs/nffs
     - libs/console/full
     - libs/os

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0216c73e/apps/test/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/test/pkg.yml b/apps/test/pkg.yml
index 5dc353a..22bee48 100644
--- a/apps/test/pkg.yml
+++ b/apps/test/pkg.yml
@@ -28,7 +28,7 @@ pkg.deps:
     - fs/nffs
     - libs/bootutil
     - libs/console/full
-    - libs/mbedtls
+    - crypto/mbedtls
     - libs/os
     - libs/testreport
     - libs/testutil

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0216c73e/crypto/mbedtls/LICENSE
----------------------------------------------------------------------
diff --git a/crypto/mbedtls/LICENSE b/crypto/mbedtls/LICENSE
new file mode 100644
index 0000000..546a8e6
--- /dev/null
+++ b/crypto/mbedtls/LICENSE
@@ -0,0 +1,2 @@
+Unless specifically indicated otherwise in a file, files are licensed
+under the Apache 2.0 license, as can be found in: apache-2.0.txt

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0216c73e/crypto/mbedtls/apache-2.0.txt
----------------------------------------------------------------------
diff --git a/crypto/mbedtls/apache-2.0.txt b/crypto/mbedtls/apache-2.0.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/crypto/mbedtls/apache-2.0.txt
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0216c73e/crypto/mbedtls/include/.gitignore
----------------------------------------------------------------------
diff --git a/crypto/mbedtls/include/.gitignore b/crypto/mbedtls/include/.gitignore
new file mode 100644
index 0000000..bf67d02
--- /dev/null
+++ b/crypto/mbedtls/include/.gitignore
@@ -0,0 +1,4 @@
+Makefile
+*.sln
+*.vcxproj
+mbedtls/check_config

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0216c73e/crypto/mbedtls/include/mbedtls/aes.h
----------------------------------------------------------------------
diff --git a/crypto/mbedtls/include/mbedtls/aes.h b/crypto/mbedtls/include/mbedtls/aes.h
new file mode 100644
index 0000000..a36e825
--- /dev/null
+++ b/crypto/mbedtls/include/mbedtls/aes.h
@@ -0,0 +1,297 @@
+/**
+ * \file aes.h
+ *
+ * \brief AES block cipher
+ *
+ *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may
+ *  not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  This file is part of mbed TLS (https://tls.mbed.org)
+ */
+#ifndef MBEDTLS_AES_H
+#define MBEDTLS_AES_H
+
+#if !defined(MBEDTLS_CONFIG_FILE)
+#include "config.h"
+#else
+#include MBEDTLS_CONFIG_FILE
+#endif
+
+#include <stddef.h>
+#include <stdint.h>
+
+/* padlock.c and aesni.c rely on these values! */
+#define MBEDTLS_AES_ENCRYPT     1
+#define MBEDTLS_AES_DECRYPT     0
+
+#define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH                -0x0020  /**< Invalid key length. */
+#define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH              -0x0022  /**< Invalid data input length. */
+
+#if !defined(MBEDTLS_AES_ALT)
+// Regular implementation
+//
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief          AES context structure
+ *
+ * \note           buf is able to hold 32 extra bytes, which can be used:
+ *                 - for alignment purposes if VIA padlock is used, and/or
+ *                 - to simplify key expansion in the 256-bit case by
+ *                 generating an extra round key
+ */
+typedef struct
+{
+    int nr;                     /*!<  number of rounds  */
+    uint32_t *rk;               /*!<  AES round keys    */
+    uint32_t buf[68];           /*!<  unaligned data    */
+}
+mbedtls_aes_context;
+
+/**
+ * \brief          Initialize AES context
+ *
+ * \param ctx      AES context to be initialized
+ */
+void mbedtls_aes_init( mbedtls_aes_context *ctx );
+
+/**
+ * \brief          Clear AES context
+ *
+ * \param ctx      AES context to be cleared
+ */
+void mbedtls_aes_free( mbedtls_aes_context *ctx );
+
+/**
+ * \brief          AES key schedule (encryption)
+ *
+ * \param ctx      AES context to be initialized
+ * \param key      encryption key
+ * \param keybits  must be 128, 192 or 256
+ *
+ * \return         0 if successful, or MBEDTLS_ERR_AES_INVALID_KEY_LENGTH
+ */
+int mbedtls_aes_setkey_enc( mbedtls_aes_context *ctx, const unsigned char *key,
+                    unsigned int keybits );
+
+/**
+ * \brief          AES key schedule (decryption)
+ *
+ * \param ctx      AES context to be initialized
+ * \param key      decryption key
+ * \param keybits  must be 128, 192 or 256
+ *
+ * \return         0 if successful, or MBEDTLS_ERR_AES_INVALID_KEY_LENGTH
+ */
+int mbedtls_aes_setkey_dec( mbedtls_aes_context *ctx, const unsigned char *key,
+                    unsigned int keybits );
+
+/**
+ * \brief          AES-ECB block encryption/decryption
+ *
+ * \param ctx      AES context
+ * \param mode     MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
+ * \param input    16-byte input block
+ * \param output   16-byte output block
+ *
+ * \return         0 if successful
+ */
+int mbedtls_aes_crypt_ecb( mbedtls_aes_context *ctx,
+                    int mode,
+                    const unsigned char input[16],
+                    unsigned char output[16] );
+
+#if defined(MBEDTLS_CIPHER_MODE_CBC)
+/**
+ * \brief          AES-CBC buffer encryption/decryption
+ *                 Length should be a multiple of the block
+ *                 size (16 bytes)
+ *
+ * \note           Upon exit, the content of the IV is updated so that you can
+ *                 call the function same function again on the following
+ *                 block(s) of data and get the same result as if it was
+ *                 encrypted in one call. This allows a "streaming" usage.
+ *                 If on the other hand you need to retain the contents of the
+ *                 IV, you should either save it manually or use the cipher
+ *                 module instead.
+ *
+ * \param ctx      AES context
+ * \param mode     MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
+ * \param length   length of the input data
+ * \param iv       initialization vector (updated after use)
+ * \param input    buffer holding the input data
+ * \param output   buffer holding the output data
+ *
+ * \return         0 if successful, or MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH
+ */
+int mbedtls_aes_crypt_cbc( mbedtls_aes_context *ctx,
+                    int mode,
+                    size_t length,
+                    unsigned char iv[16],
+                    const unsigned char *input,
+                    unsigned char *output );
+#endif /* MBEDTLS_CIPHER_MODE_CBC */
+
+#if defined(MBEDTLS_CIPHER_MODE_CFB)
+/**
+ * \brief          AES-CFB128 buffer encryption/decryption.
+ *
+ * Note: Due to the nature of CFB you should use the same key schedule for
+ * both encryption and decryption. So a context initialized with
+ * mbedtls_aes_setkey_enc() for both MBEDTLS_AES_ENCRYPT and MBEDTLS_AES_DECRYPT.
+ *
+ * \note           Upon exit, the content of the IV is updated so that you can
+ *                 call the function same function again on the following
+ *                 block(s) of data and get the same result as if it was
+ *                 encrypted in one call. This allows a "streaming" usage.
+ *                 If on the other hand you need to retain the contents of the
+ *                 IV, you should either save it manually or use the cipher
+ *                 module instead.
+ *
+ * \param ctx      AES context
+ * \param mode     MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
+ * \param length   length of the input data
+ * \param iv_off   offset in IV (updated after use)
+ * \param iv       initialization vector (updated after use)
+ * \param input    buffer holding the input data
+ * \param output   buffer holding the output data
+ *
+ * \return         0 if successful
+ */
+int mbedtls_aes_crypt_cfb128( mbedtls_aes_context *ctx,
+                       int mode,
+                       size_t length,
+                       size_t *iv_off,
+                       unsigned char iv[16],
+                       const unsigned char *input,
+                       unsigned char *output );
+
+/**
+ * \brief          AES-CFB8 buffer encryption/decryption.
+ *
+ * Note: Due to the nature of CFB you should use the same key schedule for
+ * both encryption and decryption. So a context initialized with
+ * mbedtls_aes_setkey_enc() for both MBEDTLS_AES_ENCRYPT and MBEDTLS_AES_DECRYPT.
+ *
+ * \note           Upon exit, the content of the IV is updated so that you can
+ *                 call the function same function again on the following
+ *                 block(s) of data and get the same result as if it was
+ *                 encrypted in one call. This allows a "streaming" usage.
+ *                 If on the other hand you need to retain the contents of the
+ *                 IV, you should either save it manually or use the cipher
+ *                 module instead.
+ *
+ * \param ctx      AES context
+ * \param mode     MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
+ * \param length   length of the input data
+ * \param iv       initialization vector (updated after use)
+ * \param input    buffer holding the input data
+ * \param output   buffer holding the output data
+ *
+ * \return         0 if successful
+ */
+int mbedtls_aes_crypt_cfb8( mbedtls_aes_context *ctx,
+                    int mode,
+                    size_t length,
+                    unsigned char iv[16],
+                    const unsigned char *input,
+                    unsigned char *output );
+#endif /*MBEDTLS_CIPHER_MODE_CFB */
+
+#if defined(MBEDTLS_CIPHER_MODE_CTR)
+/**
+ * \brief               AES-CTR buffer encryption/decryption
+ *
+ * Warning: You have to keep the maximum use of your counter in mind!
+ *
+ * Note: Due to the nature of CTR you should use the same key schedule for
+ * both encryption and decryption. So a context initialized with
+ * mbedtls_aes_setkey_enc() for both MBEDTLS_AES_ENCRYPT and MBEDTLS_AES_DECRYPT.
+ *
+ * \param ctx           AES context
+ * \param length        The length of the data
+ * \param nc_off        The offset in the current stream_block (for resuming
+ *                      within current cipher stream). The offset pointer to
+ *                      should be 0 at the start of a stream.
+ * \param nonce_counter The 128-bit nonce and counter.
+ * \param stream_block  The saved stream-block for resuming. Is overwritten
+ *                      by the function.
+ * \param input         The input data stream
+ * \param output        The output data stream
+ *
+ * \return         0 if successful
+ */
+int mbedtls_aes_crypt_ctr( mbedtls_aes_context *ctx,
+                       size_t length,
+                       size_t *nc_off,
+                       unsigned char nonce_counter[16],
+                       unsigned char stream_block[16],
+                       const unsigned char *input,
+                       unsigned char *output );
+#endif /* MBEDTLS_CIPHER_MODE_CTR */
+
+/**
+ * \brief           Internal AES block encryption function
+ *                  (Only exposed to allow overriding it,
+ *                  see MBEDTLS_AES_ENCRYPT_ALT)
+ *
+ * \param ctx       AES context
+ * \param input     Plaintext block
+ * \param output    Output (ciphertext) block
+ */
+void mbedtls_aes_encrypt( mbedtls_aes_context *ctx,
+                          const unsigned char input[16],
+                          unsigned char output[16] );
+
+/**
+ * \brief           Internal AES block decryption function
+ *                  (Only exposed to allow overriding it,
+ *                  see MBEDTLS_AES_DECRYPT_ALT)
+ *
+ * \param ctx       AES context
+ * \param input     Ciphertext block
+ * \param output    Output (plaintext) block
+ */
+void mbedtls_aes_decrypt( mbedtls_aes_context *ctx,
+                          const unsigned char input[16],
+                          unsigned char output[16] );
+
+#ifdef __cplusplus
+}
+#endif
+
+#else  /* MBEDTLS_AES_ALT */
+#include "aes_alt.h"
+#endif /* MBEDTLS_AES_ALT */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief          Checkup routine
+ *
+ * \return         0 if successful, or 1 if the test failed
+ */
+int mbedtls_aes_self_test( int verbose );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* aes.h */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0216c73e/crypto/mbedtls/include/mbedtls/aesni.h
----------------------------------------------------------------------
diff --git a/crypto/mbedtls/include/mbedtls/aesni.h b/crypto/mbedtls/include/mbedtls/aesni.h
new file mode 100644
index 0000000..b1b7f1c
--- /dev/null
+++ b/crypto/mbedtls/include/mbedtls/aesni.h
@@ -0,0 +1,111 @@
+/**
+ * \file aesni.h
+ *
+ * \brief AES-NI for hardware AES acceleration on some Intel processors
+ *
+ *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may
+ *  not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  This file is part of mbed TLS (https://tls.mbed.org)
+ */
+#ifndef MBEDTLS_AESNI_H
+#define MBEDTLS_AESNI_H
+
+#include "aes.h"
+
+#define MBEDTLS_AESNI_AES      0x02000000u
+#define MBEDTLS_AESNI_CLMUL    0x00000002u
+
+#if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) &&  \
+    ( defined(__amd64__) || defined(__x86_64__) )   &&  \
+    ! defined(MBEDTLS_HAVE_X86_64)
+#define MBEDTLS_HAVE_X86_64
+#endif
+
+#if defined(MBEDTLS_HAVE_X86_64)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief          AES-NI features detection routine
+ *
+ * \param what     The feature to detect
+ *                 (MBEDTLS_AESNI_AES or MBEDTLS_AESNI_CLMUL)
+ *
+ * \return         1 if CPU has support for the feature, 0 otherwise
+ */
+int mbedtls_aesni_has_support( unsigned int what );
+
+/**
+ * \brief          AES-NI AES-ECB block en(de)cryption
+ *
+ * \param ctx      AES context
+ * \param mode     MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
+ * \param input    16-byte input block
+ * \param output   16-byte output block
+ *
+ * \return         0 on success (cannot fail)
+ */
+int mbedtls_aesni_crypt_ecb( mbedtls_aes_context *ctx,
+                     int mode,
+                     const unsigned char input[16],
+                     unsigned char output[16] );
+
+/**
+ * \brief          GCM multiplication: c = a * b in GF(2^128)
+ *
+ * \param c        Result
+ * \param a        First operand
+ * \param b        Second operand
+ *
+ * \note           Both operands and result are bit strings interpreted as
+ *                 elements of GF(2^128) as per the GCM spec.
+ */
+void mbedtls_aesni_gcm_mult( unsigned char c[16],
+                     const unsigned char a[16],
+                     const unsigned char b[16] );
+
+/**
+ * \brief           Compute decryption round keys from encryption round keys
+ *
+ * \param invkey    Round keys for the equivalent inverse cipher
+ * \param fwdkey    Original round keys (for encryption)
+ * \param nr        Number of rounds (that is, number of round keys minus one)
+ */
+void mbedtls_aesni_inverse_key( unsigned char *invkey,
+                        const unsigned char *fwdkey, int nr );
+
+/**
+ * \brief           Perform key expansion (for encryption)
+ *
+ * \param rk        Destination buffer where the round keys are written
+ * \param key       Encryption key
+ * \param bits      Key size in bits (must be 128, 192 or 256)
+ *
+ * \return          0 if successful, or MBEDTLS_ERR_AES_INVALID_KEY_LENGTH
+ */
+int mbedtls_aesni_setkey_enc( unsigned char *rk,
+                      const unsigned char *key,
+                      size_t bits );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MBEDTLS_HAVE_X86_64 */
+
+#endif /* MBEDTLS_AESNI_H */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0216c73e/crypto/mbedtls/include/mbedtls/arc4.h
----------------------------------------------------------------------
diff --git a/crypto/mbedtls/include/mbedtls/arc4.h b/crypto/mbedtls/include/mbedtls/arc4.h
new file mode 100644
index 0000000..5fc5395
--- /dev/null
+++ b/crypto/mbedtls/include/mbedtls/arc4.h
@@ -0,0 +1,113 @@
+/**
+ * \file arc4.h
+ *
+ * \brief The ARCFOUR stream cipher
+ *
+ *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may
+ *  not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  This file is part of mbed TLS (https://tls.mbed.org)
+ */
+#ifndef MBEDTLS_ARC4_H
+#define MBEDTLS_ARC4_H
+
+#if !defined(MBEDTLS_CONFIG_FILE)
+#include "config.h"
+#else
+#include MBEDTLS_CONFIG_FILE
+#endif
+
+#include <stddef.h>
+
+#if !defined(MBEDTLS_ARC4_ALT)
+// Regular implementation
+//
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief          ARC4 context structure
+ */
+typedef struct
+{
+    int x;                      /*!< permutation index */
+    int y;                      /*!< permutation index */
+    unsigned char m[256];       /*!< permutation table */
+}
+mbedtls_arc4_context;
+
+/**
+ * \brief          Initialize ARC4 context
+ *
+ * \param ctx      ARC4 context to be initialized
+ */
+void mbedtls_arc4_init( mbedtls_arc4_context *ctx );
+
+/**
+ * \brief          Clear ARC4 context
+ *
+ * \param ctx      ARC4 context to be cleared
+ */
+void mbedtls_arc4_free( mbedtls_arc4_context *ctx );
+
+/**
+ * \brief          ARC4 key schedule
+ *
+ * \param ctx      ARC4 context to be setup
+ * \param key      the secret key
+ * \param keylen   length of the key, in bytes
+ */
+void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
+                 unsigned int keylen );
+
+/**
+ * \brief          ARC4 cipher function
+ *
+ * \param ctx      ARC4 context
+ * \param length   length of the input data
+ * \param input    buffer holding the input data
+ * \param output   buffer for the output data
+ *
+ * \return         0 if successful
+ */
+int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input,
+                unsigned char *output );
+
+#ifdef __cplusplus
+}
+#endif
+
+#else  /* MBEDTLS_ARC4_ALT */
+#include "arc4_alt.h"
+#endif /* MBEDTLS_ARC4_ALT */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief          Checkup routine
+ *
+ * \return         0 if successful, or 1 if the test failed
+ */
+int mbedtls_arc4_self_test( int verbose );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* arc4.h */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0216c73e/crypto/mbedtls/include/mbedtls/asn1.h
----------------------------------------------------------------------
diff --git a/crypto/mbedtls/include/mbedtls/asn1.h b/crypto/mbedtls/include/mbedtls/asn1.h
new file mode 100644
index 0000000..082832c
--- /dev/null
+++ b/crypto/mbedtls/include/mbedtls/asn1.h
@@ -0,0 +1,342 @@
+/**
+ * \file asn1.h
+ *
+ * \brief Generic ASN.1 parsing
+ *
+ *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may
+ *  not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  This file is part of mbed TLS (https://tls.mbed.org)
+ */
+#ifndef MBEDTLS_ASN1_H
+#define MBEDTLS_ASN1_H
+
+#if !defined(MBEDTLS_CONFIG_FILE)
+#include "config.h"
+#else
+#include MBEDTLS_CONFIG_FILE
+#endif
+
+#include <stddef.h>
+
+#if defined(MBEDTLS_BIGNUM_C)
+#include "bignum.h"
+#endif
+
+/**
+ * \addtogroup asn1_module
+ * \{
+ */
+
+/**
+ * \name ASN1 Error codes
+ * These error codes are OR'ed to X509 error codes for
+ * higher error granularity.
+ * ASN1 is a standard to specify data structures.
+ * \{
+ */
+#define MBEDTLS_ERR_ASN1_OUT_OF_DATA                      -0x0060  /**< Out of data when parsing an ASN1 data structure. */
+#define MBEDTLS_ERR_ASN1_UNEXPECTED_TAG                   -0x0062  /**< ASN1 tag was of an unexpected value. */
+#define MBEDTLS_ERR_ASN1_INVALID_LENGTH                   -0x0064  /**< Error when trying to determine the length or invalid length. */
+#define MBEDTLS_ERR_ASN1_LENGTH_MISMATCH                  -0x0066  /**< Actual length differs from expected length. */
+#define MBEDTLS_ERR_ASN1_INVALID_DATA                     -0x0068  /**< Data is invalid. (not used) */
+#define MBEDTLS_ERR_ASN1_ALLOC_FAILED                     -0x006A  /**< Memory allocation failed */
+#define MBEDTLS_ERR_ASN1_BUF_TOO_SMALL                    -0x006C  /**< Buffer too small when writing ASN.1 data structure. */
+
+/* \} name */
+
+/**
+ * \name DER constants
+ * These constants comply with DER encoded the ANS1 type tags.
+ * DER encoding uses hexadecimal representation.
+ * An example DER sequence is:\n
+ * - 0x02 -- tag indicating INTEGER
+ * - 0x01 -- length in octets
+ * - 0x05 -- value
+ * Such sequences are typically read into \c ::mbedtls_x509_buf.
+ * \{
+ */
+#define MBEDTLS_ASN1_BOOLEAN                 0x01
+#define MBEDTLS_ASN1_INTEGER                 0x02
+#define MBEDTLS_ASN1_BIT_STRING              0x03
+#define MBEDTLS_ASN1_OCTET_STRING            0x04
+#define MBEDTLS_ASN1_NULL                    0x05
+#define MBEDTLS_ASN1_OID                     0x06
+#define MBEDTLS_ASN1_UTF8_STRING             0x0C
+#define MBEDTLS_ASN1_SEQUENCE                0x10
+#define MBEDTLS_ASN1_SET                     0x11
+#define MBEDTLS_ASN1_PRINTABLE_STRING        0x13
+#define MBEDTLS_ASN1_T61_STRING              0x14
+#define MBEDTLS_ASN1_IA5_STRING              0x16
+#define MBEDTLS_ASN1_UTC_TIME                0x17
+#define MBEDTLS_ASN1_GENERALIZED_TIME        0x18
+#define MBEDTLS_ASN1_UNIVERSAL_STRING        0x1C
+#define MBEDTLS_ASN1_BMP_STRING              0x1E
+#define MBEDTLS_ASN1_PRIMITIVE               0x00
+#define MBEDTLS_ASN1_CONSTRUCTED             0x20
+#define MBEDTLS_ASN1_CONTEXT_SPECIFIC        0x80
+/* \} name */
+/* \} addtogroup asn1_module */
+
+/** Returns the size of the binary string, without the trailing \\0 */
+#define MBEDTLS_OID_SIZE(x) (sizeof(x) - 1)
+
+/**
+ * Compares an mbedtls_asn1_buf structure to a reference OID.
+ *
+ * Only works for 'defined' oid_str values (MBEDTLS_OID_HMAC_SHA1), you cannot use a
+ * 'unsigned char *oid' here!
+ */
+#define MBEDTLS_OID_CMP(oid_str, oid_buf)                                   \
+        ( ( MBEDTLS_OID_SIZE(oid_str) != (oid_buf)->len ) ||                \
+          memcmp( (oid_str), (oid_buf)->p, (oid_buf)->len) != 0 )
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \name Functions to parse ASN.1 data structures
+ * \{
+ */
+
+/**
+ * Type-length-value structure that allows for ASN1 using DER.
+ */
+typedef struct mbedtls_asn1_buf
+{
+    int tag;                /**< ASN1 type, e.g. MBEDTLS_ASN1_UTF8_STRING. */
+    size_t len;             /**< ASN1 length, in octets. */
+    unsigned char *p;       /**< ASN1 data, e.g. in ASCII. */
+}
+mbedtls_asn1_buf;
+
+/**
+ * Container for ASN1 bit strings.
+ */
+typedef struct mbedtls_asn1_bitstring
+{
+    size_t len;                 /**< ASN1 length, in octets. */
+    unsigned char unused_bits;  /**< Number of unused bits at the end of the string */
+    unsigned char *p;           /**< Raw ASN1 data for the bit string */
+}
+mbedtls_asn1_bitstring;
+
+/**
+ * Container for a sequence of ASN.1 items
+ */
+typedef struct mbedtls_asn1_sequence
+{
+    mbedtls_asn1_buf buf;                   /**< Buffer containing the given ASN.1 item. */
+    struct mbedtls_asn1_sequence *next;    /**< The next entry in the sequence. */
+}
+mbedtls_asn1_sequence;
+
+/**
+ * Container for a sequence or list of 'named' ASN.1 data items
+ */
+typedef struct mbedtls_asn1_named_data
+{
+    mbedtls_asn1_buf oid;                   /**< The object identifier. */
+    mbedtls_asn1_buf val;                   /**< The named value. */
+    struct mbedtls_asn1_named_data *next;  /**< The next entry in the sequence. */
+    unsigned char next_merged;      /**< Merge next item into the current one? */
+}
+mbedtls_asn1_named_data;
+
+/**
+ * \brief       Get the length of an ASN.1 element.
+ *              Updates the pointer to immediately behind the length.
+ *
+ * \param p     The position in the ASN.1 data
+ * \param end   End of data
+ * \param len   The variable that will receive the value
+ *
+ * \return      0 if successful, MBEDTLS_ERR_ASN1_OUT_OF_DATA on reaching
+ *              end of data, MBEDTLS_ERR_ASN1_INVALID_LENGTH if length is
+ *              unparseable.
+ */
+int mbedtls_asn1_get_len( unsigned char **p,
+                  const unsigned char *end,
+                  size_t *len );
+
+/**
+ * \brief       Get the tag and length of the tag. Check for the requested tag.
+ *              Updates the pointer to immediately behind the tag and length.
+ *
+ * \param p     The position in the ASN.1 data
+ * \param end   End of data
+ * \param len   The variable that will receive the length
+ * \param tag   The expected tag
+ *
+ * \return      0 if successful, MBEDTLS_ERR_ASN1_UNEXPECTED_TAG if tag did
+ *              not match requested tag, or another specific ASN.1 error code.
+ */
+int mbedtls_asn1_get_tag( unsigned char **p,
+                  const unsigned char *end,
+                  size_t *len, int tag );
+
+/**
+ * \brief       Retrieve a boolean ASN.1 tag and its value.
+ *              Updates the pointer to immediately behind the full tag.
+ *
+ * \param p     The position in the ASN.1 data
+ * \param end   End of data
+ * \param val   The variable that will receive the value
+ *
+ * \return      0 if successful or a specific ASN.1 error code.
+ */
+int mbedtls_asn1_get_bool( unsigned char **p,
+                   const unsigned char *end,
+                   int *val );
+
+/**
+ * \brief       Retrieve an integer ASN.1 tag and its value.
+ *              Updates the pointer to immediately behind the full tag.
+ *
+ * \param p     The position in the ASN.1 data
+ * \param end   End of data
+ * \param val   The variable that will receive the value
+ *
+ * \return      0 if successful or a specific ASN.1 error code.
+ */
+int mbedtls_asn1_get_int( unsigned char **p,
+                  const unsigned char *end,
+                  int *val );
+
+/**
+ * \brief       Retrieve a bitstring ASN.1 tag and its value.
+ *              Updates the pointer to immediately behind the full tag.
+ *
+ * \param p     The position in the ASN.1 data
+ * \param end   End of data
+ * \param bs    The variable that will receive the value
+ *
+ * \return      0 if successful or a specific ASN.1 error code.
+ */
+int mbedtls_asn1_get_bitstring( unsigned char **p, const unsigned char *end,
+                        mbedtls_asn1_bitstring *bs);
+
+/**
+ * \brief       Retrieve a bitstring ASN.1 tag without unused bits and its
+ *              value.
+ *              Updates the pointer to the beginning of the bit/octet string.
+ *
+ * \param p     The position in the ASN.1 data
+ * \param end   End of data
+ * \param len   Length of the actual bit/octect string in bytes
+ *
+ * \return      0 if successful or a specific ASN.1 error code.
+ */
+int mbedtls_asn1_get_bitstring_null( unsigned char **p, const unsigned char *end,
+                             size_t *len );
+
+/**
+ * \brief       Parses and splits an ASN.1 "SEQUENCE OF <tag>"
+ *              Updated the pointer to immediately behind the full sequence tag.
+ *
+ * \param p     The position in the ASN.1 data
+ * \param end   End of data
+ * \param cur   First variable in the chain to fill
+ * \param tag   Type of sequence
+ *
+ * \return      0 if successful or a specific ASN.1 error code.
+ */
+int mbedtls_asn1_get_sequence_of( unsigned char **p,
+                          const unsigned char *end,
+                          mbedtls_asn1_sequence *cur,
+                          int tag);
+
+#if defined(MBEDTLS_BIGNUM_C)
+/**
+ * \brief       Retrieve a MPI value from an integer ASN.1 tag.
+ *              Updates the pointer to immediately behind the full tag.
+ *
+ * \param p     The position in the ASN.1 data
+ * \param end   End of data
+ * \param X     The MPI that will receive the value
+ *
+ * \return      0 if successful or a specific ASN.1 or MPI error code.
+ */
+int mbedtls_asn1_get_mpi( unsigned char **p,
+                  const unsigned char *end,
+                  mbedtls_mpi *X );
+#endif /* MBEDTLS_BIGNUM_C */
+
+/**
+ * \brief       Retrieve an AlgorithmIdentifier ASN.1 sequence.
+ *              Updates the pointer to immediately behind the full
+ *              AlgorithmIdentifier.
+ *
+ * \param p     The position in the ASN.1 data
+ * \param end   End of data
+ * \param alg   The buffer to receive the OID
+ * \param params The buffer to receive the params (if any)
+ *
+ * \return      0 if successful or a specific ASN.1 or MPI error code.
+ */
+int mbedtls_asn1_get_alg( unsigned char **p,
+                  const unsigned char *end,
+                  mbedtls_asn1_buf *alg, mbedtls_asn1_buf *params );
+
+/**
+ * \brief       Retrieve an AlgorithmIdentifier ASN.1 sequence with NULL or no
+ *              params.
+ *              Updates the pointer to immediately behind the full
+ *              AlgorithmIdentifier.
+ *
+ * \param p     The position in the ASN.1 data
+ * \param end   End of data
+ * \param alg   The buffer to receive the OID
+ *
+ * \return      0 if successful or a specific ASN.1 or MPI error code.
+ */
+int mbedtls_asn1_get_alg_null( unsigned char **p,
+                       const unsigned char *end,
+                       mbedtls_asn1_buf *alg );
+
+/**
+ * \brief       Find a specific named_data entry in a sequence or list based on
+ *              the OID.
+ *
+ * \param list  The list to seek through
+ * \param oid   The OID to look for
+ * \param len   Size of the OID
+ *
+ * \return      NULL if not found, or a pointer to the existing entry.
+ */
+mbedtls_asn1_named_data *mbedtls_asn1_find_named_data( mbedtls_asn1_named_data *list,
+                                       const char *oid, size_t len );
+
+/**
+ * \brief       Free a mbedtls_asn1_named_data entry
+ *
+ * \param entry The named data entry to free
+ */
+void mbedtls_asn1_free_named_data( mbedtls_asn1_named_data *entry );
+
+/**
+ * \brief       Free all entries in a mbedtls_asn1_named_data list
+ *              Head will be set to NULL
+ *
+ * \param head  Pointer to the head of the list of named data entries to free
+ */
+void mbedtls_asn1_free_named_data_list( mbedtls_asn1_named_data **head );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* asn1.h */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0216c73e/crypto/mbedtls/include/mbedtls/asn1write.h
----------------------------------------------------------------------
diff --git a/crypto/mbedtls/include/mbedtls/asn1write.h b/crypto/mbedtls/include/mbedtls/asn1write.h
new file mode 100644
index 0000000..73ff32b
--- /dev/null
+++ b/crypto/mbedtls/include/mbedtls/asn1write.h
@@ -0,0 +1,239 @@
+/**
+ * \file asn1write.h
+ *
+ * \brief ASN.1 buffer writing functionality
+ *
+ *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may
+ *  not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  This file is part of mbed TLS (https://tls.mbed.org)
+ */
+#ifndef MBEDTLS_ASN1_WRITE_H
+#define MBEDTLS_ASN1_WRITE_H
+
+#include "asn1.h"
+
+#define MBEDTLS_ASN1_CHK_ADD(g, f) do { if( ( ret = f ) < 0 ) return( ret ); else   \
+                                g += ret; } while( 0 )
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief           Write a length field in ASN.1 format
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ * \param len       the length to write
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start, size_t len );
+
+/**
+ * \brief           Write a ASN.1 tag in ASN.1 format
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ * \param tag       the tag to write
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_tag( unsigned char **p, unsigned char *start,
+                    unsigned char tag );
+
+/**
+ * \brief           Write raw buffer data
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ * \param buf       data buffer to write
+ * \param size      length of the data buffer
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start,
+                           const unsigned char *buf, size_t size );
+
+#if defined(MBEDTLS_BIGNUM_C)
+/**
+ * \brief           Write a big number (MBEDTLS_ASN1_INTEGER) in ASN.1 format
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ * \param X         the MPI to write
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_mpi( unsigned char **p, unsigned char *start, const mbedtls_mpi *X );
+#endif /* MBEDTLS_BIGNUM_C */
+
+/**
+ * \brief           Write a NULL tag (MBEDTLS_ASN1_NULL) with zero data in ASN.1 format
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_null( unsigned char **p, unsigned char *start );
+
+/**
+ * \brief           Write an OID tag (MBEDTLS_ASN1_OID) and data in ASN.1 format
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ * \param oid       the OID to write
+ * \param oid_len   length of the OID
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_oid( unsigned char **p, unsigned char *start,
+                    const char *oid, size_t oid_len );
+
+/**
+ * \brief           Write an AlgorithmIdentifier sequence in ASN.1 format
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ * \param oid       the OID of the algorithm
+ * \param oid_len   length of the OID
+ * \param par_len   length of parameters, which must be already written.
+ *                  If 0, NULL parameters are added
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_algorithm_identifier( unsigned char **p, unsigned char *start,
+                                     const char *oid, size_t oid_len,
+                                     size_t par_len );
+
+/**
+ * \brief           Write a boolean tag (MBEDTLS_ASN1_BOOLEAN) and value in ASN.1 format
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ * \param boolean   0 or 1
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_bool( unsigned char **p, unsigned char *start, int boolean );
+
+/**
+ * \brief           Write an int tag (MBEDTLS_ASN1_INTEGER) and value in ASN.1 format
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ * \param val       the integer value
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_int( unsigned char **p, unsigned char *start, int val );
+
+/**
+ * \brief           Write a printable string tag (MBEDTLS_ASN1_PRINTABLE_STRING) and
+ *                  value in ASN.1 format
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ * \param text      the text to write
+ * \param text_len  length of the text
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_printable_string( unsigned char **p, unsigned char *start,
+                                 const char *text, size_t text_len );
+
+/**
+ * \brief           Write an IA5 string tag (MBEDTLS_ASN1_IA5_STRING) and
+ *                  value in ASN.1 format
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ * \param text      the text to write
+ * \param text_len  length of the text
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_ia5_string( unsigned char **p, unsigned char *start,
+                           const char *text, size_t text_len );
+
+/**
+ * \brief           Write a bitstring tag (MBEDTLS_ASN1_BIT_STRING) and
+ *                  value in ASN.1 format
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ * \param buf       the bitstring
+ * \param bits      the total number of bits in the bitstring
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_bitstring( unsigned char **p, unsigned char *start,
+                          const unsigned char *buf, size_t bits );
+
+/**
+ * \brief           Write an octet string tag (MBEDTLS_ASN1_OCTET_STRING) and
+ *                  value in ASN.1 format
+ *                  Note: function works backwards in data buffer
+ *
+ * \param p         reference to current position pointer
+ * \param start     start of the buffer (for bounds-checking)
+ * \param buf       data buffer to write
+ * \param size      length of the data buffer
+ *
+ * \return          the length written or a negative error code
+ */
+int mbedtls_asn1_write_octet_string( unsigned char **p, unsigned char *start,
+                             const unsigned char *buf, size_t size );
+
+/**
+ * \brief           Create or find a specific named_data entry for writing in a
+ *                  sequence or list based on the OID. If not already in there,
+ *                  a new entry is added to the head of the list.
+ *                  Warning: Destructive behaviour for the val data!
+ *
+ * \param list      Pointer to the location of the head of the list to seek
+ *                  through (will be updated in case of a new entry)
+ * \param oid       The OID to look for
+ * \param oid_len   Size of the OID
+ * \param val       Data to store (can be NULL if you want to fill it by hand)
+ * \param val_len   Minimum length of the data buffer needed
+ *
+ * \return      NULL if if there was a memory allocation error, or a pointer
+ *              to the new / existing entry.
+ */
+mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data **list,
+                                        const char *oid, size_t oid_len,
+                                        const unsigned char *val,
+                                        size_t val_len );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MBEDTLS_ASN1_WRITE_H */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0216c73e/crypto/mbedtls/include/mbedtls/base64.h
----------------------------------------------------------------------
diff --git a/crypto/mbedtls/include/mbedtls/base64.h b/crypto/mbedtls/include/mbedtls/base64.h
new file mode 100644
index 0000000..352c652
--- /dev/null
+++ b/crypto/mbedtls/include/mbedtls/base64.h
@@ -0,0 +1,88 @@
+/**
+ * \file base64.h
+ *
+ * \brief RFC 1521 base64 encoding/decoding
+ *
+ *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may
+ *  not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  This file is part of mbed TLS (https://tls.mbed.org)
+ */
+#ifndef MBEDTLS_BASE64_H
+#define MBEDTLS_BASE64_H
+
+#include <stddef.h>
+
+#define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL               -0x002A  /**< Output buffer too small. */
+#define MBEDTLS_ERR_BASE64_INVALID_CHARACTER              -0x002C  /**< Invalid character in input. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief          Encode a buffer into base64 format
+ *
+ * \param dst      destination buffer
+ * \param dlen     size of the destination buffer
+ * \param olen     number of bytes written
+ * \param src      source buffer
+ * \param slen     amount of data to be encoded
+ *
+ * \return         0 if successful, or MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL.
+ *                 *olen is always updated to reflect the amount
+ *                 of data that has (or would have) been written.
+ *                 If that length cannot be represented, then no data is
+ *                 written to the buffer and *olen is set to the maximum
+ *                 length representable as a size_t.
+ *
+ * \note           Call this function with dlen = 0 to obtain the
+ *                 required buffer size in *olen
+ */
+int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen,
+                   const unsigned char *src, size_t slen );
+
+/**
+ * \brief          Decode a base64-formatted buffer
+ *
+ * \param dst      destination buffer (can be NULL for checking size)
+ * \param dlen     size of the destination buffer
+ * \param olen     number of bytes written
+ * \param src      source buffer
+ * \param slen     amount of data to be decoded
+ *
+ * \return         0 if successful, MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL, or
+ *                 MBEDTLS_ERR_BASE64_INVALID_CHARACTER if the input data is
+ *                 not correct. *olen is always updated to reflect the amount
+ *                 of data that has (or would have) been written.
+ *
+ * \note           Call this function with *dst = NULL or dlen = 0 to obtain
+ *                 the required buffer size in *olen
+ */
+int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen,
+                   const unsigned char *src, size_t slen );
+
+/**
+ * \brief          Checkup routine
+ *
+ * \return         0 if successful, or 1 if the test failed
+ */
+int mbedtls_base64_self_test( int verbose );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* base64.h */