Feature request: SECP384R1 and SHA-384/512 in Toybox.Cryptography

Toybox.Cryptography currently supports elliptic-curve keys only on SECP224R1 and SECP256R1, and hashes only up to SHA-256.

I develop a watch app that holds an SSH private key and approves each signature on the watch. It uses the native P-256 support to stay fast and power-efficient, but the latest NSA advisory has reminded people that the CNSA suite requires P-384 with SHA-384. Doing this in Monkey C isn't practical: one P-384 scalar multiplication would take minutes on current hardware.

The request:

  • KEY_PAIR_ELLIPTIC_CURVE_SECP384R1 for KeyPair, KeyAgreement and signature verification;
  • HASH_SHA384 (and ideally HASH_SHA512) for Hash/HashBasedMessageAuthenticationCode.

Most devices' crypto libraries probably have P-384 already for TLS, so exposing it may be a small change.