12 releases

0.3.1 Jan 29, 2024
0.3.0 Nov 13, 2023
0.2.5 Apr 19, 2022
0.2.4 Jan 19, 2022
0.2.0-pre.4 May 13, 2021

#421 in Cryptography

Download history 77/week @ 2024-08-13 78/week @ 2024-08-20 243/week @ 2024-08-27 333/week @ 2024-09-03 457/week @ 2024-09-10 409/week @ 2024-09-17 445/week @ 2024-09-24 327/week @ 2024-10-01 395/week @ 2024-10-08 189/week @ 2024-10-15 347/week @ 2024-10-22 323/week @ 2024-10-29 171/week @ 2024-11-05 423/week @ 2024-11-12 437/week @ 2024-11-19 286/week @ 2024-11-26

1,364 downloads per month
Used in 7 crates (5 directly)

MIT/Apache

270KB
7K SLoC

askar-crypto

Rust Crate Rust Documentation

The askar-crypto crate provides the basic key representations and cryptographic operations used by aries-askar.

Supported Key Types

Key Type Feature Operations Notes
AES-GCM aes AEAD encryption
JWK export
A128GCM and A256GCM
AES-CBC-HMAC-SHA2 aes AEAD encryption
JWK export
A128CBC-HS256 and A256CBC-HS512
AES Key Wrap aes Authenticated encryption
JWK export
A128KW and A256KW
(X)ChaCha20-Poly1305 chacha AEAD encryption
JWK export
aka C20P, XC20P
BLS12-381 bls bls-signature1 key generation
JWK import/export
G1, G2, and G1G2 key types
Ed25519 ed25519 EdDSA signatures
JWK import/export
Conversion to X25519
X25519 ed25519 DH key exchange
JWK import/export
K-256 k256 ECDSA signatures
DH key exchange
JWK import/export
aka secp256k1
P-256 p256 ECDSA signatures
DH key exchange
JWK import/export
aka nist256p1, secp256r1

1. Compatible with bls-signature RFC draft 4 https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature-04

'Any' Key support

The any_key feature (which depends on alloc) provides a generic interface for creating and working with any supported key type.

JSON Web Algorithms

This crate provides implementations of the ECDH-ES and ECDH-1PU (draft 4) key agreement operations, for use in deriving a content encryption or key wrapping key. These primitives can be used when producing or consuming JWE envelopes using these algorithms.

no-std

This crate supports the optional alloc feature, gating types and operations that depend on a global allocator. The std feature depends on alloc, and adds support for std::error::Error.

License

Licensed under either of

at your option.

Dependencies

~1.7–4.5MB
~92K SLoC