mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 20:09:04 +00:00
Add x25519 support to generateKeyPair (#16725)
Co-authored-by: João Lucas de Oliveira Lopes <55464917+jlucaso1@users.noreply.github.com> Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
This commit is contained in:
@@ -504,6 +504,7 @@ enum class CryptoAlgorithmIdentifierTag {
|
||||
HKDF = 20,
|
||||
PBKDF2 = 21,
|
||||
ED25519 = 22,
|
||||
X25519 = 23,
|
||||
};
|
||||
|
||||
const uint8_t cryptoAlgorithmIdentifierTagMaximumValue = 22;
|
||||
@@ -2293,6 +2294,9 @@ private:
|
||||
case CryptoAlgorithmIdentifier::Ed25519:
|
||||
write(CryptoAlgorithmIdentifierTag::ED25519);
|
||||
break;
|
||||
case CryptoAlgorithmIdentifier::X25519:
|
||||
write(CryptoAlgorithmIdentifierTag::X25519);
|
||||
break;
|
||||
case CryptoAlgorithmIdentifier::None: {
|
||||
RELEASE_ASSERT_NOT_REACHED();
|
||||
break;
|
||||
@@ -3777,6 +3781,9 @@ private:
|
||||
case CryptoAlgorithmIdentifierTag::ED25519:
|
||||
result = CryptoAlgorithmIdentifier::Ed25519;
|
||||
break;
|
||||
case CryptoAlgorithmIdentifierTag::X25519:
|
||||
result = CryptoAlgorithmIdentifier::X25519;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user