https://github.com/bergzand/libcose
Constrained node COSE library
https://github.com/bergzand/libcose
c cbor cose cryptography ed25519
Last synced: over 1 year ago
JSON representation
Constrained node COSE library
- Host: GitHub
- URL: https://github.com/bergzand/libcose
- Owner: bergzand
- License: other
- Created: 2018-03-29T15:44:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-08-05T07:19:06.000Z (almost 4 years ago)
- Last Synced: 2025-03-18T09:21:35.611Z (over 1 year ago)
- Topics: c, cbor, cose, cryptography, ed25519
- Language: C
- Size: 739 KB
- Stars: 23
- Watchers: 9
- Forks: 9
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libcose
[](https://github.com/bergzand/libcose/actions/workflows/build.yml)
Libcose is a C library aiming to implement the full [COSE] standard.
Libcose is aimed at constrained devices without dynamic memory allocation,
libcose will never call malloc related calls by itself. However it does
require a simple block array allocator for cbor management.
Libcose implements modern ed25519 based signatures for signing. ECDSA based
signing and verification is implemented using Mbed TLS. RSA will probably
be skipped.
There is [online documentation](https://bergzand.github.io/libcose/) available.
### Dependencies:
- [NanoCBOR]
- Either [HACL-C], [libsodium] or [mbed TLS] as crypto library
### Building
To build a shared library from libcose:
```
make lib
```
Default libcose will try to link against libsodium for the crypto. Since
versions after v0.3.x libcose depends on tinycbor instead of cn-cbor.
### Testing
libcose is supplied with a test suite covering most cases. Testing requires
CUnit as test framework and [tinycbor] as additional CBOR library.
Running al tests is done with:
```
make test
```
### Contributing
Open an issue, PR, the usual. Builds must pass before merging. Currently
Travis tests the full test suite. In addition Travis also runs clang-tidy
to check for simple style and code mistakes.
### Limitations
Due to time constraints, for now only signing is implemented. Contributions
for encryption and authentication is of course welcome.
As libcose is aimed at constrained devices a number of configurables are
compile time defined. This includes the number of headers and the number
signatures that are allowed in a single signature structure.
[COSE]: https://tools.ietf.org/html/rfc8152
[NanoCBOR]: https://github.com/bergzand/NanoCBOR
[tinycbor]: https://github.com/intel/tinycbor
[libsodium]: https://github.com/jedisct1/libsodium
[HACL-C]: https://github.com/mitls/hacl-c
[mbed TLS]: https://tls.mbed.org/