--- /dev/null
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+#include "crypto/noise/noise.h"
+
+#include <gtest/gtest.h>
+
+using namespace Crypto::Noise;
+
+TEST(NoiseTest, KNpsk0_P256_AESGCM_SHA256_initial_state)
+{
+ SymmetricState noise{SymmetricState::HandshakeKind::KNpsk0_P256_AESGCM_SHA256};
+ // Values come from an alternative implemantation of Dong Sun Lee
+ EXPECT_EQ(noise.GetHandshakeHash(),
+ (CryptoBuffer{0x4e, 0x6f, 0x69, 0x73, 0x65, 0x5f, 0x4b, 0x4e, 0x70, 0x73, 0x6b,
+ 0x30, 0x5f, 0x50, 0x32, 0x35, 0x36, 0x5f, 0x41, 0x45, 0x53, 0x47,
+ 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x00}));
+ auto splitRes = noise.Split();
+ EXPECT_EQ(splitRes.first.Key(),
+ (CryptoBuffer{0xa4, 0xdb, 0x02, 0x9f, 0x61, 0x2c, 0x32, 0x49, 0x75, 0x2f, 0x90,
+ 0xb9, 0x2d, 0xee, 0x29, 0xce, 0x0e, 0xa6, 0xe4, 0x97, 0xbd, 0xf9,
+ 0x84, 0xeb, 0x3e, 0x77, 0x35, 0x38, 0x9d, 0x44, 0xe8, 0xdc}));
+ EXPECT_EQ(splitRes.second.Key(),
+ (CryptoBuffer{0x7f, 0x5d, 0x64, 0xf2, 0x95, 0x89, 0xd6, 0x1b, 0x4e, 0xbf, 0x57,
+ 0x74, 0x7b, 0x70, 0x87, 0x0f, 0x20, 0x9a, 0xb8, 0xd4, 0x83, 0x36,
+ 0x5f, 0xde, 0x3f, 0x46, 0x25, 0x31, 0xbd, 0x14, 0x26, 0x90}));
+}
+
+TEST(NoiseTest, NKpsk0_P256_AESGCM_SHA256_initial_state)
+{
+ SymmetricState noise{SymmetricState::HandshakeKind::NKpsk0_P256_AESGCM_SHA256};
+ // Values come from an alternative implemantation of Dong Sun Lee
+ EXPECT_EQ(noise.GetHandshakeHash(),
+ (CryptoBuffer{0x4e, 0x6f, 0x69, 0x73, 0x65, 0x5f, 0x4e, 0x4b, 0x70, 0x73, 0x6b,
+ 0x30, 0x5f, 0x50, 0x32, 0x35, 0x36, 0x5f, 0x41, 0x45, 0x53, 0x47,
+ 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x00}));
+ auto splitRes = noise.Split();
+ EXPECT_EQ(splitRes.first.Key(),
+ (CryptoBuffer{0xd8, 0xf4, 0x83, 0x2e, 0x80, 0x4c, 0x5e, 0x6b, 0x5b, 0x5f, 0xd9,
+ 0xd7, 0x70, 0x88, 0x78, 0xef, 0xbb, 0x72, 0xfb, 0x0d, 0x76, 0x79,
+ 0xa1, 0xf4, 0x53, 0x8d, 0xdd, 0x21, 0x95, 0xde, 0x4d, 0x22}));
+ EXPECT_EQ(splitRes.second.Key(),
+ (CryptoBuffer{0xb8, 0x50, 0x2d, 0xec, 0x3d, 0xa3, 0x80, 0xdd, 0x4f, 0xf9, 0x08,
+ 0x5d, 0xc3, 0x92, 0x7f, 0x82, 0xaa, 0xed, 0xf5, 0x22, 0xb8, 0x33,
+ 0xfd, 0x5e, 0x60, 0x6b, 0x2f, 0xe2, 0x6e, 0xfc, 0x18, 0xda}));
+}
+
+TEST(NoiseTest, KNpsk0_P256_AESGCM_SHA256_MixHash)
+{
+ SymmetricState noise{SymmetricState::HandshakeKind::KNpsk0_P256_AESGCM_SHA256};
+ noise.MixHash({'a', 'b', 'c'});
+ // Values come from an alternative implemantation of Dong Sun Lee
+ EXPECT_EQ(noise.GetHandshakeHash(),
+ (CryptoBuffer{0xe0, 0x92, 0xb5, 0x62, 0x6c, 0x14, 0xf8, 0x3f, 0x8d, 0x28, 0x9f,
+ 0x2c, 0x37, 0x61, 0xba, 0x15, 0xf9, 0x68, 0xb0, 0x7e, 0x40, 0x80,
+ 0x51, 0x9d, 0x76, 0x3d, 0xc8, 0xb1, 0x65, 0xf4, 0xbb, 0x20}));
+ auto splitRes = noise.Split();
+ EXPECT_EQ(splitRes.first.Key(),
+ (CryptoBuffer{0xa4, 0xdb, 0x02, 0x9f, 0x61, 0x2c, 0x32, 0x49, 0x75, 0x2f, 0x90,
+ 0xb9, 0x2d, 0xee, 0x29, 0xce, 0x0e, 0xa6, 0xe4, 0x97, 0xbd, 0xf9,
+ 0x84, 0xeb, 0x3e, 0x77, 0x35, 0x38, 0x9d, 0x44, 0xe8, 0xdc}));
+ EXPECT_EQ(splitRes.second.Key(),
+ (CryptoBuffer{0x7f, 0x5d, 0x64, 0xf2, 0x95, 0x89, 0xd6, 0x1b, 0x4e, 0xbf, 0x57,
+ 0x74, 0x7b, 0x70, 0x87, 0x0f, 0x20, 0x9a, 0xb8, 0xd4, 0x83, 0x36,
+ 0x5f, 0xde, 0x3f, 0x46, 0x25, 0x31, 0xbd, 0x14, 0x26, 0x90}));
+}
+
+TEST(NoiseTest, NKpsk0_P256_AESGCM_SHA256_MixHash)
+{
+ SymmetricState noise{SymmetricState::HandshakeKind::NKpsk0_P256_AESGCM_SHA256};
+ noise.MixHash({'a', 'b', 'c'});
+ // Values come from an alternative implemantation of Dong Sun Lee
+ EXPECT_EQ(noise.GetHandshakeHash(),
+ (CryptoBuffer{0xc3, 0xec, 0x18, 0xe6, 0x5f, 0x80, 0xcc, 0xe1, 0x43, 0x86, 0xab,
+ 0x76, 0x5d, 0xbc, 0x2f, 0xfc, 0x82, 0xc5, 0x94, 0x68, 0x9a, 0x45,
+ 0xe3, 0xb6, 0xc0, 0xa7, 0x8d, 0x8d, 0x24, 0x14, 0x52, 0x59}));
+ auto splitRes = noise.Split();
+ EXPECT_EQ(splitRes.first.Key(),
+ (CryptoBuffer{0xd8, 0xf4, 0x83, 0x2e, 0x80, 0x4c, 0x5e, 0x6b, 0x5b, 0x5f, 0xd9,
+ 0xd7, 0x70, 0x88, 0x78, 0xef, 0xbb, 0x72, 0xfb, 0x0d, 0x76, 0x79,
+ 0xa1, 0xf4, 0x53, 0x8d, 0xdd, 0x21, 0x95, 0xde, 0x4d, 0x22}));
+ EXPECT_EQ(splitRes.second.Key(),
+ (CryptoBuffer{0xb8, 0x50, 0x2d, 0xec, 0x3d, 0xa3, 0x80, 0xdd, 0x4f, 0xf9, 0x08,
+ 0x5d, 0xc3, 0x92, 0x7f, 0x82, 0xaa, 0xed, 0xf5, 0x22, 0xb8, 0x33,
+ 0xfd, 0x5e, 0x60, 0x6b, 0x2f, 0xe2, 0x6e, 0xfc, 0x18, 0xda}));
+}
+
+TEST(NoiseTest, KNpsk0_P256_AESGCM_SHA256_MixKey)
+{
+ SymmetricState noise{SymmetricState::HandshakeKind::KNpsk0_P256_AESGCM_SHA256};
+ noise.MixKey({'a', 'b', 'c'});
+ // Values come from an alternative implemantation of Dong Sun Lee
+ EXPECT_EQ(noise.GetHandshakeHash(),
+ (CryptoBuffer{0x4e, 0x6f, 0x69, 0x73, 0x65, 0x5f, 0x4b, 0x4e, 0x70, 0x73, 0x6b,
+ 0x30, 0x5f, 0x50, 0x32, 0x35, 0x36, 0x5f, 0x41, 0x45, 0x53, 0x47,
+ 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x00}));
+ auto splitRes = noise.Split();
+ EXPECT_EQ(splitRes.first.Key(),
+ (CryptoBuffer{0xfa, 0xc0, 0x19, 0x0d, 0x02, 0xa2, 0xd8, 0xa3, 0x4b, 0xb1, 0x15,
+ 0xae, 0xd1, 0x52, 0x38, 0x9d, 0xfd, 0x99, 0x35, 0x29, 0x89, 0x8d,
+ 0xf0, 0x89, 0xc7, 0xa5, 0x9e, 0x98, 0x1d, 0xad, 0x4a, 0xf9}));
+ EXPECT_EQ(splitRes.second.Key(),
+ (CryptoBuffer{0xec, 0x2a, 0x88, 0xf4, 0xb0, 0x60, 0x4c, 0x69, 0x12, 0xd4, 0x99,
+ 0x16, 0xd7, 0xae, 0x0b, 0x9d, 0x2b, 0x02, 0xf5, 0x3f, 0x10, 0x32,
+ 0xea, 0x72, 0x92, 0x9c, 0x19, 0xbf, 0x22, 0xe4, 0xe3, 0xd8}));
+}
+
+TEST(NoiseTest, NKpsk0_P256_AESGCM_SHA256_MixKey)
+{
+ SymmetricState noise{SymmetricState::HandshakeKind::NKpsk0_P256_AESGCM_SHA256};
+ noise.MixKey({'a', 'b', 'c'});
+ // Values come from an alternative implemantation of Dong Sun Lee
+ EXPECT_EQ(noise.GetHandshakeHash(),
+ (CryptoBuffer{0x4e, 0x6f, 0x69, 0x73, 0x65, 0x5f, 0x4e, 0x4b, 0x70, 0x73, 0x6b,
+ 0x30, 0x5f, 0x50, 0x32, 0x35, 0x36, 0x5f, 0x41, 0x45, 0x53, 0x47,
+ 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x00}));
+ auto splitRes = noise.Split();
+ EXPECT_EQ(splitRes.first.Key(),
+ (CryptoBuffer{0x0c, 0x7e, 0x21, 0xf2, 0x77, 0x6a, 0x8d, 0x81, 0x35, 0x72, 0xbc,
+ 0x2e, 0x64, 0xf6, 0xa4, 0xbf, 0x41, 0xad, 0x79, 0xca, 0x6c, 0xa9,
+ 0xc9, 0x38, 0x44, 0x75, 0xf8, 0xa0, 0x34, 0xa0, 0x3e, 0xc7}));
+ EXPECT_EQ(splitRes.second.Key(),
+ (CryptoBuffer{0xd6, 0x1a, 0xc7, 0x4b, 0xfc, 0x82, 0x0a, 0x76, 0x8f, 0x1e, 0x98,
+ 0x3a, 0xf6, 0xb3, 0xd2, 0xe9, 0x58, 0x21, 0xea, 0xbf, 0xef, 0x96,
+ 0xd2, 0xf7, 0x51, 0xfb, 0xce, 0xc3, 0xba, 0xa7, 0x88, 0x98}));
+}
+
+TEST(NoiseTest, KNpsk0_P256_AESGCM_SHA256_MixKeyAndHash)
+{
+ SymmetricState noise{SymmetricState::HandshakeKind::KNpsk0_P256_AESGCM_SHA256};
+ noise.MixKeyAndHash({'a', 'b', 'c'});
+ // Values come from an alternative implemantation of Dong Sun Lee
+ EXPECT_EQ(noise.GetHandshakeHash(),
+ (CryptoBuffer{0x3a, 0xf7, 0x39, 0xd6, 0xa2, 0xf4, 0x87, 0x05, 0x3c, 0xf7, 0x20,
+ 0x30, 0x91, 0x02, 0x85, 0xdf, 0x70, 0x33, 0x67, 0x53, 0xcf, 0xf1,
+ 0x22, 0xfc, 0xc6, 0x99, 0xa2, 0x9a, 0x77, 0x36, 0x11, 0xab}));
+ auto splitRes = noise.Split();
+ EXPECT_EQ(splitRes.first.Key(),
+ (CryptoBuffer{0xfa, 0xc0, 0x19, 0x0d, 0x02, 0xa2, 0xd8, 0xa3, 0x4b, 0xb1, 0x15,
+ 0xae, 0xd1, 0x52, 0x38, 0x9d, 0xfd, 0x99, 0x35, 0x29, 0x89, 0x8d,
+ 0xf0, 0x89, 0xc7, 0xa5, 0x9e, 0x98, 0x1d, 0xad, 0x4a, 0xf9}));
+ EXPECT_EQ(splitRes.second.Key(),
+ (CryptoBuffer{0xec, 0x2a, 0x88, 0xf4, 0xb0, 0x60, 0x4c, 0x69, 0x12, 0xd4, 0x99,
+ 0x16, 0xd7, 0xae, 0x0b, 0x9d, 0x2b, 0x02, 0xf5, 0x3f, 0x10, 0x32,
+ 0xea, 0x72, 0x92, 0x9c, 0x19, 0xbf, 0x22, 0xe4, 0xe3, 0xd8}));
+}
+
+TEST(NoiseTest, NKpsk0_P256_AESGCM_SHA256_MixKeyAndHash)
+{
+ SymmetricState noise{SymmetricState::HandshakeKind::NKpsk0_P256_AESGCM_SHA256};
+ noise.MixKeyAndHash({'a', 'b', 'c'});
+ // Values come from an alternative implemantation of Dong Sun Lee
+ EXPECT_EQ(noise.GetHandshakeHash(),
+ (CryptoBuffer{0x3f, 0x46, 0xd8, 0x5d, 0x19, 0x65, 0x9a, 0x23, 0x62, 0x16, 0x48,
+ 0xde, 0x8d, 0x47, 0x38, 0x06, 0x8b, 0x54, 0x6a, 0x7b, 0x99, 0x30,
+ 0x52, 0x1e, 0x4b, 0xf0, 0x0d, 0x6d, 0xa0, 0xc3, 0xe8, 0xda}));
+ auto splitRes = noise.Split();
+ EXPECT_EQ(splitRes.first.Key(),
+ (CryptoBuffer{0x0c, 0x7e, 0x21, 0xf2, 0x77, 0x6a, 0x8d, 0x81, 0x35, 0x72, 0xbc,
+ 0x2e, 0x64, 0xf6, 0xa4, 0xbf, 0x41, 0xad, 0x79, 0xca, 0x6c, 0xa9,
+ 0xc9, 0x38, 0x44, 0x75, 0xf8, 0xa0, 0x34, 0xa0, 0x3e, 0xc7}));
+ EXPECT_EQ(splitRes.second.Key(),
+ (CryptoBuffer{0xd6, 0x1a, 0xc7, 0x4b, 0xfc, 0x82, 0x0a, 0x76, 0x8f, 0x1e, 0x98,
+ 0x3a, 0xf6, 0xb3, 0xd2, 0xe9, 0x58, 0x21, 0xea, 0xbf, 0xef, 0x96,
+ 0xd2, 0xf7, 0x51, 0xfb, 0xce, 0xc3, 0xba, 0xa7, 0x88, 0x98}));
+}
+
+TEST(NoiseTest, KNpsk0_P256_AESGCM_SHA256_Encrypt_Decrypt)
+{
+ SymmetricState noise{SymmetricState::HandshakeKind::KNpsk0_P256_AESGCM_SHA256};
+ noise.MixKeyAndHash({'a', 'b', 'c'});
+
+ CryptoBuffer msg1 = {'x', 'y', 'z'};
+ CryptoBuffer msg2(77, 0x0b);
+
+ auto noise2 = noise;
+ auto ciphertext1 = noise.EncryptAndHash(msg1);
+ auto plaintext1 = noise2.DecryptAndHash(ciphertext1);
+ EXPECT_EQ(msg1, plaintext1);
+ // clang-format off
+ // Value comes from an alternative implemantation of Dong Sun Lee
+ EXPECT_EQ(ciphertext1,
+ (CryptoBuffer{
+ 0x73, 0xa5, 0x70, 0x0a, 0x9f, 0x2b, 0x63, 0x8c, 0xa9, 0x68,
+ 0xc9, 0xe7, 0x05, 0xd9, 0x9a, 0xca, 0xf2, 0x2b, 0xf1}));
+ // clang-format on
+
+ auto ciphertext2 = noise.EncryptAndHash(msg2);
+ auto plaintext2 = noise2.DecryptAndHash(ciphertext2);
+ EXPECT_EQ(msg2, plaintext2);
+ // Values come from this implementation after verifying the Noise handshake works with
+ // webauthn.io
+ EXPECT_EQ(ciphertext2,
+ (CryptoBuffer{0xac, 0xfa, 0xcf, 0x33, 0x04, 0x6a, 0x9b, 0xe4, 0x35, 0x5e, 0xc3, 0xee,
+ 0x34, 0xcb, 0xf5, 0x92, 0x5e, 0x08, 0x08, 0x51, 0x73, 0xad, 0x0f, 0xd3,
+ 0xe9, 0x19, 0x52, 0x2a, 0x46, 0x41, 0x5c, 0x81, 0x7a, 0x89, 0x50, 0x98,
+ 0xc3, 0xa8, 0x59, 0x9e, 0x43, 0x75, 0x4a, 0x43, 0x33, 0x4a, 0xb3, 0x59,
+ 0x5f, 0x19, 0xa4, 0xe4, 0x34, 0x70, 0xf9, 0x34, 0x11, 0x44, 0x03, 0xa4,
+ 0x0a, 0x1e, 0x9a, 0x3a, 0xb2, 0xf4, 0x0b, 0xef, 0x6d, 0xbe, 0x64, 0x0b,
+ 0xba, 0x75, 0x95, 0xe2, 0x0c, 0x59, 0xe7, 0x44, 0x6f, 0x36, 0x25, 0x01,
+ 0x3b, 0xa3, 0xf9, 0xf0, 0x8e, 0x01, 0xce, 0x5b, 0x25}));
+
+ EXPECT_EQ(noise.GetHandshakeHash(),
+ (CryptoBuffer{0x87, 0xc6, 0x55, 0x89, 0x86, 0x7a, 0xbe, 0x17, 0x88, 0xf1, 0x2b,
+ 0xb6, 0xf0, 0x0b, 0x6e, 0xd1, 0x8a, 0xb8, 0x68, 0xee, 0x57, 0x67,
+ 0x58, 0xfa, 0xbf, 0xb2, 0x65, 0x17, 0xed, 0xd3, 0x3b, 0x0c}));
+ auto splitRes = noise.Split();
+ EXPECT_EQ(splitRes.first.Key(),
+ (CryptoBuffer{0xfa, 0xc0, 0x19, 0x0d, 0x02, 0xa2, 0xd8, 0xa3, 0x4b, 0xb1, 0x15,
+ 0xae, 0xd1, 0x52, 0x38, 0x9d, 0xfd, 0x99, 0x35, 0x29, 0x89, 0x8d,
+ 0xf0, 0x89, 0xc7, 0xa5, 0x9e, 0x98, 0x1d, 0xad, 0x4a, 0xf9}));
+ EXPECT_EQ(splitRes.second.Key(),
+ (CryptoBuffer{0xec, 0x2a, 0x88, 0xf4, 0xb0, 0x60, 0x4c, 0x69, 0x12, 0xd4, 0x99,
+ 0x16, 0xd7, 0xae, 0x0b, 0x9d, 0x2b, 0x02, 0xf5, 0x3f, 0x10, 0x32,
+ 0xea, 0x72, 0x92, 0x9c, 0x19, 0xbf, 0x22, 0xe4, 0xe3, 0xd8}));
+}
+
+TEST(NoiseTest, NKpsk0_P256_AESGCM_SHA256_Encrypt_Decrypt)
+{
+ SymmetricState noise{SymmetricState::HandshakeKind::NKpsk0_P256_AESGCM_SHA256};
+ noise.MixKeyAndHash({'a', 'b', 'c'});
+
+ CryptoBuffer msg1 = {'x', 'y', 'z'};
+ CryptoBuffer msg2(77, 0x0b);
+
+ auto noise2 = noise;
+ auto ciphertext1 = noise.EncryptAndHash(msg1);
+ auto plaintext1 = noise2.DecryptAndHash(ciphertext1);
+ EXPECT_EQ(msg1, plaintext1);
+ // clang-format off
+ // Value comes from an alternative implemantation of Dong Sun Lee
+ EXPECT_EQ(ciphertext1,
+ (CryptoBuffer{
+ 0x6e, 0x5f, 0x52, 0xf4, 0xf8, 0x53, 0xa3, 0x6c, 0xb0, 0x27,
+ 0x43, 0xa9, 0x4c, 0x66, 0xb0, 0x64, 0xb2, 0xd2, 0x1b}));
+ // clang-format on
+
+ auto ciphertext2 = noise.EncryptAndHash(msg2);
+ auto plaintext2 = noise2.DecryptAndHash(ciphertext2);
+ EXPECT_EQ(msg2, plaintext2);
+ // Values come from this implementation after verifying the Noise handshake works with
+ // webauthn.io
+ EXPECT_EQ(ciphertext2,
+ (CryptoBuffer{0x19, 0x87, 0x80, 0x66, 0x99, 0xa6, 0x07, 0x28, 0x5d, 0xf0, 0x7e, 0x68,
+ 0x91, 0xa8, 0x16, 0xc1, 0xce, 0x79, 0x52, 0xfd, 0x5e, 0xe5, 0x57, 0xb0,
+ 0xca, 0xf2, 0xeb, 0xd3, 0x12, 0x14, 0x92, 0x2f, 0x0f, 0x05, 0x8b, 0x4f,
+ 0xf4, 0x93, 0x1d, 0x08, 0x16, 0xee, 0x82, 0x87, 0x77, 0xcf, 0x30, 0x6d,
+ 0x82, 0x3e, 0xe4, 0x3b, 0x85, 0xf4, 0xc3, 0xab, 0xcb, 0x8f, 0xcd, 0x79,
+ 0x4c, 0x04, 0xd0, 0x4d, 0x95, 0x1a, 0xf7, 0xfc, 0xa0, 0xd7, 0x77, 0x69,
+ 0x87, 0xa6, 0xa8, 0x59, 0x38, 0xcb, 0x29, 0x6d, 0xbc, 0x65, 0x6a, 0xfb,
+ 0xae, 0x99, 0x6a, 0x57, 0xb9, 0x0a, 0x59, 0x1d, 0xaf}));
+
+ EXPECT_EQ(noise.GetHandshakeHash(),
+ (CryptoBuffer{0x07, 0x84, 0xd9, 0x43, 0x5d, 0xfd, 0xd4, 0xb6, 0x98, 0x28, 0xf7,
+ 0xc1, 0x92, 0xfd, 0xff, 0x20, 0xe3, 0x93, 0x80, 0xba, 0xc6, 0xe5,
+ 0x6a, 0x7c, 0xfa, 0x8e, 0x7a, 0x5c, 0x6a, 0x5e, 0x97, 0x04}));
+ auto splitRes = noise.Split();
+ EXPECT_EQ(splitRes.first.Key(),
+ (CryptoBuffer{0x0c, 0x7e, 0x21, 0xf2, 0x77, 0x6a, 0x8d, 0x81, 0x35, 0x72, 0xbc,
+ 0x2e, 0x64, 0xf6, 0xa4, 0xbf, 0x41, 0xad, 0x79, 0xca, 0x6c, 0xa9,
+ 0xc9, 0x38, 0x44, 0x75, 0xf8, 0xa0, 0x34, 0xa0, 0x3e, 0xc7}));
+ EXPECT_EQ(splitRes.second.Key(),
+ (CryptoBuffer{0xd6, 0x1a, 0xc7, 0x4b, 0xfc, 0x82, 0x0a, 0x76, 0x8f, 0x1e, 0x98,
+ 0x3a, 0xf6, 0xb3, 0xd2, 0xe9, 0x58, 0x21, 0xea, 0xbf, 0xef, 0x96,
+ 0xd2, 0xf7, 0x51, 0xfb, 0xce, 0xc3, 0xba, 0xa7, 0x88, 0x98}));
+}