{"id":19701873,"url":"https://github.com/microchiptech/cryptoauthlib","last_synced_at":"2025-05-14T15:06:41.382Z","repository":{"id":41432306,"uuid":"111151504","full_name":"MicrochipTech/cryptoauthlib","owner":"MicrochipTech","description":"Library for interacting with the Crypto Authentication secure elements","archived":false,"fork":false,"pushed_at":"2025-05-06T14:38:56.000Z","size":85435,"stargazers_count":397,"open_issues_count":15,"forks_count":225,"subscribers_count":39,"default_branch":"main","last_synced_at":"2025-05-06T15:52:16.950Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MicrochipTech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-11-17T21:17:29.000Z","updated_at":"2025-04-27T22:05:34.000Z","dependencies_parsed_at":"2024-01-25T14:27:14.338Z","dependency_job_id":"b7eb64b6-2d8b-4d42-88df-6420009f9b5a","html_url":"https://github.com/MicrochipTech/cryptoauthlib","commit_stats":{"total_commits":96,"total_committers":10,"mean_commits":9.6,"dds":"0.44791666666666663","last_synced_commit":"405d8311a203e61657597c81b23ae7a370f485d9"},"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrochipTech%2Fcryptoauthlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrochipTech%2Fcryptoauthlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrochipTech%2Fcryptoauthlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrochipTech%2Fcryptoauthlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MicrochipTech","download_url":"https://codeload.github.com/MicrochipTech/cryptoauthlib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254169396,"owners_count":22026211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T21:11:23.455Z","updated_at":"2025-05-14T15:06:41.356Z","avatar_url":"https://github.com/MicrochipTech.png","language":"C","readme":"CryptoAuthLib - Microchip CryptoAuthentication Library {#mainpage}\n====================================================\n\nIntroduction\n------------------------\nThis library implements the APIs required to communicate with Microchip Security\ndevice. The family of devices supported currently are:\n\n|CryptoAuth                                      |CryptoAuth2                               |\n|-----------------------------------------------:|:-----------------------------------------|\n|[ATECC608C](https://www.microchip.com/ATECC608C)|[ECC204](https://www.microchip.com/ECC204)|\n|[ATECC608B](https://www.microchip.com/ATECC608B)|[ECC206](https://www.microchip.com/ECC206)|\n|[ATECC608A](http://www.microchip.com/ATECC608A) |[SHA104](https://www.microchip.com/SHA104)|\n|[ATECC508A](http://www.microchip.com/ATECC508A) |[SHA105](https://www.microchip.com/SHA105)|\n|[ATECC108A](http://www.microchip.com/ATECC108A) |[SHA106](https://www.microchip.com/SHA106)|\n|[ATSHA204A](http://www.microchip.com/ATSHA204A) |[RNG90](https://www.microchip.com/RNG90)  |\n|[ATSHA206A](https://www.microchip.com/ATSHA206A)|                                          |\n\nThe best place to start is with the [Microchip Trust Platform](https://www.microchip.com/design-centers/security-ics/trust-platform)\n\nOnline API documentation is at https://microchiptech.github.io/cryptoauthlib/\n\nLatest software and examples can be found at:\n  - https://www.microchip.com/design-centers/security-ics/trust-platform\n  - http://www.microchip.com/SWLibraryWeb/product.aspx?product=CryptoAuthLib\n\n\nPrerequisite hardware to run CryptoAuthLib examples:\n  - [CryptoAuth Trust Platform Development Kit](https://www.microchip.com/developmenttools/ProductDetails/DM320118)\n\nAlternatively a Microchip MCU and Adapter Board:\n  - [ATSAMR21 Xplained Pro]( http://www.microchip.com/atsamr21-xpro )\n    or [ATSAMD21 Xplained Pro]( http://www.microchip.com/ATSAMD21-XPRO )\n  - [CryptoAuthentication SOIC Socket Board](http://www.microchip.com/developmenttools/productdetails.aspx?partno=at88ckscktsoic-xpro )\n    to accept SOIC parts\n  - [ATECC608B mikroBUS evaluation board](https://www.microchip.com/en-us/development-tool/DT100104)\n  - [ECC204 mikroBUS evaluation board](https://www.microchip.com/en-us/development-tool/ev92r58a)\n  - [SHA104/SHA105 mikroBUS evaluation board](https://www.microchip.com/en-us/development-tool/ev97m19a)\n  - [TA010 mikroBUS evaluation board](https://www.microchip.com/en-us/development-tool/EV74C12A)\n\nFor most development, using socketed top-boards is preferable until your\nconfiguration is well tested, then you can commit it to a CryptoAuth Xplained\nPro Extension, for example. Keep in mind that once you lock a device, it will\nnot be changeable.\n\n\nExamples\n-----------\n\n  - Install the [Trust Platform Design Suite](https://www.microchip.com/en-us/products/security/trust-platform ) to access Use Case examples \n    for the different Security Solutions (ATECC608, SHA104/105, ECC204, TA010, TA100…)\n\nConfiguration\n-----------\nIn order to properly configured the library there must be a header file in your\nproject named `atca_config.h` at minimum this needs to contain defines for the\nhal and device types being used. Most integrations have an configuration mechanism\nfor generating this file. See the [atca_config.h.in](lib/atca_config.h.in) template\nwhich is configured by CMake for Linux, MacOS, \u0026 Windows projects.\n\nAn example of the configuration:\n\n```\n/* Cryptoauthlib Configuration File */\n#ifndef ATCA_CONFIG_H\n#define ATCA_CONFIG_H\n\n/* Include HALS */\n#define ATCA_HAL_I2C\n\n/* Included device support */\n#define ATCA_ATECC608_SUPPORT\n\n/* \\brief How long to wait after an initial wake failure for the POST to\n *         complete.\n * If Power-on self test (POST) is enabled, the self test will run on waking\n * from sleep or during power-on, which delays the wake reply.\n */\n#ifndef ATCA_POST_DELAY_MSEC\n#define ATCA_POST_DELAY_MSEC 25\n#endif\n\n#endif // ATCA_CONFIG_H\n```\n\nThere are two major compiler defines that affect the operation of the library.\n  - ATCA_NO_POLL can be used to revert to a non-polling mechanism for device\n    responses. Normally responses are polled for after sending a command,\n    giving quicker response times. However, if ATCA_NO_POLL is defined, then\n    the library will simply delay the max execution time of a command before\n    reading the response.\n  - ATCA_NO_HEAP can be used to remove the use of malloc/free from the main\n    library. This can be helpful for smaller MCUs that don't have a heap\n    implemented. If just using the basic API, then there shouldn't be any code\n    changes required. The lower-level API will no longer use the new/delete\n    functions and the init/release functions should be used directly.\n\nSome specific options are available in the fully documented configuration files `lib/calib/calib_config.h`,\n`atca_configuration.h`, `lib/crypto/crypto_config.h`, `lib/host/atca_host_config.h` which is also the place where features can be selected.\n We provide some configurations focused on specific use cases and the checks are enabled by default. \n\nRelease notes\n-----------\nSee [Release Notes](release_notes.md)\n\n\nHost Device Support\n---------------\n\nCryptoAuthLib will run on a variety of platforms from small micro-controllers\nto desktop host systems. See [hal readme](lib/hal/README.md)\n\nPorting requires a time delay function of millisecond resolution (hal_delay_ms) which\ncan be implemented via loop, timer, or rtos sleep/wait and a communication interface.\n\nCryptoAuthLib Architecture\n----------------------------\nCryptoauthlib API documentation is at https://microchiptech.github.io/cryptoauthlib/\n\nThe library is structured to support portability to:\n  - multiple hardware/microcontroller platforms\n  - multiple environments including bare-metal, RTOS and Windows/Linux/MacOS\n  - multiple chip communication protocols (I2C, SPI, and SWI)\n\nAll platform dependencies are contained within the HAL (hardware abstraction\nlayer).\n\n\nDirectory Structure\n-----------------------\n```\nlib - primary library source code\nlib/atcacert - certificate data and i/o methods\nlib/calib - the Basic Cryptoauth API\nlib/crypto - Software crypto implementations external crypto libraries support (primarily SHA1 and SHA2)\nlib/hal - hardware abstraction layer code for supporting specific platforms\nlib/host - support functions for common host-side calculations\nlib/jwt - json web token functions\ntest - Integration test and examples. See test/cmd-processor.c for main() implementation.\n\nFor production code, test directories should be excluded by not compiling it\ninto a project, so it is up to the developer to include or not as needed.  Test\ncode adds significant bulk to an application - it's not intended to be included\nin production code.\n```\n\nTests\n------------\n\nThere is a set of integration tests found in the test directory which will at least\npartially demonstrate the use of the objects.  Some tests may depend upon a\ncertain device being configured in a certain way and may not work for all\ndevices or specific configurations of the device. See [test readme](test/README.md)\n\nUsing CryptoAuthLib (Microchip CryptoAuth Library)\n===========================================\n\nThe best place to start is with the [Microchip Trust Platform](https://www.microchip.com/design-centers/security-ics/trust-platform)\n\nAlso application examples are included as part of the Harmony 3 framework and can be copied from the Harmony Content Manager\nor found with the Harmony 3 Framework [Cryptoauthlib_apps](https://github.com/Microchip-MPLAB-Harmony/cryptoauthlib_apps)\n\n\nIncorporating CryptoAuthLib in a Linux project using USB HID devices\n-----------------------------------------\nThe Linux HID HAL files use the Linux udev development software package.\n\nTo install the udev development package under Ubuntu Linux, please type the\nfollowing command at the terminal window:\n\n```bash\nsudo apt-get install libudev-dev\n```\n\nThis adds the udev development development software package to the Ubuntu Linux\ninstallation.\n\nThe Linux HID HAL files also require a udev rule to be added to change the\npermissions of the USB HID Devices.  Please add a new udev rule for the\nMicrochip CryptoAuth USB devices.\n\n```bash\ncd /etc/udev/rules.d\nsudo touch mchp-cryptoauth.rules\n```\n\nEdit the mchp-cryptoauth.rules file and add the following line to the file:\n```text\nSUBSYSTEM==\"hidraw\", ATTRS{idVendor}==\"03eb\", ATTRS{idProduct}==\"2312\", MODE=\"0666\"\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrochiptech%2Fcryptoauthlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrochiptech%2Fcryptoauthlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrochiptech%2Fcryptoauthlib/lists"}