forked from randombit/botan
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KEMTLS as spoken by thomwigger/kemtls-experiment
Co-Authored-By: Hannes Rantzsch <[email protected]>
- Loading branch information
Showing
20 changed files
with
380 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<defines> | ||
KEMTLS -> 20220407 | ||
</defines> | ||
|
||
<header:public> | ||
</header:public> | ||
|
||
<header:internal> | ||
</header:internal> | ||
|
||
<requires> | ||
tls13 | ||
pubkey | ||
</requires> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* KEMTLS KEM_Encapsulation Message | ||
* (C) 2022 Jack Lloyd | ||
* 2022 Hannes Rantzsch, René Meusel - neXenio GmbH | ||
* | ||
* Botan is released under the Simplified BSD License (see license.txt) | ||
*/ | ||
|
||
#include <botan/tls_messages.h> | ||
#include <botan/pubkey.h> | ||
|
||
namespace Botan::TLS { | ||
|
||
KEM_Encapsulation::KEM_Encapsulation(const Public_Key& peer_key, RandomNumberGenerator& rng) | ||
{ | ||
// TODO: shared secret length is always 32 in thomwiggers/rustls, but is it? | ||
PK_KEM_Encryptor(peer_key, rng).encrypt(m_ciphertext, m_secret, 32, rng); | ||
} | ||
|
||
std::vector<uint8_t> KEM_Encapsulation::serialize() const | ||
{ | ||
return unlock(m_ciphertext); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.