Add Chacha20Poly1305 to AEAD Algorithms
Bug: b:153649905 Change-Id: I3eaca93d0ae7b0d0cd5c502e8536977fb66ca979 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363351 Reviewed-by: Adam Langley <agl@chromium.org> Commit-Queue: Leonid Baraz <lbaraz@chromium.org> Cr-Commit-Position: refs/heads/master@{#799275}
This commit is contained in:
@ -27,6 +27,9 @@ Aead::Aead(AeadAlgorithm algorithm) {
|
|||||||
case AES_256_GCM_SIV:
|
case AES_256_GCM_SIV:
|
||||||
aead_ = EVP_aead_aes_256_gcm_siv();
|
aead_ = EVP_aead_aes_256_gcm_siv();
|
||||||
break;
|
break;
|
||||||
|
case CHACHA20_POLY1305:
|
||||||
|
aead_ = EVP_aead_chacha20_poly1305();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,12 @@ namespace crypto {
|
|||||||
// Prefer the latter in new code.
|
// Prefer the latter in new code.
|
||||||
class CRYPTO_EXPORT Aead {
|
class CRYPTO_EXPORT Aead {
|
||||||
public:
|
public:
|
||||||
enum AeadAlgorithm { AES_128_CTR_HMAC_SHA256, AES_256_GCM, AES_256_GCM_SIV };
|
enum AeadAlgorithm {
|
||||||
|
AES_128_CTR_HMAC_SHA256,
|
||||||
|
AES_256_GCM,
|
||||||
|
AES_256_GCM_SIV,
|
||||||
|
CHACHA20_POLY1305
|
||||||
|
};
|
||||||
|
|
||||||
explicit Aead(AeadAlgorithm algorithm);
|
explicit Aead(AeadAlgorithm algorithm);
|
||||||
Aead(const Aead&) = delete;
|
Aead(const Aead&) = delete;
|
||||||
|
@ -11,8 +11,10 @@
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
const crypto::Aead::AeadAlgorithm kAllAlgorithms[]{
|
const crypto::Aead::AeadAlgorithm kAllAlgorithms[]{
|
||||||
crypto::Aead::AES_128_CTR_HMAC_SHA256, crypto::Aead::AES_256_GCM,
|
crypto::Aead::AES_128_CTR_HMAC_SHA256,
|
||||||
|
crypto::Aead::AES_256_GCM,
|
||||||
crypto::Aead::AES_256_GCM_SIV,
|
crypto::Aead::AES_256_GCM_SIV,
|
||||||
|
crypto::Aead::CHACHA20_POLY1305,
|
||||||
};
|
};
|
||||||
|
|
||||||
class AeadTest : public testing::TestWithParam<crypto::Aead::AeadAlgorithm> {};
|
class AeadTest : public testing::TestWithParam<crypto::Aead::AeadAlgorithm> {};
|
||||||
|
Reference in New Issue
Block a user