• Stars
    star
    372
  • Rank 114,858 (Top 3 %)
  • Language
    C
  • License
    Other
  • Created almost 7 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Library for interacting with the Crypto Authentication secure elements

CryptoAuthLib - Microchip CryptoAuthentication Library {#mainpage}

Introduction

This library implements the APIs required to communicate with Microchip Security device. The family of devices supported currently are:

The best place to start is with the Microchip Trust Platform

Online API documentation is at https://microchiptech.github.io/cryptoauthlib/

Latest software and examples can be found at:

Prerequisite hardware to run CryptoAuthLib examples:

Alternatively a Microchip MCU and Adapter Board:

For most development, using socketed top-boards is preferable until your configuration is well tested, then you can commit it to a CryptoAuth Xplained Pro Extension, for example. Keep in mind that once you lock a device, it will not be changeable.

Examples

Configuration

In order to properly configured the library there must be a header file in your project named atca_config.h at minimum this needs to contain defines for the hal and device types being used. Most integrations have an configuration mechanism for generating this file. See the atca_config.h.in template which is configured by CMake for Linux, MacOS, & Windows projects.

An example of the configuration:

/* Cryptoauthlib Configuration File */
#ifndef ATCA_CONFIG_H
#define ATCA_CONFIG_H

/* Include HALS */
#define ATCA_HAL_I2C

/* Included device support */
#define ATCA_ATECC608_SUPPORT

/* \brief How long to wait after an initial wake failure for the POST to
 *         complete.
 * If Power-on self test (POST) is enabled, the self test will run on waking
 * from sleep or during power-on, which delays the wake reply.
 */
#ifndef ATCA_POST_DELAY_MSEC
#define ATCA_POST_DELAY_MSEC 25
#endif

#endif // ATCA_CONFIG_H

There are two major compiler defines that affect the operation of the library.

  • ATCA_NO_POLL can be used to revert to a non-polling mechanism for device responses. Normally responses are polled for after sending a command, giving quicker response times. However, if ATCA_NO_POLL is defined, then the library will simply delay the max execution time of a command before reading the response.
  • ATCA_NO_HEAP can be used to remove the use of malloc/free from the main library. This can be helpful for smaller MCUs that don't have a heap implemented. If just using the basic API, then there shouldn't be any code changes required. The lower-level API will no longer use the new/delete functions and the init/release functions should be used directly.

Some specific options are available in the fully documented configuration files lib/calib/calib_config.h, atca_configuration.h, lib/crypto/crypto_config.h, lib/host/atca_host_config.h which is also the place where features can be selected. We provide some configurations focused on specific use cases and the checks are enabled by default.

Release notes

See Release Notes

Host Device Support

CryptoAuthLib will run on a variety of platforms from small micro-controllers to desktop host systems. See hal readme

If you have specific microcontrollers or platforms you need support for, please contact us through the Microchip portal with your request.

CryptoAuthLib Architecture

Cryptoauthlib API documentation is at https://microchiptech.github.io/cryptoauthlib/

The library is structured to support portability to:

  • multiple hardware/microcontroller platforms
  • multiple environments including bare-metal, RTOS and Windows/Linux/MacOS
  • multiple chip communication protocols (I2C, SPI, and SWI)

All platform dependencies are contained within the HAL (hardware abstraction layer).

Directory Structure

lib - primary library source code
lib/atcacert - certificate data and i/o methods
lib/calib - the Basic Cryptoauth API
lib/crypto - Software crypto implementations external crypto libraries support (primarily SHA1 and SHA256)
lib/hal - hardware abstraction layer code for supporting specific platforms
lib/host - support functions for common host-side calculations
lib/jwt - json web token functions
test - Integration test and examples. See test/cmd-processor.c for main() implementation.

For production code, test directories should be excluded by not compiling it
into a project, so it is up to the developer to include or not as needed.  Test
code adds significant bulk to an application - it's not intended to be included
in production code.

Tests

There is a set of integration tests found in the test directory which will at least partially demonstrate the use of the objects. Some tests may depend upon a certain device being configured in a certain way and may not work for all devices or specific configurations of the device. See test readme

Using CryptoAuthLib (Microchip CryptoAuth Library)

The best place to start is with the Microchip Trust Platform

Also application examples are included as part of the Harmony 3 framework and can be copied from the Harmony Content Manager or found with the Harmony 3 Framework Cryptoauthlib_apps

Incorporating CryptoAuthLib in a Linux project using USB HID devices

The Linux HID HAL files use the Linux udev development software package.

To install the udev development package under Ubuntu Linux, please type the following command at the terminal window:

sudo apt-get install libudev-dev

This adds the udev development development software package to the Ubuntu Linux installation.

The Linux HID HAL files also require a udev rule to be added to change the permissions of the USB HID Devices. Please add a new udev rule for the Microchip CryptoAuth USB devices.

cd /etc/udev/rules.d
sudo touch mchp-cryptoauth.rules

Edit the mchp-cryptoauth.rules file and add the following line to the file:

SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2312", MODE="0666"

More Repositories

1

gcp-iot-core-examples

Google Cloud Platform IOT Core Examples
C
110
star
2

cryptoauth-openssl-engine

DEPRECATED: Use https://github.com/MicrochipTech/cryptoauthlib/wiki/PKCS11-Linux-Setup
C
76
star
3

cryptoauthtools

Tools for CryptoAuthentication Devices using CryptoAuthLib
Python
39
star
4

avrfreaks-projects

Projects from AVRFreaks
C
38
star
5

usb-pd-software-framework

Microchip's Lightweight USB Power Delivery Software Stack
C
30
star
6

some-ip

Example for device-to-device communication over automotive bus systems using SOME/IP.
C++
27
star
7

XPRESS-Loader

This application is designed to act as a fast on-board programmer for the MPLAB Xpress Evaluation Board. A serial to USB bridge function is simultaneously available.
C
27
star
8

RN2xx3_LORAWAN_FIRMWARE

"IoT Made Easy!" - Open sourcing the latest RN2xx3 beta firmware for self-support, self-maintenance and self-programming
C
26
star
9

ethercat-software-framework

Microchip's EtherCAT Software Stack
C
25
star
10

fpga-hls-examples

Open-Source HLS Examples for Microchip FPGAs
C
23
star
11

aws-iot-firmware-pic32mz

Microchip's PIC32MZ based IoT demos are designed to work with Amazon Web Service's AWS IoT platform and Microchip's "Insight on Things" (IoT) desktop application.
C
23
star
12

bm83_getting_started

“IoT Made Easy!" - BM83 Getting Started with Embedded and Host modes with Multi-speaker (MSPK) Firmware
22
star
13

mla_usb

USB stack from the Microchip Libraries for Applications (MLA)
C
22
star
14

oa-tc6-lib

Microchip OPEN Alliance TC6 Protocol Driver for LAN8650/1 source code and example applications.
C
20
star
15

aws-iot-zero-touch-secure-provisioning-kit

Project files for the AWS IoT Zero Touch Secure Provisioning Kit
C
19
star
16

atsamr34_long_range_p2p

"IoT Made Easy!" - Enable Easy to use P2P Protocol for Long-Range & Low Power Applications on SAM R34 LoRa Technology ICs and WLR089U0 Module
C
19
star
17

json_decoder

C
18
star
18

AWS-Secure-Insight

AWS JIT and Bring your Own Certificate Demo.
HTML
18
star
19

atsamr34_lorawan_rn_parser

"IoT Made Easy!" - Control SAM R34 or WLR089U0 Module with ASCII command set over UART
C
15
star
20

Wireless-Sensor-Network

Create a Wi-Fi/ MiWi / LoRa wireless sensor network to monitor the temperature across classrooms during Masters conference
C
15
star
21

avr_insights

Source code for avr_insights videos series
C
14
star
22

TB3209_Getting_Started_with_ADC

This repository contains examples of bare metal source code for ADC as described in TB3209 document from Microchip. The code examples were developed using ATmega4809
C
14
star
23

cryptoauth_trustplatform_designsuite

The Trust Platform for CryptoAuthenticationâ„¢ is a combination of multiple elements to simplify the addition of security to any embedded design. This platform includes Hardware protyping tools along with a unique design suite to accelerate the prototyping of the most common use cases.
C
14
star
24

iot_solutions_for_industry4.0

“IoT Made Easy!" - IoT Solutions for Industry 4.0
13
star
25

TB3216_Getting_Started_with_USART

This repository contains examples of bare metal source code for USART as described in TB3216 document from Microchip. The code examples were developed using ATmega4809
C
13
star
26

linux-pic32

PIC32 Linux BSP kernel repository
C
12
star
27

PIC32MZW1_Curiosity_OOB

"IoT Made Easy!" - OOB demo collateral for PIC32MZW1 Curiosty board
C
11
star
28

Location-Tracking-using-SAMR34-and-UBLOX-GPS-Module

Location Tracking Application on SAMR34 using a UBLOX GPS Module (LEA-6S)
C
10
star
29

classb_mcu32

Microchip IEC/UL 60730 Class B Functional Safety Libraries - PIC32
C
9
star
30

PIC32MZW1_Workshop

"IoT Made Easy!" - Guided System Development to learn PIC32MZ W1 Family Device
C
9
star
31

AVR-IoT_WG_Sensor_Node

This repository is designed to provide the last few valid images of the AVR-IOT WG board demo code.
9
star
32

Getting_Started_with_GPIO

This repository contains examples of bare metal source code for GPIO as described in TB3229 document from Microchip. The code examples were developed using ATmega4809
Makefile
9
star
33

USB-Hub-Linux-Examples

Linux example code that accompanies MCHP USB Smart hubs
C++
8
star
34

atsamr34_lorawan_lora_modulation

“IoT Made Easy!" - Adding LoRa Peer-to-Peer Connection to an existing LoRaWAN Application
C
7
star
35

PIC32CXBZ2_WBZ45x_BLE_UART_OLED_Display

"IoT Made Easy!" - This application demonstrates the use of an OLED Display interfaced with WBZ451 Curiosity Board. The text send from Mobile App is shown on the OLED Display connected to WBZ451 Curiosity Board.
C
7
star
36

unicens-linux-daemon

unicensd is the UNICENS Daemon for Linux, Android and QNX
C
7
star
37

Libero-SoC-Design-Suite-Tcl-Examples

Tcl examples repository designed primarily for use with the latest version of the Libero® SoC Design Suite.
7
star
38

RN487x-BM7x-Firmware-Upgrade-using-Host-MCU

"IoT Made Easy!" - Firmware upgrade for RN and BM devices using host MCU over UART
7
star
39

CPGZephyrDocs

Documents on Zephyr project
7
star
40

EA71C53A

Early Access Package for PIC32CXBZ2/WBZ45 Devices
C
7
star
41

PIC32CXBZ2_WBZ45x_Zigbee_Home_Thermostat

"IoT Made Easy!" - Home Thermostat solution using Zigbee 3.0. The Home Thermostat enables us to set the temperature using a Thermostat Panel, get the current temperature through Multisensor and switch on/off the air conditioner based on the current and set temperature and control the set temperature using a Zigbee Coordinator.
C
7
star
42

winc1500-wifi-smart-device-enablement-kit-aws-cloud

This repo include the default application source files and schematics of the Wi-Fi Smart Device Enablement Kit
C
7
star
43

pic32cxbz2_wbz45x_ble_can_bridge

"IoT Made Easy!" - This application serves as an illustration of how to extend a CAN network wirelessly using BLE. The CAN-BLE Central Device connects to the CAN-BLE Peripheral Device and establishes a BLE link using Microchip's proprietary Transparent UART Profile for CAN data transfer.
C
7
star
44

dh-c-programming-exercise-files

MPLAB X Projects used in the "Fundamentals of the C-Programming Language" Developer Help Page
Makefile
6
star
45

PIC16-XPRESS-Loader

A PIC16 implementation of the XPRESS-Loader (Drag'n Drop Programmer + USB-Serial Bridge)
C
6
star
46

cryptoauth_usecase_secureboot

SecureBoot Usecase
C
6
star
47

mbedtls-examples

C
6
star
48

LoRaWAN-Weather-Station-Demo-using-SAMR34

"IoT Made Easy!" - Collecting sensor data from a weather station and sending it over LoRaWAN protocol using SAM R34
C
6
star
49

aws-iot-winc1500-secure-wifi-board

Tools for WINC1500 Secure Wi-Fi Board in Microchip 2018 MASTERs Conference
Python
6
star
50

TB3217_Getting_Started_with_TCA

This repository contains examples of bare metal source code for TCA as described in TB3217 document from Microchip. The code examples were developed using ATmega4809
C
6
star
51

atsamr34_lorawan_smart_meter

“IoT Made Easy!" - Enable pulse counting on a Low Power LoRaWAN Application
C
5
star
52

kitprotocolparser_projects

This repo provides reference implementation of host project using KitProtocol Parser. The firmware available here is built based on Microchip Crypto Auth Trust Platform (DM320118) board.
C
5
star
53

bm64_getting_started

“IoT Made Easy!" - BM64 Getting Started with Stereo (DSPK) and Multi-speaker (MSPK) modes
5
star
54

BM78_DFU_with_SAMG55

"IoT Made Easy!" - This is a demo to show how to do BM78/RN4678 firmware DFU with an external host MCU
C
5
star
55

wcm-aws-iot-sdk

This project has been deprecated and replaced by aws-iot-firmware-pic32mz
5
star
56

atsamr34_rn487x_lorawan_ble

"IoT Made Easy!" - Adding BLE features & provisioning to an existing LoRaWAN Application
C
5
star
57

Sensorless_FOC_PMSM_SAME70_MCLV

MATLAB
5
star
58

PIC32MZW1_Matter_Project

"IoT Made Easy!" - PIC32MZW1 Matter example project is added to the code which fork from Matter's repo
C++
5
star
59

u-boot-pic32

Second stage bootloader for PIC32 Linux BSP
C
5
star
60

atsamr34_ecc608a_actility

"IoT Made Easy!" - Develop with the SAM R34 or WLR089U and Microchip LoRaWAN(tm) stack on Actility join server
C
5
star
61

LIGHTWEIGHT_MESH_STACK

"IoT Made Easy!" - Lightweight Mesh software stack with source code for self-support, self-maintenance and self-programming
C
5
star
62

PIC32CXBZ2_WBZ45x_WINC1500_Zigbee_Wi-Fi_Smart_Thermostat

"IoT Made Easy!" - Smart Thermostat solution using Zigbee 3.0 and Wi-Fi. The Smart Thermostat enables us to set the temperature using a Thermostat Panel, get the current temperature through Multisensor and switch on/off the air conditioner based on the current and set temperature and publish the same data onto MQTT through a Zigbee Gateway.
C
5
star
63

atsamr34_long_range_star

"IoT Made Easy!" - Enable Easy to use Star Protocol for Long-Range & Low Power Applications on SAM R34 LoRa Technology ICs and WLR089U0 Module
C
5
star
64

iot_solutions_for_smart_garage_door_opener

"IoT Made Easy!" - Microchip IoT Solutions for Smart Garage Door Opener
4
star
65

ATSAMR34_LORAWAN_ASFv3

"IoT Made Easy!" - Microchip LoRaWAN Stack Opened for SAM R34 IC and WLR089U0 Module running on Microchip Studio IDE
C
4
star
66

iot_solutions_for_smart_city

“IoT Made Easy!" - IoT Solutions for Smart City
4
star
67

PIC32CXBZ2_WBZ45x_ZIGBEE_MULTISENSOR_TEMPHUM13_CLICK

"IoT Made Easy!" - This Zigbee (End Device) multi-sensor application will read temperature and humidity data from TempHum13 click board and report the same to devices in the Zigbee network.
C
4
star
68

pic32mzw1_ffs_amazon_freertos

"IoT Made Easy!" - Amazon Frustration Free Setup for PIC32MZW1
C
4
star
69

WFI32-IoT

"IoT Made Easy!" - OOB demo collateral for WFI32-IoT board
4
star
70

PIC32CXBZ2_WBZ45x_BLE_SENSOR_Touch_ATtiny3217

"IoT Made Easy!" - Application to control the RGB led on WBZ451 Curiosity board using T10 Board and Microchip Bluetooth Data(MBD) iOS/Android app
C
4
star
71

buildroot

Buildroot repository for PIC32 Linux BSP
Makefile
4
star
72

WLR089U0_LORAWAN_ORANGE

"IoT Made Easy!" - Getting Started with WLR089U0 and Orange LoRaWAN Network
C
4
star
73

Wireless-Sensor-Network-2019

Wireless Sensor Network 2019 - LoRaWAN, WiFi and MiWi Demo
C
4
star
74

LAN9252-Click-Board

C
4
star
75

aws-iot-insight-on-things-desktop-app

Microchip's "Insight on Things" (IoT) desktop app is designed to work with Amazon Web Service's AWS IoT platform and Microchip's IoT demo's.
JavaScript
4
star
76

PIC32CXBZ2_WBZ45x_BLE_UART_E_PAPER_Display

"IoT Made Easy!" - This application demonstrates the integration of the E-PAPER Display and BLE stack on the PIC32CxBZ2/WBZ451 device.
C
4
star
77

freertos-trace_demo_application

The example application provides a port of the FreeRTOS kernel and demonstrates how to build a basic application using the ATmega4809 AVR® microcontroller, and how to trace the code run time using Percepio® Tracealyzer 4.
C
4
star
78

PIC-IoT-WG-Sensor-Node

This repository is designed to provide the last few valid images of the PIC-IOT WG board demo code. https://pic-iot.com
4
star
79

WILC-Linux-Third-Party-MPU-Images

"IoT Made Easy!" - Repository contains WILC Linux driver porting guides which describes steps to interface WILC device with other manufacturers MPU's and testing Wi-Fi functionality.
4
star
80

TB3214_Getting_Started_with_TCB

This repository contains examples of bare metal source code for TCB as described in TB3214 document from Microchip. The code examples were developed using ATmega4809
C
4
star
81

unicens

Unified Centralized Network Stack
C
4
star
82

PIC32CXBZ2_WBZ45x_ZIGBEE_CI_OLED_Display

"IoT Made Easy!" - This application demonstrates the integration of the OLED Display and Zigbee (Combined Interface) stack on the PIC32CxBZ2/WBZ451 device. The temperature and humidity measurements from the Zigbee Multisensor device are displayed on the OLED C click.
C
4
star
83

ml-same54-cult-wm8904-edgeimpulse-kws-demo

Keyword spotter demo with Edge Impulse and the SAME54 Curiosity Ultra board
C
3
star
84

aws-iot-winc1500-secure-wifi-board-included-source-files

Include the firmware code, python scripts, java pc gui for the winc1500 secure wifi board
C
3
star
85

PD_Sink_Battery_Charger_Demo

Demo project for the PD Sink battery charger board
C
3
star
86

EA14J50A

3
star
87

secure_lorawan_with_tti

"IoT Made Easy!" - Secure Authentication with SAMR34 or WLR089U, ATECC608A and The Things Industries’s Join Server
C
3
star
88

PIC32MZW1_Projects

“IoT Made Easy!" - additional projects for PIC32MZW1
C
3
star
89

PIC32MZW1_CAN_WiFi_Bridge

“IoT Made Easy!" - CAN/WiFi bridge project for PIC32MZW1
C
3
star
90

PIC32CXBZ2_WBZ45x_BLE_UART_MODBUS

"IoT Made Easy!" - This example application helps us to develop a request-response protocol using Modbus stack. The WBZ451 curiosity board acts as a client device or server device and Bluetooth(BLE) peripheral device.
C
3
star
91

atsamr34_radio_performance_testing

"IoT Made Easy!" - Enable Simple RF Performance Testing of SAM R34 IC and WLR089U0 Module using Reference Design Package Software Tools and Macro files
3
star
92

fpga-hls-docs

FPGA SmartHLS Documentation
3
star
93

WILC1000_QNX_Driver

This reprosoitry is WILC1000 QNX Driver source code
C
3
star
94

mla_fileio

File system library
C
3
star
95

WINC-Baremetal-Third-Party-MCU

“IoT Made Easy!" - Repository contains WINC Bare metal sample applications to add embedded Wi-Fi connectivity to Third-party Microcontrollers
3
star
96

avr128da48-i2c-send-receive-example

This repository contains examples of bare metal source code for I2C. The code examples were developed for AVR128DA48.
Makefile
3
star
97

TB3215_Getting_Started_with_SPI

This repository contains examples of bare metal source code for SPI as described in TB3215 document from Microchip. The code examples were developed using ATmega4809
C
3
star
98

PIC32CXBZ2_WBZ45x_BLE_SENSOR_Multi-Role

"IoT Made Easy!" - This Application demonstrates the multi-link multi-role capability of PIC32CXBZ2/WBZ45x device. The WBZ451 BLE Sensor Multi-role device acts as the central device and connects to five other WBZ451 BLE Sensor devices. The WBZ451 BLE Sensor Multi-role device also acts as peripheral device and can connect to smart phone.
C
3
star
99

PIC32CXBZ2_WBZ45x_FROM_BLE_SENSOR_TO_PHONE_APP

"IoT Made Easy!" - Follow Frank, a smart developer, making a BLE sensor based on WBZ45x device with a Phone App and make your own in 30 minutes
3
star
100

TB3213_Getting_Started_with_RTC

This repository contains examples of bare metal source code for RTC as described in TB3213 document from Microchip. The code examples were developed using ATmega4809
C
3
star