Sahamati / rahasya

The project aims to simplify the usage of ECC curve (curve25519) with Diffie-Hellman Key exchange. The work is inline with the Account Aggregator Specification.
Apache License 2.0
13 stars 20 forks source link

Enable the hex based key support for getSharedKey api #24

Closed gsasikumar closed 3 years ago

gsasikumar commented 3 years ago

Description

The update allows the getSharedKey API to accept a simple hex-encoded 32 bytes (64 hex characters) and autodetect them for generation of the shared secret keys.

Motivation and Context

This change is essential as some of the good C libraries do not generate a PEM or X509 encoded spec for X25519. Instead of spending time to convert such keys, it would be easier to auto-detect it within this framework. Also the change ensures compatibility to RFC7748

The given PR will fix only the getSharedKey API. The same fix is needed in other API's as well. They would be raised as independent PR.

Types of changes

Checklist