RustCrypto / JOSE

Pure Rust implementation of Javascript Object Signing and Encryption (JOSE)
48 stars 10 forks source link

Support ECDH and ECMR "alg" values #29

Open tgross35 opened 1 year ago

tgross35 commented 1 year ago

From https://manpages.ubuntu.com/manpages/bionic/man1/jose-jwk-exc.1.html:

The ECDH algorithm performs a standard elliptic curve multiplication such that the public value of \p rem is multiplied by the private value of \p. The ECMR algorithm has three modes of operation. Where the local key has a private key (the "d" property), it performs exactly like ECDH. If the local key does not have a private key and the remote key does have a private key, elliptic curve addition is performed on the two values. Otherwise, if neither the local key nor the remote key have a private key, the remote key is subtracted from the local key using elliptic curve subtraction. When using ECMR, be sure to validate the content of your inputs to avoid triggering the incorrect operation

I'm not sure what the scope of this project is meant to be, but this format is used with clevis/tang so is at least somewhat common