Skip to content

Commit 0b91393

Browse files
Mingtao Yangfacebook-github-bot
authored andcommitted
ech: Remove fizz::ech::getRecordDigest
Summary: Nothing uses this function, and this function puts a dependency on a concrete backend (OpenSSL). Reviewed By: zalecodez Differential Revision: D62219043 fbshipit-source-id: 9f2fe44571e3e9ebcf586c0a1b69f52921cdb68d
1 parent 5fd2ea6 commit 0b91393

File tree

3 files changed

+0
-36
lines changed

3 files changed

+0
-36
lines changed

fizz/protocol/ech/BUCK

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ cpp_library(
2626
"Encryption.h",
2727
],
2828
deps = [
29-
"//fizz/backend:openssl",
3029
"//fizz/crypto/hpke:utils",
3130
"//fizz/protocol:protocol",
3231
"//fizz/record:record",

fizz/protocol/ech/Encryption.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <fizz/protocol/ech/Encryption.h>
1010
#include "fizz/record/Types.h"
1111

12-
#include <fizz/backend/openssl/OpenSSL.h>
1312
#include <fizz/crypto/hpke/Utils.h>
1413
#include <fizz/protocol/Protocol.h>
1514
#include <fizz/protocol/ech/ECHExtensions.h>
@@ -208,36 +207,6 @@ static hpke::SetupParam getSetupParam(
208207
0};
209208
}
210209

211-
std::unique_ptr<folly::IOBuf> getRecordDigest(
212-
const ECHConfig& echConfig,
213-
hpke::KDFId id) {
214-
switch (id) {
215-
case hpke::KDFId::Sha256: {
216-
std::array<uint8_t, fizz::Sha256::HashLen> recordDigest;
217-
fizz::openssl::Hasher<Sha256>::hash(
218-
*encode(echConfig),
219-
folly::MutableByteRange(recordDigest.data(), recordDigest.size()));
220-
return folly::IOBuf::copyBuffer(recordDigest);
221-
}
222-
case hpke::KDFId::Sha384: {
223-
std::array<uint8_t, fizz::Sha384::HashLen> recordDigest;
224-
fizz::openssl::Hasher<Sha384>::hash(
225-
*encode(echConfig),
226-
folly::MutableByteRange(recordDigest.data(), recordDigest.size()));
227-
return folly::IOBuf::copyBuffer(recordDigest);
228-
}
229-
case hpke::KDFId::Sha512: {
230-
std::array<uint8_t, fizz::Sha512::HashLen> recordDigest;
231-
fizz::openssl::Hasher<Sha512>::hash(
232-
*encode(echConfig),
233-
folly::MutableByteRange(recordDigest.data(), recordDigest.size()));
234-
return folly::IOBuf::copyBuffer(recordDigest);
235-
}
236-
default:
237-
throw std::runtime_error("kdf: not implemented");
238-
}
239-
}
240-
241210
hpke::SetupResult constructHpkeSetupResult(
242211
std::unique_ptr<KeyExchange> kex,
243212
const SupportedECHConfig& supportedConfig) {

fizz/protocol/ech/Encryption.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ std::unique_ptr<hpke::HpkeContext> setupDecryptionContext(
119119
std::unique_ptr<KeyExchange> kex,
120120
uint64_t seqNum);
121121

122-
std::unique_ptr<folly::IOBuf> getRecordDigest(
123-
const ECHConfig& echConfig,
124-
hpke::KDFId id);
125-
126122
std::vector<Extension> substituteOuterExtensions(
127123
std::vector<Extension>&& innerExt,
128124
const std::vector<Extension>& outerExt);

0 commit comments

Comments
 (0)