Skip to content

Conversation

larabr
Copy link
Collaborator

@larabr larabr commented Sep 7, 2023

generateKey now accepts type: 'curve25519' and 'curve448' to generate keys as per crypto-refresh (see #1620 and #1625).

Neither type is set as default for now, since they are not widely supported.
Note that the generate key options { type: 'curve25519' } are not equivalent to { type: 'ecc', curve: 'curve25519' }: the latter is still the default (same as OpenPGP.js v5), and generates keys in legacy - but widely adopted - format.

Breaking change:

  • the value enums.publicKey.eddsa has been dropped, in favour of enums.publicKey.eddsaLegacy. This is to highlight the difference with the new format algo identifier (enums.publicKey.ed25519).
  • similarly, the string values of enums.curve.ed25519Legacy and .curve25519Legacy have been renamed from 'ed25519'/'curve25519' to 'ed25519Legacy'/'curve25519Legacy'.

TODO

@larabr larabr force-pushed the v6-generate-key-new-ed branch from b867d84 to c0506f5 Compare September 7, 2023 17:57
@larabr larabr marked this pull request as draft September 7, 2023 17:58
@larabr larabr force-pushed the v6-generate-key-new-ed branch from c0506f5 to c3642e5 Compare September 11, 2023 17:13
@larabr larabr requested a review from twiss September 11, 2023 17:14
@larabr larabr force-pushed the v6-generate-key-new-ed branch 2 times, most recently from 7f9670b to 580b76a Compare October 4, 2023 14:39
@larabr larabr changed the title crypto-refresh: support generating Curve448 and Curve25519 keys (new format) [v6] crypto-refresh: support generating Curve448 and Curve25519 keys (new format) Oct 18, 2023
@larabr larabr force-pushed the v6-generate-key-new-ed branch 2 times, most recently from 4695250 to 50b69e0 Compare October 20, 2023 16:03
Neither type is set as default for now, since they are not widely supported.
The crypto-refresh has standardised a new key format for EdDSA, whose algorithm
identifier are `enums.publicKey.ed25519` and `.ed448`
As required by the spec.
As per the spec, v6 keys must not use the legacy curve25519 format.
The new format is not used by default with v4 keys as it's not compatible with OpenPGP.js older than v5.10.0 .
However, v6 keys already break compatibility, so if the user requests them via config flag, we can safely use the new curve format as well.
…ed}25519'` to `'{curve. ed}25519Legacy'`

To reflect the crypto-refresh naming, after the standardisation of the new EdDSA
key types.
@larabr larabr force-pushed the v6-generate-key-new-ed branch from 50b69e0 to d78cfd3 Compare October 20, 2023 18:40
@larabr larabr marked this pull request as ready for review October 20, 2023 18:40
@larabr larabr merged commit 030f66e into openpgpjs:v6 Oct 20, 2023
@larabr larabr mentioned this pull request Oct 20, 2023
Merged
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants