From f10a121ef4cfa8cc794654b4127de79a35686006 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Mon, 8 Jul 2024 22:32:22 +0800 Subject: [PATCH 01/27] add xor_example --- examples/mpc/BUILD.bazel | 19 ++++++ examples/mpc/XOR_example.cc | 112 ++++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 examples/mpc/BUILD.bazel create mode 100644 examples/mpc/XOR_example.cc diff --git a/examples/mpc/BUILD.bazel b/examples/mpc/BUILD.bazel new file mode 100644 index 00000000..adb14f75 --- /dev/null +++ b/examples/mpc/BUILD.bazel @@ -0,0 +1,19 @@ + + + + + +cc_binary( + name = "XOR_example", # target 的名称 + srcs = ["XOR_example.cc"], # 指定源文件,这里假设有一个 hello.cc 文件 + deps = ["//yacl/crypto/aes:aes_opt",], # 如果有依赖项,可以在这里添加,例如:deps = [":library_target"] + copts = ["-maes"] +) + +cc_binary( + name = "AND_example", # target 的名称 + srcs = ["AND_example.cc"], # 指定源文件,这里假设有一个 hello.cc 文件 + deps = ["//yacl/crypto/aes:aes_opt",], # 如果有依赖项,可以在这里添加,例如:deps = [":library_target"] + copts = ["-maes"] +) + diff --git a/examples/mpc/XOR_example.cc b/examples/mpc/XOR_example.cc new file mode 100644 index 00000000..866b377b --- /dev/null +++ b/examples/mpc/XOR_example.cc @@ -0,0 +1,112 @@ +#include +#include +#include +#include +#include +#include "yacl/crypto/aes/aes_opt.h" +#include +#include +#include + +using namespace std; +using namespace yacl::crypto; +using uint128_t = __uint128_t; + +const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); +const uint128_t select_mask[2] = {0, all_one_uint128_t}; + +constexpr uint8_t key[16] = { + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C +}; + +inline uint128_t makeuint128_t(uint64_t high, uint64_t low) { + return (static_cast(high) << 64) | low; +} + +// generate uint128_t +uint128_t randomuint128_t() { + std::random_device rd; + std::mt19937_64 eng(rd()); + std::uniform_int_distribution distr; + + uint64_t high = distr(eng); + uint64_t low = distr(eng); + + return makeuint128_t(high, low); +} + +// get the Least Significant Bit of uint128_t +bool getLSB(const uint128_t& x) { + return (x & 1) == 1; +} + +// for encryption and decryption +template +void myhash(uint128_t * blks) { + uint128_t key_uint128_t; + AES_KEY aes_key; + memcpy(&key_uint128_t, key, sizeof(key_uint128_t)); + AES_set_encrypt_key(key_uint128_t, &aes_key); + + uint128_t tmp[K*H]; + for(int i = 0; i < K*H; ++i) + tmp[i] = blks[i]; + + ParaEnc(tmp, &aes_key); + + for(int i = 0; i < K*H; ++i) + blks[i] = blks[i] ^ tmp[i]; +} + +// garble process +void GB(string * circuits, int length, uint128_t & R, uint128_t * e,uint128_t & gate_wires, bool & d){ + R = randomuint128_t(); + R = R | 1; // ensure the LSB of R is 1 + + for(int i = 0; i < length; i++){ + if(circuits[i].find("input") != string :: npos) e[i] = randomuint128_t(); + else{ + gate_wires = e[0] ^ e[1]; + d = getLSB(gate_wires); + } + } +} + +// encoding process +void EN(bool a, bool b, uint128_t * e, unordered_map & buffer, uint128_t R){ + buffer["alice"] = e[0] ^ (select_mask[a] & R); + buffer["bob"] = e[1] ^ (select_mask[b] & R); +} + +// evaluate process +uint128_t* EV(unordered_map & buffer){ + uint128_t A = buffer["alice"], B = buffer["bob"]; + buffer["XOR"] = A ^ B; +} + + +int main(){ + bool a , b; + cout << "Please input the value:" << endl; + cin>> a >> b; + + string circuits[3] = {"input1", "input2", "outputXOR"}; + int length = 3; + uint128_t e[2]; // circuits garble value of input for encoding + uint128_t gate_wires; // circuits garble value of gate output + bool d; // value for decoding + uint128_t R; // delta in gc + unordered_map buffer; // simulate the communication process + + // step 1: generate the garble circuits + GB(circuits, length, R, e, gate_wires, d); + // step 2:encoding the inputs + EN(a, b, e, buffer, R); + // step 3: evaluation + EV(buffer); + // step 4: decoding the result + cout << a << " xor " << b << " = " << (getLSB(buffer["XOR"]) ^ d) << endl; + + return 0; +} From 1c9420628bce7de2c0e12695ce5d95266b214639 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Mon, 8 Jul 2024 22:41:24 +0800 Subject: [PATCH 02/27] add and_example --- examples/mpc/AND_example.cc | 176 ++++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 examples/mpc/AND_example.cc diff --git a/examples/mpc/AND_example.cc b/examples/mpc/AND_example.cc new file mode 100644 index 00000000..0ec25586 --- /dev/null +++ b/examples/mpc/AND_example.cc @@ -0,0 +1,176 @@ +#include +#include +#include +#include +#include +#include "yacl/crypto/aes/aes_opt.h" +#include +#include +#include + +using namespace std; +using namespace yacl::crypto; +using uint128_t = __uint128_t; + +const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); +const uint128_t select_mask[2] = {0, all_one_uint128_t}; + +constexpr uint8_t key[16] = { + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C +}; + +inline uint128_t makeuint128_t(uint64_t high, uint64_t low) { + return (static_cast(high) << 64) | low; +} + +// generate random uint128_t +uint128_t randomuint128_t() { + std::random_device rd; + std::mt19937_64 eng(rd()); + std::uniform_int_distribution distr; + + uint64_t high = distr(eng); + uint64_t low = distr(eng); + + return makeuint128_t(high, low); +} + +// get the Least Significant Bit of uint128_t +bool getLSB(const uint128_t& x) { + return (x & 1) == 1; +} + +// for encryption and decryption +template +void myhash(uint128_t * blks) { + uint128_t key_uint128_t; + AES_KEY aes_key; + memcpy(&key_uint128_t, key, sizeof(key_uint128_t)); + AES_set_encrypt_key(key_uint128_t, &aes_key); + + uint128_t tmp[K*H]; + for(int i = 0; i < K*H; ++i) + tmp[i] = blks[i]; + + ParaEnc(tmp, &aes_key); + + for(int i = 0; i < K*H; ++i) + blks[i] = blks[i] ^ tmp[i]; +} + + +// ADN gate half gate optimization +uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, uint128_t delta, uint128_t * table) { + bool pa = getLSB(LA0); + bool pb = getLSB(LB0); + + uint128_t HLA0, HA1, HLB0, HB1; + uint128_t tmp, W0; + uint128_t H[4]; + + H[0] = LA0; + H[1] = A1; + H[2] = LB0; + H[3] = B1; + + myhash<2,2>(H); + + HLA0 = H[0]; + HA1 = H[1]; + HLB0 = H[2]; + HB1 = H[3]; + + table[0] = HLA0 ^ HA1; + table[0] = table[0] ^ (select_mask[pb] & delta); + + W0 = HLA0; + W0 = W0 ^ (select_mask[pa] & table[0]); + + tmp = HLB0 ^ HB1; + table[1] = tmp ^ LA0; + + W0 = W0 ^ HLB0; + W0 = W0 ^ (select_mask[pb] & tmp); + return W0; +} + +// garble process +void GB(string * circuits, int length, uint128_t & R, uint128_t * F, uint128_t * e,uint128_t & gate_wires, bool & d){ + R = randomuint128_t(); + R = R | 1; // ensure the LSB of R is 1 + + for(int i = 0; i < length; i++){ + if(circuits[i].find("input") != string :: npos) e[i] = randomuint128_t(); + else { + gate_wires = GBAND(e[0], e[0] ^ R, e[1], e[1] ^ R, R, F); + d = getLSB(gate_wires); + } + + } +} + +// encoding process +void EN(bool a, bool b, uint128_t * e, unordered_map & buffer, uint128_t R){ + buffer["alice"] = e[0] ^ (select_mask[a] & R); + buffer["bob"] = e[1] ^ (select_mask[b] & R); +} + +// evaluate process +uint128_t* EV(unordered_map & buffer){ + uint128_t A = buffer["alice"], B = buffer["bob"]; + + uint128_t HA, HB, W; + int sa, sb; + + sa = getLSB(A); + sb = getLSB(B); + uint128_t H[2]; + + H[0] = A; + H[1] = B; + + myhash<2,1>(H); + + HA = H[0]; + HB = H[1]; + + W = HA ^ HB; + W = W ^ (select_mask[sa] & buffer["table0"]); + W = W ^ (select_mask[sb] & buffer["table1"]); + W = W ^ (select_mask[sb] & A); + + buffer["AND"] = W; +} + + +int main(){ + bool a , b; + cout << "Please input the value:" << endl; + cin>> a >> b; + + string circuits[3] = {"input1", "input2", "outputAND"}; + int length = 3; + uint128_t e[2]; // circuits garble value of input for encoding + uint128_t gate_wires; // circuits garble value of gate output + bool d; // value for decoding + uint128_t F[2]; // two half gates + uint128_t R; //delta in gc + unordered_map buffer; // simulate the communication process + + // step 1: generate the garble circuits + GB(circuits, length, R, F, e, gate_wires, d); + // step 2:encoding the inputs + EN(a, b, e, buffer, R); + + // simulate the communication of garble table + buffer["table0"] = F[0]; + buffer["table1"] = F[1]; + + // step 3: evaluation + EV(buffer); + // step 4: decoding the result + cout << a << " and " << b << " = " << (getLSB(buffer["AND"]) ^ d) << endl; + + return 0; +} From 4fd45c117d03b07caee0eebf4cc4929833c24471 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Tue, 9 Jul 2024 16:51:56 +0800 Subject: [PATCH 03/27] update XOR and AND example --- examples/mpc/AND_example.cc | 274 +++++++++++++++++++----------------- examples/mpc/BUILD.bazel | 16 +-- examples/mpc/XOR_example.cc | 165 ++++++++++++---------- 3 files changed, 242 insertions(+), 213 deletions(-) diff --git a/examples/mpc/AND_example.cc b/examples/mpc/AND_example.cc index 0ec25586..32e30bfe 100644 --- a/examples/mpc/AND_example.cc +++ b/examples/mpc/AND_example.cc @@ -1,176 +1,192 @@ +// Copyright 2024 Ant Group Co., Ltd. +// +// 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 -#include -#include -#include -#include -#include "yacl/crypto/aes/aes_opt.h" +#include #include + +#include #include +#include #include +#include + +#include "yacl/crypto/aes/aes_opt.h" using namespace std; using namespace yacl::crypto; using uint128_t = __uint128_t; -const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); +const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); const uint128_t select_mask[2] = {0, all_one_uint128_t}; -constexpr uint8_t key[16] = { - 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, - 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C -}; +AES_KEY scheduled_key[2]; inline uint128_t makeuint128_t(uint64_t high, uint64_t low) { - return (static_cast(high) << 64) | low; + return (static_cast(high) << 64) | low; } // generate random uint128_t uint128_t randomuint128_t() { - std::random_device rd; - std::mt19937_64 eng(rd()); - std::uniform_int_distribution distr; + std::random_device rd; + std::mt19937_64 eng(rd()); + std::uniform_int_distribution distr; - uint64_t high = distr(eng); - uint64_t low = distr(eng); + uint64_t high = distr(eng); + uint64_t low = distr(eng); - return makeuint128_t(high, low); + return makeuint128_t(high, low); } -// get the Least Significant Bit of uint128_t -bool getLSB(const uint128_t& x) { - return (x & 1) == 1; +template +void generateKeys() { + uint128_t keys[keyLength]; + + for (int i = 0; i < keyLength; i++) { + keys[i] = randomuint128_t(); + } + AES_opt_key_schedule(keys, scheduled_key); } +// get the Least Significant Bit of uint128_t +bool getLSB(const uint128_t& x) { return (x & 1) == 1; } + // for encryption and decryption -template -void myhash(uint128_t * blks) { - uint128_t key_uint128_t; - AES_KEY aes_key; - memcpy(&key_uint128_t, key, sizeof(key_uint128_t)); - AES_set_encrypt_key(key_uint128_t, &aes_key); - - uint128_t tmp[K*H]; - for(int i = 0; i < K*H; ++i) - tmp[i] = blks[i]; - - ParaEnc(tmp, &aes_key); - - for(int i = 0; i < K*H; ++i) - blks[i] = blks[i] ^ tmp[i]; -} +template +void myhash(uint128_t* blks) { + uint128_t tmp[K * H]; + for (int i = 0; i < K * H; ++i) tmp[i] = blks[i]; + ParaEnc(tmp, scheduled_key); + for (int i = 0; i < K * H; ++i) blks[i] = blks[i] ^ tmp[i]; +} // ADN gate half gate optimization -uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, uint128_t delta, uint128_t * table) { - bool pa = getLSB(LA0); - bool pb = getLSB(LB0); - - uint128_t HLA0, HA1, HLB0, HB1; - uint128_t tmp, W0; - uint128_t H[4]; - - H[0] = LA0; - H[1] = A1; - H[2] = LB0; - H[3] = B1; - - myhash<2,2>(H); - - HLA0 = H[0]; - HA1 = H[1]; - HLB0 = H[2]; - HB1 = H[3]; - - table[0] = HLA0 ^ HA1; - table[0] = table[0] ^ (select_mask[pb] & delta); - - W0 = HLA0; - W0 = W0 ^ (select_mask[pa] & table[0]); - - tmp = HLB0 ^ HB1; - table[1] = tmp ^ LA0; - - W0 = W0 ^ HLB0; - W0 = W0 ^ (select_mask[pb] & tmp); - return W0; +uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, + uint128_t delta, uint128_t* table) { + bool pa = getLSB(LA0); + bool pb = getLSB(LB0); + + uint128_t HLA0, HA1, HLB0, HB1; + uint128_t tmp, W0; + uint128_t H[4]; + + H[0] = LA0; + H[1] = A1; + H[2] = LB0; + H[3] = B1; + + myhash<2, 2>(H); + + HLA0 = H[0]; + HA1 = H[1]; + HLB0 = H[2]; + HB1 = H[3]; + + table[0] = HLA0 ^ HA1; + table[0] = table[0] ^ (select_mask[pb] & delta); + + W0 = HLA0; + W0 = W0 ^ (select_mask[pa] & table[0]); + + tmp = HLB0 ^ HB1; + table[1] = tmp ^ LA0; + + W0 = W0 ^ HLB0; + W0 = W0 ^ (select_mask[pb] & tmp); + return W0; } // garble process -void GB(string * circuits, int length, uint128_t & R, uint128_t * F, uint128_t * e,uint128_t & gate_wires, bool & d){ - R = randomuint128_t(); - R = R | 1; // ensure the LSB of R is 1 - - for(int i = 0; i < length; i++){ - if(circuits[i].find("input") != string :: npos) e[i] = randomuint128_t(); - else { - gate_wires = GBAND(e[0], e[0] ^ R, e[1], e[1] ^ R, R, F); - d = getLSB(gate_wires); - } - +void GB(string* circuits, int length, uint128_t& R, uint128_t* F, uint128_t* e, + uint128_t& gate_wires, bool& d) { + R = randomuint128_t(); + R = R | 1; // ensure the LSB of R is 1 + + for (int i = 0; i < length; i++) { + if (circuits[i].find("input") != string ::npos) + e[i] = randomuint128_t(); + else { + gate_wires = GBAND(e[0], e[0] ^ R, e[1], e[1] ^ R, R, F); + d = getLSB(gate_wires); } + } } // encoding process -void EN(bool a, bool b, uint128_t * e, unordered_map & buffer, uint128_t R){ - buffer["alice"] = e[0] ^ (select_mask[a] & R); - buffer["bob"] = e[1] ^ (select_mask[b] & R); +void EN(bool a, bool b, uint128_t* e, unordered_map& buffer, + uint128_t R) { + buffer["alice"] = e[0] ^ (select_mask[a] & R); + buffer["bob"] = e[1] ^ (select_mask[b] & R); } // evaluate process -uint128_t* EV(unordered_map & buffer){ - uint128_t A = buffer["alice"], B = buffer["bob"]; +uint128_t* EV(unordered_map& buffer) { + uint128_t A = buffer["alice"], B = buffer["bob"]; - uint128_t HA, HB, W; - int sa, sb; + uint128_t HA, HB, W; + int sa, sb; - sa = getLSB(A); - sb = getLSB(B); - uint128_t H[2]; + sa = getLSB(A); + sb = getLSB(B); + uint128_t H[2]; - H[0] = A; - H[1] = B; + H[0] = A; + H[1] = B; - myhash<2,1>(H); + myhash<2, 1>(H); - HA = H[0]; - HB = H[1]; + HA = H[0]; + HB = H[1]; - W = HA ^ HB; - W = W ^ (select_mask[sa] & buffer["table0"]); - W = W ^ (select_mask[sb] & buffer["table1"]); - W = W ^ (select_mask[sb] & A); + W = HA ^ HB; + W = W ^ (select_mask[sa] & buffer["table0"]); + W = W ^ (select_mask[sb] & buffer["table1"]); + W = W ^ (select_mask[sb] & A); - buffer["AND"] = W; + buffer["AND"] = W; } - -int main(){ - bool a , b; - cout << "Please input the value:" << endl; - cin>> a >> b; - - string circuits[3] = {"input1", "input2", "outputAND"}; - int length = 3; - uint128_t e[2]; // circuits garble value of input for encoding - uint128_t gate_wires; // circuits garble value of gate output - bool d; // value for decoding - uint128_t F[2]; // two half gates - uint128_t R; //delta in gc - unordered_map buffer; // simulate the communication process - - // step 1: generate the garble circuits - GB(circuits, length, R, F, e, gate_wires, d); - // step 2:encoding the inputs - EN(a, b, e, buffer, R); - - // simulate the communication of garble table - buffer["table0"] = F[0]; - buffer["table1"] = F[1]; - - // step 3: evaluation - EV(buffer); - // step 4: decoding the result - cout << a << " and " << b << " = " << (getLSB(buffer["AND"]) ^ d) << endl; - - return 0; +int main() { + bool a, b; + cout << "Please input the value:" << endl; + cin >> a >> b; + + string circuits[3] = {"input1", "input2", "outputAND"}; + int length = 3; + uint128_t e[2]; // circuits garble value of input for encoding + uint128_t gate_wires; // circuits garble value of gate output + bool d; // value for decoding + uint128_t F[2]; // two half gates + uint128_t R; // delta in gc + unordered_map + buffer; // simulate the communication process + + generateKeys(); + // step 1: generate the garble circuits + GB(circuits, length, R, F, e, gate_wires, d); + // step 2:encoding the inputs + EN(a, b, e, buffer, R); + + // simulate the communication of garble table + buffer["table0"] = F[0]; + buffer["table1"] = F[1]; + + // step 3: evaluation + EV(buffer); + // step 4: decoding the result + cout << a << " and " << b << " = " << (getLSB(buffer["AND"]) ^ d) << endl; + + return 0; } diff --git a/examples/mpc/BUILD.bazel b/examples/mpc/BUILD.bazel index adb14f75..af246cf0 100644 --- a/examples/mpc/BUILD.bazel +++ b/examples/mpc/BUILD.bazel @@ -4,16 +4,16 @@ cc_binary( - name = "XOR_example", # target 的名称 - srcs = ["XOR_example.cc"], # 指定源文件,这里假设有一个 hello.cc 文件 - deps = ["//yacl/crypto/aes:aes_opt",], # 如果有依赖项,可以在这里添加,例如:deps = [":library_target"] - copts = ["-maes"] + name = "XOR_example", + srcs = ["XOR_example.cc"], + deps = ["//yacl/crypto/aes:aes_opt",], + copts = ["-mavx","-maes","-mpclmul"] ) cc_binary( - name = "AND_example", # target 的名称 - srcs = ["AND_example.cc"], # 指定源文件,这里假设有一个 hello.cc 文件 - deps = ["//yacl/crypto/aes:aes_opt",], # 如果有依赖项,可以在这里添加,例如:deps = [":library_target"] - copts = ["-maes"] + name = "AND_example", + srcs = ["AND_example.cc"], + deps = ["//yacl/crypto/aes:aes_opt",], + copts = ["-mavx","-maes","-mpclmul"] ) diff --git a/examples/mpc/XOR_example.cc b/examples/mpc/XOR_example.cc index 866b377b..ec39571e 100644 --- a/examples/mpc/XOR_example.cc +++ b/examples/mpc/XOR_example.cc @@ -1,112 +1,125 @@ +// Copyright 2024 Ant Group Co., Ltd. +// +// 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 -#include -#include -#include -#include -#include "yacl/crypto/aes/aes_opt.h" +#include #include + +#include #include +#include #include +#include + +#include "yacl/crypto/aes/aes_opt.h" using namespace std; using namespace yacl::crypto; using uint128_t = __uint128_t; -const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); +const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); const uint128_t select_mask[2] = {0, all_one_uint128_t}; -constexpr uint8_t key[16] = { - 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, - 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C -}; +constexpr uint8_t key[16] = {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C}; inline uint128_t makeuint128_t(uint64_t high, uint64_t low) { - return (static_cast(high) << 64) | low; + return (static_cast(high) << 64) | low; } // generate uint128_t uint128_t randomuint128_t() { - std::random_device rd; - std::mt19937_64 eng(rd()); - std::uniform_int_distribution distr; + std::random_device rd; + std::mt19937_64 eng(rd()); + std::uniform_int_distribution distr; - uint64_t high = distr(eng); - uint64_t low = distr(eng); + uint64_t high = distr(eng); + uint64_t low = distr(eng); - return makeuint128_t(high, low); + return makeuint128_t(high, low); } -// get the Least Significant Bit of uint128_t -bool getLSB(const uint128_t& x) { - return (x & 1) == 1; -} +// get the Least Significant Bit of uint128_t +bool getLSB(const uint128_t& x) { return (x & 1) == 1; } // for encryption and decryption -template -void myhash(uint128_t * blks) { - uint128_t key_uint128_t; - AES_KEY aes_key; - memcpy(&key_uint128_t, key, sizeof(key_uint128_t)); - AES_set_encrypt_key(key_uint128_t, &aes_key); - - uint128_t tmp[K*H]; - for(int i = 0; i < K*H; ++i) - tmp[i] = blks[i]; - - ParaEnc(tmp, &aes_key); - - for(int i = 0; i < K*H; ++i) - blks[i] = blks[i] ^ tmp[i]; +template +void myhash(uint128_t* blks) { + uint128_t key_uint128_t; + AES_KEY aes_key; + memcpy(&key_uint128_t, key, sizeof(key_uint128_t)); + AES_set_encrypt_key(key_uint128_t, &aes_key); + + uint128_t tmp[K * H]; + for (int i = 0; i < K * H; ++i) tmp[i] = blks[i]; + + ParaEnc(tmp, &aes_key); + + for (int i = 0; i < K * H; ++i) blks[i] = blks[i] ^ tmp[i]; } // garble process -void GB(string * circuits, int length, uint128_t & R, uint128_t * e,uint128_t & gate_wires, bool & d){ - R = randomuint128_t(); - R = R | 1; // ensure the LSB of R is 1 - - for(int i = 0; i < length; i++){ - if(circuits[i].find("input") != string :: npos) e[i] = randomuint128_t(); - else{ - gate_wires = e[0] ^ e[1]; - d = getLSB(gate_wires); - } +void GB(string* circuits, int length, uint128_t& R, uint128_t* e, + uint128_t& gate_wires, bool& d) { + R = randomuint128_t(); + R = R | 1; // ensure the LSB of R is 1 + + for (int i = 0; i < length; i++) { + if (circuits[i].find("input") != string ::npos) + e[i] = randomuint128_t(); + else { + gate_wires = e[0] ^ e[1]; + d = getLSB(gate_wires); } + } } // encoding process -void EN(bool a, bool b, uint128_t * e, unordered_map & buffer, uint128_t R){ - buffer["alice"] = e[0] ^ (select_mask[a] & R); - buffer["bob"] = e[1] ^ (select_mask[b] & R); +void EN(bool a, bool b, uint128_t* e, unordered_map& buffer, + uint128_t R) { + buffer["alice"] = e[0] ^ (select_mask[a] & R); + buffer["bob"] = e[1] ^ (select_mask[b] & R); } // evaluate process -uint128_t* EV(unordered_map & buffer){ - uint128_t A = buffer["alice"], B = buffer["bob"]; - buffer["XOR"] = A ^ B; +uint128_t* EV(unordered_map& buffer) { + uint128_t A = buffer["alice"], B = buffer["bob"]; + buffer["XOR"] = A ^ B; } - -int main(){ - bool a , b; - cout << "Please input the value:" << endl; - cin>> a >> b; - - string circuits[3] = {"input1", "input2", "outputXOR"}; - int length = 3; - uint128_t e[2]; // circuits garble value of input for encoding - uint128_t gate_wires; // circuits garble value of gate output - bool d; // value for decoding - uint128_t R; // delta in gc - unordered_map buffer; // simulate the communication process - - // step 1: generate the garble circuits - GB(circuits, length, R, e, gate_wires, d); - // step 2:encoding the inputs - EN(a, b, e, buffer, R); - // step 3: evaluation - EV(buffer); - // step 4: decoding the result - cout << a << " xor " << b << " = " << (getLSB(buffer["XOR"]) ^ d) << endl; - - return 0; +int main() { + bool a, b; + cout << "Please input the value:" << endl; + cin >> a >> b; + + string circuits[3] = {"input1", "input2", "outputXOR"}; + int length = 3; + uint128_t e[2]; // circuits garble value of input for encoding + uint128_t gate_wires; // circuits garble value of gate output + bool d; // value for decoding + uint128_t R; // delta in gc + unordered_map + buffer; // simulate the communication process + + // step 1: generate the garble circuits + GB(circuits, length, R, e, gate_wires, d); + // step 2:encoding the inputs + EN(a, b, e, buffer, R); + // step 3: evaluation + EV(buffer); + // step 4: decoding the result + cout << a << " xor " << b << " = " << (getLSB(buffer["XOR"]) ^ d) << endl; + + return 0; } From cd1f0148693835e1393d06bac28a5f272adcafc0 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Tue, 23 Jul 2024 15:46:41 +0800 Subject: [PATCH 04/27] gc example --- examples/gc/BUILD.bazel | 42 +++++ examples/gc/mitccrh.h | 58 ++++++ examples/gc/test.cc | 378 ++++++++++++++++++++++++++++++++++++++++ examples/gc/test_ot.cc | 46 +++++ yacl/utils/BUILD.bazel | 7 + yacl/utils/utils.cc | 14 ++ yacl/utils/utils.h | 33 ++++ 7 files changed, 578 insertions(+) create mode 100644 examples/gc/BUILD.bazel create mode 100644 examples/gc/mitccrh.h create mode 100644 examples/gc/test.cc create mode 100644 examples/gc/test_ot.cc create mode 100644 yacl/utils/utils.cc create mode 100644 yacl/utils/utils.h diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel new file mode 100644 index 00000000..ca42d707 --- /dev/null +++ b/examples/gc/BUILD.bazel @@ -0,0 +1,42 @@ +cc_library( + name = "mitccrh", + hdrs = [ + "mitccrh.h", + ], + deps = ["//yacl/crypto/aes:aes_opt", + "//yacl/utils:utils", + "//yacl/crypto/tools:crhash"], + copts = ["-mavx","-maes","-mpclmul"] +) + +cc_binary( + name = "test_ot", + srcs = ["test_ot.cc"], + deps = [ + "//yacl/kernel/algorithms:iknp_ote", + "//yacl/crypto/rand", + "//yacl/link:test_util", + ], +) + + + +cc_binary( + name = "test", + srcs = ["test.cc"], + deps = [ + ":mitccrh", + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/io/stream:file_io", + "//yacl/crypto/rand:rand", + "//yacl/crypto/tools:prg", + "//yacl/io/circuit:bristol_fashion", + "//yacl/utils:circuit_executor", + "//yacl/kernel/algorithms:iknp_ote", + "//yacl/link:test_util", + "//yacl/kernel/algorithms:base_ot", + + ], + copts = ["-mavx","-maes","-mpclmul"] +) diff --git a/examples/gc/mitccrh.h b/examples/gc/mitccrh.h new file mode 100644 index 00000000..854366ce --- /dev/null +++ b/examples/gc/mitccrh.h @@ -0,0 +1,58 @@ + +#include + +#include "yacl/crypto/aes/aes_opt.h" +#include "yacl/crypto/tools/crhash.h" +#include "yacl/utils/utils.h" +/* + * [REF] Implementation of "Better Concrete Security for Half-Gates Garbling (in + * the Multi-Instance Setting)" https://eprint.iacr.org/2019/1168.pdf + */ +using namespace yacl::crypto; +using block = __uint128_t; +template +class MITCCRH { + public: + AES_KEY scheduled_key[BatchSize]; + block keys[BatchSize]; + int key_used = BatchSize; + block start_point; + uint64_t gid = 0; + + void setS(block sin) { this->start_point = sin; } + + void renew_ks(uint64_t gid) { + this->gid = gid; + renew_ks(); + } + + void renew_ks() { + for (int i = 0; i < BatchSize; ++i) + keys[i] = start_point ^ make_uint128_t(gid++, 0); + AES_opt_key_schedule(keys, scheduled_key); + key_used = 0; + } + + template + void hash_cir(block* blks) { + /********因为Sigma函数这里在编译指令里加了--copt=-fpermissive************** + */ + for (int i = 0; i < K * H; ++i) blks[i] = Sigma(blks[i]); + hash(blks); + } + + template + void hash(block* blks, bool used = false) { + assert(K <= BatchSize); + assert(BatchSize % K == 0); + if (key_used == BatchSize) renew_ks(); + + block tmp[K * H]; + for (int i = 0; i < K * H; ++i) tmp[i] = blks[i]; + + ParaEnc(tmp, scheduled_key + key_used); + if (used) key_used += K; + + for (int i = 0; i < K * H; ++i) blks[i] = blks[i] ^ tmp[i]; + } +}; diff --git a/examples/gc/test.cc b/examples/gc/test.cc new file mode 100644 index 00000000..e28ce5b3 --- /dev/null +++ b/examples/gc/test.cc @@ -0,0 +1,378 @@ +#include + +#include "absl/strings/escaping.h" +#include "absl/types/span.h" +#include "examples/gc/mitccrh.h" +#include "fmt/format.h" + +#include "yacl/base/byte_container_view.h" +#include "yacl/base/dynamic_bitset.h" +#include "yacl/crypto/rand/rand.h" +#include "yacl/io/circuit/bristol_fashion.h" +#include "yacl/io/stream/file_io.h" +#include "yacl/kernel/algorithms/base_ot.h" +#include "yacl/kernel/algorithms/iknp_ote.h" +#include "yacl/link/test_util.h" +#include "yacl/utils/circuit_executor.h" +using namespace yacl; +using namespace std; +namespace { +using uint128_t = __uint128_t; +} + +const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); +const uint128_t select_mask[2] = {0, all_one_uint128_t}; + +std::shared_ptr circ_; +vector wires_; +vector gb_value; + +// enum class Op { +// adder64, √ +// aes_128, √ +// divide64, √ +// mult2_64, +// mult64, √ +// neg64, √ +// sha256, +// sub64, √ +// udivide64, √ +// zero_equal √ +// } + +inline uint128_t Aes128(uint128_t k, uint128_t m) { + crypto::SymmetricCrypto enc(crypto::SymmetricCrypto::CryptoType::AES128_ECB, + k); + return enc.Encrypt(m); +} + +uint128_t ReverseBytes(uint128_t x) { + auto byte_view = ByteContainerView(&x, sizeof(x)); + uint128_t ret = 0; + auto buf = std::vector(sizeof(ret)); + for (size_t i = 0; i < byte_view.size(); ++i) { + buf[byte_view.size() - i - 1] = byte_view[i]; + } + std::memcpy(&ret, buf.data(), buf.size()); + return ret; +} + +uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, + uint128_t delta, uint128_t* table, MITCCRH<8>* mitccrh) { + bool pa = getLSB(LA0); + bool pb = getLSB(LB0); + + uint128_t HLA0, HA1, HLB0, HB1; + uint128_t tmp, W0; + uint128_t H[4]; + + H[0] = LA0; + H[1] = A1; + H[2] = LB0; + H[3] = B1; + + mitccrh->hash<2, 2>(H); + + HLA0 = H[0]; + HA1 = H[1]; + HLB0 = H[2]; + HB1 = H[3]; + + table[0] = HLA0 ^ HA1; + table[0] = table[0] ^ (select_mask[pb] & delta); + + W0 = HLA0; + W0 = W0 ^ (select_mask[pa] & table[0]); + + tmp = HLB0 ^ HB1; + table[1] = tmp ^ LA0; + + W0 = W0 ^ HLB0; + W0 = W0 ^ (select_mask[pb] & tmp); + return W0; +} + +uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table, + MITCCRH<8>* mitccrh) { + uint128_t HA, HB, W; + int sa, sb; + + sa = getLSB(A); + sb = getLSB(B); + + uint128_t H[2]; + H[0] = A; + H[1] = B; + mitccrh->hash<2, 1>(H); + HA = H[0]; + HB = H[1]; + + W = HA ^ HB; + W = W ^ (select_mask[sa] & table[0]); + W = W ^ (select_mask[sb] & table[1]); + W = W ^ (select_mask[sb] & A); + return W; +} + +template +void finalize(absl::Span outputs) { + // YACL_ENFORCE(outputs.size() >= circ_->nov); + + size_t index = wires_.size(); + + for (size_t i = 0; i < circ_->nov; ++i) { + dynamic_bitset result(circ_->now[i]); + for (size_t j = 0; j < circ_->now[i]; ++j) { + int wire_index = index - circ_->now[i] + j; + result[j] = getLSB(wires_[wire_index]) ^ + getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 + // 对应的混淆电路计算为LSB ^ d + // 输出线路在后xx位 + } + outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); + index -= circ_->now[i]; + } +} + +int main() { + // 参与方的设置,需要参照halfgate_gen/eva和sh_gen/eva 以下是一些用到的变量 + // constant[2] 0为全局delta 1为not门用到的public label + // 秘钥相关 mitch 秘钥初始化start_point, shared_prg + const int kWorldSize = 2; + int num_ot = 64; // 用于OT + + uint128_t tmp[2]; + random_uint128_t(tmp, 2); + tmp[0] = tmp[0] | 1; // 已确保LSB为1 + uint128_t delta = tmp[0]; + + uint128_t constant[3]; + random_uint128_t(constant, 2); + constant[2] = constant[1] ^ delta; // gen方使用 constant[1]为eva方使用 + + MITCCRH<8> mitccrh; // 密钥生成和加密 8为Batch_size, schedule_key长度 + mitccrh.setS(tmp[1]); // 秘钥生成start_point + + // 电路读取 + string operate; + cin >> operate; + + string pth = fmt::format("{0}/yacl/io/circuit/data/{1}.txt", + std::filesystem::current_path().string(), operate); + yacl::io::CircuitReader reader(pth); + reader.ReadMeta(); + reader.ReadAllGates(); + circ_ = reader.StealCirc(); + + // aes_128随机初始化输入值 + std::vector inputs = {crypto::FastRandU128(), + crypto::FastRandU128()}; + std::vector result(1); + // 其余情况 + // std::vector inputs = {crypto::FastRandU64(), + // crypto::FastRandU64()}; std::vector result(1); + + // int2bool 还是得老老实实进行GB完整过程,主要目的是存储d[] + // 用dynamic_bitset转化为二进制后,再进行混淆得到混淆值,后面的直接按电路顺序计算 + // 生成的table 存储 vector< vector(2)> > (num_gate) 存储时把gate_ID记录下来 + + // aes_128 + dynamic_bitset bi_val; + // 其余情况 + // dynamic_bitset bi_val; + + for (auto input : inputs) { + bi_val.append(input); // 直接转换为二进制 输入线路在前128位 + } + + // ***************GB阶段*************** + + // 初始化 + gb_value.resize(circ_->nw); + vector> table(circ_->ng, vector(2)); + + // 混淆过程 + int num_of_input_wires = 0; + for (size_t i = 0; i < circ_->niv; ++i) { + num_of_input_wires += circ_->niw[i]; + } + + random_uint128_t(gb_value.data(), num_of_input_wires); + + for (int i = 0; i < circ_->gates.size(); i++) { + auto gate = circ_->gates[i]; + switch (gate.op) { + case io::BFCircuit::Op::XOR: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 + const auto& iw1 = gb_value.operator[](gate.iw[1]); + gb_value[gate.ow[0]] = iw0 ^ iw1; + break; + } + case io::BFCircuit::Op::AND: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + const auto& iw1 = gb_value.operator[](gate.iw[1]); + gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, delta, + table[i].data(), &mitccrh); + break; + } + case io::BFCircuit::Op::INV: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + gb_value[gate.ow[0]] = iw0 ^ constant[2]; + break; + } + case io::BFCircuit::Op::EQ: { + gb_value[gate.ow[0]] = gate.iw[0]; + break; + } + case io::BFCircuit::Op::EQW: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + gb_value[gate.ow[0]] = iw0; + break; + } + case io::BFCircuit::Op::MAND: { /* multiple ANDs */ + YACL_THROW("Unimplemented MAND gate"); + break; + } + default: + YACL_THROW("Unknown Gate Type: {}", (int)gate.op); + } + } + + /******** EN阶段 *********/ + + wires_.resize(circ_->nw); + // 前64位 直接置换 garbler + for (int i = 0; i < circ_->niw[0]; i++) { + wires_[i] = gb_value[i] ^ (select_mask[bi_val[i]] & delta); + } + + /* ************暂时没看懂*********** */ + // 后64位 用OT evaluator 用iknp + // vector> send_blocks; + // vector recv_blocks(num_ot); + // dynamic_bitset choices(num_ot); + // for (int i = 64; i < 128; i++) { + // send_blocks.push_back({gb_value[i], gb_value[i] ^ delta}); + // choices.push_back(bi_val[i]); + // } + + // auto send = MakeOtSendStore(send_blocks); + // auto recv = MakeOtRecvStore(choices, recv_blocks); + + // auto lctxs = yacl::link::test::SetupWorld(kWorldSize); + // std::vector> send_out(num_ot); + // std::vector recv_out(num_ot); + // std::future sender = std::async([&] { + // IknpOtExtSend(lctxs[0], recv, absl::MakeSpan(send_out), false); + // }); // 发送到base_ot.recv + // std::future receiver = std::async([&] { + // IknpOtExtRecv(lctxs[1], send, choices, absl::MakeSpan(recv_out), + // false); // 从base_ot.send取 + // }); + // receiver.get(); + // sender.get(); + + /* ***********尝试使用base_OT*********** */ + + // auto contexts = link::test::SetupWorld(kWorldSize); + // vector> send_blocks; + // vector recv_blocks(num_ot); + // dynamic_bitset choices(num_ot); + // for (int i = 64; i < 128; i++) { + // send_blocks.push_back({gb_value[i], gb_value[i] ^ delta}); + // choices.push_back(bi_val[i]); + // } + + // std::future sender = + // std::async([&] { BaseOtSend(contexts[0], + // absl::MakeSpan(send_blocks)); + // }); + // std::future receiver = std::async( + // [&] { BaseOtRecv(contexts[1], choices, absl::MakeSpan(recv_blocks)); + // }); + // sender.get(); + // receiver.get(); + + if (operate != "neg64" && operate != "zero_equal") { + for (int i = circ_->niw[0]; i < circ_->niw[0] + circ_->niw[1]; i++) { + wires_[i] = gb_value[i] ^ (select_mask[bi_val[i]] & delta); + } + } + + // 计算方进行计算 按拓扑顺序进行计算 + for (int i = 0; i < circ_->gates.size(); i++) { + auto gate = circ_->gates[i]; + switch (gate.op) { + case io::BFCircuit::Op::XOR: { + const auto& iw0 = wires_.operator[](gate.iw[0]); // 取到具体值 + const auto& iw1 = wires_.operator[](gate.iw[1]); + wires_[gate.ow[0]] = iw0 ^ iw1; + break; + } + case io::BFCircuit::Op::AND: { + const auto& iw0 = wires_.operator[](gate.iw[0]); + const auto& iw1 = wires_.operator[](gate.iw[1]); + wires_[gate.ow[0]] = EVAND(iw0, iw1, table[i].data(), &mitccrh); + break; + } + case io::BFCircuit::Op::INV: { + const auto& iw0 = wires_.operator[](gate.iw[0]); + wires_[gate.ow[0]] = iw0 ^ constant[1]; + break; + } + case io::BFCircuit::Op::EQ: { + wires_[gate.ow[0]] = gate.iw[0]; + break; + } + case io::BFCircuit::Op::EQW: { + const auto& iw0 = wires_.operator[](gate.iw[0]); + wires_[gate.ow[0]] = iw0; + break; + } + case io::BFCircuit::Op::MAND: { /* multiple ANDs */ + YACL_THROW("Unimplemented MAND gate"); + break; + } + default: + YACL_THROW("Unknown Gate Type: {}", (int)gate.op); + } + } + + // 识别输出线路 进行DE操作 + finalize(absl::MakeSpan(result)); + + // 检查计算结果是否正确 + cout << inputs[0] << " " << inputs[1] << endl; + if (operate == "adder64") { + cout << inputs[0] + inputs[1] << endl; + } else if (operate == "divide64") { + cout << static_cast(inputs[0]) / static_cast(inputs[1]) + << endl; + } else if (operate == "udivide64") { + cout << inputs[0] / inputs[1] << endl; + } else if (operate == "mult64") { + cout << inputs[0] * inputs[1] << endl; + } else if (operate == "neg64") { + cout << -inputs[0] << endl; + } else if (operate == "sub64") { + cout << inputs[0] - inputs[1] << endl; + } else if (operate == "aes_128") { + cout << Aes128(ReverseBytes(inputs[0]), ReverseBytes(inputs[1])) << endl; + result[0] = ReverseBytes(result[0]); + } else { + cout << "else" << endl; + } + + cout << result[0] << endl; + + /* WHEN */ + // PlainExecutor exec; + // exec.LoadCircuitFile(io::BuiltinBFCircuit::Add64Path()); + // exec.SetupInputs(absl::MakeSpan(inputs)); // En + // exec.Exec(); + // exec.Finalize(absl::MakeSpan(result)); + + /* THEN 验证计算结果 */ + + return 0; +} \ No newline at end of file diff --git a/examples/gc/test_ot.cc b/examples/gc/test_ot.cc new file mode 100644 index 00000000..43bfd4d9 --- /dev/null +++ b/examples/gc/test_ot.cc @@ -0,0 +1,46 @@ + + +#include +#include +#include +#include +#include + +#include "yacl/base/exception.h" +#include "yacl/crypto/rand/rand.h" +#include "yacl/kernel/algorithms/iknp_ote.h" +#include "yacl/link/test_util.h" + +using namespace std; +using namespace yacl; +using namespace yacl::crypto; +using namespace yacl::link; + +int main() { + const int kWorldSize = 2; + int num_ot = 10; + + auto lctxs = link::test::SetupWorld(kWorldSize); // setup network + auto base_ot = MockRots(128); // mock base ot + auto choices = RandBits>(num_ot); // get input + + // WHEN + std::vector> send_out(num_ot); + std::vector recv_out(num_ot); + std::future sender = std::async([&] { + IknpOtExtSend(lctxs[0], base_ot.recv, absl::MakeSpan(send_out), false); + }); // 发送到base_ot.recv + std::future receiver = std::async([&] { + IknpOtExtRecv(lctxs[1], base_ot.send, choices, absl::MakeSpan(recv_out), + false); // 从base_ot.send取 + }); + receiver.get(); + sender.get(); + + // THEN + for (size_t i = 0; i < num_ot; ++i) { + cout << "send_out:" << send_out[i][choices[i]] + << "\t recv_out:" << recv_out[i] << endl; + } + return 0; +} diff --git a/yacl/utils/BUILD.bazel b/yacl/utils/BUILD.bazel index e0b3ab4f..c6861b42 100644 --- a/yacl/utils/BUILD.bazel +++ b/yacl/utils/BUILD.bazel @@ -293,3 +293,10 @@ yacl_cc_library( "compile_time_utils.h", ], ) + +yacl_cc_library( + name = "utils", + srcs = ["utils.cc"], + hdrs = ["utils.h"], + deps = [], +) diff --git a/yacl/utils/utils.cc b/yacl/utils/utils.cc new file mode 100644 index 00000000..964ecfba --- /dev/null +++ b/yacl/utils/utils.cc @@ -0,0 +1,14 @@ +#include "yacl/utils/utils.h" + +void random_uint128_t(uint128_t* data, int nblocks) { + for (int i = 0; i < nblocks; i++) { + std::random_device rd; + std::mt19937_64 eng(rd()); + std::uniform_int_distribution distr; + + uint64_t high = distr(eng); + uint64_t low = distr(eng); + + data[i] = make_uint128_t(high, low); + } +} \ No newline at end of file diff --git a/yacl/utils/utils.h b/yacl/utils/utils.h new file mode 100644 index 00000000..02719a89 --- /dev/null +++ b/yacl/utils/utils.h @@ -0,0 +1,33 @@ +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace std; +using uint128_t = __uint128_t; +using block = uint128_t; + +template +inline void int_to_bool(bool* data, T input, int len); + +inline uint128_t make_uint128_t(uint64_t high, uint64_t low) { + return (static_cast(high) << 64) | low; +} + +void random_uint128_t(uint128_t* data, int nblocks = 1); + +template +inline void int_to_bool(bool* data, T input, int len) { + for (int i = 0; i < len; ++i) { + data[i] = (input & 1) == 1; + input >>= 1; + } +} + +// get the Least Significant Bit of uint128_t +inline bool getLSB(const uint128_t& x) { return (x & 1) == 1; } \ No newline at end of file From 57351630b749805295ba4267e10574512b42d587 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Tue, 13 Aug 2024 16:13:22 +0800 Subject: [PATCH 05/27] OT debug --- examples/gc/test.cc | 132 +++++++++++++++++++++++++++----------------- 1 file changed, 82 insertions(+), 50 deletions(-) diff --git a/examples/gc/test.cc b/examples/gc/test.cc index e28ce5b3..9bc5afff 100644 --- a/examples/gc/test.cc +++ b/examples/gc/test.cc @@ -1,4 +1,8 @@ + #include +#include +#include +#include #include "absl/strings/escaping.h" #include "absl/types/span.h" @@ -12,6 +16,8 @@ #include "yacl/io/stream/file_io.h" #include "yacl/kernel/algorithms/base_ot.h" #include "yacl/kernel/algorithms/iknp_ote.h" +#include "yacl/kernel/ot_kernel.h" +#include "yacl/kernel/type/ot_store_utils.h" #include "yacl/link/test_util.h" #include "yacl/utils/circuit_executor.h" using namespace yacl; @@ -129,22 +135,45 @@ void finalize(absl::Span outputs) { // 对应的混淆电路计算为LSB ^ d // 输出线路在后xx位 } + // cout << "输出:" << result.data() << endl; outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); index -= circ_->now[i]; } } int main() { + auto lctxs = link::test::SetupWorld(2); + + const size_t num_ot = 5000; + const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::Ferret; + OtSendStore ot_send(num_ot, OtStoreType::Compact); // placeholder + OtRecvStore ot_recv(num_ot, OtStoreType::Compact); // placeholder + OtKernel kernel0(OtKernel::Role::Sender, ext_algorithm); + OtKernel kernel1(OtKernel::Role::Receiver, ext_algorithm); + + // WHEN + auto sender = std::async([&] { + kernel0.init(lctxs[0]); + kernel0.eval_cot_random_choice(lctxs[0], num_ot, &ot_send); + }); + auto receiver = std::async([&] { + kernel1.init(lctxs[1]); + kernel1.eval_cot_random_choice(lctxs[1], num_ot, &ot_recv); + }); + + sender.get(); + receiver.get(); + cout << "OT delta :" << ot_send.GetDelta() << endl; + // 参与方的设置,需要参照halfgate_gen/eva和sh_gen/eva 以下是一些用到的变量 // constant[2] 0为全局delta 1为not门用到的public label // 秘钥相关 mitch 秘钥初始化start_point, shared_prg const int kWorldSize = 2; - int num_ot = 64; // 用于OT uint128_t tmp[2]; random_uint128_t(tmp, 2); - tmp[0] = tmp[0] | 1; // 已确保LSB为1 - uint128_t delta = tmp[0]; + tmp[0] = tmp[0] | 1; // 已确保LSB为1 + uint128_t delta = ot_send.GetDelta(); // 统一全局Delta uint128_t constant[3]; random_uint128_t(constant, 2); @@ -165,21 +194,21 @@ int main() { circ_ = reader.StealCirc(); // aes_128随机初始化输入值 - std::vector inputs = {crypto::FastRandU128(), - crypto::FastRandU128()}; - std::vector result(1); + // std::vector inputs = {crypto::FastRandU128(), + // crypto::FastRandU128()}; + // std::vector result(1); // 其余情况 - // std::vector inputs = {crypto::FastRandU64(), - // crypto::FastRandU64()}; std::vector result(1); + std::vector inputs = {crypto::FastRandU64(), crypto::FastRandU64()}; + std::vector result(1); // int2bool 还是得老老实实进行GB完整过程,主要目的是存储d[] // 用dynamic_bitset转化为二进制后,再进行混淆得到混淆值,后面的直接按电路顺序计算 // 生成的table 存储 vector< vector(2)> > (num_gate) 存储时把gate_ID记录下来 // aes_128 - dynamic_bitset bi_val; + // dynamic_bitset bi_val; // 其余情况 - // dynamic_bitset bi_val; + dynamic_bitset bi_val; for (auto input : inputs) { bi_val.append(input); // 直接转换为二进制 输入线路在前128位 @@ -197,47 +226,9 @@ int main() { num_of_input_wires += circ_->niw[i]; } + // random_uint128_t(gb_value.data(), circ_->niw[0]); random_uint128_t(gb_value.data(), num_of_input_wires); - for (int i = 0; i < circ_->gates.size(); i++) { - auto gate = circ_->gates[i]; - switch (gate.op) { - case io::BFCircuit::Op::XOR: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 - const auto& iw1 = gb_value.operator[](gate.iw[1]); - gb_value[gate.ow[0]] = iw0 ^ iw1; - break; - } - case io::BFCircuit::Op::AND: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); - const auto& iw1 = gb_value.operator[](gate.iw[1]); - gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, delta, - table[i].data(), &mitccrh); - break; - } - case io::BFCircuit::Op::INV: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); - gb_value[gate.ow[0]] = iw0 ^ constant[2]; - break; - } - case io::BFCircuit::Op::EQ: { - gb_value[gate.ow[0]] = gate.iw[0]; - break; - } - case io::BFCircuit::Op::EQW: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); - gb_value[gate.ow[0]] = iw0; - break; - } - case io::BFCircuit::Op::MAND: { /* multiple ANDs */ - YACL_THROW("Unimplemented MAND gate"); - break; - } - default: - YACL_THROW("Unknown Gate Type: {}", (int)gate.op); - } - } - /******** EN阶段 *********/ wires_.resize(circ_->nw); @@ -295,7 +286,48 @@ int main() { if (operate != "neg64" && operate != "zero_equal") { for (int i = circ_->niw[0]; i < circ_->niw[0] + circ_->niw[1]; i++) { - wires_[i] = gb_value[i] ^ (select_mask[bi_val[i]] & delta); + gb_value[i] = ot_send.GetBlock(i - circ_->niw[0], 0); + wires_[i] = ot_recv.GetBlock(i - circ_->niw[0]); + // wires_[i] = gb_value[i] ^ (select_mask[bi_val[i]] & delta); + } + } + + for (int i = 0; i < circ_->gates.size(); i++) { + auto gate = circ_->gates[i]; + switch (gate.op) { + case io::BFCircuit::Op::XOR: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 + const auto& iw1 = gb_value.operator[](gate.iw[1]); + gb_value[gate.ow[0]] = iw0 ^ iw1; + break; + } + case io::BFCircuit::Op::AND: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + const auto& iw1 = gb_value.operator[](gate.iw[1]); + gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, delta, + table[i].data(), &mitccrh); + break; + } + case io::BFCircuit::Op::INV: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + gb_value[gate.ow[0]] = iw0 ^ constant[2]; + break; + } + case io::BFCircuit::Op::EQ: { + gb_value[gate.ow[0]] = gate.iw[0]; + break; + } + case io::BFCircuit::Op::EQW: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + gb_value[gate.ow[0]] = iw0; + break; + } + case io::BFCircuit::Op::MAND: { /* multiple ANDs */ + YACL_THROW("Unimplemented MAND gate"); + break; + } + default: + YACL_THROW("Unknown Gate Type: {}", (int)gate.op); } } From 31809e89cd9de3205c6cafb6eef59edd125990b0 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Mon, 11 Nov 2024 15:49:53 +0800 Subject: [PATCH 06/27] sha256 --- examples/gc/sha256.cc | 324 +++++++++++++++++++++++++++++++++ yacl/utils/circuit_executor.cc | 104 +++++++++-- yacl/utils/circuit_executor.h | 15 +- 3 files changed, 425 insertions(+), 18 deletions(-) create mode 100644 examples/gc/sha256.cc diff --git a/examples/gc/sha256.cc b/examples/gc/sha256.cc new file mode 100644 index 00000000..02558c6a --- /dev/null +++ b/examples/gc/sha256.cc @@ -0,0 +1,324 @@ +#include +// #include + +#include + +#include "absl/strings/escaping.h" + +#include "yacl/base/byte_container_view.h" +#include "yacl/base/dynamic_bitset.h" +#include "yacl/crypto/block_cipher/symmetric_crypto.h" +#include "yacl/crypto/hash/hash_utils.h" +#include "yacl/crypto/rand/rand.h" +#include "yacl/io/circuit/bristol_fashion.h" +#include "yacl/utils/circuit_executor.h" + +using namespace std; +using namespace yacl; + +// void sha256_preprocess(uint8_t *input_data, size_t input_len, +// uint8_t **padded_data, size_t *padded_len) { +// size_t pad_len = input_len + 1 + 8; // +1 for 0x80 and +8 for length +// size_t rem = pad_len % 64; +// if (rem > 0) { +// pad_len += (64 - rem); +// } + +// // Allocate memory for padded data +// *padded_data = (uint8_t *)malloc(pad_len); +// *padded_len = pad_len; + +// // Copy original data +// memcpy(*padded_data, input_data, input_len); + +// // Append the "1" bit (0x80) +// (*padded_data)[input_len] = 0x80; + +// // Append zeros +// memset(*padded_data + input_len + 1, 0, pad_len - input_len - 9); + +// // Append original length in bits (big-endian) +// uint64_t bit_len = input_len * 8; +// for (int i = 0; i < 8; ++i) { +// (*padded_data)[pad_len - 1 - i] = (bit_len >> (i * 8)) & 0xff; +// } +// } + +uint8_t reverse_bits(uint8_t byte) { + byte = (byte & 0xF0) >> 4 | (byte & 0x0F) << 4; + byte = (byte & 0xCC) >> 2 | (byte & 0x33) << 2; + byte = (byte & 0xAA) >> 1 | (byte & 0x55) << 1; + return byte; +} + +vector preprocess(const std::vector &message) { + // 步骤 1: 填充消息 + size_t original_length = message.size() * 8; // 原始消息的比特长度 + std::vector padded_message = message; + + // 添加 1 位 + padded_message.push_back(0x80); + + // 添加 0 位,直到长度为 448 位(56 字节) + while ((padded_message.size() * 8) % 512 != 448) { + padded_message.push_back(0x00); + } + // cout << "11 " << padded_message.size() * 8 << endl; + // cout << "origin_len" << original_length << endl; + // vector temp; + // 添加原始消息长度(64 位) + for (int i = 7; i >= 0; --i) { + padded_message.push_back((original_length >> (i * 8)) & 0xFF); + // temp.push_back((original_length >> (i * 8)) & 0xFF); + } + // cout << "len:"; + // for (int i = 0; i < temp.size(); i++) { + // bitset<8> b(temp[i]); + // cout << b << ' '; + // } + // cout << endl; + + return padded_message; +} + +uint128_t ReverseBytes(uint128_t x) { + auto byte_view = ByteContainerView(&x, sizeof(x)); + uint128_t ret = 0; + auto buf = std::vector(sizeof(ret)); + for (size_t i = 0; i < byte_view.size(); ++i) { + buf[byte_view.size() - i - 1] = byte_view[i]; + } + std::memcpy(&ret, buf.data(), buf.size()); + return ret; +} + +std::string uint128ToBinaryString(__uint128_t value) { + std::string result; + for (int i = 127; i >= 0; --i) { + result += ((value >> i) & 1) ? '1' : '0'; + } + return result; +} + +uint128_t CopyDataAsUint128(const uint8_t *data, bool flag) { + uint128_t ret; + int len = flag ? sizeof(uint128_t) / 2 : sizeof(uint128_t); + for (int idx = 0; idx < len; ++idx) { + reinterpret_cast(&ret)[idx] = data[idx]; + // cout << uint128ToBinaryString(ret) << endl; + } + return ret; +} + +std::vector stringToBinary(const std::string &str) { + std::vector binaryData(str.begin(), str.end()); + return binaryData; +} + +std::string uint128ToString(__uint128_t value) { + if (value == 0) return "0"; + + std::string result; + while (value > 0) { + result.insert(result.begin(), '0' + static_cast(value % 10)); + value /= 10; + } + return result; +} + +// template +// void PlainExecutor::Finalize(absl::Span outputs) { +// // YACL_ENFORCE(outputs.size() >= circ_->nov); + +// size_t index = wires_.size(); +// for (size_t i = 0; i < circ_->nov; ++i) { +// int half_num_wire = circ_->now[i] / 2; + +// dynamic_bitset result(circ_->now[i]); + +// for (size_t j = 0; j < circ_->now[i]; ++j) { +// result[j % 128] = +// wires_[index - circ_->now[i] + +// j]; // 得到的是逆序的二进制值 对应的混淆电路计算为 +// // LSB ^ d 输出线路在后xx位 +// if (j % 128 == 127) { +// outputs[circ_->nov - i - 1] = +// *(uint128_t*)result.data(); // 先得到最后位置上的 +// index -= circ_->now[i]; +// cout << std::hex << outputs[circ_->nov - i - 1] << "\t"; +// } +// } +// } +// cout << endl; +// } + +// template +// void PlainExecutor::SetupInputs( +// vector inputs_bi) { // Span方便指针的使用 +// // YACL_ENFORCE(inputs.size() == circ_->niv); +// for (auto input : inputs_bi) { +// wires_.append( +// std::bitset<8>(input).begin(), +// std::bitset<8>(input).end()); // 直接转换为二进制 输入线路在前128位 +// } +// wires_.resize(circ_->nw); +// } + +// #include + +// std::vector stringToBinary(const std::string& str) { +// std::vector binaryData(str.begin(), str.end()); +// return binaryData; +// } + +// int main() { +// std::string str = "Hello"; +// std::vector binaryData = stringToBinary(str); + +// // 打印二进制数据 +// for (uint8_t byte : binaryData) { +// std::cout << std::bitset<8>(byte) << " "; +// } +// std::cout << std::endl; + +// return 0; +// } + +void get_sha256_initial_hash_values(uint32_t hash[8]) { + // SHA256 的初始哈希值(每个值为 32 位) + hash[0] = 0x6a09e667; + hash[1] = 0xbb67ae85; + hash[2] = 0x3c6ef372; + hash[3] = 0xa54ff53a; + hash[4] = 0x510e527f; + hash[5] = 0x9b05688c; + hash[6] = 0x1f83d9ab; + hash[7] = 0x5be0cd19; +} +int main() { + // const char *data = "Hello, OpenSSL!"; + // size_t data_len = strlen(data); + + // // 进行 SHA256 预处理 + // uint8_t *padded_data; + // size_t padded_len; + // sha256_preprocess((uint8_t *)data, data_len, &padded_data, &padded_len); + // cout << "预处理:"; + // for (int i = 0; i < 64; i++) { + // cout << std::hex << static_cast(padded_data[i]); + // } + // cout << endl; + + // vector data_vec(padded_data, padded_data + 64); + + std::string input; + cout << "请输入:"; + cin >> input; + std::vector message(input.begin(), input.end()); + + // 预处理消息 + std::vector data_vec = preprocess(message); + + std::vector hash_vec = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, + 0xa54ff53a, 0x510e527f, 0x9b05688c, + 0x1f83d9ab, 0x5be0cd19}; + std::vector byte_hash_vec; + + // 遍历 hash_vec 并将每个 uint32_t 分解为 4 个字节存储到 byte_hash_vec 中 + for (uint32_t value : hash_vec) { + byte_hash_vec.push_back(value >> 24 & 0xFF); + byte_hash_vec.push_back((value >> 16) & 0xFF); + byte_hash_vec.push_back((value >> 8) & 0xFF); + byte_hash_vec.push_back((value) & 0xFF); + } + + for (auto &elem : data_vec) { + elem = reverse_bits(elem); + } + reverse(data_vec.begin(), data_vec.end()); + + // cout << "预处理:"; + // for (int i = 0; i < data_vec.size(); i++) { + // bitset<8> b(data_vec[i]); + // cout << b; + // } + // cout << endl; + + for (auto &elem : byte_hash_vec) { + elem = reverse_bits(elem); + } + reverse(byte_hash_vec.begin(), byte_hash_vec.end()); + + // cout << "hash"; + // for (int i = 0; i < 32; i++) { + // bitset<8> b(byte_hash_vec[i]); + // cout << b; + // } + // cout << endl; + + vector input_vec; + + for (auto &elem : data_vec) { + input_vec.push_back(elem); + } + for (auto &elem : byte_hash_vec) { + input_vec.push_back(elem); + } + + // std::vector output_vec(input_vec.size() / 16); + + // for (size_t i = 0; i < output_vec.size(); ++i) { + // uint128_t value = 0; + // for (size_t j = 0; j < 16; ++j) { + // value |= static_cast(input_vec[i * 16 + j]) << (j * 8); + // } + // output_vec[i] = value; + // } + + // for (auto &elem : output_vec) { + // bitset<128> b(elem); + // cout << b; + // } + // cout << endl; + + vector result(32); + string pth_str = fmt::format("{}/yacl/io/circuit/data/sha256.txt", + std::filesystem::current_path().string()); + PlainExecutor exec; + + // cout << "指针内容:" << *(uint8_t *)input_vec.data() << endl; + + exec.LoadCircuitFile(pth_str); + exec.wires_.resize( + exec.circ_->nw); // 这里的wires_类型为boost::dynamic_bitset + // cout << "大小:" << exec.wires_.size() << endl; + + // memcpy(&exec.wires_, input_vec.data(), 96 * sizeof(uint8_t)); + for (size_t i = 0; i < input_vec.size(); ++i) { + for (int j = 0; j < 8; ++j) { + exec.wires_[i * 8 + j] = (input_vec[i] >> (7 - j)) & 1; // 逐位赋值 + } + } + + // cout << "大小:" << exec.wires_.size() << endl; + + // exec.SetupInputs(absl::MakeSpan(input_vec)); // 拼成一个vector + + exec.Exec(); + + exec.Finalize(absl::MakeSpan(result)); + + reverse(result.begin(), result.end()); + for (int i = 0; i < 32; i++) { + cout << std::hex << std::setw(2) << std::setfill('0') + << static_cast(result[i]); + // cout << result[i]; + // bitset<8> bits(result[i]); + // cout << bits; + } + cout << endl; + // cout << std::hex << static_cast(result[1]) << "\t" << result[0] << + // endl; + + return 0; +} \ No newline at end of file diff --git a/yacl/utils/circuit_executor.cc b/yacl/utils/circuit_executor.cc index 9552b7db..91414243 100644 --- a/yacl/utils/circuit_executor.cc +++ b/yacl/utils/circuit_executor.cc @@ -14,6 +14,8 @@ #include "yacl/utils/circuit_executor.h" +using namespace std; + namespace yacl { namespace { @@ -32,22 +34,47 @@ void PlainExecutor::LoadCircuitFile(const std::string& path) { circ_ = reader.StealCirc(); } -template -void PlainExecutor::SetupInputs(absl::Span inputs) { - YACL_ENFORCE(inputs.size() == circ_->niv); - for (auto input : inputs) { - wires_.append(input); +std::string dynamic_bitset_to_string(const boost::dynamic_bitset<>& bits) { + std::string str(bits.size(), '0'); // 创建一个与位集大小相同的字符串 + for (size_t i = 0; i < bits.size(); ++i) { + if (bits[i]) { + str[bits.size() - 1 - i] = '1'; // 反向填充字符串 + } } + return str; +} + +template +void PlainExecutor::SetupInputs( + absl::Span inputs) { // Span方便指针的使用 + // YACL_ENFORCE(inputs.size() == circ_->niv); + // for (auto input : inputs) { + // wires_.append(input); // 直接转换为二进制 输入线路在前128位 + // } + + // memccpy(wires_.data(), inputs.data(), 1, sizeof(inputs)); + inputs.size(); wires_.resize(circ_->nw); } template void PlainExecutor::Exec() { + // wires_.resize(circ_->nw); + // for (int i = 2; i < 514; i++) { + // wires_[i - 2] = wires_[i]; + // } + // cout << "线路输入:"; + // cout << wires_.size() << endl; + // for (int i = 0; i < 768; i++) { + // cout << wires_[i]; + // } + // // cout << dynamic_bitset_to_string(wires_) << endl; + // cout << endl; // Evaluate all gates, sequentially for (const auto& gate : circ_->gates) { switch (gate.op) { case io::BFCircuit::Op::XOR: { - const auto& iw0 = wires_.operator[](gate.iw[0]); + const auto& iw0 = wires_.operator[](gate.iw[0]); // 取到具体值 const auto& iw1 = wires_.operator[](gate.iw[1]); wires_.set(gate.ow[0], PlaintextCore::xor_gate(iw0, iw1)); break; @@ -82,22 +109,71 @@ void PlainExecutor::Exec() { } } +// template +// void PlainExecutor::Finalize(absl::Span outputs) { +// YACL_ENFORCE(outputs.size() >= circ_->nov); + +// size_t index = wires_.size(); +// for (size_t i = 0; i < circ_->nov; ++i) { +// dynamic_bitset result(circ_->now[i]); +// for (size_t j = 0; j < circ_->now[i]; ++j) { +// result[j] = wires_[index - circ_->now[i] + +// j]; // 得到的是逆序的二进制值 对应的混淆电路计算为 +// // LSB ^ d 输出线路在后xx位 +// } +// outputs[circ_->nov - i - 1] = *(uint8_t*)result.data(); +// // outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); +// index -= circ_->now[i]; +// } +// } + template void PlainExecutor::Finalize(absl::Span outputs) { - YACL_ENFORCE(outputs.size() >= circ_->nov); + // YACL_ENFORCE(outputs.size() >= circ_->nov); size_t index = wires_.size(); - for (size_t i = 0; i < circ_->nov; ++i) { - dynamic_bitset result(circ_->now[i]); - for (size_t j = 0; j < circ_->now[i]; ++j) { - result[j] = wires_[index - circ_->now[i] + j]; + // reverse(wires_ + wires_.size() - 256, wires_ + wires_.size()); + // int arr[256]; + // for (int i = 0; i < 256; i++) { + // arr[i] = wires_[index - 256 + i]; + // } + // for (int i = 0; i < 256; i++) { + // wires_[index - 256 + i] = arr[255 - i]; + // } + + // for (int i = 0; i < 256; i++) { + // cout << wires_[index - 256 + i]; + // } + // reverse(wires_ + index - 256, wires_ + index - 250); + // int start = index - 256; + // int end = index; + // while (start < end) { + // // 交换 start 和 end 的位 + // bool temp = wires_[start]; + // wires_[start] = wires_[end - 1]; + // wires_[end - 1] = temp; + + // // 移动指针 + // ++start; + // --end; + // } + + cout << endl; + for (size_t i = 0; i < 32; ++i) { + dynamic_bitset result(8); + for (size_t j = 0; j < 8; ++j) { + result[j] = + wires_[index - 8 + j]; // 得到的是逆序的二进制值 对应的混淆电路计算为 + // LSB ^ d 输出线路在后xx位 } - outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); - index -= circ_->now[i]; + outputs[32 - i - 1] = *(uint8_t*)result.data(); + // outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); + index -= 8; } } -template class PlainExecutor; +template class PlainExecutor; template class PlainExecutor; +// template class PlainExecutor; } // namespace yacl diff --git a/yacl/utils/circuit_executor.h b/yacl/utils/circuit_executor.h index fe824cf4..3056ed62 100644 --- a/yacl/utils/circuit_executor.h +++ b/yacl/utils/circuit_executor.h @@ -14,16 +14,20 @@ #pragma once +#include + +#include #include +#include "yacl/base/buffer.h" #include "yacl/base/dynamic_bitset.h" #include "yacl/io/circuit/bristol_fashion.h" +using namespace std; namespace yacl { // plaintext protocol that executes everything without link -template class PlainExecutor { public: // Constructor @@ -33,17 +37,20 @@ class PlainExecutor { void LoadCircuitFile(const std::string &path); // Setup the input wire (local operation) + template void SetupInputs(absl::Span inputs); - + void SetupInputs(vector inputs_bi); // Execute the circuit void Exec(); // Finalize and get the result + template void Finalize(absl::Span outputs); - private: + public: // NOTE: please make sure you use the correct order of wires - dynamic_bitset wires_; // shares + boost::dynamic_bitset wires_; // shares GC的时候这里要重新写vector + // 是否可以,以及顺序问题 std::shared_ptr circ_; // bristol fashion circuit }; From 70c455e7aa58806202ac9bf4b45f62fae3be346d Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Mon, 18 Nov 2024 13:46:42 +0800 Subject: [PATCH 07/27] update code --- examples/gc/BUILD.bazel | 27 ++- examples/gc/mitccrh.h | 6 +- examples/gc/sha256.cc | 179 ++++++++--------- examples/gc/test.cc | 358 +++++++++++++++++++++++++-------- examples/mpc/AND_example.cc | 27 ++- examples/mpc/XOR_example.cc | 125 ------------ yacl/utils/BUILD.bazel | 7 +- yacl/utils/circuit_executor.cc | 12 +- yacl/utils/circuit_executor.h | 14 +- yacl/utils/utils.cc | 14 -- yacl/utils/utils.h | 33 --- 11 files changed, 413 insertions(+), 389 deletions(-) delete mode 100644 examples/mpc/XOR_example.cc delete mode 100644 yacl/utils/utils.cc delete mode 100644 yacl/utils/utils.h diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel index ca42d707..eecfd1fd 100644 --- a/examples/gc/BUILD.bazel +++ b/examples/gc/BUILD.bazel @@ -4,7 +4,7 @@ cc_library( "mitccrh.h", ], deps = ["//yacl/crypto/aes:aes_opt", - "//yacl/utils:utils", + ":utils", "//yacl/crypto/tools:crhash"], copts = ["-mavx","-maes","-mpclmul"] ) @@ -40,3 +40,28 @@ cc_binary( ], copts = ["-mavx","-maes","-mpclmul"] ) + +cc_binary( + name = "sha256_", + srcs = ["sha256.cc"], + deps = [ + ":mitccrh", + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/crypto/block_cipher:symmetric_crypto", + "//yacl/crypto/hash:hash_utils", + "//yacl/crypto/rand:rand", + "//yacl/io/circuit:bristol_fashion", + "//yacl/utils:circuit_executor", + + + ], + copts = ["-mavx","-maes","-mpclmul"] +) + +cc_library( + name = "utils", + srcs = ["utils.cc"], + hdrs = ["utils.h"], + deps = [], +) \ No newline at end of file diff --git a/examples/gc/mitccrh.h b/examples/gc/mitccrh.h index 854366ce..36d2948e 100644 --- a/examples/gc/mitccrh.h +++ b/examples/gc/mitccrh.h @@ -1,19 +1,19 @@ #include +#include #include "yacl/crypto/aes/aes_opt.h" #include "yacl/crypto/tools/crhash.h" -#include "yacl/utils/utils.h" /* * [REF] Implementation of "Better Concrete Security for Half-Gates Garbling (in * the Multi-Instance Setting)" https://eprint.iacr.org/2019/1168.pdf */ -using namespace yacl::crypto; + using block = __uint128_t; template class MITCCRH { public: - AES_KEY scheduled_key[BatchSize]; + yacl::crypto::AES_KEY scheduled_key[BatchSize]; block keys[BatchSize]; int key_used = BatchSize; block start_point; diff --git a/examples/gc/sha256.cc b/examples/gc/sha256.cc index 02558c6a..a73ee89e 100644 --- a/examples/gc/sha256.cc +++ b/examples/gc/sha256.cc @@ -13,9 +13,8 @@ #include "yacl/io/circuit/bristol_fashion.h" #include "yacl/utils/circuit_executor.h" -using namespace std; -using namespace yacl; - +// using namespace std; +// using namespace yacl; // void sha256_preprocess(uint8_t *input_data, size_t input_len, // uint8_t **padded_data, size_t *padded_len) { // size_t pad_len = input_len + 1 + 8; // +1 for 0x80 and +8 for length @@ -63,68 +62,68 @@ vector preprocess(const std::vector &message) { while ((padded_message.size() * 8) % 512 != 448) { padded_message.push_back(0x00); } - // cout << "11 " << padded_message.size() * 8 << endl; - // cout << "origin_len" << original_length << endl; + // std::cout << "11 " << padded_message.size() * 8 << endl; + // std::cout << "origin_len" << original_length << endl; // vector temp; // 添加原始消息长度(64 位) for (int i = 7; i >= 0; --i) { padded_message.push_back((original_length >> (i * 8)) & 0xFF); // temp.push_back((original_length >> (i * 8)) & 0xFF); } - // cout << "len:"; + // std::cout << "len:"; // for (int i = 0; i < temp.size(); i++) { // bitset<8> b(temp[i]); - // cout << b << ' '; + // std::cout << b << ' '; // } - // cout << endl; + // std::cout << endl; return padded_message; } -uint128_t ReverseBytes(uint128_t x) { - auto byte_view = ByteContainerView(&x, sizeof(x)); - uint128_t ret = 0; - auto buf = std::vector(sizeof(ret)); - for (size_t i = 0; i < byte_view.size(); ++i) { - buf[byte_view.size() - i - 1] = byte_view[i]; - } - std::memcpy(&ret, buf.data(), buf.size()); - return ret; -} +// uint128_t ReverseBytes(uint128_t x) { +// auto byte_view = ByteContainerView(&x, sizeof(x)); +// uint128_t ret = 0; +// auto buf = std::vector(sizeof(ret)); +// for (size_t i = 0; i < byte_view.size(); ++i) { +// buf[byte_view.size() - i - 1] = byte_view[i]; +// } +// std::memcpy(&ret, buf.data(), buf.size()); +// return ret; +// } -std::string uint128ToBinaryString(__uint128_t value) { - std::string result; - for (int i = 127; i >= 0; --i) { - result += ((value >> i) & 1) ? '1' : '0'; - } - return result; -} +// std::string uint128ToBinaryString(__uint128_t value) { +// std::string result; +// for (int i = 127; i >= 0; --i) { +// result += ((value >> i) & 1) ? '1' : '0'; +// } +// return result; +// } -uint128_t CopyDataAsUint128(const uint8_t *data, bool flag) { - uint128_t ret; - int len = flag ? sizeof(uint128_t) / 2 : sizeof(uint128_t); - for (int idx = 0; idx < len; ++idx) { - reinterpret_cast(&ret)[idx] = data[idx]; - // cout << uint128ToBinaryString(ret) << endl; - } - return ret; -} +// uint128_t CopyDataAsUint128(const uint8_t *data, bool flag) { +// uint128_t ret; +// int len = flag ? sizeof(uint128_t) / 2 : sizeof(uint128_t); +// for (int idx = 0; idx < len; ++idx) { +// reinterpret_cast(&ret)[idx] = data[idx]; +// // std::cout << uint128ToBinaryString(ret) << endl; +// } +// return ret; +// } -std::vector stringToBinary(const std::string &str) { - std::vector binaryData(str.begin(), str.end()); - return binaryData; -} +// std::vector stringToBinary(const std::string &str) { +// std::vector binaryData(str.begin(), str.end()); +// return binaryData; +// } -std::string uint128ToString(__uint128_t value) { - if (value == 0) return "0"; +// std::string uint128ToString(__uint128_t value) { +// if (value == 0) return "0"; - std::string result; - while (value > 0) { - result.insert(result.begin(), '0' + static_cast(value % 10)); - value /= 10; - } - return result; -} +// std::string result; +// while (value > 0) { +// result.insert(result.begin(), '0' + static_cast(value % 10)); +// value /= 10; +// } +// return result; +// } // template // void PlainExecutor::Finalize(absl::Span outputs) { @@ -145,11 +144,11 @@ std::string uint128ToString(__uint128_t value) { // outputs[circ_->nov - i - 1] = // *(uint128_t*)result.data(); // 先得到最后位置上的 // index -= circ_->now[i]; -// cout << std::hex << outputs[circ_->nov - i - 1] << "\t"; +// std::cout << std::hex << outputs[circ_->nov - i - 1] << "\t"; // } // } // } -// cout << endl; +// std::cout << endl; // } // template @@ -177,24 +176,24 @@ std::string uint128ToString(__uint128_t value) { // // 打印二进制数据 // for (uint8_t byte : binaryData) { -// std::cout << std::bitset<8>(byte) << " "; +// std::std::cout << std::bitset<8>(byte) << " "; // } -// std::cout << std::endl; +// std::std::cout << std::endl; // return 0; // } -void get_sha256_initial_hash_values(uint32_t hash[8]) { - // SHA256 的初始哈希值(每个值为 32 位) - hash[0] = 0x6a09e667; - hash[1] = 0xbb67ae85; - hash[2] = 0x3c6ef372; - hash[3] = 0xa54ff53a; - hash[4] = 0x510e527f; - hash[5] = 0x9b05688c; - hash[6] = 0x1f83d9ab; - hash[7] = 0x5be0cd19; -} +// void get_sha256_initial_hash_values(uint32_t hash[8]) { +// // SHA256 的初始哈希值(每个值为 32 位) +// hash[0] = 0x6a09e667; +// hash[1] = 0xbb67ae85; +// hash[2] = 0x3c6ef372; +// hash[3] = 0xa54ff53a; +// hash[4] = 0x510e527f; +// hash[5] = 0x9b05688c; +// hash[6] = 0x1f83d9ab; +// hash[7] = 0x5be0cd19; +// } int main() { // const char *data = "Hello, OpenSSL!"; // size_t data_len = strlen(data); @@ -203,17 +202,17 @@ int main() { // uint8_t *padded_data; // size_t padded_len; // sha256_preprocess((uint8_t *)data, data_len, &padded_data, &padded_len); - // cout << "预处理:"; + // std::cout << "预处理:"; // for (int i = 0; i < 64; i++) { - // cout << std::hex << static_cast(padded_data[i]); + // std::cout << std::hex << static_cast(padded_data[i]); // } - // cout << endl; + // std::cout << endl; // vector data_vec(padded_data, padded_data + 64); std::string input; - cout << "请输入:"; - cin >> input; + std::cout << "请输入:"; + std::cin >> input; std::vector message(input.begin(), input.end()); // 预处理消息 @@ -237,26 +236,26 @@ int main() { } reverse(data_vec.begin(), data_vec.end()); - // cout << "预处理:"; + // std::cout << "预处理:"; // for (int i = 0; i < data_vec.size(); i++) { // bitset<8> b(data_vec[i]); - // cout << b; + // std::cout << b; // } - // cout << endl; + // std::cout << endl; for (auto &elem : byte_hash_vec) { elem = reverse_bits(elem); } reverse(byte_hash_vec.begin(), byte_hash_vec.end()); - // cout << "hash"; + // std::cout << "hash"; // for (int i = 0; i < 32; i++) { // bitset<8> b(byte_hash_vec[i]); - // cout << b; + // std::cout << b; // } - // cout << endl; + // std::cout << endl; - vector input_vec; + std::vector input_vec; for (auto &elem : data_vec) { input_vec.push_back(elem); @@ -277,21 +276,21 @@ int main() { // for (auto &elem : output_vec) { // bitset<128> b(elem); - // cout << b; + // std::cout << b; // } - // cout << endl; + // std::cout << endl; - vector result(32); - string pth_str = fmt::format("{}/yacl/io/circuit/data/sha256.txt", - std::filesystem::current_path().string()); - PlainExecutor exec; + std::vector result(32); + std::string pth_str = fmt::format("{}/yacl/io/circuit/data/sha256.txt", + std::filesystem::current_path().string()); + ycal::PlainExecutor exec; - // cout << "指针内容:" << *(uint8_t *)input_vec.data() << endl; + // std::cout << "指针内容:" << *(uint8_t *)input_vec.data() << endl; exec.LoadCircuitFile(pth_str); exec.wires_.resize( exec.circ_->nw); // 这里的wires_类型为boost::dynamic_bitset - // cout << "大小:" << exec.wires_.size() << endl; + // std::cout << "大小:" << exec.wires_.size() << endl; // memcpy(&exec.wires_, input_vec.data(), 96 * sizeof(uint8_t)); for (size_t i = 0; i < input_vec.size(); ++i) { @@ -300,7 +299,7 @@ int main() { } } - // cout << "大小:" << exec.wires_.size() << endl; + // std::cout << "大小:" << exec.wires_.size() << endl; // exec.SetupInputs(absl::MakeSpan(input_vec)); // 拼成一个vector @@ -310,15 +309,15 @@ int main() { reverse(result.begin(), result.end()); for (int i = 0; i < 32; i++) { - cout << std::hex << std::setw(2) << std::setfill('0') - << static_cast(result[i]); - // cout << result[i]; + std::cout << std::hex << std::setw(2) << std::setfill('0') + << static_cast(result[i]); + // std::cout << result[i]; // bitset<8> bits(result[i]); - // cout << bits; + // std::cout << bits; } - cout << endl; - // cout << std::hex << static_cast(result[1]) << "\t" << result[0] << - // endl; + std::cout << std::endl; + // std::cout << std::hex << static_cast(result[1]) << "\t" << result[0] + // << endl; return 0; } \ No newline at end of file diff --git a/examples/gc/test.cc b/examples/gc/test.cc index 9bc5afff..6f6c8380 100644 --- a/examples/gc/test.cc +++ b/examples/gc/test.cc @@ -4,13 +4,14 @@ #include #include -#include "absl/strings/escaping.h" +#include "absl/std::strings/escaping.h" #include "absl/types/span.h" #include "examples/gc/mitccrh.h" #include "fmt/format.h" #include "yacl/base/byte_container_view.h" #include "yacl/base/dynamic_bitset.h" +#include "yacl/base/exception.h" #include "yacl/crypto/rand/rand.h" #include "yacl/io/circuit/bristol_fashion.h" #include "yacl/io/stream/file_io.h" @@ -18,10 +19,11 @@ #include "yacl/kernel/algorithms/iknp_ote.h" #include "yacl/kernel/ot_kernel.h" #include "yacl/kernel/type/ot_store_utils.h" +#include "yacl/link/context.h" +#include "yacl/link/factory.h" #include "yacl/link/test_util.h" #include "yacl/utils/circuit_executor.h" -using namespace yacl; -using namespace std; + namespace { using uint128_t = __uint128_t; } @@ -30,8 +32,8 @@ const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); const uint128_t select_mask[2] = {0, all_one_uint128_t}; std::shared_ptr circ_; -vector wires_; -vector gb_value; +std::vector wires_; +std::vector gb_value; // enum class Op { // adder64, √ @@ -47,8 +49,8 @@ vector gb_value; // } inline uint128_t Aes128(uint128_t k, uint128_t m) { - crypto::SymmetricCrypto enc(crypto::SymmetricCrypto::CryptoType::AES128_ECB, - k); + yacl::crypto::SymmetricCrypto enc( + yacl::crypto::SymmetricCrypto::CryptoType::AES128_ECB, k); return enc.Encrypt(m); } @@ -127,7 +129,7 @@ void finalize(absl::Span outputs) { size_t index = wires_.size(); for (size_t i = 0; i < circ_->nov; ++i) { - dynamic_bitset result(circ_->now[i]); + yacl::dynamic_bitset result(circ_->now[i]); for (size_t j = 0; j < circ_->now[i]; ++j) { int wire_index = index - circ_->now[i] + j; result[j] = getLSB(wires_[wire_index]) ^ @@ -135,70 +137,109 @@ void finalize(absl::Span outputs) { // 对应的混淆电路计算为LSB ^ d // 输出线路在后xx位 } - // cout << "输出:" << result.data() << endl; + // std::cout << "输出:" << result.data() << std::endl; outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); index -= circ_->now[i]; } } -int main() { - auto lctxs = link::test::SetupWorld(2); - - const size_t num_ot = 5000; - const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::Ferret; - OtSendStore ot_send(num_ot, OtStoreType::Compact); // placeholder - OtRecvStore ot_recv(num_ot, OtStoreType::Compact); // placeholder - OtKernel kernel0(OtKernel::Role::Sender, ext_algorithm); - OtKernel kernel1(OtKernel::Role::Receiver, ext_algorithm); - - // WHEN - auto sender = std::async([&] { - kernel0.init(lctxs[0]); - kernel0.eval_cot_random_choice(lctxs[0], num_ot, &ot_send); - }); - auto receiver = std::async([&] { - kernel1.init(lctxs[1]); - kernel1.eval_cot_random_choice(lctxs[1], num_ot, &ot_recv); - }); - - sender.get(); - receiver.get(); - cout << "OT delta :" << ot_send.GetDelta() << endl; +int main(int argc, char* argv[]) { + int FLAGS_rank = std::stoi(argv[1]); + + size_t world_size = 2; + yacl::link::ContextDesc ctx_desc; + + for (size_t rank = 0; rank < world_size; rank++) { + const auto id = fmt::format("id-{}", rank); + const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); + ctx_desc.parties.push_back({id, host}); + } + + auto lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, FLAGS_rank); + lctx->ConnectToMesh(); + // auto lctxs = link::test::SetupWorld(2); + + // const size_t num_ot = 5000; + // const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::Ferret; + // OtSendStore ot_send(num_ot, OtStoreType::Compact); // placeholder + // OtRecvStore ot_recv(num_ot, OtStoreType::Compact); // placeholder + // OtKernel kernel0(OtKernel::Role::Sender, ext_algorithm); + // OtKernel kernel1(OtKernel::Role::Receiver, ext_algorithm); + + // // WHEN + // auto sender = std::async([&] { + // kernel0.init(lctxs[0]); + // kernel0.eval_cot_random_choice(lctxs[0], num_ot, &ot_send); + // }); + // auto receiver = std::async([&] { + // kernel1.init(lctxs[1]); + // kernel1.eval_cot_random_choice(lctxs[1], num_ot, &ot_recv); + // }); + + // sender.get(); + // receiver.get(); + // std::cout << "OT delta :" << ot_send.GetDelta() << std::endl; // 参与方的设置,需要参照halfgate_gen/eva和sh_gen/eva 以下是一些用到的变量 // constant[2] 0为全局delta 1为not门用到的public label // 秘钥相关 mitch 秘钥初始化start_point, shared_prg - const int kWorldSize = 2; + + // const int kWorldSize = 2; uint128_t tmp[2]; - random_uint128_t(tmp, 2); - tmp[0] = tmp[0] | 1; // 已确保LSB为1 - uint128_t delta = ot_send.GetDelta(); // 统一全局Delta + if (FLAGS_rank == 0) { + random_uint128_t(tmp, 2); + lctx->Send(1, ByteContainerView(tmp, sizeof(uint128_t) * 2), "tmp"); + std::cout << "tmpSend" << std::endl; + } else { + yacl::Buffer r = lctx->Recv(0, "tmp"); + const uint128_t* buffer_data = r.data(); + memcpy(tmp, buffer_data, sizeof(uint128_t) * 2); + std::cout << "tmpRecv" << std::endl; + } + + tmp[0] = tmp[0] | 1; // 已确保LSB为1 + uint128_t delta = tmp[0]; // 统一全局Delta uint128_t constant[3]; - random_uint128_t(constant, 2); + if (FLAGS_rank == 0) { + random_uint128_t(constant, 2); + lctx->Send(1, ByteContainerView(constant, sizeof(uint128_t) * 3), + "constant"); + std::cout << "constantSend" << std::endl; + } else { + Buffer r = lctx->Recv(0, "constant"); + const uint128_t* buffer_data = r.data(); + memcpy(constant, buffer_data, sizeof(uint128_t) * 3); + std::cout << "constantRecv" << std::endl; + } + constant[2] = constant[1] ^ delta; // gen方使用 constant[1]为eva方使用 MITCCRH<8> mitccrh; // 密钥生成和加密 8为Batch_size, schedule_key长度 mitccrh.setS(tmp[1]); // 秘钥生成start_point // 电路读取 - string operate; - cin >> operate; + std::string operate; + std::cin >> operate; - string pth = fmt::format("{0}/yacl/io/circuit/data/{1}.txt", - std::filesystem::current_path().string(), operate); + std::string pth = + fmt::format("{0}/yacl/io/circuit/data/{1}.txt", + std::filesystem::current_path().std::string(), operate); yacl::io::CircuitReader reader(pth); reader.ReadMeta(); reader.ReadAllGates(); - circ_ = reader.StealCirc(); + circ_ = reader.StealCirc(); // 指针 // aes_128随机初始化输入值 // std::vector inputs = {crypto::FastRandU128(), // crypto::FastRandU128()}; // std::vector result(1); // 其余情况 - std::vector inputs = {crypto::FastRandU64(), crypto::FastRandU64()}; + uint64_t input = crypto::FastRandU64(); + std::cout << "input:" << input << std::endl; + uint64_t input1; + std::vector result(1); // int2bool 还是得老老实实进行GB完整过程,主要目的是存储d[] @@ -208,22 +249,21 @@ int main() { // aes_128 // dynamic_bitset bi_val; // 其余情况 - dynamic_bitset bi_val; + yacl::dynamic_bitset bi_val; - for (auto input : inputs) { - bi_val.append(input); // 直接转换为二进制 输入线路在前128位 - } + bi_val.append(input); // 直接转换为二进制 输入线路在前64位 // ***************GB阶段*************** // 初始化 gb_value.resize(circ_->nw); - vector> table(circ_->ng, vector(2)); + uint128_t table[circ_->ng][2]; // 混淆过程 int num_of_input_wires = 0; for (size_t i = 0; i < circ_->niv; ++i) { num_of_input_wires += circ_->niw[i]; + // break; } // random_uint128_t(gb_value.data(), circ_->niw[0]); @@ -237,8 +277,33 @@ int main() { wires_[i] = gb_value[i] ^ (select_mask[bi_val[i]] & delta); } + if (FLAGS_rank == 0) { + lctx->Send(1, ByteContainerView(wires_.data(), sizeof(uint128_t) * 64), + "garbleInput1"); + std::cout << "sendInput1" << std::endl; + + } else { + yacl::Buffer r = lctx->Recv(0, "garbleInput1"); + + const uint128_t* buffer_data = r.data(); + memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * 64); + std::cout << "recvInput1" << std::endl; + } + if (FLAGS_rank == 0) { + lctx->Send(1, ByteContainerView(&input, sizeof(uint64_t)), "Input1"); + std::cout << "Input1OriginSend" << std::endl; + + } else { + yacl::Buffer r = lctx->Recv(0, "Input1"); + + const uint64_t* buffer_data = r.data(); + input1 = *buffer_data; + std::cout << "Input1OriginRecv:" << input1 << std::endl; + } + // ************混淆方进行发送********* + /* ************暂时没看懂*********** */ - // 后64位 用OT evaluator 用iknp + // 后64位 用OT evaluator 用iknpsendTable // vector> send_blocks; // vector recv_blocks(num_ot); // dynamic_bitset choices(num_ot); @@ -284,45 +349,109 @@ int main() { // sender.get(); // receiver.get(); + // const int kWorldSize = 2; + // auto contexts = link::test::SetupWorld(kWorldSize); + + // int num_ot = 64; + + // // WHEN + + // auto sender = std::async([&] { return BaseOtSend(contexts[0], num_ot); }); + // auto receiver = + // std::async([&] { return BaseOtRecv(contexts[1], choices, num_ot); }); + // auto send_blocks = sender.get(); + // auto recv_blocks = receiver.get(); + if (operate != "neg64" && operate != "zero_equal") { - for (int i = circ_->niw[0]; i < circ_->niw[0] + circ_->niw[1]; i++) { - gb_value[i] = ot_send.GetBlock(i - circ_->niw[0], 0); - wires_[i] = ot_recv.GetBlock(i - circ_->niw[0]); - // wires_[i] = gb_value[i] ^ (select_mask[bi_val[i]] & delta); + // const int kWorldSize = 2; + // int num_ot = 128; + + // auto lctxs = link::test::SetupWorld(kWorldSize); // setup network + // auto base_ot = MockCots(128, delta); // mock base ot + // dynamic_bitset choices; + // choices.append(inputs[1]); // 后64位全为0 + + // // WHEN + // std::vector> send_out(num_ot); + // std::vector recv_out(num_ot); + // std::future sender = std::async([&] { + // IknpOtExtSend(lctxs[0], base_ot.recv, absl::MakeSpan(send_out), false); + // }); // 发送到base_ot.recv + // std::future receiver = std::async([&] { + // IknpOtExtRecv(lctxs[1], base_ot.send, choices, + // absl::MakeSpan(recv_out), + // false); // 从base_ot.send取 + // }); + // receiver.get(); + // sender.get(); + + // for (int i = circ_->niw[0]; i < circ_->niw[0] + circ_->niw[1]; i++) { + // // gb_value[i] = send_out[i - 64][0]; + // // wires_[i] = recv_out[i - 64]; + // // if (send_out[i - 64][0] ^ delta == send_out[i - 64][1]) + // // std::cout << true << std::endl; + + // wires_[i] = gb_value[i] ^ (select_mask[bi_val[i]] & delta); + // } + // 发送混淆值让 计算方 自己选 + if (FLAGS_rank == 0) { + lctx->Send( + 1, ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), + "garbleInput2"); + std::cout << "sendInput2" << std::endl; + + } else { + yacl::Buffer r = lctx->Recv(0, "garbleInput2"); + const uint128_t* buffer_data = r.data(); + for (int i = 0; i < circ_->niw[1]; i++) { + // gb_value[i] = send_out[i - 64][0]; + // wires_[i] = recv_out[i - 64]; + // if (send_out[i - 64][0] ^ delta == send_out[i - 64][1]) + // std::cout << true << std::endl; + + wires_[i + circ_->niw[0]] = + buffer_data[i] ^ (select_mask[bi_val[i]] & delta); + } + std::cout << "recvInput2" << std::endl; } } + std::cout << "输入线路值:"; + for (int i = 0; i < 64; i++) { + std::cout << bi_val[i]; + } + std::cout << std::endl; for (int i = 0; i < circ_->gates.size(); i++) { auto gate = circ_->gates[i]; switch (gate.op) { - case io::BFCircuit::Op::XOR: { + case yacl::io::BFCircuit::Op::XOR: { const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 const auto& iw1 = gb_value.operator[](gate.iw[1]); gb_value[gate.ow[0]] = iw0 ^ iw1; break; } - case io::BFCircuit::Op::AND: { + case yacl::io::BFCircuit::Op::AND: { const auto& iw0 = gb_value.operator[](gate.iw[0]); const auto& iw1 = gb_value.operator[](gate.iw[1]); gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, delta, - table[i].data(), &mitccrh); + table[i], &mitccrh); break; } - case io::BFCircuit::Op::INV: { + case yacl::io::BFCircuit::Op::INV: { const auto& iw0 = gb_value.operator[](gate.iw[0]); gb_value[gate.ow[0]] = iw0 ^ constant[2]; break; } - case io::BFCircuit::Op::EQ: { + case yacl::io::BFCircuit::Op::EQ: { gb_value[gate.ow[0]] = gate.iw[0]; break; } - case io::BFCircuit::Op::EQW: { + case yacl::io::BFCircuit::Op::EQW: { const auto& iw0 = gb_value.operator[](gate.iw[0]); gb_value[gate.ow[0]] = iw0; break; } - case io::BFCircuit::Op::MAND: { /* multiple ANDs */ + case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ YACL_THROW("Unimplemented MAND gate"); break; } @@ -331,37 +460,59 @@ int main() { } } + // 发送混淆表 + if (FLAGS_rank == 0) { + lctx->Send(1, ByteContainerView(table, sizeof(uint128_t) * 2 * circ_->ng), + "table"); + std::cout << "sendTable" << std::endl; + // std::cout << "table0" << table[132][0]; + + } else { + yacl::Buffer r = lctx->Recv(0, "table"); + const uint128_t* buffer_data = r.data(); + int k = 0; + for (int i = 0; i < circ_->ng; i++) { + for (int j = 0; j < 2; j++) { + table[i][j] = buffer_data[k]; + k++; + } + } + + std::cout << "recvTable" << std::endl; + // std::cout << "table0" << table[132][0]; + } + // 计算方进行计算 按拓扑顺序进行计算 for (int i = 0; i < circ_->gates.size(); i++) { auto gate = circ_->gates[i]; switch (gate.op) { - case io::BFCircuit::Op::XOR: { + case yacl::io::BFCircuit::Op::XOR: { const auto& iw0 = wires_.operator[](gate.iw[0]); // 取到具体值 const auto& iw1 = wires_.operator[](gate.iw[1]); wires_[gate.ow[0]] = iw0 ^ iw1; break; } - case io::BFCircuit::Op::AND: { + case yacl::io::BFCircuit::Op::AND: { const auto& iw0 = wires_.operator[](gate.iw[0]); const auto& iw1 = wires_.operator[](gate.iw[1]); - wires_[gate.ow[0]] = EVAND(iw0, iw1, table[i].data(), &mitccrh); + wires_[gate.ow[0]] = EVAND(iw0, iw1, table[i], &mitccrh); break; } - case io::BFCircuit::Op::INV: { + case yacl::io::BFCircuit::Op::INV: { const auto& iw0 = wires_.operator[](gate.iw[0]); wires_[gate.ow[0]] = iw0 ^ constant[1]; break; } - case io::BFCircuit::Op::EQ: { + case yacl::io::BFCircuit::Op::EQ: { wires_[gate.ow[0]] = gate.iw[0]; break; } - case io::BFCircuit::Op::EQW: { + case yacl::io::BFCircuit::Op::EQW: { const auto& iw0 = wires_.operator[](gate.iw[0]); wires_[gate.ow[0]] = iw0; break; } - case io::BFCircuit::Op::MAND: { /* multiple ANDs */ + case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ YACL_THROW("Unimplemented MAND gate"); break; } @@ -371,31 +522,62 @@ int main() { } // 识别输出线路 进行DE操作 - finalize(absl::MakeSpan(result)); + // *********Finalize应该由谁来做,怎么做 + size_t index = wires_.size(); + int start = index - circ_->now[0]; + if (FLAGS_rank == 1) { + lctx->Send(0, + ByteContainerView(wires_.data() + start, sizeof(uint128_t) * 64), + "output"); + std::cout << "sendOutput" << std::endl; + // std::cout << "output:" << wires_[index - 1] << std::endl; - // 检查计算结果是否正确 - cout << inputs[0] << " " << inputs[1] << endl; - if (operate == "adder64") { - cout << inputs[0] + inputs[1] << endl; - } else if (operate == "divide64") { - cout << static_cast(inputs[0]) / static_cast(inputs[1]) - << endl; - } else if (operate == "udivide64") { - cout << inputs[0] / inputs[1] << endl; - } else if (operate == "mult64") { - cout << inputs[0] * inputs[1] << endl; - } else if (operate == "neg64") { - cout << -inputs[0] << endl; - } else if (operate == "sub64") { - cout << inputs[0] - inputs[1] << endl; - } else if (operate == "aes_128") { - cout << Aes128(ReverseBytes(inputs[0]), ReverseBytes(inputs[1])) << endl; - result[0] = ReverseBytes(result[0]); } else { - cout << "else" << endl; + yacl::Buffer r = lctx->Recv(1, "output"); + const uint128_t* buffer_data = r.data(); + + memcpy(wires_.data() + start, buffer_data, sizeof(uint128_t) * 64); + // for (int i = 0; i < circ_->niw[1]; i++) { + // // gb_value[i] = send_out[i - 64][0]; + // // wires_[i] = recv_out[i - 64]; + // // if (send_out[i - 64][0] ^ delta == send_out[i - 64][1]) + // // std::cout << true << std::endl; + + // wires_[i + circ_->niw[0]] = + // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); + // } + std::cout << "recvOutput" << std::endl; + // std::cout << "output:" << wires_[index - 1] << std::endl; } - cout << result[0] << endl; + // 检查计算结果是否正确 + // std::cout << inputs[0] << " " << inputs[1] << std::endl; + if (FLAGS_rank == 1) { + std::cout << "明文计算结果:"; + if (operate == "adder64") { + std::cout << input1 + input << std::endl; + } else if (operate == "divide64") { + std::cout << static_cast(input1) / static_cast(input) + << std::endl; + } else if (operate == "udivide64") { + std::cout << input1 / input << std::endl; + } else if (operate == "mult64") { + std::cout << input1 * input << std::endl; + } else if (operate == "neg64") { + std::cout << -input1 << std::endl; + } else if (operate == "sub64") { + std::cout << input1 - input << std::endl; + } else if (operate == "aes_128") { + std::cout << Aes128(ReverseBytes(input1), ReverseBytes(input)) + << std::endl; + result[0] = ReverseBytes(result[0]); + } else { + std::cout << "else" << std::endl; + } + } else { + finalize(absl::MakeSpan(result)); + std::cout << "MPC结果:" << result[0] << std::endl; + } /* WHEN */ // PlainExecutor exec; diff --git a/examples/mpc/AND_example.cc b/examples/mpc/AND_example.cc index 32e30bfe..8b9bf37c 100644 --- a/examples/mpc/AND_example.cc +++ b/examples/mpc/AND_example.cc @@ -24,14 +24,12 @@ #include "yacl/crypto/aes/aes_opt.h" -using namespace std; -using namespace yacl::crypto; using uint128_t = __uint128_t; const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); const uint128_t select_mask[2] = {0, all_one_uint128_t}; -AES_KEY scheduled_key[2]; +yacl::crypto::AES_KEY scheduled_key[2]; inline uint128_t makeuint128_t(uint64_t high, uint64_t low) { return (static_cast(high) << 64) | low; @@ -109,13 +107,13 @@ uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, } // garble process -void GB(string* circuits, int length, uint128_t& R, uint128_t* F, uint128_t* e, - uint128_t& gate_wires, bool& d) { +void GB(std::string* circuits, int length, uint128_t& R, uint128_t* F, + uint128_t* e, uint128_t& gate_wires, bool& d) { R = randomuint128_t(); R = R | 1; // ensure the LSB of R is 1 for (int i = 0; i < length; i++) { - if (circuits[i].find("input") != string ::npos) + if (circuits[i].find("input") != std::string ::npos) e[i] = randomuint128_t(); else { gate_wires = GBAND(e[0], e[0] ^ R, e[1], e[1] ^ R, R, F); @@ -125,14 +123,14 @@ void GB(string* circuits, int length, uint128_t& R, uint128_t* F, uint128_t* e, } // encoding process -void EN(bool a, bool b, uint128_t* e, unordered_map& buffer, - uint128_t R) { +void EN(bool a, bool b, uint128_t* e, + std::unordered_map& buffer, uint128_t R) { buffer["alice"] = e[0] ^ (select_mask[a] & R); buffer["bob"] = e[1] ^ (select_mask[b] & R); } // evaluate process -uint128_t* EV(unordered_map& buffer) { +uint128_t* EV(std::unordered_map& buffer) { uint128_t A = buffer["alice"], B = buffer["bob"]; uint128_t HA, HB, W; @@ -160,17 +158,17 @@ uint128_t* EV(unordered_map& buffer) { int main() { bool a, b; - cout << "Please input the value:" << endl; - cin >> a >> b; + std::cout << "Please input the value:" << std::endl; + std::cin >> a >> b; - string circuits[3] = {"input1", "input2", "outputAND"}; + std::string circuits[3] = {"input1", "input2", "outputAND"}; int length = 3; uint128_t e[2]; // circuits garble value of input for encoding uint128_t gate_wires; // circuits garble value of gate output bool d; // value for decoding uint128_t F[2]; // two half gates uint128_t R; // delta in gc - unordered_map + std::unordered_map buffer; // simulate the communication process generateKeys(); @@ -186,7 +184,8 @@ int main() { // step 3: evaluation EV(buffer); // step 4: decoding the result - cout << a << " and " << b << " = " << (getLSB(buffer["AND"]) ^ d) << endl; + std::cout << a << " and " << b << " = " << (getLSB(buffer["AND"]) ^ d) + << std::endl; return 0; } diff --git a/examples/mpc/XOR_example.cc b/examples/mpc/XOR_example.cc deleted file mode 100644 index ec39571e..00000000 --- a/examples/mpc/XOR_example.cc +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright 2024 Ant Group Co., Ltd. -// -// 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 -#include -#include - -#include -#include -#include -#include -#include - -#include "yacl/crypto/aes/aes_opt.h" - -using namespace std; -using namespace yacl::crypto; -using uint128_t = __uint128_t; - -const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); -const uint128_t select_mask[2] = {0, all_one_uint128_t}; - -constexpr uint8_t key[16] = {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, - 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C}; - -inline uint128_t makeuint128_t(uint64_t high, uint64_t low) { - return (static_cast(high) << 64) | low; -} - -// generate uint128_t -uint128_t randomuint128_t() { - std::random_device rd; - std::mt19937_64 eng(rd()); - std::uniform_int_distribution distr; - - uint64_t high = distr(eng); - uint64_t low = distr(eng); - - return makeuint128_t(high, low); -} - -// get the Least Significant Bit of uint128_t -bool getLSB(const uint128_t& x) { return (x & 1) == 1; } - -// for encryption and decryption -template -void myhash(uint128_t* blks) { - uint128_t key_uint128_t; - AES_KEY aes_key; - memcpy(&key_uint128_t, key, sizeof(key_uint128_t)); - AES_set_encrypt_key(key_uint128_t, &aes_key); - - uint128_t tmp[K * H]; - for (int i = 0; i < K * H; ++i) tmp[i] = blks[i]; - - ParaEnc(tmp, &aes_key); - - for (int i = 0; i < K * H; ++i) blks[i] = blks[i] ^ tmp[i]; -} - -// garble process -void GB(string* circuits, int length, uint128_t& R, uint128_t* e, - uint128_t& gate_wires, bool& d) { - R = randomuint128_t(); - R = R | 1; // ensure the LSB of R is 1 - - for (int i = 0; i < length; i++) { - if (circuits[i].find("input") != string ::npos) - e[i] = randomuint128_t(); - else { - gate_wires = e[0] ^ e[1]; - d = getLSB(gate_wires); - } - } -} - -// encoding process -void EN(bool a, bool b, uint128_t* e, unordered_map& buffer, - uint128_t R) { - buffer["alice"] = e[0] ^ (select_mask[a] & R); - buffer["bob"] = e[1] ^ (select_mask[b] & R); -} - -// evaluate process -uint128_t* EV(unordered_map& buffer) { - uint128_t A = buffer["alice"], B = buffer["bob"]; - buffer["XOR"] = A ^ B; -} - -int main() { - bool a, b; - cout << "Please input the value:" << endl; - cin >> a >> b; - - string circuits[3] = {"input1", "input2", "outputXOR"}; - int length = 3; - uint128_t e[2]; // circuits garble value of input for encoding - uint128_t gate_wires; // circuits garble value of gate output - bool d; // value for decoding - uint128_t R; // delta in gc - unordered_map - buffer; // simulate the communication process - - // step 1: generate the garble circuits - GB(circuits, length, R, e, gate_wires, d); - // step 2:encoding the inputs - EN(a, b, e, buffer, R); - // step 3: evaluation - EV(buffer); - // step 4: decoding the result - cout << a << " xor " << b << " = " << (getLSB(buffer["XOR"]) ^ d) << endl; - - return 0; -} diff --git a/yacl/utils/BUILD.bazel b/yacl/utils/BUILD.bazel index c6861b42..2a46faf7 100644 --- a/yacl/utils/BUILD.bazel +++ b/yacl/utils/BUILD.bazel @@ -294,9 +294,4 @@ yacl_cc_library( ], ) -yacl_cc_library( - name = "utils", - srcs = ["utils.cc"], - hdrs = ["utils.h"], - deps = [], -) + diff --git a/yacl/utils/circuit_executor.cc b/yacl/utils/circuit_executor.cc index 91414243..69b784f2 100644 --- a/yacl/utils/circuit_executor.cc +++ b/yacl/utils/circuit_executor.cc @@ -13,9 +13,7 @@ // limitations under the License. #include "yacl/utils/circuit_executor.h" - -using namespace std; - +// using namespace std; namespace yacl { namespace { @@ -34,7 +32,7 @@ void PlainExecutor::LoadCircuitFile(const std::string& path) { circ_ = reader.StealCirc(); } -std::string dynamic_bitset_to_string(const boost::dynamic_bitset<>& bits) { +std::string dynamic_bitset_to_string(const dynamic_bitset<>& bits) { std::string str(bits.size(), '0'); // 创建一个与位集大小相同的字符串 for (size_t i = 0; i < bits.size(); ++i) { if (bits[i]) { @@ -64,10 +62,11 @@ void PlainExecutor::Exec() { // wires_[i - 2] = wires_[i]; // } // cout << "线路输入:"; - // cout << wires_.size() << endl; + // // cout << wires_.size() << endl; // for (int i = 0; i < 768; i++) { // cout << wires_[i]; // } + // cout << endl; // // cout << dynamic_bitset_to_string(wires_) << endl; // cout << endl; // Evaluate all gates, sequentially @@ -158,8 +157,7 @@ void PlainExecutor::Finalize(absl::Span outputs) { // --end; // } - cout << endl; - for (size_t i = 0; i < 32; ++i) { + for (size_t i = 0; i < 32; ++i) { dynamic_bitset result(8); for (size_t j = 0; j < 8; ++j) { result[j] = diff --git a/yacl/utils/circuit_executor.h b/yacl/utils/circuit_executor.h index 3056ed62..631d787b 100644 --- a/yacl/utils/circuit_executor.h +++ b/yacl/utils/circuit_executor.h @@ -16,18 +16,16 @@ #include -#include #include #include "yacl/base/buffer.h" #include "yacl/base/dynamic_bitset.h" #include "yacl/io/circuit/bristol_fashion.h" -using namespace std; namespace yacl { // plaintext protocol that executes everything without link - +template class PlainExecutor { public: // Constructor @@ -37,20 +35,20 @@ class PlainExecutor { void LoadCircuitFile(const std::string &path); // Setup the input wire (local operation) - template + // template void SetupInputs(absl::Span inputs); - void SetupInputs(vector inputs_bi); + void SetupInputs(std::vector inputs_bi); // Execute the circuit void Exec(); // Finalize and get the result - template + // template void Finalize(absl::Span outputs); public: // NOTE: please make sure you use the correct order of wires - boost::dynamic_bitset wires_; // shares GC的时候这里要重新写vector - // 是否可以,以及顺序问题 + dynamic_bitset wires_; // shares GC的时候这里要重新写vector + // 是否可以,以及顺序问题 std::shared_ptr circ_; // bristol fashion circuit }; diff --git a/yacl/utils/utils.cc b/yacl/utils/utils.cc deleted file mode 100644 index 964ecfba..00000000 --- a/yacl/utils/utils.cc +++ /dev/null @@ -1,14 +0,0 @@ -#include "yacl/utils/utils.h" - -void random_uint128_t(uint128_t* data, int nblocks) { - for (int i = 0; i < nblocks; i++) { - std::random_device rd; - std::mt19937_64 eng(rd()); - std::uniform_int_distribution distr; - - uint64_t high = distr(eng); - uint64_t low = distr(eng); - - data[i] = make_uint128_t(high, low); - } -} \ No newline at end of file diff --git a/yacl/utils/utils.h b/yacl/utils/utils.h deleted file mode 100644 index 02719a89..00000000 --- a/yacl/utils/utils.h +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include -#include - -#include -#include -#include -#include -#include - -using namespace std; -using uint128_t = __uint128_t; -using block = uint128_t; - -template -inline void int_to_bool(bool* data, T input, int len); - -inline uint128_t make_uint128_t(uint64_t high, uint64_t low) { - return (static_cast(high) << 64) | low; -} - -void random_uint128_t(uint128_t* data, int nblocks = 1); - -template -inline void int_to_bool(bool* data, T input, int len) { - for (int i = 0; i < len; ++i) { - data[i] = (input & 1) == 1; - input >>= 1; - } -} - -// get the Least Significant Bit of uint128_t -inline bool getLSB(const uint128_t& x) { return (x & 1) == 1; } \ No newline at end of file From 235bd2e4508a6483d4f706fdf98e66319b4f4954 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Sat, 23 Nov 2024 16:51:52 +0800 Subject: [PATCH 08/27] pr-deadlywing --- examples/gc/BUILD.bazel | 4 +- examples/gc/mitccrh.h | 7 +-- examples/gc/sha256.cc | 58 +++++++++++------------- examples/gc/test.cc | 38 +++++++++------- yacl/utils/circuit_executor.cc | 83 ++++++++++++++-------------------- yacl/utils/circuit_executor.h | 69 ++++++++++++++++++++++++---- 6 files changed, 149 insertions(+), 110 deletions(-) diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel index eecfd1fd..9de8745f 100644 --- a/examples/gc/BUILD.bazel +++ b/examples/gc/BUILD.bazel @@ -1,3 +1,5 @@ + + cc_library( name = "mitccrh", hdrs = [ @@ -18,7 +20,7 @@ cc_binary( "//yacl/link:test_util", ], ) - + cc_binary( diff --git a/examples/gc/mitccrh.h b/examples/gc/mitccrh.h index 36d2948e..094a206d 100644 --- a/examples/gc/mitccrh.h +++ b/examples/gc/mitccrh.h @@ -1,6 +1,7 @@ #include -#include + +#include "utils.h" #include "yacl/crypto/aes/aes_opt.h" #include "yacl/crypto/tools/crhash.h" @@ -29,7 +30,7 @@ class MITCCRH { void renew_ks() { for (int i = 0; i < BatchSize; ++i) keys[i] = start_point ^ make_uint128_t(gid++, 0); - AES_opt_key_schedule(keys, scheduled_key); + yacl::crypto::AES_opt_key_schedule(keys, scheduled_key); key_used = 0; } @@ -50,7 +51,7 @@ class MITCCRH { block tmp[K * H]; for (int i = 0; i < K * H; ++i) tmp[i] = blks[i]; - ParaEnc(tmp, scheduled_key + key_used); + yacl::crypto::ParaEnc(tmp, scheduled_key + key_used); if (used) key_used += K; for (int i = 0; i < K * H; ++i) blks[i] = blks[i] ^ tmp[i]; diff --git a/examples/gc/sha256.cc b/examples/gc/sha256.cc index a73ee89e..ebb86573 100644 --- a/examples/gc/sha256.cc +++ b/examples/gc/sha256.cc @@ -50,7 +50,7 @@ uint8_t reverse_bits(uint8_t byte) { return byte; } -vector preprocess(const std::vector &message) { +std::vector preprocess(const std::vector &message) { // 步骤 1: 填充消息 size_t original_length = message.size() * 8; // 原始消息的比特长度 std::vector padded_message = message; @@ -218,36 +218,39 @@ int main() { // 预处理消息 std::vector data_vec = preprocess(message); - std::vector hash_vec = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, - 0xa54ff53a, 0x510e527f, 0x9b05688c, - 0x1f83d9ab, 0x5be0cd19}; - std::vector byte_hash_vec; + // std::vector hash_vec = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, + // 0xa54ff53a, 0x510e527f, 0x9b05688c, + // 0x1f83d9ab, 0x5be0cd19}; - // 遍历 hash_vec 并将每个 uint32_t 分解为 4 个字节存储到 byte_hash_vec 中 - for (uint32_t value : hash_vec) { - byte_hash_vec.push_back(value >> 24 & 0xFF); - byte_hash_vec.push_back((value >> 16) & 0xFF); - byte_hash_vec.push_back((value >> 8) & 0xFF); - byte_hash_vec.push_back((value) & 0xFF); - } + /* + Initial hash value, reference: + https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf + Section 5.3 + */ + std::vector byte_hash_vec = { + 0x6a, 0x09, 0xe6, 0x67, 0xbb, 0x67, 0xae, 0x85, 0x3c, 0x6e, 0xf3, + 0x72, 0xa5, 0x4f, 0xf5, 0x3a, 0x51, 0x0e, 0x52, 0x7f, 0x9b, 0x05, + 0x68, 0x8c, 0x1f, 0x83, 0xd9, 0xab, 0x5b, 0xe0, 0xcd, 0x19}; + // 遍历 hash_vec 并将每个 uint32_t 分解为 4 个字节存储到 byte_hash_vec 中 + // for (uint32_t value : hash_vec) { + // byte_hash_vec.push_back(value >> 24 & 0xFF); + // byte_hash_vec.push_back((value >> 16) & 0xFF); + // byte_hash_vec.push_back((value >> 8) & 0xFF); + // byte_hash_vec.push_back((value) & 0xFF); + // } for (auto &elem : data_vec) { elem = reverse_bits(elem); } - reverse(data_vec.begin(), data_vec.end()); - - // std::cout << "预处理:"; - // for (int i = 0; i < data_vec.size(); i++) { - // bitset<8> b(data_vec[i]); - // std::cout << b; - // } - // std::cout << endl; - for (auto &elem : byte_hash_vec) { elem = reverse_bits(elem); } - reverse(byte_hash_vec.begin(), byte_hash_vec.end()); +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + + reverse(data_vec.begin(), data_vec.end()); + reverse(byte_hash_vec.begin(), byte_hash_vec.end()); +#endif // std::cout << "hash"; // for (int i = 0; i < 32; i++) { // bitset<8> b(byte_hash_vec[i]); @@ -283,24 +286,17 @@ int main() { std::vector result(32); std::string pth_str = fmt::format("{}/yacl/io/circuit/data/sha256.txt", std::filesystem::current_path().string()); - ycal::PlainExecutor exec; - + yacl::PlainExecutor exec; // std::cout << "指针内容:" << *(uint8_t *)input_vec.data() << endl; exec.LoadCircuitFile(pth_str); - exec.wires_.resize( - exec.circ_->nw); // 这里的wires_类型为boost::dynamic_bitset - // std::cout << "大小:" << exec.wires_.size() << endl; - - // memcpy(&exec.wires_, input_vec.data(), 96 * sizeof(uint8_t)); + exec.wires_.resize(exec.circ_->nw); for (size_t i = 0; i < input_vec.size(); ++i) { for (int j = 0; j < 8; ++j) { exec.wires_[i * 8 + j] = (input_vec[i] >> (7 - j)) & 1; // 逐位赋值 } } - // std::cout << "大小:" << exec.wires_.size() << endl; - // exec.SetupInputs(absl::MakeSpan(input_vec)); // 拼成一个vector exec.Exec(); diff --git a/examples/gc/test.cc b/examples/gc/test.cc index 6f6c8380..6541fd34 100644 --- a/examples/gc/test.cc +++ b/examples/gc/test.cc @@ -4,7 +4,7 @@ #include #include -#include "absl/std::strings/escaping.h" +// #include "absl/std::strings/escaping.h" #include "absl/types/span.h" #include "examples/gc/mitccrh.h" #include "fmt/format.h" @@ -17,7 +17,7 @@ #include "yacl/io/stream/file_io.h" #include "yacl/kernel/algorithms/base_ot.h" #include "yacl/kernel/algorithms/iknp_ote.h" -#include "yacl/kernel/ot_kernel.h" +// #include "yacl/kernel/ot_kernel.h" #include "yacl/kernel/type/ot_store_utils.h" #include "yacl/link/context.h" #include "yacl/link/factory.h" @@ -31,7 +31,7 @@ using uint128_t = __uint128_t; const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); const uint128_t select_mask[2] = {0, all_one_uint128_t}; -std::shared_ptr circ_; +std::shared_ptr circ_; std::vector wires_; std::vector gb_value; @@ -55,7 +55,7 @@ inline uint128_t Aes128(uint128_t k, uint128_t m) { } uint128_t ReverseBytes(uint128_t x) { - auto byte_view = ByteContainerView(&x, sizeof(x)); + auto byte_view = yacl::ByteContainerView(&x, sizeof(x)); uint128_t ret = 0; auto buf = std::vector(sizeof(ret)); for (size_t i = 0; i < byte_view.size(); ++i) { @@ -189,7 +189,7 @@ int main(int argc, char* argv[]) { uint128_t tmp[2]; if (FLAGS_rank == 0) { random_uint128_t(tmp, 2); - lctx->Send(1, ByteContainerView(tmp, sizeof(uint128_t) * 2), "tmp"); + lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 2), "tmp"); std::cout << "tmpSend" << std::endl; } else { yacl::Buffer r = lctx->Recv(0, "tmp"); @@ -204,11 +204,11 @@ int main(int argc, char* argv[]) { uint128_t constant[3]; if (FLAGS_rank == 0) { random_uint128_t(constant, 2); - lctx->Send(1, ByteContainerView(constant, sizeof(uint128_t) * 3), + lctx->Send(1, yacl::ByteContainerView(constant, sizeof(uint128_t) * 3), "constant"); std::cout << "constantSend" << std::endl; } else { - Buffer r = lctx->Recv(0, "constant"); + yacl::Buffer r = lctx->Recv(0, "constant"); const uint128_t* buffer_data = r.data(); memcpy(constant, buffer_data, sizeof(uint128_t) * 3); std::cout << "constantRecv" << std::endl; @@ -225,7 +225,7 @@ int main(int argc, char* argv[]) { std::string pth = fmt::format("{0}/yacl/io/circuit/data/{1}.txt", - std::filesystem::current_path().std::string(), operate); + std::filesystem::current_path().string(), operate); yacl::io::CircuitReader reader(pth); reader.ReadMeta(); reader.ReadAllGates(); @@ -236,7 +236,7 @@ int main(int argc, char* argv[]) { // crypto::FastRandU128()}; // std::vector result(1); // 其余情况 - uint64_t input = crypto::FastRandU64(); + uint64_t input = yacl::crypto::FastRandU64(); std::cout << "input:" << input << std::endl; uint64_t input1; @@ -278,7 +278,8 @@ int main(int argc, char* argv[]) { } if (FLAGS_rank == 0) { - lctx->Send(1, ByteContainerView(wires_.data(), sizeof(uint128_t) * 64), + lctx->Send(1, + yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * 64), "garbleInput1"); std::cout << "sendInput1" << std::endl; @@ -290,7 +291,7 @@ int main(int argc, char* argv[]) { std::cout << "recvInput1" << std::endl; } if (FLAGS_rank == 0) { - lctx->Send(1, ByteContainerView(&input, sizeof(uint64_t)), "Input1"); + lctx->Send(1, yacl::ByteContainerView(&input, sizeof(uint64_t)), "Input1"); std::cout << "Input1OriginSend" << std::endl; } else { @@ -396,7 +397,8 @@ int main(int argc, char* argv[]) { // 发送混淆值让 计算方 自己选 if (FLAGS_rank == 0) { lctx->Send( - 1, ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), + 1, + yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), "garbleInput2"); std::cout << "sendInput2" << std::endl; @@ -462,8 +464,9 @@ int main(int argc, char* argv[]) { // 发送混淆表 if (FLAGS_rank == 0) { - lctx->Send(1, ByteContainerView(table, sizeof(uint128_t) * 2 * circ_->ng), - "table"); + lctx->Send( + 1, yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_->ng), + "table"); std::cout << "sendTable" << std::endl; // std::cout << "table0" << table[132][0]; @@ -526,9 +529,10 @@ int main(int argc, char* argv[]) { size_t index = wires_.size(); int start = index - circ_->now[0]; if (FLAGS_rank == 1) { - lctx->Send(0, - ByteContainerView(wires_.data() + start, sizeof(uint128_t) * 64), - "output"); + lctx->Send( + 0, + yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * 64), + "output"); std::cout << "sendOutput" << std::endl; // std::cout << "output:" << wires_[index - 1] << std::endl; diff --git a/yacl/utils/circuit_executor.cc b/yacl/utils/circuit_executor.cc index 69b784f2..9b49221f 100644 --- a/yacl/utils/circuit_executor.cc +++ b/yacl/utils/circuit_executor.cc @@ -45,14 +45,10 @@ std::string dynamic_bitset_to_string(const dynamic_bitset<>& bits) { template void PlainExecutor::SetupInputs( absl::Span inputs) { // Span方便指针的使用 - // YACL_ENFORCE(inputs.size() == circ_->niv); - // for (auto input : inputs) { - // wires_.append(input); // 直接转换为二进制 输入线路在前128位 - // } - - // memccpy(wires_.data(), inputs.data(), 1, sizeof(inputs)); - inputs.size(); wires_.resize(circ_->nw); + for (auto input : inputs) { + wires_.append(input); + } } template @@ -61,12 +57,12 @@ void PlainExecutor::Exec() { // for (int i = 2; i < 514; i++) { // wires_[i - 2] = wires_[i]; // } - // cout << "线路输入:"; - // // cout << wires_.size() << endl; + // std::cout << "线路输入:"; + // for (int i = 0; i < 768; i++) { - // cout << wires_[i]; + // std::cout << wires_[i]; // } - // cout << endl; + // std::cout << std::endl; // // cout << dynamic_bitset_to_string(wires_) << endl; // cout << endl; // Evaluate all gates, sequentially @@ -126,47 +122,38 @@ void PlainExecutor::Exec() { // } // } +// template +// void PlainExecutor::Finalize(absl::Span outputs) { +// // YACL_ENFORCE(outputs.size() >= circ_->nov); + +// size_t index = wires_.size(); + +// for (size_t i = 0; i < 32; ++i) { +// dynamic_bitset result(8); +// for (size_t j = 0; j < 8; ++j) { +// result[j] = +// wires_[index - 8 + j]; // 得到的是逆序的二进制值 +// 对应的混淆电路计算为 +// // LSB ^ d 输出线路在后xx位 +// } +// outputs[32 - i - 1] = *(uint8_t*)result.data(); +// // outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); +// index -= 8; +// } +// } + template void PlainExecutor::Finalize(absl::Span outputs) { - // YACL_ENFORCE(outputs.size() >= circ_->nov); + YACL_ENFORCE(outputs.size() >= circ_->nov); size_t index = wires_.size(); - // reverse(wires_ + wires_.size() - 256, wires_ + wires_.size()); - // int arr[256]; - // for (int i = 0; i < 256; i++) { - // arr[i] = wires_[index - 256 + i]; - // } - // for (int i = 0; i < 256; i++) { - // wires_[index - 256 + i] = arr[255 - i]; - // } - - // for (int i = 0; i < 256; i++) { - // cout << wires_[index - 256 + i]; - // } - // reverse(wires_ + index - 256, wires_ + index - 250); - // int start = index - 256; - // int end = index; - // while (start < end) { - // // 交换 start 和 end 的位 - // bool temp = wires_[start]; - // wires_[start] = wires_[end - 1]; - // wires_[end - 1] = temp; - - // // 移动指针 - // ++start; - // --end; - // } - - for (size_t i = 0; i < 32; ++i) { - dynamic_bitset result(8); - for (size_t j = 0; j < 8; ++j) { - result[j] = - wires_[index - 8 + j]; // 得到的是逆序的二进制值 对应的混淆电路计算为 - // LSB ^ d 输出线路在后xx位 + for (size_t i = 0; i < circ_->nov; ++i) { + dynamic_bitset result(circ_->now[i]); + for (size_t j = 0; j < circ_->now[i]; ++j) { + result[j] = wires_[index - circ_->now[i] + j]; } - outputs[32 - i - 1] = *(uint8_t*)result.data(); - // outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); - index -= 8; + outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); + index -= circ_->now[i]; } } @@ -174,4 +161,4 @@ template class PlainExecutor; template class PlainExecutor; // template class PlainExecutor; -} // namespace yacl +} // namespace yacl \ No newline at end of file diff --git a/yacl/utils/circuit_executor.h b/yacl/utils/circuit_executor.h index 631d787b..64d652fc 100644 --- a/yacl/utils/circuit_executor.h +++ b/yacl/utils/circuit_executor.h @@ -1,3 +1,57 @@ +// // Copyright 2024 Ant Group Co., Ltd. +// // +// // 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. + +// #pragma once + +// #include + +// #include "yacl/base/buffer.h" +// #include "yacl/base/dynamic_bitset.h" +// #include "yacl/io/circuit/bristol_fashion.h" + +// namespace yacl { + +// // plaintext protocol that executes everything without link +// template +// class PlainExecutor { +// public: +// // Constructor +// explicit PlainExecutor() = default; + +// // Load circuit from file (local operation) +// void LoadCircuitFile(const std::string &path); + +// // Setup the input wire (local operation) +// // template +// void SetupInputs(absl::Span inputs); +// // void SetupInputs(std::vector inputs_bi); +// // Execute the circuit +// void Exec(); + +// // Finalize and get the result +// // template +// void Finalize(absl::Span outputs); + +// public: +// // NOTE: please make sure you use the correct order of wires +// dynamic_bitset wires_; // shares GC的时候这里要重新写vector +// // 是否可以,以及顺序问题 +// std::shared_ptr circ_; // bristol fashion circuit +// }; + +// } // namespace yacl + // Copyright 2024 Ant Group Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,17 +68,15 @@ #pragma once -#include - #include -#include "yacl/base/buffer.h" #include "yacl/base/dynamic_bitset.h" #include "yacl/io/circuit/bristol_fashion.h" namespace yacl { // plaintext protocol that executes everything without link + template class PlainExecutor { public: @@ -35,21 +87,18 @@ class PlainExecutor { void LoadCircuitFile(const std::string &path); // Setup the input wire (local operation) - // template void SetupInputs(absl::Span inputs); - void SetupInputs(std::vector inputs_bi); + // Execute the circuit void Exec(); // Finalize and get the result - // template void Finalize(absl::Span outputs); - public: + private: // NOTE: please make sure you use the correct order of wires - dynamic_bitset wires_; // shares GC的时候这里要重新写vector - // 是否可以,以及顺序问题 + dynamic_bitset wires_; // shares std::shared_ptr circ_; // bristol fashion circuit }; -} // namespace yacl +} // namespace yacl \ No newline at end of file From bbb5ced3ed21117740a28f16563d53aa01157328 Mon Sep 17 00:00:00 2001 From: gitCoder1024 <88184811+gitCoder1024@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:35:18 +0800 Subject: [PATCH 09/27] Create utils.cc add utils --- examples/gc/utils.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 examples/gc/utils.cc diff --git a/examples/gc/utils.cc b/examples/gc/utils.cc new file mode 100644 index 00000000..9a92db24 --- /dev/null +++ b/examples/gc/utils.cc @@ -0,0 +1,14 @@ +#include "utils.h" + +void random_uint128_t(uint128_t* data, int nblocks) { + for (int i = 0; i < nblocks; i++) { + std::random_device rd; + std::mt19937_64 eng(rd()); + std::uniform_int_distribution distr; + + uint64_t high = distr(eng); + uint64_t low = distr(eng); + + data[i] = make_uint128_t(high, low); + } +} From efd1352c635b515c27a7e5ddbf191811cc27d0ab Mon Sep 17 00:00:00 2001 From: gitCoder1024 <88184811+gitCoder1024@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:35:45 +0800 Subject: [PATCH 10/27] Create utils.h --- examples/gc/utils.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 examples/gc/utils.h diff --git a/examples/gc/utils.h b/examples/gc/utils.h new file mode 100644 index 00000000..e72a4842 --- /dev/null +++ b/examples/gc/utils.h @@ -0,0 +1,32 @@ +#include +#include +#include + +#include +#include +#include +#include +#include + +using uint128_t = __uint128_t; +using block = uint128_t; + +template +inline void int_to_bool(bool* data, T input, int len); + +inline uint128_t make_uint128_t(uint64_t high, uint64_t low) { + return (static_cast(high) << 64) | low; +} + +void random_uint128_t(uint128_t* data, int nblocks = 1); + +template +inline void int_to_bool(bool* data, T input, int len) { + for (int i = 0; i < len; ++i) { + data[i] = (input & 1) == 1; + input >>= 1; + } +} + +// get the Least Significant Bit of uint128_t +inline bool getLSB(const uint128_t& x) { return (x & 1) == 1; } From 93e4775dcc0b4ccace75eea7cb6959b864e4f8a4 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Wed, 11 Dec 2024 15:28:33 +0800 Subject: [PATCH 11/27] delete extra comments --- examples/gc/test.cc | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/examples/gc/test.cc b/examples/gc/test.cc index 6541fd34..5904aaab 100644 --- a/examples/gc/test.cc +++ b/examples/gc/test.cc @@ -24,6 +24,8 @@ #include "yacl/link/test_util.h" #include "yacl/utils/circuit_executor.h" +using namespace std; +using namespace yacl; namespace { using uint128_t = __uint128_t; } @@ -155,7 +157,8 @@ int main(int argc, char* argv[]) { ctx_desc.parties.push_back({id, host}); } - auto lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, FLAGS_rank); + auto lctx = yacl::link::FactoryBrpc().CreateContext( + ctx_desc, FLAGS_rank); // yacl::link::test lctx->ConnectToMesh(); // auto lctxs = link::test::SetupWorld(2); @@ -332,23 +335,27 @@ int main(int argc, char* argv[]) { /* ***********尝试使用base_OT*********** */ // auto contexts = link::test::SetupWorld(kWorldSize); - // vector> send_blocks; - // vector recv_blocks(num_ot); - // dynamic_bitset choices(num_ot); - // for (int i = 64; i < 128; i++) { - // send_blocks.push_back({gb_value[i], gb_value[i] ^ delta}); - // choices.push_back(bi_val[i]); - // } - - // std::future sender = - // std::async([&] { BaseOtSend(contexts[0], - // absl::MakeSpan(send_blocks)); - // }); - // std::future receiver = std::async( - // [&] { BaseOtRecv(contexts[1], choices, absl::MakeSpan(recv_blocks)); - // }); - // sender.get(); - // receiver.get(); + int num_ot = 64; + UninitAlignedVector> send_blocks; + UninitAlignedVector recv_blocks(num_ot); + dynamic_bitset choices(num_ot); + for (int i = 64; i < 128; i++) { + send_blocks.push_back({gb_value[i], gb_value[i] ^ delta}); + choices.push_back(bi_val[i]); + } + + std::future sender = + yacl::crypto::BaseOtSend(lctx[0], absl::MakeSpan(send_blocks)); + + std::future receiver = + yacl::crypto::BaseOtRecv(1, choices, absl::MakeSpan(recv_blocks)); + + for (int i = 0; i < num_ot; i++) { + if (send_blocks[i][choices[i]] != recv_blocks[i]) { + cout << "**********OT错误************"; + break; + } + } // const int kWorldSize = 2; // auto contexts = link::test::SetupWorld(kWorldSize); @@ -394,6 +401,7 @@ int main(int argc, char* argv[]) { // wires_[i] = gb_value[i] ^ (select_mask[bi_val[i]] & delta); // } + // 发送混淆值让 计算方 自己选 if (FLAGS_rank == 0) { lctx->Send( From 76bf0bca8f619b0f11e85103239c733c96ac1a08 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Fri, 20 Dec 2024 15:10:21 +0800 Subject: [PATCH 12/27] test_split --- examples/gc/evaluator.h | 110 +++++++++++++ examples/gc/garbler.h | 154 ++++++++++++++++++ examples/gc/test_split.cc | 331 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 595 insertions(+) create mode 100644 examples/gc/evaluator.h create mode 100644 examples/gc/garbler.h create mode 100644 examples/gc/test_split.cc diff --git a/examples/gc/evaluator.h b/examples/gc/evaluator.h new file mode 100644 index 00000000..610f5b29 --- /dev/null +++ b/examples/gc/evaluator.h @@ -0,0 +1,110 @@ +#pragma once +#include +#include +#include +#include + +// #include "absl/std::strings/escaping.h" +#include "absl/types/span.h" +#include "examples/gc/mitccrh.h" +#include "fmt/format.h" + +#include "yacl/base/byte_container_view.h" +#include "yacl/base/dynamic_bitset.h" +#include "yacl/base/exception.h" +#include "yacl/crypto/rand/rand.h" +#include "yacl/io/circuit/bristol_fashion.h" +#include "yacl/io/stream/file_io.h" +#include "yacl/kernel/algorithms/base_ot.h" +#include "yacl/kernel/algorithms/iknp_ote.h" +// #include "yacl/kernel/ot_kernel.h" +#include "yacl/kernel/type/ot_store_utils.h" +#include "yacl/link/context.h" +#include "yacl/link/factory.h" +#include "yacl/link/test_util.h" +#include "yacl/utils/circuit_executor.h" + +using namespace std; +using namespace yacl; +namespace { +using uint128_t = __uint128_t; +} + +uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); +uint128_t select_mask[2] = {0, all_one_uint128_t}; + +class Evaluator { + public: + std::shared_ptr lctx; + uint128_t delta; + uint128_t inv_constant; + uint128_t start_point; + MITCCRH<8> mitccrh; + + std::vector wires_; + std::vector gb_value; + yacl::io::BFCircuit circ_; + + uint64_t input; + + void setup() { + // 通信环境初始化 + size_t world_size = 2; + yacl::link::ContextDesc ctx_desc; + + for (size_t rank = 0; rank < world_size; rank++) { + const auto id = fmt::format("id-{}", rank); + const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); + ctx_desc.parties.push_back({id, host}); + } + + auto lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, + 1); // yacl::link::test + lctx->ConnectToMesh(); + + uint128_t tmp[3]; + // delta, inv_constant, start_point 接收 + yacl::Buffer r = lctx->Recv(0, "tmp"); + const uint128_t* buffer_data = r.data(); + memcpy(tmp, buffer_data, sizeof(uint128_t) * 3); + std::cout << "tmpRecv" << std::endl; + + delta = tmp[0]; + inv_constant = tmp[1]; + start_point = tmp[2]; + + // 秘钥生成 + mitccrh.setS(start_point); + } + + void inputProcess(yacl::io::BFCircuit param_circ_) { + circ_ = param_circ_; + gb_value.resize(circ_.nw); + wires_.resize(circ_.nw); + + yacl::dynamic_bitset bi_val; + bi_val.append(input); // 直接转换为二进制 输入线路在前64位 + + input = yacl::crypto::FastRandU64(); + std::cout << "input of evaluator:" << input << std::endl; + + // 接收garbler混淆值 + yacl::Buffer r = lctx->Recv(0, "garbleInput1"); + cout << "lctx->Recv" << endl; + const uint128_t* buffer_data = r.data(); + cout << "const uint128_t* buffer_data = r.data();" << endl; + memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * 64); + cout << "memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * 64);" + << endl; + std::cout << "recvInput1" << std::endl; + + // // 对evaluator自己的输入值进行混淆 + // r = lctx->Recv(0, "garbleInput2"); + // buffer_data = r.data(); + // for (int i = 0; i < circ_.niw[1]; i++) { + // wires_[i + circ_.niw[0]] = + // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); + // } + // std::cout << "recvInput2" << std::endl; + } +}; \ No newline at end of file diff --git a/examples/gc/garbler.h b/examples/gc/garbler.h new file mode 100644 index 00000000..252db9dc --- /dev/null +++ b/examples/gc/garbler.h @@ -0,0 +1,154 @@ +#pragma once +#include +#include +#include +#include + +// #include "absl/std::strings/escaping.h" +#include "absl/types/span.h" +#include "examples/gc/mitccrh.h" +#include "fmt/format.h" + +#include "yacl/base/byte_container_view.h" +#include "yacl/base/dynamic_bitset.h" +#include "yacl/base/exception.h" +#include "yacl/crypto/rand/rand.h" +#include "yacl/io/circuit/bristol_fashion.h" +#include "yacl/io/stream/file_io.h" +#include "yacl/kernel/algorithms/base_ot.h" +#include "yacl/kernel/algorithms/iknp_ote.h" +// #include "yacl/kernel/ot_kernel.h" +#include "yacl/kernel/type/ot_store_utils.h" +#include "yacl/link/context.h" +#include "yacl/link/factory.h" +#include "yacl/link/test_util.h" +#include "yacl/utils/circuit_executor.h" + +using namespace std; +using namespace yacl; +namespace { +using uint128_t = __uint128_t; +} +uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); +uint128_t select_mask_[2] = {0, all_one_uint128_t_}; +class Garbler { + public: + std::shared_ptr lctx; + uint128_t delta; + uint128_t inv_constant; + uint128_t start_point; + MITCCRH<8> mitccrh; + + std::vector wires_; + std::vector gb_value; + yacl::io::BFCircuit circ_; + + uint64_t input; + + void setup() { + // 通信环境初始化 + size_t world_size = 2; + yacl::link::ContextDesc ctx_desc; + + for (size_t rank = 0; rank < world_size; rank++) { + const auto id = fmt::format("id-{}", rank); + const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); + ctx_desc.parties.push_back({id, host}); + } + + // 可以直接用Context + auto lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, + 0); // yacl::link::test + lctx->ConnectToMesh(); + + // delta, inv_constant, start_point 初始化并发送给evaluator + uint128_t tmp[3]; + + random_uint128_t(tmp, 3); + tmp[0] = tmp[0] | 1; + lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 3), "tmp"); + std::cout << "tmpSend" << std::endl; + + delta = tmp[0]; + inv_constant = tmp[1] ^ delta; + start_point = tmp[2]; + + // 秘钥生成 + mitccrh.setS(start_point); + } + + // 包扩 输入值生成和混淆,并将双方混淆值发送给对方 + void inputProcess(yacl::io::BFCircuit param_circ_) { + circ_ = param_circ_; + gb_value.resize(circ_.nw); + wires_.resize(circ_.nw); + + input = yacl::crypto::FastRandU64(); + std::cout << "input of garbler:" << input << std::endl; + + yacl::dynamic_bitset bi_val; + bi_val.append(input); // 直接转换为二进制 输入线路在前64位 + + // 混淆过程 + int num_of_input_wires = 0; + for (size_t i = 0; i < circ_.niv; ++i) { + num_of_input_wires += circ_.niw[i]; + } + // random_uint128_t(gb_value.data(), circ_.niw[0]); + random_uint128_t(gb_value.data(), num_of_input_wires); + + // 前64位 直接置换 garbler + for (int i = 0; i < circ_.niw[0]; i++) { + wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); + } + + lctx->Send(1, + yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * 64), + "garbleInput1"); + + std::cout << "lctx->Send" << std::endl; + + std::cout << "sendInput1" << std::endl; + + // lctx->Send( + // 1, + // yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * + // 64), "garbleInput2"); + // std::cout << "sendInput2" << std::endl; + } + + uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, + uint128_t delta, uint128_t* table, MITCCRH<8>* mitccrh) { + bool pa = getLSB(LA0); + bool pb = getLSB(LB0); + + uint128_t HLA0, HA1, HLB0, HB1; + uint128_t tmp, W0; + uint128_t H[4]; + + H[0] = LA0; + H[1] = A1; + H[2] = LB0; + H[3] = B1; + + mitccrh->hash<2, 2>(H); + + HLA0 = H[0]; + HA1 = H[1]; + HLB0 = H[2]; + HB1 = H[3]; + + table[0] = HLA0 ^ HA1; + table[0] = table[0] ^ (select_mask_[pb] & delta); + + W0 = HLA0; + W0 = W0 ^ (select_mask_[pa] & table[0]); + + tmp = HLB0 ^ HB1; + table[1] = tmp ^ LA0; + + W0 = W0 ^ HLB0; + W0 = W0 ^ (select_mask_[pb] & tmp); + return W0; + } +}; \ No newline at end of file diff --git a/examples/gc/test_split.cc b/examples/gc/test_split.cc new file mode 100644 index 00000000..5a6050fb --- /dev/null +++ b/examples/gc/test_split.cc @@ -0,0 +1,331 @@ +#pragma once +#include +#include +#include +#include + +// #include "absl/std::strings/escaping.h" +#include "absl/types/span.h" +#include "examples/gc/evaluator.h" +#include "examples/gc/garbler.h" +#include "fmt/format.h" + +using namespace std; +using namespace yacl; +namespace { +using uint128_t = __uint128_t; +} + +std::shared_ptr circ_; +std::vector wires_; +std::vector gb_value; + +// enum class Op { +// adder64, √ +// aes_128, √ +// divide64, √ +// mult2_64, +// mult64, √ +// neg64, √ +// sha256, +// sub64, √ +// udivide64, √ +// zero_equal √ +// } + +inline uint128_t Aes128(uint128_t k, uint128_t m) { + yacl::crypto::SymmetricCrypto enc( + yacl::crypto::SymmetricCrypto::CryptoType::AES128_ECB, k); + return enc.Encrypt(m); +} + +uint128_t ReverseBytes(uint128_t x) { + auto byte_view = yacl::ByteContainerView(&x, sizeof(x)); + uint128_t ret = 0; + auto buf = std::vector(sizeof(ret)); + for (size_t i = 0; i < byte_view.size(); ++i) { + buf[byte_view.size() - i - 1] = byte_view[i]; + } + std::memcpy(&ret, buf.data(), buf.size()); + return ret; +} + +// uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, +// uint128_t delta, uint128_t* table, MITCCRH<8>* mitccrh) { +// bool pa = getLSB(LA0); +// bool pb = getLSB(LB0); + +// uint128_t HLA0, HA1, HLB0, HB1; +// uint128_t tmp, W0; +// uint128_t H[4]; + +// H[0] = LA0; +// H[1] = A1; +// H[2] = LB0; +// H[3] = B1; + +// mitccrh->hash<2, 2>(H); + +// HLA0 = H[0]; +// HA1 = H[1]; +// HLB0 = H[2]; +// HB1 = H[3]; + +// table[0] = HLA0 ^ HA1; +// table[0] = table[0] ^ (select_mask[pb] & delta); + +// W0 = HLA0; +// W0 = W0 ^ (select_mask[pa] & table[0]); + +// tmp = HLB0 ^ HB1; +// table[1] = tmp ^ LA0; + +// W0 = W0 ^ HLB0; +// W0 = W0 ^ (select_mask[pb] & tmp); +// return W0; +// } + +// uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table, +// MITCCRH<8>* mitccrh) { +// uint128_t HA, HB, W; +// int sa, sb; + +// sa = getLSB(A); +// sb = getLSB(B); + +// uint128_t H[2]; +// H[0] = A; +// H[1] = B; +// mitccrh->hash<2, 1>(H); +// HA = H[0]; +// HB = H[1]; + +// W = HA ^ HB; +// W = W ^ (select_mask[sa] & table[0]); +// W = W ^ (select_mask[sb] & table[1]); +// W = W ^ (select_mask[sb] & A); +// return W; +// } + +// template +// void finalize(absl::Span outputs) { +// // YACL_ENFORCE(outputs.size() >= circ_->nov); + +// size_t index = wires_.size(); + +// for (size_t i = 0; i < circ_->nov; ++i) { +// yacl::dynamic_bitset result(circ_->now[i]); +// for (size_t j = 0; j < circ_->now[i]; ++j) { +// int wire_index = index - circ_->now[i] + j; +// result[j] = getLSB(wires_[wire_index]) ^ +// getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 +// // 对应的混淆电路计算为LSB ^ +// d +// // 输出线路在后xx位 +// } +// // std::cout << "输出:" << result.data() << std::endl; +// outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); +// index -= circ_->now[i]; +// } +// } + +int main() { + // 初始化 + Garbler* garbler = new Garbler(); + Evaluator* evaluator = new Evaluator(); + + std::future thread1 = std::async([&] { garbler->setup(); }); + std::future thread2 = std::async([&] { evaluator->setup(); }); + thread1.get(); + thread2.get(); + + // 电路读取 + std::string operate; + std::cin >> operate; + + std::string pth = + fmt::format("{0}/yacl/io/circuit/data/{1}.txt", + std::filesystem::current_path().string(), operate); + yacl::io::CircuitReader reader(pth); + reader.ReadMeta(); + reader.ReadAllGates(); + circ_ = reader.StealCirc(); // 指针 + + // 输入值混淆 + thread1 = std::async([&] { garbler->inputProcess(*circ_); }); + thread2 = std::async([&] { evaluator->inputProcess(*circ_); }); + thread1.get(); + thread2.get(); + + // for (int i = 0; i < circ_->gates.size(); i++) { + // auto gate = circ_->gates[i]; + // switch (gate.op) { + // case yacl::io::BFCircuit::Op::XOR: { + // const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 + // const auto& iw1 = gb_value.operator[](gate.iw[1]); + // gb_value[gate.ow[0]] = iw0 ^ iw1; + // break; + // } + // case yacl::io::BFCircuit::Op::AND: { + // const auto& iw0 = gb_value.operator[](gate.iw[0]); + // const auto& iw1 = gb_value.operator[](gate.iw[1]); + // gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, + // delta, + // table[i], &mitccrh); + // break; + // } + // case yacl::io::BFCircuit::Op::INV: { + // const auto& iw0 = gb_value.operator[](gate.iw[0]); + // gb_value[gate.ow[0]] = iw0 ^ constant[2]; + // break; + // } + // case yacl::io::BFCircuit::Op::EQ: { + // gb_value[gate.ow[0]] = gate.iw[0]; + // break; + // } + // case yacl::io::BFCircuit::Op::EQW: { + // const auto& iw0 = gb_value.operator[](gate.iw[0]); + // gb_value[gate.ow[0]] = iw0; + // break; + // } + // case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ + // YACL_THROW("Unimplemented MAND gate"); + // break; + // } + // default: + // YACL_THROW("Unknown Gate Type: {}", (int)gate.op); + // } + // } + + // // 发送混淆表 + // if (FLAGS_rank == 0) { + // lctx->Send( + // 1, yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_->ng), + // "table"); + // std::cout << "sendTable" << std::endl; + // // std::cout << "table0" << table[132][0]; + + // } else { + // yacl::Buffer r = lctx->Recv(0, "table"); + // const uint128_t* buffer_data = r.data(); + // int k = 0; + // for (int i = 0; i < circ_->ng; i++) { + // for (int j = 0; j < 2; j++) { + // table[i][j] = buffer_data[k]; + // k++; + // } + // } + + // std::cout << "recvTable" << std::endl; + // // std::cout << "table0" << table[132][0]; + // } + + // // 计算方进行计算 按拓扑顺序进行计算 + // for (int i = 0; i < circ_->gates.size(); i++) { + // auto gate = circ_->gates[i]; + // switch (gate.op) { + // case yacl::io::BFCircuit::Op::XOR: { + // const auto& iw0 = wires_.operator[](gate.iw[0]); // 取到具体值 + // const auto& iw1 = wires_.operator[](gate.iw[1]); + // wires_[gate.ow[0]] = iw0 ^ iw1; + // break; + // } + // case yacl::io::BFCircuit::Op::AND: { + // const auto& iw0 = wires_.operator[](gate.iw[0]); + // const auto& iw1 = wires_.operator[](gate.iw[1]); + // wires_[gate.ow[0]] = EVAND(iw0, iw1, table[i], &mitccrh); + // break; + // } + // case yacl::io::BFCircuit::Op::INV: { + // const auto& iw0 = wires_.operator[](gate.iw[0]); + // wires_[gate.ow[0]] = iw0 ^ constant[1]; + // break; + // } + // case yacl::io::BFCircuit::Op::EQ: { + // wires_[gate.ow[0]] = gate.iw[0]; + // break; + // } + // case yacl::io::BFCircuit::Op::EQW: { + // const auto& iw0 = wires_.operator[](gate.iw[0]); + // wires_[gate.ow[0]] = iw0; + // break; + // } + // case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ + // YACL_THROW("Unimplemented MAND gate"); + // break; + // } + // default: + // YACL_THROW("Unknown Gate Type: {}", (int)gate.op); + // } + // } + + // // 识别输出线路 进行DE操作 + // // *********Finalize应该由谁来做,怎么做 + // size_t index = wires_.size(); + // int start = index - circ_->now[0]; + // if (FLAGS_rank == 1) { + // lctx->Send( + // 0, + // yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * + // 64), "output"); + // std::cout << "sendOutput" << std::endl; + // // std::cout << "output:" << wires_[index - 1] << std::endl; + + // } else { + // yacl::Buffer r = lctx->Recv(1, "output"); + // const uint128_t* buffer_data = r.data(); + + // memcpy(wires_.data() + start, buffer_data, sizeof(uint128_t) * 64); + // // for (int i = 0; i < circ_->niw[1]; i++) { + // // // gb_value[i] = send_out[i - 64][0]; + // // // wires_[i] = recv_out[i - 64]; + // // // if (send_out[i - 64][0] ^ delta == send_out[i - 64][1]) + // // // std::cout << true << std::endl; + + // // wires_[i + circ_->niw[0]] = + // // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); + // // } + // std::cout << "recvOutput" << std::endl; + // // std::cout << "output:" << wires_[index - 1] << std::endl; + // } + + // // 检查计算结果是否正确 + // // std::cout << inputs[0] << " " << inputs[1] << std::endl; + // if (FLAGS_rank == 1) { + // std::cout << "明文计算结果:"; + // if (operate == "adder64") { + // std::cout << input1 + input << std::endl; + // } else if (operate == "divide64") { + // std::cout << static_cast(input1) / static_cast(input) + // << std::endl; + // } else if (operate == "udivide64") { + // std::cout << input1 / input << std::endl; + // } else if (operate == "mult64") { + // std::cout << input1 * input << std::endl; + // } else if (operate == "neg64") { + // std::cout << -input1 << std::endl; + // } else if (operate == "sub64") { + // std::cout << input1 - input << std::endl; + // } else if (operate == "aes_128") { + // std::cout << Aes128(ReverseBytes(input1), ReverseBytes(input)) + // << std::endl; + // result[0] = ReverseBytes(result[0]); + // } else { + // std::cout << "else" << std::endl; + // } + // } else { + // finalize(absl::MakeSpan(result)); + // std::cout << "MPC结果:" << result[0] << std::endl; + // } + + // /* WHEN */ + // // PlainExecutor exec; + // // exec.LoadCircuitFile(io::BuiltinBFCircuit::Add64Path()); + // // exec.SetupInputs(absl::MakeSpan(inputs)); // En + // // exec.Exec(); + // // exec.Finalize(absl::MakeSpan(result)); + + // /* THEN 验证计算结果 */ + + // return 0; +} \ No newline at end of file From 7282279dd9fe8f8f1b0e7e8a537908c519f5c402 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Fri, 20 Dec 2024 15:26:10 +0800 Subject: [PATCH 13/27] update --- examples/gc/BUILD.bazel | 191 +++++++++++++++++++++++++++++++++------- examples/gc/mitccrh.h | 2 +- examples/gc/test.cc | 108 +++-------------------- 3 files changed, 168 insertions(+), 133 deletions(-) diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel index 9de8745f..91448a80 100644 --- a/examples/gc/BUILD.bazel +++ b/examples/gc/BUILD.bazel @@ -1,64 +1,95 @@ - - cc_library( name = "mitccrh", hdrs = [ "mitccrh.h", ], - deps = ["//yacl/crypto/aes:aes_opt", - ":utils", - "//yacl/crypto/tools:crhash"], - copts = ["-mavx","-maes","-mpclmul"] + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], + deps = [ + ":utils", + "//yacl/crypto/aes:aes_opt", + "//yacl/crypto/tools:crhash", + ], ) cc_binary( name = "test_ot", srcs = ["test_ot.cc"], deps = [ - "//yacl/kernel/algorithms:iknp_ote", "//yacl/crypto/rand", + "//yacl/kernel/algorithms:iknp_ote", "//yacl/link:test_util", ], ) - +cc_binary( + name = "gc_test_1", + srcs = ["gc_test_1.cc"], + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], + deps = [ + ":mitccrh", + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/crypto/rand", + "//yacl/crypto/tools:prg", + "//yacl/io/circuit:bristol_fashion", + "//yacl/io/stream:file_io", + "//yacl/kernel/algorithms:base_ot", + "//yacl/kernel/algorithms:iknp_ote", + "//yacl/link:test_util", + "//yacl/utils:circuit_executor", + ], +) cc_binary( name = "test", srcs = ["test.cc"], + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], + data = ["//yacl/io/circuit:circuit_data"], deps = [ - ":mitccrh", - "//yacl/base:byte_container_view", - "//yacl/base:dynamic_bitset", - "//yacl/io/stream:file_io", - "//yacl/crypto/rand:rand", - "//yacl/crypto/tools:prg", - "//yacl/io/circuit:bristol_fashion", - "//yacl/utils:circuit_executor", - "//yacl/kernel/algorithms:iknp_ote", - "//yacl/link:test_util", - "//yacl/kernel/algorithms:base_ot", - - ], - copts = ["-mavx","-maes","-mpclmul"] + ":mitccrh", + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/crypto/rand", + "//yacl/crypto/tools:prg", + "//yacl/io/circuit:bristol_fashion", + "//yacl/io/stream:file_io", + "//yacl/kernel/algorithms:base_ot", + "//yacl/kernel/algorithms:iknp_ote", + "//yacl/link:test_util", + "//yacl/utils:circuit_executor", + ], ) cc_binary( name = "sha256_", srcs = ["sha256.cc"], + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], deps = [ - ":mitccrh", - "//yacl/base:byte_container_view", - "//yacl/base:dynamic_bitset", - "//yacl/crypto/block_cipher:symmetric_crypto", - "//yacl/crypto/hash:hash_utils", - "//yacl/crypto/rand:rand", - "//yacl/io/circuit:bristol_fashion", - "//yacl/utils:circuit_executor", - - - ], - copts = ["-mavx","-maes","-mpclmul"] + ":mitccrh", + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/crypto/block_cipher:symmetric_crypto", + "//yacl/crypto/hash:hash_utils", + "//yacl/crypto/rand", + "//yacl/io/circuit:bristol_fashion", + "//yacl/utils:circuit_executor", + ], ) cc_library( @@ -66,4 +97,96 @@ cc_library( srcs = ["utils.cc"], hdrs = ["utils.h"], deps = [], +) + +cc_binary( + name = "Obj", + srcs = ["Obj.cc"], + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], + + deps = [ + + "//yacl/io/circuit:bristol_fashion", + + ], +) + +cc_library( + name = "garbler", + hdrs = [ + "garbler.h", + ], + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], + deps = [ + ":mitccrh", + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/crypto/rand", + "//yacl/crypto/tools:prg", + "//yacl/io/circuit:bristol_fashion", + "//yacl/io/stream:file_io", + "//yacl/kernel/algorithms:base_ot", + "//yacl/kernel/algorithms:iknp_ote", + "//yacl/link:test_util", + "//yacl/utils:circuit_executor", + ], +) + +cc_library( + name = "evaluator", + hdrs = [ + "evaluator.h", + ], + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], + deps = [ + ":mitccrh", + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/crypto/rand", + "//yacl/crypto/tools:prg", + "//yacl/io/circuit:bristol_fashion", + "//yacl/io/stream:file_io", + "//yacl/kernel/algorithms:base_ot", + "//yacl/kernel/algorithms:iknp_ote", + "//yacl/link:test_util", + "//yacl/utils:circuit_executor", + ], +) + +cc_binary( + name = "test_split", + srcs = ["test_split.cc"], + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], + data = ["//yacl/io/circuit:circuit_data"], + deps = [ + ":mitccrh", + ":garbler", + ":evaluator", + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/crypto/rand", + "//yacl/crypto/tools:prg", + "//yacl/io/circuit:bristol_fashion", + "//yacl/io/stream:file_io", + "//yacl/kernel/algorithms:base_ot", + "//yacl/kernel/algorithms:iknp_ote", + "//yacl/link:test_util", + "//yacl/utils:circuit_executor", + ], ) \ No newline at end of file diff --git a/examples/gc/mitccrh.h b/examples/gc/mitccrh.h index 094a206d..1181aba3 100644 --- a/examples/gc/mitccrh.h +++ b/examples/gc/mitccrh.h @@ -1,4 +1,4 @@ - +#pragma once #include #include "utils.h" diff --git a/examples/gc/test.cc b/examples/gc/test.cc index 5904aaab..fb3c870e 100644 --- a/examples/gc/test.cc +++ b/examples/gc/test.cc @@ -160,36 +160,15 @@ int main(int argc, char* argv[]) { auto lctx = yacl::link::FactoryBrpc().CreateContext( ctx_desc, FLAGS_rank); // yacl::link::test lctx->ConnectToMesh(); - // auto lctxs = link::test::SetupWorld(2); - - // const size_t num_ot = 5000; - // const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::Ferret; - // OtSendStore ot_send(num_ot, OtStoreType::Compact); // placeholder - // OtRecvStore ot_recv(num_ot, OtStoreType::Compact); // placeholder - // OtKernel kernel0(OtKernel::Role::Sender, ext_algorithm); - // OtKernel kernel1(OtKernel::Role::Receiver, ext_algorithm); - - // // WHEN - // auto sender = std::async([&] { - // kernel0.init(lctxs[0]); - // kernel0.eval_cot_random_choice(lctxs[0], num_ot, &ot_send); - // }); - // auto receiver = std::async([&] { - // kernel1.init(lctxs[1]); - // kernel1.eval_cot_random_choice(lctxs[1], num_ot, &ot_recv); - // }); - - // sender.get(); - // receiver.get(); - // std::cout << "OT delta :" << ot_send.GetDelta() << std::endl; // 参与方的设置,需要参照halfgate_gen/eva和sh_gen/eva 以下是一些用到的变量 // constant[2] 0为全局delta 1为not门用到的public label // 秘钥相关 mitch 秘钥初始化start_point, shared_prg - // const int kWorldSize = 2; - + // tmp[0]后续用作delta tmp[1]用作秘钥start_point uint128_t tmp[2]; + + // tmp和constant的发送可以放在setup里,专门写一个函数 if (FLAGS_rank == 0) { random_uint128_t(tmp, 2); lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 2), "tmp"); @@ -205,6 +184,7 @@ int main(int argc, char* argv[]) { uint128_t delta = tmp[0]; // 统一全局Delta uint128_t constant[3]; + if (FLAGS_rank == 0) { random_uint128_t(constant, 2); lctx->Send(1, yacl::ByteContainerView(constant, sizeof(uint128_t) * 3), @@ -266,7 +246,6 @@ int main(int argc, char* argv[]) { int num_of_input_wires = 0; for (size_t i = 0; i < circ_->niv; ++i) { num_of_input_wires += circ_->niw[i]; - // break; } // random_uint128_t(gb_value.data(), circ_->niw[0]); @@ -304,51 +283,19 @@ int main(int argc, char* argv[]) { input1 = *buffer_data; std::cout << "Input1OriginRecv:" << input1 << std::endl; } - // ************混淆方进行发送********* - /* ************暂时没看懂*********** */ - // 后64位 用OT evaluator 用iknpsendTable - // vector> send_blocks; - // vector recv_blocks(num_ot); - // dynamic_bitset choices(num_ot); - // for (int i = 64; i < 128; i++) { - // send_blocks.push_back({gb_value[i], gb_value[i] ^ delta}); - // choices.push_back(bi_val[i]); - // } - - // auto send = MakeOtSendStore(send_blocks); - // auto recv = MakeOtRecvStore(choices, recv_blocks); - - // auto lctxs = yacl::link::test::SetupWorld(kWorldSize); - // std::vector> send_out(num_ot); - // std::vector recv_out(num_ot); - // std::future sender = std::async([&] { - // IknpOtExtSend(lctxs[0], recv, absl::MakeSpan(send_out), false); - // }); // 发送到base_ot.recv - // std::future receiver = std::async([&] { - // IknpOtExtRecv(lctxs[1], send, choices, absl::MakeSpan(recv_out), - // false); // 从base_ot.send取 - // }); - // receiver.get(); - // sender.get(); - - /* ***********尝试使用base_OT*********** */ - - // auto contexts = link::test::SetupWorld(kWorldSize); + // ************混淆方进行发送********* int num_ot = 64; - UninitAlignedVector> send_blocks; - UninitAlignedVector recv_blocks(num_ot); + vector> send_blocks; + vector recv_blocks(num_ot); dynamic_bitset choices(num_ot); for (int i = 64; i < 128; i++) { send_blocks.push_back({gb_value[i], gb_value[i] ^ delta}); choices.push_back(bi_val[i]); } - std::future sender = - yacl::crypto::BaseOtSend(lctx[0], absl::MakeSpan(send_blocks)); - - std::future receiver = - yacl::crypto::BaseOtRecv(1, choices, absl::MakeSpan(recv_blocks)); + yacl::crypto::BaseOtSend(lctx, absl::MakeSpan(send_blocks)); + yacl::crypto::BaseOtRecv(lctx, bi_val, absl::MakeSpan(recv_blocks)); for (int i = 0; i < num_ot; i++) { if (send_blocks[i][choices[i]] != recv_blocks[i]) { @@ -357,42 +304,7 @@ int main(int argc, char* argv[]) { } } - // const int kWorldSize = 2; - // auto contexts = link::test::SetupWorld(kWorldSize); - - // int num_ot = 64; - - // // WHEN - - // auto sender = std::async([&] { return BaseOtSend(contexts[0], num_ot); }); - // auto receiver = - // std::async([&] { return BaseOtRecv(contexts[1], choices, num_ot); }); - // auto send_blocks = sender.get(); - // auto recv_blocks = receiver.get(); - if (operate != "neg64" && operate != "zero_equal") { - // const int kWorldSize = 2; - // int num_ot = 128; - - // auto lctxs = link::test::SetupWorld(kWorldSize); // setup network - // auto base_ot = MockCots(128, delta); // mock base ot - // dynamic_bitset choices; - // choices.append(inputs[1]); // 后64位全为0 - - // // WHEN - // std::vector> send_out(num_ot); - // std::vector recv_out(num_ot); - // std::future sender = std::async([&] { - // IknpOtExtSend(lctxs[0], base_ot.recv, absl::MakeSpan(send_out), false); - // }); // 发送到base_ot.recv - // std::future receiver = std::async([&] { - // IknpOtExtRecv(lctxs[1], base_ot.send, choices, - // absl::MakeSpan(recv_out), - // false); // 从base_ot.send取 - // }); - // receiver.get(); - // sender.get(); - // for (int i = circ_->niw[0]; i < circ_->niw[0] + circ_->niw[1]; i++) { // // gb_value[i] = send_out[i - 64][0]; // // wires_[i] = recv_out[i - 64]; @@ -601,4 +513,4 @@ int main(int argc, char* argv[]) { /* THEN 验证计算结果 */ return 0; -} \ No newline at end of file +} From 41a3b84e960a04d2370d48fd89524c9c5bffcbd7 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Wed, 25 Dec 2024 16:23:54 +0800 Subject: [PATCH 14/27] table not correct --- examples/gc/evaluator.h | 128 ++++++++++++++++++++---- examples/gc/garbler.h | 108 ++++++++++++++++++-- examples/gc/test_split.cc | 203 +++++++++----------------------------- 3 files changed, 253 insertions(+), 186 deletions(-) diff --git a/examples/gc/evaluator.h b/examples/gc/evaluator.h index 610f5b29..84d729da 100644 --- a/examples/gc/evaluator.h +++ b/examples/gc/evaluator.h @@ -35,7 +35,6 @@ uint128_t select_mask[2] = {0, all_one_uint128_t}; class Evaluator { public: - std::shared_ptr lctx; uint128_t delta; uint128_t inv_constant; uint128_t start_point; @@ -44,7 +43,8 @@ class Evaluator { std::vector wires_; std::vector gb_value; yacl::io::BFCircuit circ_; - + std::shared_ptr lctx; + uint128_t** table; uint64_t input; void setup() { @@ -58,8 +58,8 @@ class Evaluator { ctx_desc.parties.push_back({id, host}); } - auto lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, - 1); // yacl::link::test + lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, + 1); // yacl::link::test lctx->ConnectToMesh(); uint128_t tmp[3]; @@ -90,21 +90,115 @@ class Evaluator { // 接收garbler混淆值 yacl::Buffer r = lctx->Recv(0, "garbleInput1"); - cout << "lctx->Recv" << endl; + const uint128_t* buffer_data = r.data(); - cout << "const uint128_t* buffer_data = r.data();" << endl; + memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * 64); - cout << "memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * 64);" - << endl; + std::cout << "recvInput1" << std::endl; - // // 对evaluator自己的输入值进行混淆 - // r = lctx->Recv(0, "garbleInput2"); - // buffer_data = r.data(); - // for (int i = 0; i < circ_.niw[1]; i++) { - // wires_[i + circ_.niw[0]] = - // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); - // } - // std::cout << "recvInput2" << std::endl; + // 对evaluator自己的输入值进行混淆 + r = lctx->Recv(0, "garbleInput2"); + buffer_data = r.data(); + for (int i = 0; i < circ_.niw[1]; i++) { + wires_[i + circ_.niw[0]] = + buffer_data[i] ^ (select_mask[bi_val[i]] & delta); + } + std::cout << "recvInput2" << std::endl; + lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint64_t)), "Input1"); + } + void recvTable() { + table = new uint128_t*[circ_.ng]; + for (int i = 0; i < circ_.ng; ++i) { + table[i] = new uint128_t[2]; + } + + yacl::Buffer r = lctx->Recv(0, "table"); + const uint128_t* buffer_data = r.data(); + int k = 0; + for (int i = 0; i < circ_.ng; i++) { + for (int j = 0; j < 2; j++) { + table[i][j] = buffer_data[k]; + k++; + } + } + + std::cout << "recvTable" << std::endl; + cout << "table:"; + for(int i = 0; i < circ_.ng; i++){ + for(int j = 0; j < 2; j++){ + cout << table[i][j] << endl; + } + } + } + uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table, + MITCCRH<8>* mitccrh) { + uint128_t HA, HB, W; + int sa, sb; + + sa = getLSB(A); + sb = getLSB(B); + + uint128_t H[2]; + H[0] = A; + H[1] = B; + mitccrh->hash<2, 1>(H); + HA = H[0]; + HB = H[1]; + + W = HA ^ HB; + W = W ^ (select_mask[sa] & table[0]); + W = W ^ (select_mask[sb] & table[1]); + W = W ^ (select_mask[sb] & A); + return W; + } + + void EV() { + for (int i = 0; i < circ_.gates.size(); i++) { + auto gate = circ_.gates[i]; + switch (gate.op) { + case yacl::io::BFCircuit::Op::XOR: { + const auto& iw0 = wires_.operator[](gate.iw[0]); // 取到具体值 + const auto& iw1 = wires_.operator[](gate.iw[1]); + wires_[gate.ow[0]] = iw0 ^ iw1; + break; + } + case yacl::io::BFCircuit::Op::AND: { + const auto& iw0 = wires_.operator[](gate.iw[0]); + const auto& iw1 = wires_.operator[](gate.iw[1]); + wires_[gate.ow[0]] = EVAND(iw0, iw1, table[i], &mitccrh); + break; + } + case yacl::io::BFCircuit::Op::INV: { + const auto& iw0 = wires_.operator[](gate.iw[0]); + wires_[gate.ow[0]] = iw0 ^ inv_constant; + break; + } + case yacl::io::BFCircuit::Op::EQ: { + wires_[gate.ow[0]] = gate.iw[0]; + break; + } + case yacl::io::BFCircuit::Op::EQW: { + const auto& iw0 = wires_.operator[](gate.iw[0]); + wires_[gate.ow[0]] = iw0; + break; + } + case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ + YACL_THROW("Unimplemented MAND gate"); + break; + } + default: + YACL_THROW("Unknown Gate Type: {}", (int)gate.op); + } + } + } + void sendOutput() { + size_t index = wires_.size(); + int start = index - circ_.now[0]; + lctx->Send( + 0, + yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * 64), + "output"); + std::cout << "sendOutput" << std::endl; } -}; \ No newline at end of file +}; diff --git a/examples/gc/garbler.h b/examples/gc/garbler.h index 252db9dc..f8c9c762 100644 --- a/examples/gc/garbler.h +++ b/examples/gc/garbler.h @@ -42,8 +42,9 @@ class Garbler { std::vector wires_; std::vector gb_value; yacl::io::BFCircuit circ_; - + uint128_t** table; uint64_t input; + uint64_t input_EV; void setup() { // 通信环境初始化 @@ -57,8 +58,8 @@ class Garbler { } // 可以直接用Context - auto lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, - 0); // yacl::link::test + lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, + 0); // yacl::link::test lctx->ConnectToMesh(); // delta, inv_constant, start_point 初始化并发送给evaluator @@ -106,15 +107,18 @@ class Garbler { yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * 64), "garbleInput1"); - std::cout << "lctx->Send" << std::endl; - std::cout << "sendInput1" << std::endl; - // lctx->Send( - // 1, - // yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * - // 64), "garbleInput2"); - // std::cout << "sendInput2" << std::endl; + lctx->Send( + 1, + yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), + "garbleInput2"); + std::cout << "sendInput2" << std::endl; + + yacl::Buffer r = lctx->Recv(1, "Input1"); + + const uint64_t* buffer_data = r.data(); + input_EV = *buffer_data; } uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, @@ -151,4 +155,88 @@ class Garbler { W0 = W0 ^ (select_mask_[pb] & tmp); return W0; } + void GB() { + table = new uint128_t*[circ_.ng]; + for (int i = 0; i < circ_.ng; ++i) { + table[i] = new uint128_t[2]; + } + for (int i = 0; i < circ_.gates.size(); i++) { + auto gate = circ_.gates[i]; + switch (gate.op) { + case yacl::io::BFCircuit::Op::XOR: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 + const auto& iw1 = gb_value.operator[](gate.iw[1]); + gb_value[gate.ow[0]] = iw0 ^ iw1; + break; + } + case yacl::io::BFCircuit::Op::AND: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + const auto& iw1 = gb_value.operator[](gate.iw[1]); + gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, + delta, table[i], &mitccrh); + break; + } + case yacl::io::BFCircuit::Op::INV: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + gb_value[gate.ow[0]] = iw0 ^ inv_constant; + break; + } + case yacl::io::BFCircuit::Op::EQ: { + gb_value[gate.ow[0]] = gate.iw[0]; + break; + } + case yacl::io::BFCircuit::Op::EQW: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + gb_value[gate.ow[0]] = iw0; + break; + } + case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ + YACL_THROW("Unimplemented MAND gate"); + break; + } + default: + YACL_THROW("Unknown Gate Type: {}", (int)gate.op); + } + } + } + + void sendTable() { + lctx->Send(1, + yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_.ng), + "table"); + std::cout << "sendTable" << std::endl; + + + } + void decode() { + // 现接收计算结果 + size_t index = wires_.size(); + int start = index - circ_.now[0]; + + yacl::Buffer r = lctx->Recv(1, "output"); + const uint128_t* buffer_data = r.data(); + + memcpy(wires_.data() + start, buffer_data, sizeof(uint128_t) * 64); + std::cout << "recvOutput" << std::endl; + + // decode + std::vector result(1); + absl::Span outputs = absl::MakeSpan(result); + for (size_t i = 0; i < circ_.nov; ++i) { + yacl::dynamic_bitset result_block(circ_.now[i]); + for (size_t j = 0; j < circ_.now[i]; ++j) { + int wire_index = index - circ_.now[i] + j; + result_block[j] = + getLSB(wires_[wire_index]) ^ + getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 + // 对应的混淆电路计算为LSB ^ + // d 输出线路在后xx位 + } + // std::cout << "输出:" << result.data() << std::endl; + outputs[circ_.nov - i - 1] = *(uint128_t*)result_block.data(); + index -= circ_.now[i]; + } + std::cout << "MPC结果:" << result[0] << std::endl; + std::cout << "明文结果:" << input + input_EV << std::endl; + } }; \ No newline at end of file diff --git a/examples/gc/test_split.cc b/examples/gc/test_split.cc index 5a6050fb..7f47ae42 100644 --- a/examples/gc/test_split.cc +++ b/examples/gc/test_split.cc @@ -85,27 +85,27 @@ uint128_t ReverseBytes(uint128_t x) { // return W0; // } -// uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table, -// MITCCRH<8>* mitccrh) { -// uint128_t HA, HB, W; -// int sa, sb; - -// sa = getLSB(A); -// sb = getLSB(B); - -// uint128_t H[2]; -// H[0] = A; -// H[1] = B; -// mitccrh->hash<2, 1>(H); -// HA = H[0]; -// HB = H[1]; - -// W = HA ^ HB; -// W = W ^ (select_mask[sa] & table[0]); -// W = W ^ (select_mask[sb] & table[1]); -// W = W ^ (select_mask[sb] & A); -// return W; -// } +uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table, + MITCCRH<8>* mitccrh) { + uint128_t HA, HB, W; + int sa, sb; + + sa = getLSB(A); + sb = getLSB(B); + + uint128_t H[2]; + H[0] = A; + H[1] = B; + mitccrh->hash<2, 1>(H); + HA = H[0]; + HB = H[1]; + + W = HA ^ HB; + W = W ^ (select_mask[sa] & table[0]); + W = W ^ (select_mask[sb] & table[1]); + W = W ^ (select_mask[sb] & A); + return W; +} // template // void finalize(absl::Span outputs) { @@ -140,12 +140,16 @@ int main() { thread2.get(); // 电路读取 - std::string operate; - std::cin >> operate; + // std::string operate; + // cout << "输入进行的操作: "; + // std::cin >> operate; + // std::string pth = + // fmt::format("{0}/yacl/io/circuit/data/{1}.txt", + // std::filesystem::current_path().string(), operate); std::string pth = fmt::format("{0}/yacl/io/circuit/data/{1}.txt", - std::filesystem::current_path().string(), operate); + std::filesystem::current_path().string(), "adder64"); yacl::io::CircuitReader reader(pth); reader.ReadMeta(); reader.ReadAllGates(); @@ -157,137 +161,18 @@ int main() { thread1.get(); thread2.get(); - // for (int i = 0; i < circ_->gates.size(); i++) { - // auto gate = circ_->gates[i]; - // switch (gate.op) { - // case yacl::io::BFCircuit::Op::XOR: { - // const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 - // const auto& iw1 = gb_value.operator[](gate.iw[1]); - // gb_value[gate.ow[0]] = iw0 ^ iw1; - // break; - // } - // case yacl::io::BFCircuit::Op::AND: { - // const auto& iw0 = gb_value.operator[](gate.iw[0]); - // const auto& iw1 = gb_value.operator[](gate.iw[1]); - // gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, - // delta, - // table[i], &mitccrh); - // break; - // } - // case yacl::io::BFCircuit::Op::INV: { - // const auto& iw0 = gb_value.operator[](gate.iw[0]); - // gb_value[gate.ow[0]] = iw0 ^ constant[2]; - // break; - // } - // case yacl::io::BFCircuit::Op::EQ: { - // gb_value[gate.ow[0]] = gate.iw[0]; - // break; - // } - // case yacl::io::BFCircuit::Op::EQW: { - // const auto& iw0 = gb_value.operator[](gate.iw[0]); - // gb_value[gate.ow[0]] = iw0; - // break; - // } - // case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ - // YACL_THROW("Unimplemented MAND gate"); - // break; - // } - // default: - // YACL_THROW("Unknown Gate Type: {}", (int)gate.op); - // } - // } - - // // 发送混淆表 - // if (FLAGS_rank == 0) { - // lctx->Send( - // 1, yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_->ng), - // "table"); - // std::cout << "sendTable" << std::endl; - // // std::cout << "table0" << table[132][0]; + // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator + garbler->GB(); + garbler->sendTable(); - // } else { - // yacl::Buffer r = lctx->Recv(0, "table"); - // const uint128_t* buffer_data = r.data(); - // int k = 0; - // for (int i = 0; i < circ_->ng; i++) { - // for (int j = 0; j < 2; j++) { - // table[i][j] = buffer_data[k]; - // k++; - // } - // } - - // std::cout << "recvTable" << std::endl; - // // std::cout << "table0" << table[132][0]; - // } + evaluator->recvTable(); // // 计算方进行计算 按拓扑顺序进行计算 - // for (int i = 0; i < circ_->gates.size(); i++) { - // auto gate = circ_->gates[i]; - // switch (gate.op) { - // case yacl::io::BFCircuit::Op::XOR: { - // const auto& iw0 = wires_.operator[](gate.iw[0]); // 取到具体值 - // const auto& iw1 = wires_.operator[](gate.iw[1]); - // wires_[gate.ow[0]] = iw0 ^ iw1; - // break; - // } - // case yacl::io::BFCircuit::Op::AND: { - // const auto& iw0 = wires_.operator[](gate.iw[0]); - // const auto& iw1 = wires_.operator[](gate.iw[1]); - // wires_[gate.ow[0]] = EVAND(iw0, iw1, table[i], &mitccrh); - // break; - // } - // case yacl::io::BFCircuit::Op::INV: { - // const auto& iw0 = wires_.operator[](gate.iw[0]); - // wires_[gate.ow[0]] = iw0 ^ constant[1]; - // break; - // } - // case yacl::io::BFCircuit::Op::EQ: { - // wires_[gate.ow[0]] = gate.iw[0]; - // break; - // } - // case yacl::io::BFCircuit::Op::EQW: { - // const auto& iw0 = wires_.operator[](gate.iw[0]); - // wires_[gate.ow[0]] = iw0; - // break; - // } - // case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ - // YACL_THROW("Unimplemented MAND gate"); - // break; - // } - // default: - // YACL_THROW("Unknown Gate Type: {}", (int)gate.op); - // } - // } + evaluator->EV(); - // // 识别输出线路 进行DE操作 - // // *********Finalize应该由谁来做,怎么做 - // size_t index = wires_.size(); - // int start = index - circ_->now[0]; - // if (FLAGS_rank == 1) { - // lctx->Send( - // 0, - // yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * - // 64), "output"); - // std::cout << "sendOutput" << std::endl; - // // std::cout << "output:" << wires_[index - 1] << std::endl; - - // } else { - // yacl::Buffer r = lctx->Recv(1, "output"); - // const uint128_t* buffer_data = r.data(); - - // memcpy(wires_.data() + start, buffer_data, sizeof(uint128_t) * 64); - // // for (int i = 0; i < circ_->niw[1]; i++) { - // // // gb_value[i] = send_out[i - 64][0]; - // // // wires_[i] = recv_out[i - 64]; - // // // if (send_out[i - 64][0] ^ delta == send_out[i - 64][1]) - // // // std::cout << true << std::endl; - - // // wires_[i + circ_->niw[0]] = - // // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); - // // } - // std::cout << "recvOutput" << std::endl; - // // std::cout << "output:" << wires_[index - 1] << std::endl; - // } + // // evaluator发送计算结果 garbler进行DE操作 + evaluator->sendOutput(); + garbler->decode(); // // 检查计算结果是否正确 // // std::cout << inputs[0] << " " << inputs[1] << std::endl; @@ -318,14 +203,14 @@ int main() { // std::cout << "MPC结果:" << result[0] << std::endl; // } - // /* WHEN */ - // // PlainExecutor exec; - // // exec.LoadCircuitFile(io::BuiltinBFCircuit::Add64Path()); - // // exec.SetupInputs(absl::MakeSpan(inputs)); // En - // // exec.Exec(); - // // exec.Finalize(absl::MakeSpan(result)); + /* WHEN */ + // PlainExecutor exec; + // exec.LoadCircuitFile(io::BuiltinBFCircuit::Add64Path()); + // exec.SetupInputs(absl::MakeSpan(inputs)); // En + // exec.Exec(); + // exec.Finalize(absl::MakeSpan(result)); - // /* THEN 验证计算结果 */ + /* THEN 验证计算结果 */ - // return 0; + return 0; } \ No newline at end of file From d4b45930996482ac8a29e9790f1e9658625060d5 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Thu, 26 Dec 2024 19:40:35 +0800 Subject: [PATCH 15/27] wrong answer --- examples/gc/evaluator.h | 23 ++++++++++--------- examples/gc/garbler.h | 48 +++++++++++++++++++++++---------------- examples/gc/test_split.cc | 6 ++++- 3 files changed, 45 insertions(+), 32 deletions(-) diff --git a/examples/gc/evaluator.h b/examples/gc/evaluator.h index 84d729da..6ff50b58 100644 --- a/examples/gc/evaluator.h +++ b/examples/gc/evaluator.h @@ -44,7 +44,7 @@ class Evaluator { std::vector gb_value; yacl::io::BFCircuit circ_; std::shared_ptr lctx; - uint128_t** table; + uint128_t table[376][2]; uint64_t input; void setup() { @@ -103,15 +103,16 @@ class Evaluator { for (int i = 0; i < circ_.niw[1]; i++) { wires_[i + circ_.niw[0]] = buffer_data[i] ^ (select_mask[bi_val[i]] & delta); + } std::cout << "recvInput2" << std::endl; lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint64_t)), "Input1"); } void recvTable() { - table = new uint128_t*[circ_.ng]; - for (int i = 0; i < circ_.ng; ++i) { - table[i] = new uint128_t[2]; - } + // table = new uint128_t*[circ_.ng]; + // for (int i = 0; i < circ_.ng; ++i) { + // table[i] = new uint128_t[2]; + // } yacl::Buffer r = lctx->Recv(0, "table"); const uint128_t* buffer_data = r.data(); @@ -124,12 +125,12 @@ class Evaluator { } std::cout << "recvTable" << std::endl; - cout << "table:"; - for(int i = 0; i < circ_.ng; i++){ - for(int j = 0; j < 2; j++){ - cout << table[i][j] << endl; - } - } + // cout << "table:"; + // for(int i = 0; i < circ_.ng; i++){ + // for(int j = 0; j < 2; j++){ + // cout << table[i][j] << endl; + // } + // } } uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table, MITCCRH<8>* mitccrh) { diff --git a/examples/gc/garbler.h b/examples/gc/garbler.h index f8c9c762..df7d4dc6 100644 --- a/examples/gc/garbler.h +++ b/examples/gc/garbler.h @@ -42,7 +42,7 @@ class Garbler { std::vector wires_; std::vector gb_value; yacl::io::BFCircuit circ_; - uint128_t** table; + uint128_t table[376][2]; uint64_t input; uint64_t input_EV; @@ -98,6 +98,7 @@ class Garbler { // random_uint128_t(gb_value.data(), circ_.niw[0]); random_uint128_t(gb_value.data(), num_of_input_wires); + // 前64位 直接置换 garbler for (int i = 0; i < circ_.niw[0]; i++) { wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); @@ -156,10 +157,10 @@ class Garbler { return W0; } void GB() { - table = new uint128_t*[circ_.ng]; - for (int i = 0; i < circ_.ng; ++i) { - table[i] = new uint128_t[2]; - } + // table = new uint128_t*[circ_.ng]; + // for (int i = 0; i < circ_.ng; ++i) { + // table[i] = new uint128_t[2]; + // } for (int i = 0; i < circ_.gates.size(); i++) { auto gate = circ_.gates[i]; switch (gate.op) { @@ -221,22 +222,29 @@ class Garbler { // decode std::vector result(1); - absl::Span outputs = absl::MakeSpan(result); - for (size_t i = 0; i < circ_.nov; ++i) { - yacl::dynamic_bitset result_block(circ_.now[i]); - for (size_t j = 0; j < circ_.now[i]; ++j) { - int wire_index = index - circ_.now[i] + j; - result_block[j] = - getLSB(wires_[wire_index]) ^ - getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 - // 对应的混淆电路计算为LSB ^ - // d 输出线路在后xx位 - } - // std::cout << "输出:" << result.data() << std::endl; - outputs[circ_.nov - i - 1] = *(uint128_t*)result_block.data(); - index -= circ_.now[i]; - } + finalize(absl::MakeSpan(result)); std::cout << "MPC结果:" << result[0] << std::endl; std::cout << "明文结果:" << input + input_EV << std::endl; } + template +void finalize(absl::Span outputs) { + // YACL_ENFORCE(outputs.size() >= circ_->nov); + + size_t index = wires_.size(); + + for (size_t i = 0; i < circ_.nov; ++i) { + yacl::dynamic_bitset result(circ_.now[i]); + for (size_t j = 0; j < circ_.now[i]; ++j) { + int wire_index = index - circ_.now[i] + j; + result[j] = getLSB(wires_[wire_index]) ^ + getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 + // 对应的混淆电路计算为LSB ^ d + // 输出线路在后xx位 + } + // std::cout << "输出:" << result.data() << std::endl; + outputs[circ_.nov - i - 1] = *(T*)result.data(); + index -= circ_.now[i]; + } +} + }; \ No newline at end of file diff --git a/examples/gc/test_split.cc b/examples/gc/test_split.cc index 7f47ae42..b33e8108 100644 --- a/examples/gc/test_split.cc +++ b/examples/gc/test_split.cc @@ -138,7 +138,7 @@ int main() { std::future thread2 = std::async([&] { evaluator->setup(); }); thread1.get(); thread2.get(); - + // 电路读取 // std::string operate; // cout << "输入进行的操作: "; @@ -160,19 +160,23 @@ int main() { thread2 = std::async([&] { evaluator->inputProcess(*circ_); }); thread1.get(); thread2.get(); + // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator garbler->GB(); garbler->sendTable(); evaluator->recvTable(); + // // 计算方进行计算 按拓扑顺序进行计算 evaluator->EV(); // // evaluator发送计算结果 garbler进行DE操作 evaluator->sendOutput(); + garbler->decode(); + // // 检查计算结果是否正确 // // std::cout << inputs[0] << " " << inputs[1] << std::endl; From 696a1276452ebcf60d477f221882b3476f16497a Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Fri, 3 Jan 2025 16:49:44 +0800 Subject: [PATCH 16/27] bug solved --- examples/gc/BUILD.bazel | 36 ++++++++++ examples/gc/evaluator.h | 42 +++++++++-- examples/gc/garbler.h | 38 +++++++--- examples/gc/rot_test.cc | 147 ++++++++++++++++++++++++++++++++++++++ examples/gc/test_split.cc | 147 ++------------------------------------ 5 files changed, 253 insertions(+), 157 deletions(-) create mode 100644 examples/gc/rot_test.cc diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel index 91448a80..05949273 100644 --- a/examples/gc/BUILD.bazel +++ b/examples/gc/BUILD.bazel @@ -137,6 +137,8 @@ cc_library( "//yacl/kernel/algorithms:iknp_ote", "//yacl/link:test_util", "//yacl/utils:circuit_executor", + "//yacl/kernel:ot_kernel", + "//yacl/kernel/type:ot_store_utils", ], ) @@ -162,6 +164,8 @@ cc_library( "//yacl/kernel/algorithms:iknp_ote", "//yacl/link:test_util", "//yacl/utils:circuit_executor", + "//yacl/kernel:ot_kernel", + "//yacl/kernel/type:ot_store_utils", ], ) @@ -188,5 +192,37 @@ cc_binary( "//yacl/kernel/algorithms:iknp_ote", "//yacl/link:test_util", "//yacl/utils:circuit_executor", + "//yacl/kernel:ot_kernel", + "//yacl/kernel/type:ot_store_utils", + ], +) + +cc_binary( + name = "rot_test", + srcs = ["rot_test.cc"], + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], + deps = [ + ":mitccrh", + ":garbler", + ":evaluator", + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/crypto/rand", + "//yacl/crypto/tools:prg", + "//yacl/io/circuit:bristol_fashion", + "//yacl/io/stream:file_io", + "//yacl/kernel/algorithms:base_ot", + "//yacl/kernel/algorithms:iknp_ote", + + "//yacl/utils:circuit_executor", + + "//yacl/kernel/type:ot_store_utils", + "//yacl/link:test_util", + "//yacl/kernel:ot_kernel" + ], ) \ No newline at end of file diff --git a/examples/gc/evaluator.h b/examples/gc/evaluator.h index 6ff50b58..140f58f4 100644 --- a/examples/gc/evaluator.h +++ b/examples/gc/evaluator.h @@ -23,9 +23,12 @@ #include "yacl/link/factory.h" #include "yacl/link/test_util.h" #include "yacl/utils/circuit_executor.h" +#include "yacl/kernel/ot_kernel.h" +#include "yacl/kernel/type/ot_store_utils.h" using namespace std; using namespace yacl; +using namespace yacl::crypto; namespace { using uint128_t = __uint128_t; } @@ -47,6 +50,9 @@ class Evaluator { uint128_t table[376][2]; uint64_t input; + const int num_ot = 64; + yacl::crypto::OtRecvStore ot_recv = OtRecvStore(num_ot, yacl::crypto::OtStoreType::Normal); + void setup() { // 通信环境初始化 size_t world_size = 2; @@ -62,6 +68,12 @@ class Evaluator { 1); // yacl::link::test lctx->ConnectToMesh(); + //OT on-line + const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; + yacl::crypto::OtKernel kernel1(yacl::crypto::OtKernel::Role::Receiver, ext_algorithm); + kernel1.init(lctx); + kernel1.eval_rot(lctx, num_ot, &ot_recv); + uint128_t tmp[3]; // delta, inv_constant, start_point 接收 yacl::Buffer r = lctx->Recv(0, "tmp"); @@ -83,11 +95,11 @@ class Evaluator { wires_.resize(circ_.nw); yacl::dynamic_bitset bi_val; - bi_val.append(input); // 直接转换为二进制 输入线路在前64位 + input = yacl::crypto::FastRandU64(); std::cout << "input of evaluator:" << input << std::endl; - +bi_val.append(input); // 直接转换为二进制 输入线路在前64位 // 接收garbler混淆值 yacl::Buffer r = lctx->Recv(0, "garbleInput1"); @@ -98,6 +110,7 @@ class Evaluator { std::cout << "recvInput1" << std::endl; // 对evaluator自己的输入值进行混淆 + r = lctx->Recv(0, "garbleInput2"); buffer_data = r.data(); for (int i = 0; i < circ_.niw[1]; i++) { @@ -106,6 +119,9 @@ class Evaluator { } std::cout << "recvInput2" << std::endl; + + onLineOT(); + lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint64_t)), "Input1"); } void recvTable() { @@ -132,8 +148,8 @@ class Evaluator { // } // } } - uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table, - MITCCRH<8>* mitccrh) { + uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, + MITCCRH<8>* mitccrh_pointer) { uint128_t HA, HB, W; int sa, sb; @@ -143,13 +159,13 @@ class Evaluator { uint128_t H[2]; H[0] = A; H[1] = B; - mitccrh->hash<2, 1>(H); + mitccrh_pointer->hash<2, 1>(H); HA = H[0]; HB = H[1]; W = HA ^ HB; - W = W ^ (select_mask[sa] & table[0]); - W = W ^ (select_mask[sb] & table[1]); + W = W ^ (select_mask[sa] & table_item[0]); + W = W ^ (select_mask[sb] & table_item[1]); W = W ^ (select_mask[sb] & A); return W; } @@ -202,4 +218,16 @@ class Evaluator { "output"); std::cout << "sendOutput" << std::endl; } + void onLineOT(){ + yacl::dynamic_bitset d_choice; + yacl::dynamic_bitset choice; + choice.append(input); + + for(int i = 0; i < 64; i++){ + int a = ot_recv.GetChoice(i); + d_choice[i] = a ^ choice[i]; + } + // cout << "大小" << sizeof(d_choice) << endl; + // lctx->Send(0, yacl::ByteContainerView(&d_choice, sizeof(uint64_t)), "d_choice"); + } }; diff --git a/examples/gc/garbler.h b/examples/gc/garbler.h index df7d4dc6..2f295850 100644 --- a/examples/gc/garbler.h +++ b/examples/gc/garbler.h @@ -23,7 +23,8 @@ #include "yacl/link/factory.h" #include "yacl/link/test_util.h" #include "yacl/utils/circuit_executor.h" - +#include "yacl/kernel/ot_kernel.h" +#include "yacl/kernel/type/ot_store_utils.h" using namespace std; using namespace yacl; namespace { @@ -46,6 +47,10 @@ class Garbler { uint64_t input; uint64_t input_EV; + const int num_ot = 64; + yacl::crypto::OtSendStore ot_send = OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); + + void setup() { // 通信环境初始化 size_t world_size = 2; @@ -62,6 +67,12 @@ class Garbler { 0); // yacl::link::test lctx->ConnectToMesh(); + //OT off-line + const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; + yacl::crypto::OtKernel kernel0(yacl::crypto::OtKernel::Role::Sender, ext_algorithm); + kernel0.init(lctx); + kernel0.eval_rot(lctx, num_ot, &ot_send); + // delta, inv_constant, start_point 初始化并发送给evaluator uint128_t tmp[3]; @@ -120,10 +131,12 @@ class Garbler { const uint64_t* buffer_data = r.data(); input_EV = *buffer_data; + + onlineOT(); } uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, - uint128_t delta, uint128_t* table, MITCCRH<8>* mitccrh) { + uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { bool pa = getLSB(LA0); bool pb = getLSB(LB0); @@ -136,25 +149,26 @@ class Garbler { H[2] = LB0; H[3] = B1; - mitccrh->hash<2, 2>(H); + mitccrh_pointer->hash<2, 2>(H); HLA0 = H[0]; HA1 = H[1]; HLB0 = H[2]; HB1 = H[3]; - table[0] = HLA0 ^ HA1; - table[0] = table[0] ^ (select_mask_[pb] & delta); + table_item[0] = HLA0 ^ HA1; + table_item[0] = table_item[0] ^ (select_mask_[pb] & delta); W0 = HLA0; - W0 = W0 ^ (select_mask_[pa] & table[0]); + W0 = W0 ^ (select_mask_[pa] & table_item[0]); tmp = HLB0 ^ HB1; - table[1] = tmp ^ LA0; + table_item[1] = tmp ^ LA0; W0 = W0 ^ HLB0; W0 = W0 ^ (select_mask_[pb] & tmp); return W0; + } void GB() { // table = new uint128_t*[circ_.ng]; @@ -174,7 +188,7 @@ class Garbler { const auto& iw0 = gb_value.operator[](gate.iw[0]); const auto& iw1 = gb_value.operator[](gate.iw[1]); gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, - delta, table[i], &mitccrh); + table[i], &mitccrh); break; } case yacl::io::BFCircuit::Op::INV: { @@ -246,5 +260,13 @@ void finalize(absl::Span outputs) { index -= circ_.now[i]; } } +void onlineOT(){ + yacl::dynamic_bitset d_choice; + // yacl::Buffer r = lctx->Recv(1, "d_choice"); + + // const uint64_t* buffer_data = r.data(); + // // d_choice = *buffer_data; + // cout << "d_choice" <<*buffer_data << endl; +} }; \ No newline at end of file diff --git a/examples/gc/rot_test.cc b/examples/gc/rot_test.cc new file mode 100644 index 00000000..c1384b9c --- /dev/null +++ b/examples/gc/rot_test.cc @@ -0,0 +1,147 @@ +#pragma once +#include "yacl/kernel/type/ot_store_utils.h" +#include "yacl/link/test_util.h" +#include +#include +#include "yacl/kernel/ot_kernel.h" + + +using namespace std; +using namespace yacl; +using namespace yacl::crypto; + +using OtMsg = uint128_t; +using OtMsgPair = std::array; +using OtChoices = dynamic_bitset; + +constexpr uint32_t kBatchSize = 128; + + +// Conversion from cot to rot (OtStoreType == Normal) +void naive_rot2ot( + const std::shared_ptr& lctx, + const OtSendStore& ot_store, absl::Span msgpairs) { + static_assert(kBatchSize % 128 == 0); // batch size should be multiple of 128 + YACL_ENFORCE(ot_store.Type() == OtStoreType::Normal); + YACL_ENFORCE(ot_store.Size() == msgpairs.size()); + const uint32_t ot_num = msgpairs.size(); + const uint32_t batch_num = (ot_num + kBatchSize - 1) / kBatchSize; + + dynamic_bitset masked_choices(ot_num); + auto buf = lctx->Recv(lctx->NextRank(), ""); + std::memcpy(masked_choices.data(), buf.data(), buf.size()); + + // for each batch + for (uint32_t i = 0; i < batch_num; ++i) { + const uint32_t limit = std::min(kBatchSize, ot_num - i * kBatchSize); + + // generate masks for all msg pairs + std::vector batch_send(limit); + for (uint32_t j = 0; j < limit; ++j) { + auto idx = i * kBatchSize + j; + // fmt::print("{} {}\n", idx, masked_choices.size()); + + if (!masked_choices[idx]) { + batch_send[j][0] = ot_store.GetBlock(idx, 0) ^ msgpairs[idx][0]; + batch_send[j][1] = ot_store.GetBlock(idx, 1) ^ msgpairs[idx][1]; + } else { + batch_send[j][0] = ot_store.GetBlock(idx, 1) ^ msgpairs[idx][0]; + batch_send[j][1] = ot_store.GetBlock(idx, 0) ^ msgpairs[idx][1]; + } + } + + lctx->SendAsync( + lctx->NextRank(), + ByteContainerView(batch_send.data(), sizeof(uint128_t) * limit * 2), + ""); + } +} + +void naive_rot2ot_recv( + const std::shared_ptr& lctx, + const OtRecvStore& ot_store, const OtChoices& choices, + absl::Span out) { + static_assert(kBatchSize % 128 == 0); // batch size should be multiple of 128 + YACL_ENFORCE(ot_store.Type() == OtStoreType::Normal); + YACL_ENFORCE(ot_store.Size() == choices.size()); + const uint32_t ot_num = ot_store.Size(); + const uint32_t batch_num = (ot_num + kBatchSize - 1) / kBatchSize; + + auto masked_choice = ot_store.CopyBitBuf() ^ choices; + lctx->SendAsync( + lctx->NextRank(), + ByteContainerView(masked_choice.data(), + sizeof(uint128_t) * masked_choice.num_blocks()), + "Sending masked choices"); + + // for each batch + for (uint32_t i = 0; i < batch_num; ++i) { + const uint32_t limit = std::min(kBatchSize, ot_num - i * kBatchSize); + + // receive masked messages + auto buf = lctx->Recv(lctx->NextRank(), ""); + std::vector batch_recv(limit); + std::memcpy(batch_recv.data(), buf.data(), buf.size()); + + for (uint32_t j = 0; j < limit; ++j) { + auto idx = i * kBatchSize + j; + // fmt::print("{} {}\n", idx, choices.size()); + out[idx] = batch_recv[j][choices[idx]] ^ ot_store.GetBlock(idx); + } + } +} + +int main(){ + + auto lctxs = link::test::SetupWorld(2); + + const size_t num_ot = 1; + const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; + + yacl::crypto::OtSendStore ot_send(num_ot, yacl::crypto::OtStoreType::Normal); // placeholder + yacl::crypto::OtRecvStore ot_recv(num_ot, yacl::crypto::OtStoreType::Normal); // placeholder + + yacl::crypto::OtKernel kernel0(yacl::crypto::OtKernel::Role::Sender, ext_algorithm); + yacl::crypto::OtKernel kernel1(yacl::crypto::OtKernel::Role::Receiver, ext_algorithm); + + // WHEN + auto sender = std::async([&] { + kernel0.init(lctxs[0]); + kernel0.eval_rot(lctxs[0], num_ot, &ot_send); + }); + auto receiver = std::async([&] { + kernel1.init(lctxs[1]); + kernel1.eval_rot(lctxs[1], num_ot, &ot_recv); + }); + sender.get(); + receiver.get(); + + cout << "$: "; + for(int i = 0; i < num_ot; i++){ + cout << ot_send.GetBlock(i, ot_recv.GetChoice(i)) <<" " << ot_send.GetBlock(i, ot_recv.GetChoice(i))<< " " << ot_recv.GetBlock(i) << endl; + } + + + + vector> msgPairs(1); + msgPairs[0][0] = yacl::crypto::FastRandU128(); + msgPairs[0][1] = yacl::crypto::FastRandU128(); + + cout << "Msg: "; + cout << msgPairs[0][0] << " " << msgPairs[0][1] << endl; + + int choice = 0; + + int d = choice ^ ot_recv.GetChoice(0); + + uint128_t x0 = ot_send.GetBlock(0, d) ^ msgPairs[0][0]; + uint128_t x1 = ot_send.GetBlock(0, d ^ 1) ^ msgPairs[0][1]; + + uint128_t result = x0 ^ ot_send.GetBlock(0, ot_recv.GetChoice(0)); + + cout << result; + + + + return 0; +} \ No newline at end of file diff --git a/examples/gc/test_split.cc b/examples/gc/test_split.cc index b33e8108..fcbf729b 100644 --- a/examples/gc/test_split.cc +++ b/examples/gc/test_split.cc @@ -9,29 +9,19 @@ #include "examples/gc/evaluator.h" #include "examples/gc/garbler.h" #include "fmt/format.h" +#include "yacl/kernel/ot_kernel.h" +#include "yacl/kernel/type/ot_store_utils.h" using namespace std; using namespace yacl; +using namespace yacl::crypto; namespace { using uint128_t = __uint128_t; } std::shared_ptr circ_; -std::vector wires_; -std::vector gb_value; -// enum class Op { -// adder64, √ -// aes_128, √ -// divide64, √ -// mult2_64, -// mult64, √ -// neg64, √ -// sha256, -// sub64, √ -// udivide64, √ -// zero_equal √ -// } + inline uint128_t Aes128(uint128_t k, uint128_t m) { yacl::crypto::SymmetricCrypto enc( @@ -39,96 +29,6 @@ inline uint128_t Aes128(uint128_t k, uint128_t m) { return enc.Encrypt(m); } -uint128_t ReverseBytes(uint128_t x) { - auto byte_view = yacl::ByteContainerView(&x, sizeof(x)); - uint128_t ret = 0; - auto buf = std::vector(sizeof(ret)); - for (size_t i = 0; i < byte_view.size(); ++i) { - buf[byte_view.size() - i - 1] = byte_view[i]; - } - std::memcpy(&ret, buf.data(), buf.size()); - return ret; -} - -// uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, -// uint128_t delta, uint128_t* table, MITCCRH<8>* mitccrh) { -// bool pa = getLSB(LA0); -// bool pb = getLSB(LB0); - -// uint128_t HLA0, HA1, HLB0, HB1; -// uint128_t tmp, W0; -// uint128_t H[4]; - -// H[0] = LA0; -// H[1] = A1; -// H[2] = LB0; -// H[3] = B1; - -// mitccrh->hash<2, 2>(H); - -// HLA0 = H[0]; -// HA1 = H[1]; -// HLB0 = H[2]; -// HB1 = H[3]; - -// table[0] = HLA0 ^ HA1; -// table[0] = table[0] ^ (select_mask[pb] & delta); - -// W0 = HLA0; -// W0 = W0 ^ (select_mask[pa] & table[0]); - -// tmp = HLB0 ^ HB1; -// table[1] = tmp ^ LA0; - -// W0 = W0 ^ HLB0; -// W0 = W0 ^ (select_mask[pb] & tmp); -// return W0; -// } - -uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table, - MITCCRH<8>* mitccrh) { - uint128_t HA, HB, W; - int sa, sb; - - sa = getLSB(A); - sb = getLSB(B); - - uint128_t H[2]; - H[0] = A; - H[1] = B; - mitccrh->hash<2, 1>(H); - HA = H[0]; - HB = H[1]; - - W = HA ^ HB; - W = W ^ (select_mask[sa] & table[0]); - W = W ^ (select_mask[sb] & table[1]); - W = W ^ (select_mask[sb] & A); - return W; -} - -// template -// void finalize(absl::Span outputs) { -// // YACL_ENFORCE(outputs.size() >= circ_->nov); - -// size_t index = wires_.size(); - -// for (size_t i = 0; i < circ_->nov; ++i) { -// yacl::dynamic_bitset result(circ_->now[i]); -// for (size_t j = 0; j < circ_->now[i]; ++j) { -// int wire_index = index - circ_->now[i] + j; -// result[j] = getLSB(wires_[wire_index]) ^ -// getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 -// // 对应的混淆电路计算为LSB ^ -// d -// // 输出线路在后xx位 -// } -// // std::cout << "输出:" << result.data() << std::endl; -// outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); -// index -= circ_->now[i]; -// } -// } - int main() { // 初始化 Garbler* garbler = new Garbler(); @@ -138,6 +38,7 @@ int main() { std::future thread2 = std::async([&] { evaluator->setup(); }); thread1.get(); thread2.get(); + cout << "ROT:" << garbler -> ot_send.GetBlock(3, evaluator->ot_recv.GetChoice(3)) <<" " << evaluator->ot_recv.GetBlock(3) << endl; // 电路读取 // std::string operate; @@ -178,43 +79,5 @@ int main() { garbler->decode(); - // // 检查计算结果是否正确 - // // std::cout << inputs[0] << " " << inputs[1] << std::endl; - // if (FLAGS_rank == 1) { - // std::cout << "明文计算结果:"; - // if (operate == "adder64") { - // std::cout << input1 + input << std::endl; - // } else if (operate == "divide64") { - // std::cout << static_cast(input1) / static_cast(input) - // << std::endl; - // } else if (operate == "udivide64") { - // std::cout << input1 / input << std::endl; - // } else if (operate == "mult64") { - // std::cout << input1 * input << std::endl; - // } else if (operate == "neg64") { - // std::cout << -input1 << std::endl; - // } else if (operate == "sub64") { - // std::cout << input1 - input << std::endl; - // } else if (operate == "aes_128") { - // std::cout << Aes128(ReverseBytes(input1), ReverseBytes(input)) - // << std::endl; - // result[0] = ReverseBytes(result[0]); - // } else { - // std::cout << "else" << std::endl; - // } - // } else { - // finalize(absl::MakeSpan(result)); - // std::cout << "MPC结果:" << result[0] << std::endl; - // } - - /* WHEN */ - // PlainExecutor exec; - // exec.LoadCircuitFile(io::BuiltinBFCircuit::Add64Path()); - // exec.SetupInputs(absl::MakeSpan(inputs)); // En - // exec.Exec(); - // exec.Finalize(absl::MakeSpan(result)); - - /* THEN 验证计算结果 */ - return 0; } \ No newline at end of file From 623fa9f2581d4b772098052a18acfcb4a524e842 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Fri, 10 Jan 2025 15:28:02 +0800 Subject: [PATCH 17/27] code reconstruct add64 --- examples/gc/BUILD.bazel | 6 --- examples/gc/evaluator.h | 64 +++++++++++++------------- examples/gc/garbler.h | 94 +++++++++++++++++++++++---------------- examples/gc/test_split.cc | 18 ++++---- 4 files changed, 94 insertions(+), 88 deletions(-) diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel index 05949273..dc78c597 100644 --- a/examples/gc/BUILD.bazel +++ b/examples/gc/BUILD.bazel @@ -107,11 +107,8 @@ cc_binary( "-maes", "-mpclmul", ], - deps = [ - "//yacl/io/circuit:bristol_fashion", - ], ) @@ -217,12 +214,9 @@ cc_binary( "//yacl/io/stream:file_io", "//yacl/kernel/algorithms:base_ot", "//yacl/kernel/algorithms:iknp_ote", - "//yacl/utils:circuit_executor", - "//yacl/kernel/type:ot_store_utils", "//yacl/link:test_util", "//yacl/kernel:ot_kernel" - ], ) \ No newline at end of file diff --git a/examples/gc/evaluator.h b/examples/gc/evaluator.h index 140f58f4..7584a354 100644 --- a/examples/gc/evaluator.h +++ b/examples/gc/evaluator.h @@ -4,7 +4,6 @@ #include #include -// #include "absl/std::strings/escaping.h" #include "absl/types/span.h" #include "examples/gc/mitccrh.h" #include "fmt/format.h" @@ -17,7 +16,6 @@ #include "yacl/io/stream/file_io.h" #include "yacl/kernel/algorithms/base_ot.h" #include "yacl/kernel/algorithms/iknp_ote.h" -// #include "yacl/kernel/ot_kernel.h" #include "yacl/kernel/type/ot_store_utils.h" #include "yacl/link/context.h" #include "yacl/link/factory.h" @@ -31,6 +29,9 @@ using namespace yacl; using namespace yacl::crypto; namespace { using uint128_t = __uint128_t; +using OtMsg = uint128_t; +using OtMsgPair = std::array; +using OtChoices = dynamic_bitset; } uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); @@ -65,10 +66,10 @@ class Evaluator { } lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, - 1); // yacl::link::test + 1); lctx->ConnectToMesh(); - //OT on-line + //OT off-line const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; yacl::crypto::OtKernel kernel1(yacl::crypto::OtKernel::Role::Receiver, ext_algorithm); kernel1.init(lctx); @@ -99,7 +100,7 @@ class Evaluator { input = yacl::crypto::FastRandU64(); std::cout << "input of evaluator:" << input << std::endl; -bi_val.append(input); // 直接转换为二进制 输入线路在前64位 + bi_val.append(input); // 直接转换为二进制 输入线路在前64位 // 接收garbler混淆值 yacl::Buffer r = lctx->Recv(0, "garbleInput1"); @@ -110,25 +111,20 @@ bi_val.append(input); // 直接转换为二进制 输入线路在前64位 std::cout << "recvInput1" << std::endl; // 对evaluator自己的输入值进行混淆 - - r = lctx->Recv(0, "garbleInput2"); - buffer_data = r.data(); - for (int i = 0; i < circ_.niw[1]; i++) { - wires_[i + circ_.niw[0]] = - buffer_data[i] ^ (select_mask[bi_val[i]] & delta); + // r = lctx->Recv(0, "garbleInput2"); + // buffer_data = r.data(); + // for (int i = 0; i < circ_.niw[1]; i++) { + // wires_[i + circ_.niw[0]] = + // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); - } - std::cout << "recvInput2" << std::endl; + // } + // std::cout << "recvInput2" << std::endl; - onLineOT(); + // onLineOT(); lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint64_t)), "Input1"); } void recvTable() { - // table = new uint128_t*[circ_.ng]; - // for (int i = 0; i < circ_.ng; ++i) { - // table[i] = new uint128_t[2]; - // } yacl::Buffer r = lctx->Recv(0, "table"); const uint128_t* buffer_data = r.data(); @@ -141,12 +137,7 @@ bi_val.append(input); // 直接转换为二进制 输入线路在前64位 } std::cout << "recvTable" << std::endl; - // cout << "table:"; - // for(int i = 0; i < circ_.ng; i++){ - // for(int j = 0; j < 2; j++){ - // cout << table[i][j] << endl; - // } - // } + } uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { @@ -219,15 +210,22 @@ bi_val.append(input); // 直接转换为二进制 输入线路在前64位 std::cout << "sendOutput" << std::endl; } void onLineOT(){ - yacl::dynamic_bitset d_choice; - yacl::dynamic_bitset choice; - choice.append(input); - - for(int i = 0; i < 64; i++){ - int a = ot_recv.GetChoice(i); - d_choice[i] = a ^ choice[i]; + + yacl::dynamic_bitset choices; + choices.append(input); + + yacl::dynamic_bitset ot = ot_recv.CopyBitBuf(); + ot.resize(choices.size()); + + yacl::dynamic_bitset masked_choices = ot ^ choices; + lctx->Send(0, yacl::ByteContainerView(masked_choices.data(), sizeof(uint128_t)), "masked_choice"); + + auto buf = lctx->Recv(lctx->NextRank(), ""); + std::vector batch_recv(64); + std::memcpy(batch_recv.data(), buf.data(), buf.size()); + for (uint32_t j = 0; j < 64; ++j) { + auto idx = 64 + j; + wires_[idx] = batch_recv[j][choices[j]] ^ ot_recv.GetBlock(j); } - // cout << "大小" << sizeof(d_choice) << endl; - // lctx->Send(0, yacl::ByteContainerView(&d_choice, sizeof(uint64_t)), "d_choice"); } }; diff --git a/examples/gc/garbler.h b/examples/gc/garbler.h index 2f295850..1302c274 100644 --- a/examples/gc/garbler.h +++ b/examples/gc/garbler.h @@ -4,7 +4,6 @@ #include #include -// #include "absl/std::strings/escaping.h" #include "absl/types/span.h" #include "examples/gc/mitccrh.h" #include "fmt/format.h" @@ -17,7 +16,6 @@ #include "yacl/io/stream/file_io.h" #include "yacl/kernel/algorithms/base_ot.h" #include "yacl/kernel/algorithms/iknp_ote.h" -// #include "yacl/kernel/ot_kernel.h" #include "yacl/kernel/type/ot_store_utils.h" #include "yacl/link/context.h" #include "yacl/link/factory.h" @@ -29,6 +27,9 @@ using namespace std; using namespace yacl; namespace { using uint128_t = __uint128_t; +using OtMsg = uint128_t; +using OtMsgPair = std::array; +using OtChoices = dynamic_bitset; } uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); uint128_t select_mask_[2] = {0, all_one_uint128_t_}; @@ -62,9 +63,9 @@ class Garbler { ctx_desc.parties.push_back({id, host}); } - // 可以直接用Context + lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, - 0); // yacl::link::test + 0); lctx->ConnectToMesh(); //OT off-line @@ -89,7 +90,7 @@ class Garbler { mitccrh.setS(start_point); } - // 包扩 输入值生成和混淆,并将双方混淆值发送给对方 + // 包扩 输入值生成和混淆,garbler混淆值的发送 void inputProcess(yacl::io::BFCircuit param_circ_) { circ_ = param_circ_; gb_value.resize(circ_.nw); @@ -106,7 +107,7 @@ class Garbler { for (size_t i = 0; i < circ_.niv; ++i) { num_of_input_wires += circ_.niw[i]; } - // random_uint128_t(gb_value.data(), circ_.niw[0]); + random_uint128_t(gb_value.data(), num_of_input_wires); @@ -121,18 +122,20 @@ class Garbler { std::cout << "sendInput1" << std::endl; - lctx->Send( - 1, - yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), - "garbleInput2"); - std::cout << "sendInput2" << std::endl; + // lctx->Send( + // 1, + // yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), + // "garbleInput2"); + // std::cout << "sendInput2" << std::endl; + + // onlineOT(); yacl::Buffer r = lctx->Recv(1, "Input1"); const uint64_t* buffer_data = r.data(); input_EV = *buffer_data; - onlineOT(); + } uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, @@ -171,10 +174,7 @@ class Garbler { } void GB() { - // table = new uint128_t*[circ_.ng]; - // for (int i = 0; i < circ_.ng; ++i) { - // table[i] = new uint128_t[2]; - // } + for (int i = 0; i < circ_.gates.size(); i++) { auto gate = circ_.gates[i]; switch (gate.op) { @@ -220,8 +220,6 @@ class Garbler { yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_.ng), "table"); std::cout << "sendTable" << std::endl; - - } void decode() { // 现接收计算结果 @@ -240,33 +238,51 @@ class Garbler { std::cout << "MPC结果:" << result[0] << std::endl; std::cout << "明文结果:" << input + input_EV << std::endl; } + template -void finalize(absl::Span outputs) { + void finalize(absl::Span outputs) { // YACL_ENFORCE(outputs.size() >= circ_->nov); - size_t index = wires_.size(); + size_t index = wires_.size(); - for (size_t i = 0; i < circ_.nov; ++i) { - yacl::dynamic_bitset result(circ_.now[i]); - for (size_t j = 0; j < circ_.now[i]; ++j) { - int wire_index = index - circ_.now[i] + j; - result[j] = getLSB(wires_[wire_index]) ^ - getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 - // 对应的混淆电路计算为LSB ^ d - // 输出线路在后xx位 + for (size_t i = 0; i < circ_.nov; ++i) { + yacl::dynamic_bitset result(circ_.now[i]); + for (size_t j = 0; j < circ_.now[i]; ++j) { + int wire_index = index - circ_.now[i] + j; + result[j] = getLSB(wires_[wire_index]) ^ + getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 + // 对应的混淆电路计算为LSB ^ d + // 输出线路在后xx位 + } + + outputs[circ_.nov - i - 1] = *(T*)result.data(); + index -= circ_.now[i]; } - // std::cout << "输出:" << result.data() << std::endl; - outputs[circ_.nov - i - 1] = *(T*)result.data(); - index -= circ_.now[i]; } -} -void onlineOT(){ - yacl::dynamic_bitset d_choice; - // yacl::Buffer r = lctx->Recv(1, "d_choice"); + void onlineOT(){ - // const uint64_t* buffer_data = r.data(); - // // d_choice = *buffer_data; - // cout << "d_choice" <<*buffer_data << endl; -} + auto buf = lctx->Recv(1, "masked_choice"); + + dynamic_bitset masked_choices(64); + std::memcpy(masked_choices.data(), buf.data(), buf.size()); + + std::vector batch_send(64); + + for (uint32_t j = 0; j < 64; ++j) { + auto idx = 64 + j; + if (!masked_choices[j]) { + batch_send[j][0] = ot_send.GetBlock(j, 0) ^ gb_value[idx]; + batch_send[j][1] = ot_send.GetBlock(j, 1) ^ gb_value[idx] ^ delta; + } else { + batch_send[j][0] = ot_send.GetBlock(j, 1) ^ gb_value[idx]; + batch_send[j][1] = ot_send.GetBlock(j, 0) ^ gb_value[idx] ^ delta; + } + } + + lctx->SendAsync( + lctx->NextRank(), + ByteContainerView(batch_send.data(), sizeof(uint128_t) * 64 * 2), + ""); + } }; \ No newline at end of file diff --git a/examples/gc/test_split.cc b/examples/gc/test_split.cc index fcbf729b..1af15640 100644 --- a/examples/gc/test_split.cc +++ b/examples/gc/test_split.cc @@ -22,7 +22,6 @@ using uint128_t = __uint128_t; std::shared_ptr circ_; - inline uint128_t Aes128(uint128_t k, uint128_t m) { yacl::crypto::SymmetricCrypto enc( yacl::crypto::SymmetricCrypto::CryptoType::AES128_ECB, k); @@ -38,16 +37,9 @@ int main() { std::future thread2 = std::async([&] { evaluator->setup(); }); thread1.get(); thread2.get(); - cout << "ROT:" << garbler -> ot_send.GetBlock(3, evaluator->ot_recv.GetChoice(3)) <<" " << evaluator->ot_recv.GetBlock(3) << endl; + // 电路读取 - // std::string operate; - // cout << "输入进行的操作: "; - // std::cin >> operate; - - // std::string pth = - // fmt::format("{0}/yacl/io/circuit/data/{1}.txt", - // std::filesystem::current_path().string(), operate); std::string pth = fmt::format("{0}/yacl/io/circuit/data/{1}.txt", std::filesystem::current_path().string(), "adder64"); @@ -56,11 +48,17 @@ int main() { reader.ReadAllGates(); circ_ = reader.StealCirc(); // 指针 - // 输入值混淆 + // 输入处理 thread1 = std::async([&] { garbler->inputProcess(*circ_); }); thread2 = std::async([&] { evaluator->inputProcess(*circ_); }); thread1.get(); thread2.get(); + + // OT + thread1 = std::async([&] { evaluator -> onLineOT();}); + thread2 = std::async([&] { garbler -> onlineOT(); }); + thread1.get(); + thread2.get(); // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator From 112b2e6fc5203b0dd459266aa5c7621713b1bb11 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Thu, 20 Feb 2025 17:05:12 +0800 Subject: [PATCH 18/27] debug MPint --- examples/gc/BUILD.bazel | 56 +++++ examples/gc/OT.cc | 57 +++++ examples/gc/Obj.cc | 29 +++ examples/gc/aes_128_evaluator.h | 237 +++++++++++++++++++++ examples/gc/aes_128_garbler.h | 325 +++++++++++++++++++++++++++++ examples/gc/bs.cc | 37 ++++ examples/gc/evaluator.h | 2 +- examples/gc/gc_test_1.cc | 169 +++++++++++++++ examples/gc/gpt_hash.cc | 71 +++++++ examples/gc/hexToBinary.cc | 36 ++++ examples/gc/sha256_garbler.h | 325 +++++++++++++++++++++++++++++ examples/gc/sleep_.cc | 76 +++++++ examples/gc/test.cc | 46 ++-- examples/gc/testByte.cc | 17 ++ examples/gc/test_sha.cc | 124 +++++++++++ examples/gc/test_split.cc | 16 +- yacl/crypto/rand/rand.h | 13 ++ yacl/io/circuit/bristol_fashion.cc | 51 +++++ yacl/io/circuit/bristol_fashion.h | 4 + 19 files changed, 1661 insertions(+), 30 deletions(-) create mode 100644 examples/gc/OT.cc create mode 100644 examples/gc/Obj.cc create mode 100644 examples/gc/aes_128_evaluator.h create mode 100644 examples/gc/aes_128_garbler.h create mode 100644 examples/gc/bs.cc create mode 100644 examples/gc/gc_test_1.cc create mode 100644 examples/gc/gpt_hash.cc create mode 100644 examples/gc/hexToBinary.cc create mode 100644 examples/gc/sha256_garbler.h create mode 100644 examples/gc/sleep_.cc create mode 100644 examples/gc/testByte.cc create mode 100644 examples/gc/test_sha.cc diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel index dc78c597..090f3f79 100644 --- a/examples/gc/BUILD.bazel +++ b/examples/gc/BUILD.bazel @@ -166,6 +166,60 @@ cc_library( ], ) +cc_library( + name = "aes_128_garbler", + hdrs = [ + "aes_128_garbler.h", + ], + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], + deps = [ + ":mitccrh", + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/crypto/rand", + "//yacl/crypto/tools:prg", + "//yacl/io/circuit:bristol_fashion", + "//yacl/io/stream:file_io", + "//yacl/kernel/algorithms:base_ot", + "//yacl/kernel/algorithms:iknp_ote", + "//yacl/link:test_util", + "//yacl/utils:circuit_executor", + "//yacl/kernel:ot_kernel", + "//yacl/kernel/type:ot_store_utils", + ], +) + +cc_library( + name = "aes_128_evaluator", + hdrs = [ + "aes_128_evaluator.h", + ], + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], + deps = [ + ":mitccrh", + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/crypto/rand", + "//yacl/crypto/tools:prg", + "//yacl/io/circuit:bristol_fashion", + "//yacl/io/stream:file_io", + "//yacl/kernel/algorithms:base_ot", + "//yacl/kernel/algorithms:iknp_ote", + "//yacl/link:test_util", + "//yacl/utils:circuit_executor", + "//yacl/kernel:ot_kernel", + "//yacl/kernel/type:ot_store_utils", + ], +) + cc_binary( name = "test_split", srcs = ["test_split.cc"], @@ -179,6 +233,8 @@ cc_binary( ":mitccrh", ":garbler", ":evaluator", + ":aes_128_garbler", + ":aes_128_evaluator", "//yacl/base:byte_container_view", "//yacl/base:dynamic_bitset", "//yacl/crypto/rand", diff --git a/examples/gc/OT.cc b/examples/gc/OT.cc new file mode 100644 index 00000000..3eb41b06 --- /dev/null +++ b/examples/gc/OT.cc @@ -0,0 +1,57 @@ +#include + +#include "gflags/gflags.h" + +#include "yacl/base/exception.h" +#include "yacl/link/context.h" +#include "yacl/link/factory.h" + +using namespace std; +using namespace yacl; +using uint128_t = __uint128_t; +DEFINE_int32(rank, -1, "rank of the party: 0/1"); + +int main(int argc, char* argv[]) { + google::ParseCommandLineFlags(&argc, &argv, true); + + YACL_ENFORCE(FLAGS_rank != -1, "Invalid Arguemnts: rank"); + + size_t world_size = 2; + yacl::link::ContextDesc ctx_desc; + + for (size_t rank = 0; rank < world_size; rank++) { + const auto id = fmt::format("id-{}", rank); + const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); + ctx_desc.parties.push_back({id, host}); + } + + auto lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, FLAGS_rank); + lctx->ConnectToMesh(); + + vector gb_value(25, 1); + + //统一 delta constant + // 发送 混淆X 电路表 (输出电路的标签 ×) + // OT + // 计算结果 + if (FLAGS_rank == 0) { + lctx->Send(1, ByteContainerView(gb_value.data(), sizeof(uint128_t) * 25), + "test"); + cout << "send" << endl; + } else { + Buffer r = lctx->Recv(0, "test"); + + const uint128_t* buffer_data = r.data(); + size_t buffer_size = r.size() / 16; + + std::cout << "Received data size: " << buffer_size << std::endl; + for (size_t i = 0; i < buffer_size; ++i) { + std::cout << static_cast(buffer_data[i]) << " "; + } + cout << endl; + + cout << "recv" << endl; + } + + return 0; +} \ No newline at end of file diff --git a/examples/gc/Obj.cc b/examples/gc/Obj.cc new file mode 100644 index 00000000..e7961aa7 --- /dev/null +++ b/examples/gc/Obj.cc @@ -0,0 +1,29 @@ +#include "bits/stdc++.h" + +#include "yacl/io/circuit/bristol_fashion.h" + +using namespace std; + +void func(yacl::io::BFCircuit cir) { + cir.ng = 45; + cout << "func:" << cir.ng << endl; +} + +int main() { + std::string operate; + std::cin >> operate; + + std::string pth = + fmt::format("{0}/yacl/io/circuit/data/{1}.txt", + std::filesystem::current_path().string(), operate); + yacl::io::CircuitReader reader(pth); + reader.ReadMeta(); + reader.ReadAllGates(); + std::shared_ptr circ_ = reader.StealCirc(); + + func(*circ_); + + cout << "origin:" << circ_->ng << endl; + + return 0; +} diff --git a/examples/gc/aes_128_evaluator.h b/examples/gc/aes_128_evaluator.h new file mode 100644 index 00000000..d34a7c3c --- /dev/null +++ b/examples/gc/aes_128_evaluator.h @@ -0,0 +1,237 @@ +#pragma once +#include +#include +#include +#include + +#include "absl/types/span.h" +#include "examples/gc/mitccrh.h" +#include "fmt/format.h" + +#include "yacl/base/byte_container_view.h" +#include "yacl/base/dynamic_bitset.h" +#include "yacl/base/exception.h" +#include "yacl/crypto/rand/rand.h" +#include "yacl/io/circuit/bristol_fashion.h" +#include "yacl/io/stream/file_io.h" +#include "yacl/kernel/algorithms/base_ot.h" +#include "yacl/kernel/algorithms/iknp_ote.h" +#include "yacl/kernel/type/ot_store_utils.h" +#include "yacl/link/context.h" +#include "yacl/link/factory.h" +#include "yacl/link/test_util.h" +#include "yacl/utils/circuit_executor.h" +#include "yacl/kernel/ot_kernel.h" +#include "yacl/kernel/type/ot_store_utils.h" + +using namespace std; +using namespace yacl; +using namespace yacl::crypto; +namespace { +using uint128_t = __uint128_t; +using OtMsg = uint128_t; +using OtMsgPair = std::array; +using OtChoices = dynamic_bitset; +} + +uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); +uint128_t select_mask[2] = {0, all_one_uint128_t}; + +class EvaluatorAES { + public: + uint128_t delta; + uint128_t inv_constant; + uint128_t start_point; + MITCCRH<8> mitccrh; + + std::vector wires_; + std::vector gb_value; + yacl::io::BFCircuit circ_; + std::shared_ptr lctx; + + //根据电路改 + uint128_t table[36663][2]; + uint128_t input; + const int num_ot = 128; + + yacl::crypto::OtRecvStore ot_recv = OtRecvStore(num_ot, yacl::crypto::OtStoreType::Normal); + + void setup() { + // 通信环境初始化 + size_t world_size = 2; + yacl::link::ContextDesc ctx_desc; + + for (size_t rank = 0; rank < world_size; rank++) { + const auto id = fmt::format("id-{}", rank); + const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); + ctx_desc.parties.push_back({id, host}); + } + + lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, + 1); + lctx->ConnectToMesh(); + + //OT off-line + const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; + yacl::crypto::OtKernel kernel1(yacl::crypto::OtKernel::Role::Receiver, ext_algorithm); + kernel1.init(lctx); + kernel1.eval_rot(lctx, num_ot, &ot_recv); + + uint128_t tmp[3]; + // delta, inv_constant, start_point 接收 + yacl::Buffer r = lctx->Recv(0, "tmp"); + const uint128_t* buffer_data = r.data(); + memcpy(tmp, buffer_data, sizeof(uint128_t) * 3); + std::cout << "tmpRecv" << std::endl; + + delta = tmp[0]; + inv_constant = tmp[1]; + start_point = tmp[2]; + + // 秘钥生成 + mitccrh.setS(start_point); + } + + void inputProcess(yacl::io::BFCircuit param_circ_) { + circ_ = param_circ_; + gb_value.resize(circ_.nw); + wires_.resize(circ_.nw); + + //输入位数有关 + yacl::dynamic_bitset bi_val; + + //输入位数有关 + input = yacl::crypto::FastRandU128(); + std::cout << "input of evaluator:" << input << std::endl; + bi_val.append(input); // 直接转换为二进制 输入线路在前64位 + // 接收garbler混淆值 + yacl::Buffer r = lctx->Recv(0, "garbleInput1"); + + const uint128_t* buffer_data = r.data(); + + memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * num_ot); + + std::cout << "recvInput1" << std::endl; + + // 对evaluator自己的输入值进行混淆 + // r = lctx->Recv(0, "garbleInput2"); + // buffer_data = r.data(); + // for (int i = 0; i < circ_.niw[1]; i++) { + // wires_[i + circ_.niw[0]] = + // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); + + // } + // std::cout << "recvInput2" << std::endl; + + // onLineOT(); + + //输入位数有关 + lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint128_t)), "Input1"); + } + void recvTable() { + + yacl::Buffer r = lctx->Recv(0, "table"); + const uint128_t* buffer_data = r.data(); + int k = 0; + for (int i = 0; i < circ_.ng; i++) { + for (int j = 0; j < 2; j++) { + table[i][j] = buffer_data[k]; + k++; + } + } + + std::cout << "recvTable" << std::endl; + + } + + //未检查 + uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, + MITCCRH<8>* mitccrh_pointer) { + uint128_t HA, HB, W; + int sa, sb; + + sa = getLSB(A); + sb = getLSB(B); + + uint128_t H[2]; + H[0] = A; + H[1] = B; + mitccrh_pointer->hash<2, 1>(H); + HA = H[0]; + HB = H[1]; + + W = HA ^ HB; + W = W ^ (select_mask[sa] & table_item[0]); + W = W ^ (select_mask[sb] & table_item[1]); + W = W ^ (select_mask[sb] & A); + return W; + } + + void EV() { + for (int i = 0; i < circ_.gates.size(); i++) { + auto gate = circ_.gates[i]; + switch (gate.op) { + case yacl::io::BFCircuit::Op::XOR: { + const auto& iw0 = wires_.operator[](gate.iw[0]); // 取到具体值 + const auto& iw1 = wires_.operator[](gate.iw[1]); + wires_[gate.ow[0]] = iw0 ^ iw1; + break; + } + case yacl::io::BFCircuit::Op::AND: { + const auto& iw0 = wires_.operator[](gate.iw[0]); + const auto& iw1 = wires_.operator[](gate.iw[1]); + wires_[gate.ow[0]] = EVAND(iw0, iw1, table[i], &mitccrh); + break; + } + case yacl::io::BFCircuit::Op::INV: { + const auto& iw0 = wires_.operator[](gate.iw[0]); + wires_[gate.ow[0]] = iw0 ^ inv_constant; + break; + } + case yacl::io::BFCircuit::Op::EQ: { + wires_[gate.ow[0]] = gate.iw[0]; + break; + } + case yacl::io::BFCircuit::Op::EQW: { + const auto& iw0 = wires_.operator[](gate.iw[0]); + wires_[gate.ow[0]] = iw0; + break; + } + case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ + YACL_THROW("Unimplemented MAND gate"); + break; + } + default: + YACL_THROW("Unknown Gate Type: {}", (int)gate.op); + } + } + } + void sendOutput() { + size_t index = wires_.size(); + int start = index - circ_.now[0]; + lctx->Send( + 0, + yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * num_ot), + "output"); + std::cout << "sendOutput" << std::endl; + } + void onLineOT(){ + + yacl::dynamic_bitset choices; + choices.append(input); + + yacl::dynamic_bitset ot = ot_recv.CopyBitBuf(); + ot.resize(choices.size()); + + yacl::dynamic_bitset masked_choices = ot ^ choices; + lctx->Send(0, yacl::ByteContainerView(masked_choices.data(), sizeof(uint128_t)), "masked_choice"); + + auto buf = lctx->Recv(lctx->NextRank(), ""); + std::vector batch_recv(num_ot); + std::memcpy(batch_recv.data(), buf.data(), buf.size()); + for (uint32_t j = 0; j < num_ot; ++j) { + auto idx = num_ot + j; + wires_[idx] = batch_recv[j][choices[j]] ^ ot_recv.GetBlock(j); + } + } +}; \ No newline at end of file diff --git a/examples/gc/aes_128_garbler.h b/examples/gc/aes_128_garbler.h new file mode 100644 index 00000000..c58b378e --- /dev/null +++ b/examples/gc/aes_128_garbler.h @@ -0,0 +1,325 @@ +#pragma once +#include +#include +#include +#include + +#include "absl/types/span.h" +#include "examples/gc/mitccrh.h" +#include "fmt/format.h" + +#include "yacl/base/byte_container_view.h" +#include "yacl/base/dynamic_bitset.h" +#include "yacl/base/exception.h" +#include "yacl/crypto/rand/rand.h" +#include "yacl/io/circuit/bristol_fashion.h" +#include "yacl/io/stream/file_io.h" +#include "yacl/kernel/algorithms/base_ot.h" +#include "yacl/kernel/algorithms/iknp_ote.h" +#include "yacl/kernel/type/ot_store_utils.h" +#include "yacl/link/context.h" +#include "yacl/link/factory.h" +#include "yacl/link/test_util.h" +#include "yacl/utils/circuit_executor.h" +#include "yacl/kernel/ot_kernel.h" +#include "yacl/kernel/type/ot_store_utils.h" +using namespace std; +using namespace yacl; +namespace { +using uint128_t = __uint128_t; +using OtMsg = uint128_t; +using OtMsgPair = std::array; +using OtChoices = dynamic_bitset; +} + + +uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); +uint128_t select_mask_[2] = {0, all_one_uint128_t_}; + +inline uint128_t Aes128(uint128_t k, uint128_t m) { + crypto::SymmetricCrypto enc(crypto::SymmetricCrypto::CryptoType::AES128_ECB, + k); + return enc.Encrypt(m); +} + + uint128_t ReverseBytes(uint128_t x) { + auto byte_view = ByteContainerView(&x, sizeof(x)); + uint128_t ret = 0; + auto buf = std::vector(sizeof(ret)); + for (size_t i = 0; i < byte_view.size(); ++i) { + buf[byte_view.size() - i - 1] = byte_view[i]; + } + std::memcpy(&ret, buf.data(), buf.size()); + return ret; +} +class GarblerAES { + public: + std::shared_ptr lctx; + uint128_t delta; + uint128_t inv_constant; + uint128_t start_point; + MITCCRH<8> mitccrh; + + std::vector wires_; + std::vector gb_value; + yacl::io::BFCircuit circ_; + //根据电路改 + uint128_t table[36663][2]; + + //输入数据类型需要修改 + uint128_t input; + uint128_t input_EV; + + //num_ot根据输入改 + const int num_ot = 128; + yacl::crypto::OtSendStore ot_send = OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); + + + + + void setup() { + // 通信环境初始化 + size_t world_size = 2; + yacl::link::ContextDesc ctx_desc; + + for (size_t rank = 0; rank < world_size; rank++) { + const auto id = fmt::format("id-{}", rank); + const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); + ctx_desc.parties.push_back({id, host}); + } + + + lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, + 0); + lctx->ConnectToMesh(); + + //OT off-line + const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; + yacl::crypto::OtKernel kernel0(yacl::crypto::OtKernel::Role::Sender, ext_algorithm); + kernel0.init(lctx); + kernel0.eval_rot(lctx, num_ot, &ot_send); + + // delta, inv_constant, start_point 初始化并发送给evaluator + uint128_t tmp[3]; + + random_uint128_t(tmp, 3); + tmp[0] = tmp[0] | 1; + lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 3), "tmp"); + std::cout << "tmpSend" << std::endl; + + delta = tmp[0]; + inv_constant = tmp[1] ^ delta; + start_point = tmp[2]; + + // 秘钥生成 + mitccrh.setS(start_point); + } + + // 包扩 输入值生成和混淆,garbler混淆值的发送 + void inputProcess(yacl::io::BFCircuit param_circ_) { + circ_ = param_circ_; + gb_value.resize(circ_.nw); + wires_.resize(circ_.nw); + + //输入位数有关 + input = yacl::crypto::FastRandU128(); + std::cout << "input of garbler:" << input << std::endl; + + //输入位数有关 + yacl::dynamic_bitset bi_val; + bi_val.append(input); // 直接转换为二进制 输入线路在前64位 + + // 混淆过程 + int num_of_input_wires = 0; + for (size_t i = 0; i < circ_.niv; ++i) { + num_of_input_wires += circ_.niw[i]; + } + + random_uint128_t(gb_value.data(), num_of_input_wires); + + + // 前64位 直接置换 garbler + for (int i = 0; i < circ_.niw[0]; i++) { + wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); + } + + lctx->Send(1, + yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), + "garbleInput1"); + + std::cout << "sendInput1" << std::endl; + + // lctx->Send( + // 1, + // yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), + // "garbleInput2"); + // std::cout << "sendInput2" << std::endl; + + // onlineOT(); + + yacl::Buffer r = lctx->Recv(1, "Input1"); + + //输入位数有关 + const uint128_t* buffer_data = r.data(); + input_EV = *buffer_data; + + + } + + uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, + uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { + bool pa = getLSB(LA0); + bool pb = getLSB(LB0); + + uint128_t HLA0, HA1, HLB0, HB1; + uint128_t tmp, W0; + uint128_t H[4]; + + H[0] = LA0; + H[1] = A1; + H[2] = LB0; + H[3] = B1; + + mitccrh_pointer->hash<2, 2>(H); + + HLA0 = H[0]; + HA1 = H[1]; + HLB0 = H[2]; + HB1 = H[3]; + + table_item[0] = HLA0 ^ HA1; + table_item[0] = table_item[0] ^ (select_mask_[pb] & delta); + + W0 = HLA0; + W0 = W0 ^ (select_mask_[pa] & table_item[0]); + + tmp = HLB0 ^ HB1; + table_item[1] = tmp ^ LA0; + + W0 = W0 ^ HLB0; + W0 = W0 ^ (select_mask_[pb] & tmp); + return W0; + + } + void GB() { + + for (int i = 0; i < circ_.gates.size(); i++) { + auto gate = circ_.gates[i]; + switch (gate.op) { + case yacl::io::BFCircuit::Op::XOR: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 + const auto& iw1 = gb_value.operator[](gate.iw[1]); + gb_value[gate.ow[0]] = iw0 ^ iw1; + break; + } + case yacl::io::BFCircuit::Op::AND: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + const auto& iw1 = gb_value.operator[](gate.iw[1]); + gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, + table[i], &mitccrh); + break; + } + case yacl::io::BFCircuit::Op::INV: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + gb_value[gate.ow[0]] = iw0 ^ inv_constant; + break; + } + case yacl::io::BFCircuit::Op::EQ: { + gb_value[gate.ow[0]] = gate.iw[0]; + break; + } + case yacl::io::BFCircuit::Op::EQW: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + gb_value[gate.ow[0]] = iw0; + break; + } + case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ + YACL_THROW("Unimplemented MAND gate"); + break; + } + default: + YACL_THROW("Unknown Gate Type: {}", (int)gate.op); + } + } + } + + void sendTable() { + lctx->Send(1, + yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_.ng), + "table"); + std::cout << "sendTable" << std::endl; + } + void decode() { + // 现接收计算结果 + size_t index = wires_.size(); + int start = index - circ_.now[0]; + + yacl::Buffer r = lctx->Recv(1, "output"); + const uint128_t* buffer_data = r.data(); + + memcpy(wires_.data() + start, buffer_data, sizeof(uint128_t) * num_ot); + std::cout << "recvOutput" << std::endl; + + // decode + + // 线路有关 输出位数 + std::vector result(1); + finalize(absl::MakeSpan(result)); + std::cout << "MPC结果:" << ReverseBytes(result[0]) << std::endl; + std::cout << "明文结果:" << Aes128(ReverseBytes(input), ReverseBytes(input_EV)) << std::endl; //待修改 + } + + + /******** + * + * + * 可能有bug + * + * **********/ + template + void finalize(absl::Span outputs) { + // YACL_ENFORCE(outputs.size() >= circ_->nov); + + size_t index = wires_.size(); + + for (size_t i = 0; i < circ_.nov; ++i) { + yacl::dynamic_bitset result(circ_.now[i]); + for (size_t j = 0; j < circ_.now[i]; ++j) { + int wire_index = index - circ_.now[i] + j; + result[j] = getLSB(wires_[wire_index]) ^ + getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 + // 对应的混淆电路计算为LSB ^ d + // 输出线路在后xx位 + } + + outputs[circ_.nov - i - 1] = *(T*)result.data(); + index -= circ_.now[i]; + } + } + void onlineOT(){ + + auto buf = lctx->Recv(1, "masked_choice"); + + dynamic_bitset masked_choices(num_ot); + std::memcpy(masked_choices.data(), buf.data(), buf.size()); + + std::vector batch_send(num_ot); + + for (uint32_t j = 0; j < num_ot; ++j) { + auto idx = num_ot + j; + if (!masked_choices[j]) { + batch_send[j][0] = ot_send.GetBlock(j, 0) ^ gb_value[idx]; + batch_send[j][1] = ot_send.GetBlock(j, 1) ^ gb_value[idx] ^ delta; + } else { + batch_send[j][0] = ot_send.GetBlock(j, 1) ^ gb_value[idx]; + batch_send[j][1] = ot_send.GetBlock(j, 0) ^ gb_value[idx] ^ delta; + } + } + + lctx->SendAsync( + lctx->NextRank(), + ByteContainerView(batch_send.data(), sizeof(uint128_t) * num_ot * 2), + ""); + } + +}; \ No newline at end of file diff --git a/examples/gc/bs.cc b/examples/gc/bs.cc new file mode 100644 index 00000000..14c89e45 --- /dev/null +++ b/examples/gc/bs.cc @@ -0,0 +1,37 @@ +#include +#include +#include + +void copyVectorToDynamicBitset(const std::vector& vec, + boost::dynamic_bitset& bitset) { + // 清空原有的 bitset 内容 + bitset.clear(); + + // 设置 bitset 的大小为 vec.size() * 8(每个 uint8_t 有 8 位) + bitset.resize(vec.size() * 8); + + // 遍历 vec 中的每个字节 + for (size_t i = 0; i < vec.size(); ++i) { + uint8_t byte = vec[i]; + for (int j = 0; j < 8; ++j) { + // 从最低位开始设置位 + bitset[i * 8 + j] = (byte >> j) & 1; + } + } +} + +int main() { + std::vector vec = {0x01, 0x02, 0x03}; // 示例数据 + boost::dynamic_bitset bitset; + + copyVectorToDynamicBitset(vec, bitset); + + // 打印 bitset 的内容 + std::cout << "Bitset contents: "; + for (size_t i = 0; i < bitset.size(); ++i) { + std::cout << bitset[i]; + } + std::cout << std::endl; + + return 0; +} \ No newline at end of file diff --git a/examples/gc/evaluator.h b/examples/gc/evaluator.h index 7584a354..fbeaaa1a 100644 --- a/examples/gc/evaluator.h +++ b/examples/gc/evaluator.h @@ -228,4 +228,4 @@ class Evaluator { wires_[idx] = batch_recv[j][choices[j]] ^ ot_recv.GetBlock(j); } } -}; +}; \ No newline at end of file diff --git a/examples/gc/gc_test_1.cc b/examples/gc/gc_test_1.cc new file mode 100644 index 00000000..d8d7abe4 --- /dev/null +++ b/examples/gc/gc_test_1.cc @@ -0,0 +1,169 @@ +#include + +#include "absl/strings/escaping.h" +#include "absl/types/span.h" +#include "examples/gc/mitccrh.h" +#include "fmt/format.h" + +#include "yacl/base/byte_container_view.h" +#include "yacl/base/dynamic_bitset.h" +#include "yacl/crypto/rand/rand.h" +#include "yacl/io/circuit/bristol_fashion.h" +#include "yacl/io/stream/file_io.h" +#include "yacl/kernel/algorithms/base_ot.h" +#include "yacl/kernel/algorithms/iknp_ote.h" +#include "yacl/link/test_util.h" +#include "yacl/utils/circuit_executor.h" +using namespace yacl; +using namespace std; +namespace { +using uint128_t = __uint128_t; +} + +const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); +const uint128_t select_mask[2] = {0, all_one_uint128_t}; + +std::shared_ptr circ_; +vector wires_; +vector gb_value; + +// enum class Op { +// adder64, √ +// aes_128, √ +// divide64, √ +// mult2_64, +// mult64, √ +// neg64, √ +// sha256, +// sub64, √ +// udivide64, √ +// zero_equal √ +// } + +inline uint128_t Aes128(uint128_t k, uint128_t m) { + crypto::SymmetricCrypto enc(crypto::SymmetricCrypto::CryptoType::AES128_ECB, + k); + return enc.Encrypt(m); +} + +uint128_t ReverseBytes(uint128_t x) { + auto byte_view = ByteContainerView(&x, sizeof(x)); + uint128_t ret = 0; + auto buf = std::vector(sizeof(ret)); + for (size_t i = 0; i < byte_view.size(); ++i) { + buf[byte_view.size() - i - 1] = byte_view[i]; + } + std::memcpy(&ret, buf.data(), buf.size()); + return ret; +} + +uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, + uint128_t delta, uint128_t* table, MITCCRH<8>* mitccrh) { + bool pa = getLSB(LA0); + bool pb = getLSB(LB0); + + uint128_t HLA0, HA1, HLB0, HB1; + uint128_t tmp, W0; + uint128_t H[4]; + + H[0] = LA0; + H[1] = A1; + H[2] = LB0; + H[3] = B1; + + mitccrh->hash<2, 2>(H); + + HLA0 = H[0]; + HA1 = H[1]; + HLB0 = H[2]; + HB1 = H[3]; + + table[0] = HLA0 ^ HA1; + table[0] = table[0] ^ (select_mask[pb] & delta); + + W0 = HLA0; + W0 = W0 ^ (select_mask[pa] & table[0]); + + tmp = HLB0 ^ HB1; + table[1] = tmp ^ LA0; + + W0 = W0 ^ HLB0; + W0 = W0 ^ (select_mask[pb] & tmp); + return W0; +} + +uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table, + MITCCRH<8>* mitccrh) { + uint128_t HA, HB, W; + int sa, sb; + + sa = getLSB(A); + sb = getLSB(B); + + uint128_t H[2]; + H[0] = A; + H[1] = B; + mitccrh->hash<2, 1>(H); + HA = H[0]; + HB = H[1]; + + W = HA ^ HB; + W = W ^ (select_mask[sa] & table[0]); + W = W ^ (select_mask[sb] & table[1]); + W = W ^ (select_mask[sb] & A); + return W; +} + +template +void finalize(absl::Span outputs) { + // YACL_ENFORCE(outputs.size() >= circ_->nov); + + size_t index = wires_.size(); + + for (size_t i = 0; i < circ_->nov; ++i) { + dynamic_bitset result(circ_->now[i]); + for (size_t j = 0; j < circ_->now[i]; ++j) { + int wire_index = index - circ_->now[i] + j; + result[j] = getLSB(wires_[wire_index]) ^ + getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 + // 对应的混淆电路计算为LSB ^ d + // 输出线路在后xx位 + } + outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); + index -= circ_->now[i]; + } +} + +int main() { + int num_ot = 10; + const int kWorldSize = 2; + auto contexts = link::test::SetupWorld(kWorldSize); + + std::vector> send_blocks; + std::vector recv_blocks; + + send_blocks.resize(num_ot); + recv_blocks.resize(num_ot); + + // WHEN + auto choices = yacl::crypto::RandBits>(num_ot); + std::future sender = std::async([&] { + yacl::crypto::BaseOtSend(contexts[0], absl::MakeSpan(send_blocks)); + }); + std::future receiver = std::async([&] { + yacl::crypto::BaseOtRecv(contexts[1], choices, absl::MakeSpan(recv_blocks)); + }); + sender.get(); + receiver.get(); + cout << "choice" << choices << endl; + // THEN + for (unsigned i = 0; i < num_ot; ++i) { + unsigned idx = choices[i] ? 1 : 0; + cout << send_blocks[i][idx] << " " << recv_blocks[i] << endl; + if (send_blocks[i][idx] != recv_blocks[i]) { + cout << "error" << endl; + break; + } + } + return 0; +} diff --git a/examples/gc/gpt_hash.cc b/examples/gc/gpt_hash.cc new file mode 100644 index 00000000..fafe2422 --- /dev/null +++ b/examples/gc/gpt_hash.cc @@ -0,0 +1,71 @@ +#include +#include +#include +#include +#include + +// 手动进行 SHA256 预处理 +void sha256_preprocess(uint8_t *input_data, size_t input_len, + uint8_t **padded_data, size_t *padded_len) { + size_t pad_len = input_len + 1 + 8; // +1 for 0x80 and +8 for length + size_t rem = pad_len % 64; + if (rem > 0) { + pad_len += (64 - rem); + } + + // Allocate memory for padded data + *padded_data = (uint8_t *)malloc(pad_len); + *padded_len = pad_len; + + // Copy original data + memcpy(*padded_data, input_data, input_len); + + // Append the "1" bit (0x80) + (*padded_data)[input_len] = 0x80; + + // Append zeros + memset(*padded_data + input_len + 1, 0, pad_len - input_len - 9); + + // Append original length in bits (big-endian) + uint64_t bit_len = input_len * 8; + for (int i = 0; i < 8; ++i) { + (*padded_data)[pad_len - 1 - i] = (bit_len >> (i * 8)) & 0xff; + } +} + +int main() { + // 原始输入数据 + const char *data = "Hello, OpenSSL!"; + size_t data_len = strlen(data); + + // 进行 SHA256 预处理 + uint8_t *padded_data; + size_t padded_len; + sha256_preprocess((uint8_t *)data, data_len, &padded_data, &padded_len); + + // 使用 OpenSSL 计算 SHA256 哈希 + EVP_MD_CTX *mdctx = EVP_MD_CTX_new(); + unsigned char hash[32]; + + // 初始化 SHA256 上下文 + EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL); + + // 将预处理后的数据输入 OpenSSL + EVP_DigestUpdate(mdctx, padded_data, padded_len); + + // 获取最终哈希值 + EVP_DigestFinal_ex(mdctx, hash, NULL); + + // 打印哈希值 + printf("SHA256 hash: "); + for (int i = 0; i < 32; i++) { + printf("%02x", hash[i]); + } + printf("\n"); + + // 释放资源 + EVP_MD_CTX_free(mdctx); + free(padded_data); + + return 0; +} \ No newline at end of file diff --git a/examples/gc/hexToBinary.cc b/examples/gc/hexToBinary.cc new file mode 100644 index 00000000..698435a3 --- /dev/null +++ b/examples/gc/hexToBinary.cc @@ -0,0 +1,36 @@ +#include +#include +#include + +std::string hexToBinary(const std::string& hex) { + std::unordered_map hexToBinaryMap = { + {'0', "0000"}, {'1', "0001"}, {'2', "0010"}, {'3', "0011"}, + {'4', "0100"}, {'5', "0101"}, {'6', "0110"}, {'7', "0111"}, + {'8', "1000"}, {'9', "1001"}, {'A', "1010"}, {'B', "1011"}, + {'C', "1100"}, {'D', "1101"}, {'E', "1110"}, {'F', "1111"}}; + + std::string binary = ""; + for (char c : hex) { + c = toupper(c); // 转换为大写字母以匹配映射 + if (hexToBinaryMap.find(c) != hexToBinaryMap.end()) { + binary += hexToBinaryMap[c]; + } else { + std::cerr << "Invalid hex character: " << c << std::endl; + return ""; // 返回空字符串表示错误 + } + } + return binary; +} + +int main() { + std::string hexInput; + std::cout << "Enter a hexadecimal string: "; + std::cin >> hexInput; + + std::string binaryOutput = hexToBinary(hexInput); + if (!binaryOutput.empty()) { + std::cout << "Binary representation: " << binaryOutput << std::endl; + } + + return 0; +} diff --git a/examples/gc/sha256_garbler.h b/examples/gc/sha256_garbler.h new file mode 100644 index 00000000..c58b378e --- /dev/null +++ b/examples/gc/sha256_garbler.h @@ -0,0 +1,325 @@ +#pragma once +#include +#include +#include +#include + +#include "absl/types/span.h" +#include "examples/gc/mitccrh.h" +#include "fmt/format.h" + +#include "yacl/base/byte_container_view.h" +#include "yacl/base/dynamic_bitset.h" +#include "yacl/base/exception.h" +#include "yacl/crypto/rand/rand.h" +#include "yacl/io/circuit/bristol_fashion.h" +#include "yacl/io/stream/file_io.h" +#include "yacl/kernel/algorithms/base_ot.h" +#include "yacl/kernel/algorithms/iknp_ote.h" +#include "yacl/kernel/type/ot_store_utils.h" +#include "yacl/link/context.h" +#include "yacl/link/factory.h" +#include "yacl/link/test_util.h" +#include "yacl/utils/circuit_executor.h" +#include "yacl/kernel/ot_kernel.h" +#include "yacl/kernel/type/ot_store_utils.h" +using namespace std; +using namespace yacl; +namespace { +using uint128_t = __uint128_t; +using OtMsg = uint128_t; +using OtMsgPair = std::array; +using OtChoices = dynamic_bitset; +} + + +uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); +uint128_t select_mask_[2] = {0, all_one_uint128_t_}; + +inline uint128_t Aes128(uint128_t k, uint128_t m) { + crypto::SymmetricCrypto enc(crypto::SymmetricCrypto::CryptoType::AES128_ECB, + k); + return enc.Encrypt(m); +} + + uint128_t ReverseBytes(uint128_t x) { + auto byte_view = ByteContainerView(&x, sizeof(x)); + uint128_t ret = 0; + auto buf = std::vector(sizeof(ret)); + for (size_t i = 0; i < byte_view.size(); ++i) { + buf[byte_view.size() - i - 1] = byte_view[i]; + } + std::memcpy(&ret, buf.data(), buf.size()); + return ret; +} +class GarblerAES { + public: + std::shared_ptr lctx; + uint128_t delta; + uint128_t inv_constant; + uint128_t start_point; + MITCCRH<8> mitccrh; + + std::vector wires_; + std::vector gb_value; + yacl::io::BFCircuit circ_; + //根据电路改 + uint128_t table[36663][2]; + + //输入数据类型需要修改 + uint128_t input; + uint128_t input_EV; + + //num_ot根据输入改 + const int num_ot = 128; + yacl::crypto::OtSendStore ot_send = OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); + + + + + void setup() { + // 通信环境初始化 + size_t world_size = 2; + yacl::link::ContextDesc ctx_desc; + + for (size_t rank = 0; rank < world_size; rank++) { + const auto id = fmt::format("id-{}", rank); + const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); + ctx_desc.parties.push_back({id, host}); + } + + + lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, + 0); + lctx->ConnectToMesh(); + + //OT off-line + const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; + yacl::crypto::OtKernel kernel0(yacl::crypto::OtKernel::Role::Sender, ext_algorithm); + kernel0.init(lctx); + kernel0.eval_rot(lctx, num_ot, &ot_send); + + // delta, inv_constant, start_point 初始化并发送给evaluator + uint128_t tmp[3]; + + random_uint128_t(tmp, 3); + tmp[0] = tmp[0] | 1; + lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 3), "tmp"); + std::cout << "tmpSend" << std::endl; + + delta = tmp[0]; + inv_constant = tmp[1] ^ delta; + start_point = tmp[2]; + + // 秘钥生成 + mitccrh.setS(start_point); + } + + // 包扩 输入值生成和混淆,garbler混淆值的发送 + void inputProcess(yacl::io::BFCircuit param_circ_) { + circ_ = param_circ_; + gb_value.resize(circ_.nw); + wires_.resize(circ_.nw); + + //输入位数有关 + input = yacl::crypto::FastRandU128(); + std::cout << "input of garbler:" << input << std::endl; + + //输入位数有关 + yacl::dynamic_bitset bi_val; + bi_val.append(input); // 直接转换为二进制 输入线路在前64位 + + // 混淆过程 + int num_of_input_wires = 0; + for (size_t i = 0; i < circ_.niv; ++i) { + num_of_input_wires += circ_.niw[i]; + } + + random_uint128_t(gb_value.data(), num_of_input_wires); + + + // 前64位 直接置换 garbler + for (int i = 0; i < circ_.niw[0]; i++) { + wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); + } + + lctx->Send(1, + yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), + "garbleInput1"); + + std::cout << "sendInput1" << std::endl; + + // lctx->Send( + // 1, + // yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), + // "garbleInput2"); + // std::cout << "sendInput2" << std::endl; + + // onlineOT(); + + yacl::Buffer r = lctx->Recv(1, "Input1"); + + //输入位数有关 + const uint128_t* buffer_data = r.data(); + input_EV = *buffer_data; + + + } + + uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, + uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { + bool pa = getLSB(LA0); + bool pb = getLSB(LB0); + + uint128_t HLA0, HA1, HLB0, HB1; + uint128_t tmp, W0; + uint128_t H[4]; + + H[0] = LA0; + H[1] = A1; + H[2] = LB0; + H[3] = B1; + + mitccrh_pointer->hash<2, 2>(H); + + HLA0 = H[0]; + HA1 = H[1]; + HLB0 = H[2]; + HB1 = H[3]; + + table_item[0] = HLA0 ^ HA1; + table_item[0] = table_item[0] ^ (select_mask_[pb] & delta); + + W0 = HLA0; + W0 = W0 ^ (select_mask_[pa] & table_item[0]); + + tmp = HLB0 ^ HB1; + table_item[1] = tmp ^ LA0; + + W0 = W0 ^ HLB0; + W0 = W0 ^ (select_mask_[pb] & tmp); + return W0; + + } + void GB() { + + for (int i = 0; i < circ_.gates.size(); i++) { + auto gate = circ_.gates[i]; + switch (gate.op) { + case yacl::io::BFCircuit::Op::XOR: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 + const auto& iw1 = gb_value.operator[](gate.iw[1]); + gb_value[gate.ow[0]] = iw0 ^ iw1; + break; + } + case yacl::io::BFCircuit::Op::AND: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + const auto& iw1 = gb_value.operator[](gate.iw[1]); + gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, + table[i], &mitccrh); + break; + } + case yacl::io::BFCircuit::Op::INV: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + gb_value[gate.ow[0]] = iw0 ^ inv_constant; + break; + } + case yacl::io::BFCircuit::Op::EQ: { + gb_value[gate.ow[0]] = gate.iw[0]; + break; + } + case yacl::io::BFCircuit::Op::EQW: { + const auto& iw0 = gb_value.operator[](gate.iw[0]); + gb_value[gate.ow[0]] = iw0; + break; + } + case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ + YACL_THROW("Unimplemented MAND gate"); + break; + } + default: + YACL_THROW("Unknown Gate Type: {}", (int)gate.op); + } + } + } + + void sendTable() { + lctx->Send(1, + yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_.ng), + "table"); + std::cout << "sendTable" << std::endl; + } + void decode() { + // 现接收计算结果 + size_t index = wires_.size(); + int start = index - circ_.now[0]; + + yacl::Buffer r = lctx->Recv(1, "output"); + const uint128_t* buffer_data = r.data(); + + memcpy(wires_.data() + start, buffer_data, sizeof(uint128_t) * num_ot); + std::cout << "recvOutput" << std::endl; + + // decode + + // 线路有关 输出位数 + std::vector result(1); + finalize(absl::MakeSpan(result)); + std::cout << "MPC结果:" << ReverseBytes(result[0]) << std::endl; + std::cout << "明文结果:" << Aes128(ReverseBytes(input), ReverseBytes(input_EV)) << std::endl; //待修改 + } + + + /******** + * + * + * 可能有bug + * + * **********/ + template + void finalize(absl::Span outputs) { + // YACL_ENFORCE(outputs.size() >= circ_->nov); + + size_t index = wires_.size(); + + for (size_t i = 0; i < circ_.nov; ++i) { + yacl::dynamic_bitset result(circ_.now[i]); + for (size_t j = 0; j < circ_.now[i]; ++j) { + int wire_index = index - circ_.now[i] + j; + result[j] = getLSB(wires_[wire_index]) ^ + getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 + // 对应的混淆电路计算为LSB ^ d + // 输出线路在后xx位 + } + + outputs[circ_.nov - i - 1] = *(T*)result.data(); + index -= circ_.now[i]; + } + } + void onlineOT(){ + + auto buf = lctx->Recv(1, "masked_choice"); + + dynamic_bitset masked_choices(num_ot); + std::memcpy(masked_choices.data(), buf.data(), buf.size()); + + std::vector batch_send(num_ot); + + for (uint32_t j = 0; j < num_ot; ++j) { + auto idx = num_ot + j; + if (!masked_choices[j]) { + batch_send[j][0] = ot_send.GetBlock(j, 0) ^ gb_value[idx]; + batch_send[j][1] = ot_send.GetBlock(j, 1) ^ gb_value[idx] ^ delta; + } else { + batch_send[j][0] = ot_send.GetBlock(j, 1) ^ gb_value[idx]; + batch_send[j][1] = ot_send.GetBlock(j, 0) ^ gb_value[idx] ^ delta; + } + } + + lctx->SendAsync( + lctx->NextRank(), + ByteContainerView(batch_send.data(), sizeof(uint128_t) * num_ot * 2), + ""); + } + +}; \ No newline at end of file diff --git a/examples/gc/sleep_.cc b/examples/gc/sleep_.cc new file mode 100644 index 00000000..dbfad316 --- /dev/null +++ b/examples/gc/sleep_.cc @@ -0,0 +1,76 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "fmt/format.h" +// #include "gtest/gtest.h" +#include "yacl/link/context.h" +#include "yacl/link/factory.h" +#include "yacl/link/link.h" + +class FactoryTest { + public: + FactoryTest() { + static int desc_count = 0; + contexts_.resize(2); + yacl::link::ContextDesc desc; + desc.id = fmt::format("world_{}", desc_count++); + desc.brpc_retry_count = 20; + desc.parties.push_back( + yacl::link::ContextDesc::Party("alice", "172.18.0.2:63927")); + desc.parties.push_back( + yacl::link::ContextDesc::Party("bob", "172.18.0.3:63921")); + auto create_brpc = [&](int self_rank) { + contexts_[self_rank] = + yacl::link::FactoryBrpc().CreateContext(desc, self_rank); + }; + std::vector> creates; + creates.push_back(std::async(create_brpc, 0)); + for (auto& f : creates) { + f.get(); + } + std::cout << "Connect to Bob successfully\n"; + } + + void work() { + auto test = [&](int self_rank) { + int dst_rank = 1 - self_rank; + this->contexts_[self_rank]->SendAsync(dst_rank, "Hello I am 0", "test"); + yacl::Buffer r = this->contexts_[self_rank]->Recv(dst_rank, "test"); + std::string r_str(r.data(), r.size()); + std::cout << self_rank << " Receive " << r_str << '\n'; + }; + std::vector> tests; + tests.push_back(std::async(test, 0)); + for (auto& f : tests) { + f.get(); + } + } + + ~FactoryTest() { + auto wait = [&](int self_rank) { + contexts_[self_rank]->WaitLinkTaskFinish(); + }; + std::vector> waits; + waits.push_back(std::async(wait, 0)); + for (auto& f : waits) { + f.get(); + } + } + std::vector> contexts_; +}; + +int main() { + FactoryTest F; + sleep(2); + F.work(); + return 0; +} \ No newline at end of file diff --git a/examples/gc/test.cc b/examples/gc/test.cc index fb3c870e..6b2c3064 100644 --- a/examples/gc/test.cc +++ b/examples/gc/test.cc @@ -1,4 +1,4 @@ - + #include #include #include @@ -266,11 +266,13 @@ int main(int argc, char* argv[]) { std::cout << "sendInput1" << std::endl; } else { + yacl::Buffer r = lctx->Recv(0, "garbleInput1"); const uint128_t* buffer_data = r.data(); memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * 64); std::cout << "recvInput1" << std::endl; + } if (FLAGS_rank == 0) { lctx->Send(1, yacl::ByteContainerView(&input, sizeof(uint64_t)), "Input1"); @@ -285,24 +287,24 @@ int main(int argc, char* argv[]) { } // ************混淆方进行发送********* - int num_ot = 64; - vector> send_blocks; - vector recv_blocks(num_ot); - dynamic_bitset choices(num_ot); - for (int i = 64; i < 128; i++) { - send_blocks.push_back({gb_value[i], gb_value[i] ^ delta}); - choices.push_back(bi_val[i]); - } - - yacl::crypto::BaseOtSend(lctx, absl::MakeSpan(send_blocks)); - yacl::crypto::BaseOtRecv(lctx, bi_val, absl::MakeSpan(recv_blocks)); - - for (int i = 0; i < num_ot; i++) { - if (send_blocks[i][choices[i]] != recv_blocks[i]) { - cout << "**********OT错误************"; - break; - } - } + // int num_ot = 64; + // vector> send_blocks; + // vector recv_blocks(num_ot); + // dynamic_bitset choices(num_ot); + // for (int i = 64; i < 128; i++) { + // send_blocks.push_back({gb_value[i], gb_value[i] ^ delta}); + // choices.push_back(bi_val[i]); + // } + + // yacl::crypto::BaseOtSend(lctx, absl::MakeSpan(send_blocks)); + // yacl::crypto::BaseOtRecv(lctx, bi_val, absl::MakeSpan(recv_blocks)); + + // for (int i = 0; i < num_ot; i++) { + // if (send_blocks[i][choices[i]] != recv_blocks[i]) { + // cout << "**********OT错误************"; + // break; + // } + // } if (operate != "neg64" && operate != "zero_equal") { // for (int i = circ_->niw[0]; i < circ_->niw[0] + circ_->niw[1]; i++) { @@ -343,6 +345,7 @@ int main(int argc, char* argv[]) { } std::cout << std::endl; +if(FLAGS_rank == 0){ for (int i = 0; i < circ_->gates.size(); i++) { auto gate = circ_->gates[i]; switch (gate.op) { @@ -381,12 +384,14 @@ int main(int argc, char* argv[]) { YACL_THROW("Unknown Gate Type: {}", (int)gate.op); } } + } // 发送混淆表 if (FLAGS_rank == 0) { lctx->Send( 1, yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_->ng), "table"); + std::cout << "sendTable" << std::endl; // std::cout << "table0" << table[132][0]; @@ -400,12 +405,14 @@ int main(int argc, char* argv[]) { k++; } } + std::cout << "recvTable" << std::endl; // std::cout << "table0" << table[132][0]; } // 计算方进行计算 按拓扑顺序进行计算 +if(FLAGS_rank == 1){ for (int i = 0; i < circ_->gates.size(); i++) { auto gate = circ_->gates[i]; switch (gate.op) { @@ -443,6 +450,7 @@ int main(int argc, char* argv[]) { YACL_THROW("Unknown Gate Type: {}", (int)gate.op); } } + } // 识别输出线路 进行DE操作 // *********Finalize应该由谁来做,怎么做 diff --git a/examples/gc/testByte.cc b/examples/gc/testByte.cc new file mode 100644 index 00000000..fa4e5d5c --- /dev/null +++ b/examples/gc/testByte.cc @@ -0,0 +1,17 @@ +#include + +#include "absl/strings/escaping.h" + +#include "yacl/base/byte_container_view.h" +#include "yacl/base/dynamic_bitset.h" +#include "yacl/base/buffer.h" +#include "yacl/utils/circuit_executor.h" + +using namespace std; +using namespace yacl; + +int main() { + // string str = "hello world!"; + PlainExecutor exec; + return 0; +} \ No newline at end of file diff --git a/examples/gc/test_sha.cc b/examples/gc/test_sha.cc new file mode 100644 index 00000000..a053810d --- /dev/null +++ b/examples/gc/test_sha.cc @@ -0,0 +1,124 @@ +#include + +#include "absl/strings/escaping.h" + +#include "yacl/base/byte_container_view.h" +#include "yacl/base/dynamic_bitset.h" +#include "yacl/crypto/block_cipher/symmetric_crypto.h" +#include "yacl/crypto/hash/hash_utils.h" +#include "yacl/crypto/rand/rand.h" +#include "yacl/io/circuit/bristol_fashion.h" +#include "yacl/utils/circuit_executor.h" +using namespace std; +using namespace yacl; + +using uint256_t = std::array; +using uint512_t = std::array; + +template +void PlainExecutor::Finalize(absl::Span outputs) { + // YACL_ENFORCE(outputs.size() >= circ_->nov); + + size_t index = wires_.size(); + for (size_t i = 0; i < circ_->nov; ++i) { + int half_num_wire = circ_->now[i] / 2; + + dynamic_bitset result(circ_->now[i]); + + for (size_t j = 0; j < circ_->now[i]; ++j) { + result[j % 128] = + wires_[index - circ_->now[i] + + j]; // 得到的是逆序的二进制值 对应的混淆电路计算为 + // LSB ^ d 输出线路在后xx位 + if (j % 128 == 127) { + outputs[circ_->nov - i - 1] = + *(uint128_t*)result.data(); // 先得到最后位置上的 + index -= circ_->now[i]; + cout << std::hex << outputs[circ_->nov - i - 1] << "\t"; + } + } + } + cout << endl; +} + +int main() { + // std::vector data = {0x61, 0x62, 0x63}; // 表示 "abc" + std::vector inputs = { + crypto::FastRandU128(), crypto::FastRandU128(), crypto::FastRandU128(), + crypto::FastRandU128(), 9110772664878759871, 6885964247225200029}; + for (int i = 0; i < 4; i++) { + cout << inputs[i]; + } + cout << endl; + + uint512_t input = {crypto::FastRandU128(), crypto::FastRandU128(), + crypto::FastRandU128(), crypto::FastRandU128()}; + vector result(2); + + // 将 vector 转换为 absl::Span + // ByteContainerView data_view(data); + std::vector data = { + 0x6a, 0x09, 0xe6, 0x67, // H0 + 0xbb, 0x67, 0xae, 0x85, // H1 + 0x3c, 0x6e, 0xf3, 0x72, // H2 + 0xa5, 0x4f, 0xf5, 0x3a, // H3 + 0x51, 0x0e, 0x52, 0x7f, // H4 + 0x9b, 0x05, 0x68, 0x8c, // H5 + 0x1f, 0x83, 0xd9, 0xab, // H6 + 0x5b, 0xe0, 0xcd, 0x19 // H7 + }; + // auto byte_view_init = ByteContainerView(&data, 32); + ByteContainerView byte_view_init(data); + string s = "wH6jKt2bGlUkQX8Mv0YD93jf4A1aCbz2P5EqVnSLRWNmJZOTpoBR3xdhFV7W6gXk"; + vector byteArray(s.begin(), s.end()); + for (int i = 0; i < 32; i++) { + byteArray.push_back(data[i]); + } + // for(auto a: byteArray){ + // cout << a << endl; + // } + // auto byte_view_s = ByteContainerView(&s, 64); + // ByteContainerView byte_view_s(s); + // vector inputs{byte_view_s, byte_view_init}; + // cout << "type" << byte_view_s[0] << endl; + + string str = fmt::format("{}/yacl/io/circuit/data/sha256.txt", + std::filesystem::current_path().string()); + PlainExecutor exec; + + exec.LoadCircuitFile(str); + exec.SetupInputs(absl::MakeSpan(inputs)); + exec.Exec(); + exec.Finalize(absl::MakeSpan(result)); + + // cout << result[0] << "\t" << result[1] << endl; + + // cout << result[0] << "\t" << result[1]; + + // std::array hash = yacl::crypto::Sha256(data_view); + // for (auto byte : hash) { + // std::cout << std::hex << std::setw(2) << std::setfill('0') << + // (int)byte; + // } + // std::cout << std::endl; + // uint32_t H0 = 0x6a09e667; + // uint32_t H1 = 0xbb67ae85; + // uint32_t H2 = 0x3c6ef372; + // uint32_t H3 = 0xa54ff53a; + // uint32_t H4 = 0x510e527f; + // uint32_t H5 = 0x9b05688c; + // uint32_t H6 = 0x1f83d9ab; + // uint32_t H7 = 0x5be0cd19; + + // // 拼接前 4 个 32 位整数 + // uint64_t high = ((uint64_t)H0 << 96) | ((uint64_t)H1 << 64) | + // ((uint64_t)H2 << 32) | (uint64_t)H3; + + // // 拼接后 4 个 32 位整数 + // uint64_t low = ((uint64_t)H4 << 96) | ((uint64_t)H5 << 64) | + // ((uint64_t)H6 << 32) | (uint64_t)H7; + // // 输出结果 + // std::cout << "High 128 bits" << high << std::endl; + // std::cout << "Low 128 bits" << low << std::endl; + return 0; +} \ No newline at end of file diff --git a/examples/gc/test_split.cc b/examples/gc/test_split.cc index 1af15640..ea700370 100644 --- a/examples/gc/test_split.cc +++ b/examples/gc/test_split.cc @@ -6,8 +6,8 @@ // #include "absl/std::strings/escaping.h" #include "absl/types/span.h" -#include "examples/gc/evaluator.h" -#include "examples/gc/garbler.h" +#include "examples/gc/aes_128_evaluator.h" +#include "examples/gc/aes_128_garbler.h" #include "fmt/format.h" #include "yacl/kernel/ot_kernel.h" #include "yacl/kernel/type/ot_store_utils.h" @@ -22,16 +22,12 @@ using uint128_t = __uint128_t; std::shared_ptr circ_; -inline uint128_t Aes128(uint128_t k, uint128_t m) { - yacl::crypto::SymmetricCrypto enc( - yacl::crypto::SymmetricCrypto::CryptoType::AES128_ECB, k); - return enc.Encrypt(m); -} + int main() { // 初始化 - Garbler* garbler = new Garbler(); - Evaluator* evaluator = new Evaluator(); + GarblerAES* garbler = new GarblerAES(); + EvaluatorAES* evaluator = new EvaluatorAES(); std::future thread1 = std::async([&] { garbler->setup(); }); std::future thread2 = std::async([&] { evaluator->setup(); }); @@ -42,7 +38,7 @@ int main() { // 电路读取 std::string pth = fmt::format("{0}/yacl/io/circuit/data/{1}.txt", - std::filesystem::current_path().string(), "adder64"); + std::filesystem::current_path().string(), "aes_128"); yacl::io::CircuitReader reader(pth); reader.ReadMeta(); reader.ReadAllGates(); diff --git a/yacl/crypto/rand/rand.h b/yacl/crypto/rand/rand.h index 5c2c351f..fde3d68b 100644 --- a/yacl/crypto/rand/rand.h +++ b/yacl/crypto/rand/rand.h @@ -81,6 +81,19 @@ inline uint32_t RandInRange(uint32_t n) { uint32_t tmp = FastRandU64(); return tmp % n; } +template , int> = 0> +inline T RandLtN(T n) { + // see: nist-sp800-90A, Appendix A.5.3 + // efficiency: constant-round + auto required_size = + sizeof(T) + (YACL_MODULE_SECPARAM_S_UINT("rand") + 7) / 8; + auto rand_bytes = SecureRandBytes(required_size); + math::MPInt r; + r.FromMagBytes(rand_bytes, Endian::little); + math::MPInt::Mod(r, math::MPInt(n), &r); + return r.Get(); +} // ----------------------------- // Random Support for Yacl Types // ----------------------------- diff --git a/yacl/io/circuit/bristol_fashion.cc b/yacl/io/circuit/bristol_fashion.cc index eb447866..0b39056e 100644 --- a/yacl/io/circuit/bristol_fashion.cc +++ b/yacl/io/circuit/bristol_fashion.cc @@ -145,4 +145,55 @@ void CircuitReader::ReadAllGates() { } } +std::vector BuiltinBFCircuit::PrepareSha256Input( + ByteContainerView input) { +constexpr size_t kFixPadSize = 1; // in bytes +constexpr size_t kMsgLenSize = sizeof(uint64_t); // in bytes +constexpr size_t kMsgBlockSize = 64; // in bytes +const auto kInitSha256Bytes = GetSha256InitialHashValues(); + +uint64_t input_size = input.size(); // in bytes +uint64_t zero_padding_size = + (input_size + kFixPadSize + kMsgLenSize) % kMsgBlockSize == 0 + ? 0 + : kMsgBlockSize - + (input_size + kFixPadSize + kMsgLenSize) % kMsgBlockSize; +uint64_t message_size = + input_size + kFixPadSize + zero_padding_size + kMsgLenSize; +uint64_t result_size = message_size + kInitSha256Bytes.size(); + +// TODO: support arbitrary large input +YACL_ENFORCE(message_size == kMsgBlockSize); + +// Declare the result byte-vector +size_t offset = 0; +std::vector result(result_size); + +// the next 64 bits should be the byte length of input message +uint64_t input_bitnum = input_size * 8; // in bits +std::memcpy(result.data() + offset, &input_bitnum, sizeof(input_bitnum)); +offset += sizeof(uint64_t); + +// zero padding (result vector has zero initialization) +// ... should doing nothing ... +offset += zero_padding_size; + +// additional padding bit-'1' (as a mark) +result[offset] = 0x80; +offset += kFixPadSize; + +// original input message +auto input_reverse = std::vector(input.begin(), input.end()); +std::reverse(input_reverse.begin(), input_reverse.end()); +std::memcpy(result.data() + offset, input_reverse.data(), input_size); +offset += input_size; + +// initial hash values +std::memcpy(result.data() + offset, kInitSha256Bytes.data(), + kInitSha256Bytes.size()); +// offset += kInitSha256Bytes.size(); + +return result; +} + } // namespace yacl::io diff --git a/yacl/io/circuit/bristol_fashion.h b/yacl/io/circuit/bristol_fashion.h index 5dcb063e..fd5d723b 100644 --- a/yacl/io/circuit/bristol_fashion.h +++ b/yacl/io/circuit/bristol_fashion.h @@ -144,6 +144,10 @@ class BuiltinBFCircuit { std::filesystem::current_path().string()); } + static std::string Sha256Path() { + return fmt::format("{}/sha256.txt", CircDataDir); + } + static std::vector PrepareSha256Input(ByteContainerView input); // NOTE: sha256 needs two inputs, a 512 bit buffer, and a 256 bit previous // digest value // From aa6a6d5d2bc6469fa103c6b2eace9008e4397b07 Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Fri, 28 Feb 2025 17:06:18 +0800 Subject: [PATCH 19/27] gc_sha256_inputOK --- examples/gc/BUILD.bazel | 33 ++++++- examples/gc/sha256_garbler.h | 149 ++++++++++++++++++++--------- examples/gc/test_split.cc | 42 ++++---- yacl/crypto/rand/BUILD.bazel | 1 + yacl/crypto/rand/rand.h | 3 +- yacl/io/circuit/BUILD.bazel | 1 + yacl/io/circuit/bristol_fashion.cc | 11 ++- yacl/io/circuit/bristol_fashion.h | 6 +- 8 files changed, 179 insertions(+), 67 deletions(-) diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel index 090f3f79..d5e1b0d0 100644 --- a/examples/gc/BUILD.bazel +++ b/examples/gc/BUILD.bazel @@ -193,6 +193,36 @@ cc_library( ], ) +cc_library( + name = "sha256_garbler", + hdrs = [ + "sha256_garbler.h", + ], + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], + deps = [ + ":mitccrh", + "//yacl/crypto/block_cipher:symmetric_crypto", + + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/crypto/rand", + "//yacl/crypto/tools:prg", + "//yacl/io/circuit:bristol_fashion", + "//yacl/io/stream:file_io", + "//yacl/kernel/algorithms:base_ot", + "//yacl/kernel/algorithms:iknp_ote", + "//yacl/link:test_util", + "//yacl/utils:circuit_executor", + "//yacl/kernel:ot_kernel", + "//yacl/kernel/type:ot_store_utils", + "//yacl/math/mpint" + ], +) + cc_library( name = "aes_128_evaluator", hdrs = [ @@ -233,7 +263,8 @@ cc_binary( ":mitccrh", ":garbler", ":evaluator", - ":aes_128_garbler", + ":sha256_garbler", + ":aes_128_evaluator", "//yacl/base:byte_container_view", "//yacl/base:dynamic_bitset", diff --git a/examples/gc/sha256_garbler.h b/examples/gc/sha256_garbler.h index c58b378e..3c7cdee4 100644 --- a/examples/gc/sha256_garbler.h +++ b/examples/gc/sha256_garbler.h @@ -20,9 +20,12 @@ #include "yacl/link/context.h" #include "yacl/link/factory.h" #include "yacl/link/test_util.h" +#include "yacl/crypto/block_cipher/symmetric_crypto.h" #include "yacl/utils/circuit_executor.h" #include "yacl/kernel/ot_kernel.h" #include "yacl/kernel/type/ot_store_utils.h" +#include "yacl/math/mpint/mp_int.h" +#include "yacl/crypto/hash/ssl_hash.h" using namespace std; using namespace yacl; namespace { @@ -42,17 +45,21 @@ inline uint128_t Aes128(uint128_t k, uint128_t m) { return enc.Encrypt(m); } - uint128_t ReverseBytes(uint128_t x) { - auto byte_view = ByteContainerView(&x, sizeof(x)); - uint128_t ret = 0; - auto buf = std::vector(sizeof(ret)); - for (size_t i = 0; i < byte_view.size(); ++i) { - buf[byte_view.size() - i - 1] = byte_view[i]; - } - std::memcpy(&ret, buf.data(), buf.size()); - return ret; + +template , int> = 0> +inline T RandLtN(T n) { + // see: nist-sp800-90A, Appendix A.5.3 + // efficiency: constant-round + auto required_size = + sizeof(T) + (YACL_MODULE_SECPARAM_S_UINT("rand") + 7) / 8; + auto rand_bytes = SecureRandBytes(required_size); + math::MPInt r; + r.FromMagBytes(rand_bytes, Endian::little); + math::MPInt::Mod(r, math::MPInt(n), &r); + return r.Get(); } -class GarblerAES { +class GarblerSHA256 { public: std::shared_ptr lctx; uint128_t delta; @@ -75,8 +82,61 @@ class GarblerAES { yacl::crypto::OtSendStore ot_send = OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); - - + constexpr std::array GetSha256InitialHashValues() { + return {0x19, 0xcd, 0xe0, 0x5b, 0xab, 0xd9, 0x83, 0x1f, 0x8c, 0x68, 0x05, + 0x9b, 0x7f, 0x52, 0x0e, 0x51, 0x3a, 0xf5, 0x4f, 0xa5, 0x72, 0xf3, + 0x6e, 0x3c, 0x85, 0xae, 0x67, 0xbb, 0x67, 0xe6, 0x09, 0x6a}; + } + std::vector PrepareSha256Input( + ByteContainerView input) { + constexpr size_t kFixPadSize = 1; // in bytes + constexpr size_t kMsgLenSize = sizeof(uint64_t); // in bytes + constexpr size_t kMsgBlockSize = 64; // in bytes + const auto kInitSha256Bytes = GetSha256InitialHashValues(); + + uint64_t input_size = input.size(); // in bytes + uint64_t zero_padding_size = + (input_size + kFixPadSize + kMsgLenSize) % kMsgBlockSize == 0 + ? 0 + : kMsgBlockSize - + (input_size + kFixPadSize + kMsgLenSize) % kMsgBlockSize; + uint64_t message_size = + input_size + kFixPadSize + zero_padding_size + kMsgLenSize; + uint64_t result_size = message_size + kInitSha256Bytes.size(); + + // TODO: support arbitrary large input + YACL_ENFORCE(message_size == kMsgBlockSize); + + // Declare the result byte-vector + size_t offset = 0; + std::vector result(result_size); + + // the next 64 bits should be the byte length of input message + uint64_t input_bitnum = input_size * 8; // in bits + std::memcpy(result.data() + offset, &input_bitnum, sizeof(input_bitnum)); + offset += sizeof(uint64_t); + + // zero padding (result vector has zero initialization) + // ... should doing nothing ... + offset += zero_padding_size; + + // additional padding bit-'1' (as a mark) + result[offset] = 0x80; + offset += kFixPadSize; + + // original input message + auto input_reverse = std::vector(input.begin(), input.end()); + std::reverse(input_reverse.begin(), input_reverse.end()); + std::memcpy(result.data() + offset, input_reverse.data(), input_size); + offset += input_size; + + // initial hash values + std::memcpy(result.data() + offset, kInitSha256Bytes.data(), + kInitSha256Bytes.size()); + // offset += kInitSha256Bytes.size(); + + return result; + } void setup() { // 通信环境初始化 size_t world_size = 2; @@ -122,46 +182,49 @@ class GarblerAES { wires_.resize(circ_.nw); //输入位数有关 - input = yacl::crypto::FastRandU128(); - std::cout << "input of garbler:" << input << std::endl; + auto message = crypto::FastRandBytes(crypto::RandLtN(32)); + auto in_buf = io::BuiltinBFCircuit::PrepareSha256Input(message); - //输入位数有关 - yacl::dynamic_bitset bi_val; - bi_val.append(input); // 直接转换为二进制 输入线路在前64位 + // input = yacl::crypto::FastRandU128(); + // std::cout << "input of garbler:" << input << std::endl; - // 混淆过程 - int num_of_input_wires = 0; - for (size_t i = 0; i < circ_.niv; ++i) { - num_of_input_wires += circ_.niw[i]; - } + // //输入位数有关 + // yacl::dynamic_bitset bi_val; + // bi_val.append(input); // 直接转换为二进制 输入线路在前64位 + + // // 混淆过程 + // int num_of_input_wires = 0; + // for (size_t i = 0; i < circ_.niv; ++i) { + // num_of_input_wires += circ_.niw[i]; + // } - random_uint128_t(gb_value.data(), num_of_input_wires); + // random_uint128_t(gb_value.data(), num_of_input_wires); - // 前64位 直接置换 garbler - for (int i = 0; i < circ_.niw[0]; i++) { - wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); - } + // // 前64位 直接置换 garbler + // for (int i = 0; i < circ_.niw[0]; i++) { + // wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); + // } - lctx->Send(1, - yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), - "garbleInput1"); + // lctx->Send(1, + // yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), + // "garbleInput1"); - std::cout << "sendInput1" << std::endl; + // std::cout << "sendInput1" << std::endl; - // lctx->Send( - // 1, - // yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), - // "garbleInput2"); - // std::cout << "sendInput2" << std::endl; + // // lctx->Send( + // // 1, + // // yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), + // // "garbleInput2"); + // // std::cout << "sendInput2" << std::endl; - // onlineOT(); + // // onlineOT(); - yacl::Buffer r = lctx->Recv(1, "Input1"); + // yacl::Buffer r = lctx->Recv(1, "Input1"); - //输入位数有关 - const uint128_t* buffer_data = r.data(); - input_EV = *buffer_data; + // //输入位数有关 + // const uint128_t* buffer_data = r.data(); + // input_EV = *buffer_data; } @@ -265,8 +328,8 @@ class GarblerAES { // 线路有关 输出位数 std::vector result(1); finalize(absl::MakeSpan(result)); - std::cout << "MPC结果:" << ReverseBytes(result[0]) << std::endl; - std::cout << "明文结果:" << Aes128(ReverseBytes(input), ReverseBytes(input_EV)) << std::endl; //待修改 + // std::cout << "MPC结果:" << ReverseBytes(result[0]) << std::endl; + // std::cout << "明文结果:" << Aes128(ReverseBytes(input), ReverseBytes(input_EV)) << std::endl; //待修改 } diff --git a/examples/gc/test_split.cc b/examples/gc/test_split.cc index ea700370..0d883ce1 100644 --- a/examples/gc/test_split.cc +++ b/examples/gc/test_split.cc @@ -7,7 +7,8 @@ // #include "absl/std::strings/escaping.h" #include "absl/types/span.h" #include "examples/gc/aes_128_evaluator.h" -#include "examples/gc/aes_128_garbler.h" + +#include "examples/gc/sha256_garbler.h" #include "fmt/format.h" #include "yacl/kernel/ot_kernel.h" #include "yacl/kernel/type/ot_store_utils.h" @@ -26,7 +27,7 @@ std::shared_ptr circ_; int main() { // 初始化 - GarblerAES* garbler = new GarblerAES(); + GarblerSHA256* garbler = new GarblerSHA256(); EvaluatorAES* evaluator = new EvaluatorAES(); std::future thread1 = std::async([&] { garbler->setup(); }); @@ -45,32 +46,33 @@ int main() { circ_ = reader.StealCirc(); // 指针 // 输入处理 - thread1 = std::async([&] { garbler->inputProcess(*circ_); }); - thread2 = std::async([&] { evaluator->inputProcess(*circ_); }); - thread1.get(); - thread2.get(); + garbler->inputProcess(*circ_); + // thread1 = std::async([&] { garbler->inputProcess(*circ_); }); + // thread2 = std::async([&] { evaluator->inputProcess(*circ_); }); + // thread1.get(); + // thread2.get(); - // OT - thread1 = std::async([&] { evaluator -> onLineOT();}); - thread2 = std::async([&] { garbler -> onlineOT(); }); - thread1.get(); - thread2.get(); + // // OT + // thread1 = std::async([&] { evaluator -> onLineOT();}); + // thread2 = std::async([&] { garbler -> onlineOT(); }); + // thread1.get(); + // thread2.get(); - // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator - garbler->GB(); - garbler->sendTable(); + // // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator + // garbler->GB(); + // garbler->sendTable(); - evaluator->recvTable(); + // evaluator->recvTable(); - // // 计算方进行计算 按拓扑顺序进行计算 - evaluator->EV(); + // // // 计算方进行计算 按拓扑顺序进行计算 + // evaluator->EV(); - // // evaluator发送计算结果 garbler进行DE操作 - evaluator->sendOutput(); + // // // evaluator发送计算结果 garbler进行DE操作 + // evaluator->sendOutput(); - garbler->decode(); + // garbler->decode(); return 0; diff --git a/yacl/crypto/rand/BUILD.bazel b/yacl/crypto/rand/BUILD.bazel index 8e289f65..557a99c9 100644 --- a/yacl/crypto/rand/BUILD.bazel +++ b/yacl/crypto/rand/BUILD.bazel @@ -27,6 +27,7 @@ yacl_cc_library( "//yacl/base:int128", "//yacl/crypto/rand/drbg", "//yacl/crypto/tools:prg", + "//yacl/math/mpint:mpint", ], ) diff --git a/yacl/crypto/rand/rand.h b/yacl/crypto/rand/rand.h index fde3d68b..804bb373 100644 --- a/yacl/crypto/rand/rand.h +++ b/yacl/crypto/rand/rand.h @@ -27,7 +27,7 @@ #include "yacl/crypto/openssl_wrappers.h" #include "yacl/crypto/rand/drbg/drbg.h" #include "yacl/secparam.h" - +#include "yacl/math/mpint/mp_int.h" namespace yacl::crypto { // ------------------------- @@ -114,6 +114,7 @@ inline T FastRandBits(uint64_t len) { return RandBits(len, true); } + // Generate rand bits in a secure but slow way template , std::enable_if_t::value, bool> = true> diff --git a/yacl/io/circuit/BUILD.bazel b/yacl/io/circuit/BUILD.bazel index 34458bef..499116c5 100644 --- a/yacl/io/circuit/BUILD.bazel +++ b/yacl/io/circuit/BUILD.bazel @@ -26,6 +26,7 @@ yacl_cc_library( srcs = ["bristol_fashion.cc"], hdrs = ["bristol_fashion.h"], deps = [ + "//yacl/base:byte_container_view", "//yacl/io/stream:file_io", "//yacl/link:context", ], diff --git a/yacl/io/circuit/bristol_fashion.cc b/yacl/io/circuit/bristol_fashion.cc index 0b39056e..e1befd21 100644 --- a/yacl/io/circuit/bristol_fashion.cc +++ b/yacl/io/circuit/bristol_fashion.cc @@ -16,7 +16,7 @@ #include "absl/strings/numbers.h" #include "absl/strings/str_split.h" - +#include "spdlog/spdlog.h" #include "yacl/base/exception.h" namespace yacl::io { @@ -145,6 +145,14 @@ void CircuitReader::ReadAllGates() { } } +namespace { + constexpr std::array GetSha256InitialHashValues() { + return {0x19, 0xcd, 0xe0, 0x5b, 0xab, 0xd9, 0x83, 0x1f, 0x8c, 0x68, 0x05, + 0x9b, 0x7f, 0x52, 0x0e, 0x51, 0x3a, 0xf5, 0x4f, 0xa5, 0x72, 0xf3, + 0x6e, 0x3c, 0x85, 0xae, 0x67, 0xbb, 0x67, 0xe6, 0x09, 0x6a}; + } + } // namespace + std::vector BuiltinBFCircuit::PrepareSha256Input( ByteContainerView input) { constexpr size_t kFixPadSize = 1; // in bytes @@ -196,4 +204,5 @@ std::memcpy(result.data() + offset, kInitSha256Bytes.data(), return result; } + } // namespace yacl::io diff --git a/yacl/io/circuit/bristol_fashion.h b/yacl/io/circuit/bristol_fashion.h index fd5d723b..2088f4f5 100644 --- a/yacl/io/circuit/bristol_fashion.h +++ b/yacl/io/circuit/bristol_fashion.h @@ -23,10 +23,13 @@ #include "spdlog/spdlog.h" +#include "yacl/base/byte_container_view.h" #include "yacl/base/exception.h" #include "yacl/io/stream/file_io.h" #include "yacl/io/stream/interface.h" + + namespace yacl::io { // Bristol Fashion Circuit @@ -145,7 +148,8 @@ class BuiltinBFCircuit { } static std::string Sha256Path() { - return fmt::format("{}/sha256.txt", CircDataDir); + return fmt::format("{}/yacl/io/circuit/data/sha256.txt", + std::filesystem::current_path().string()); } static std::vector PrepareSha256Input(ByteContainerView input); // NOTE: sha256 needs two inputs, a 512 bit buffer, and a 256 bit previous From 60edf2852554de8937e73fbf00c2e85eeced868b Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Mon, 3 Mar 2025 16:59:15 +0800 Subject: [PATCH 20/27] sync25_3_3 --- examples/gc/BUILD.bazel | 29 +++- examples/gc/sha256_evaluator.h | 243 +++++++++++++++++++++++++++++++++ examples/gc/sha256_garbler.h | 200 +++++++++++++-------------- examples/gc/test_split.cc | 35 ++--- 4 files changed, 389 insertions(+), 118 deletions(-) create mode 100644 examples/gc/sha256_evaluator.h diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel index d5e1b0d0..707d5832 100644 --- a/examples/gc/BUILD.bazel +++ b/examples/gc/BUILD.bazel @@ -223,6 +223,33 @@ cc_library( ], ) +cc_library( + name = "sha256_evaluator", + hdrs = [ + "sha256_evaluator.h", + ], + copts = [ + "-mavx", + "-maes", + "-mpclmul", + ], + deps = [ + ":mitccrh", + "//yacl/base:byte_container_view", + "//yacl/base:dynamic_bitset", + "//yacl/crypto/rand", + "//yacl/crypto/tools:prg", + "//yacl/io/circuit:bristol_fashion", + "//yacl/io/stream:file_io", + "//yacl/kernel/algorithms:base_ot", + "//yacl/kernel/algorithms:iknp_ote", + "//yacl/link:test_util", + "//yacl/utils:circuit_executor", + "//yacl/kernel:ot_kernel", + "//yacl/kernel/type:ot_store_utils", + ], +) + cc_library( name = "aes_128_evaluator", hdrs = [ @@ -264,7 +291,7 @@ cc_binary( ":garbler", ":evaluator", ":sha256_garbler", - + ":sha256_evaluator", ":aes_128_evaluator", "//yacl/base:byte_container_view", "//yacl/base:dynamic_bitset", diff --git a/examples/gc/sha256_evaluator.h b/examples/gc/sha256_evaluator.h new file mode 100644 index 00000000..b74278a4 --- /dev/null +++ b/examples/gc/sha256_evaluator.h @@ -0,0 +1,243 @@ +#pragma once +#include +#include +#include +#include + +#include "absl/types/span.h" +#include "examples/gc/mitccrh.h" +#include "fmt/format.h" + +#include "yacl/base/byte_container_view.h" +#include "yacl/base/dynamic_bitset.h" +#include "yacl/base/exception.h" +#include "yacl/crypto/rand/rand.h" +#include "yacl/io/circuit/bristol_fashion.h" +#include "yacl/io/stream/file_io.h" +#include "yacl/kernel/algorithms/base_ot.h" +#include "yacl/kernel/algorithms/iknp_ote.h" +#include "yacl/kernel/type/ot_store_utils.h" +#include "yacl/link/context.h" +#include "yacl/link/factory.h" +#include "yacl/link/test_util.h" +#include "yacl/utils/circuit_executor.h" +#include "yacl/kernel/ot_kernel.h" +#include "yacl/kernel/type/ot_store_utils.h" + +using namespace std; +using namespace yacl; +using namespace yacl::crypto; +namespace { +using uint128_t = __uint128_t; +using OtMsg = uint128_t; +using OtMsgPair = std::array; +using OtChoices = dynamic_bitset; +} + +uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); +uint128_t select_mask[2] = {0, all_one_uint128_t}; + +class EvaluatorSHA256 { + public: + uint128_t delta; + uint128_t inv_constant; + uint128_t start_point; + MITCCRH<8> mitccrh; + + std::vector wires_; + std::vector gb_value; + yacl::io::BFCircuit circ_; + std::shared_ptr lctx; + + //根据电路改 + uint128_t table[135073][2]; + uint128_t input; + const int num_ot = 768; + + yacl::crypto::OtRecvStore ot_recv = OtRecvStore(num_ot, yacl::crypto::OtStoreType::Normal); + + void setup() { + // 通信环境初始化 + size_t world_size = 2; + yacl::link::ContextDesc ctx_desc; + + for (size_t rank = 0; rank < world_size; rank++) { + const auto id = fmt::format("id-{}", rank); + const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); + ctx_desc.parties.push_back({id, host}); + } + + lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, + 1); + lctx->ConnectToMesh(); + + //OT off-line + const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; + yacl::crypto::OtKernel kernel1(yacl::crypto::OtKernel::Role::Receiver, ext_algorithm); + kernel1.init(lctx); + kernel1.eval_rot(lctx, num_ot, &ot_recv); + + uint128_t tmp[3]; + // delta, inv_constant, start_point 接收 + yacl::Buffer r = lctx->Recv(0, "tmp"); + const uint128_t* buffer_data = r.data(); + memcpy(tmp, buffer_data, sizeof(uint128_t) * 3); + std::cout << "tmpRecv" << std::endl; + + delta = tmp[0]; + inv_constant = tmp[1]; + start_point = tmp[2]; + + // 秘钥生成 + mitccrh.setS(start_point); + } + + void inputProcess(yacl::io::BFCircuit param_circ_) { + circ_ = param_circ_; + gb_value.resize(circ_.nw); + wires_.resize(circ_.nw); + + //输入位数有关 + // yacl::dynamic_bitset bi_val; + + // //输入位数有关 + // input = yacl::crypto::FastRandU128(); + // std::cout << "input of evaluator:" << input << std::endl; + // bi_val.append(input); // 直接转换为二进制 输入线路在前64位 + // 接收garbler混淆值 + yacl::Buffer r = lctx->Recv(0, "garbleInput1"); + + const uint128_t* buffer_data = r.data(); + + memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * num_ot); + + std::cout << "recvInput1" << std::endl; + + // 对evaluator自己的输入值进行混淆 + // r = lctx->Recv(0, "garbleInput2"); + // buffer_data = r.data(); + // for (int i = 0; i < circ_.niw[1]; i++) { + // wires_[i + circ_.niw[0]] = + // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); + + // } + // std::cout << "recvInput2" << std::endl; + + // onLineOT(); + + //输入位数有关 + // lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint128_t)), "Input1"); + } + void recvTable() { + + yacl::Buffer r = lctx->Recv(0, "table"); + const uint128_t* buffer_data = r.data(); + int k = 0; + for (int i = 0; i < circ_.ng; i++) { + for (int j = 0; j < 2; j++) { + table[i][j] = buffer_data[k]; + k++; + } + } + + std::cout << "recvTable" << std::endl; + + } + + //未检查 + uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, + MITCCRH<8>* mitccrh_pointer) { + uint128_t HA, HB, W; + int sa, sb; + + sa = getLSB(A); + sb = getLSB(B); + + uint128_t H[2]; + H[0] = A; + H[1] = B; + mitccrh_pointer->hash<2, 1>(H); + HA = H[0]; + HB = H[1]; + + W = HA ^ HB; + W = W ^ (select_mask[sa] & table_item[0]); + W = W ^ (select_mask[sb] & table_item[1]); + W = W ^ (select_mask[sb] & A); + return W; + } + + void EV() { + for (int i = 0; i < circ_.gates.size(); i++) { + auto gate = circ_.gates[i]; + switch (gate.op) { + case yacl::io::BFCircuit::Op::XOR: { + const auto& iw0 = wires_.operator[](gate.iw[0]); // 取到具体值 + const auto& iw1 = wires_.operator[](gate.iw[1]); + wires_[gate.ow[0]] = iw0 ^ iw1; + break; + } + case yacl::io::BFCircuit::Op::AND: { + const auto& iw0 = wires_.operator[](gate.iw[0]); + const auto& iw1 = wires_.operator[](gate.iw[1]); + wires_[gate.ow[0]] = EVAND(iw0, iw1, table[i], &mitccrh); + break; + } + case yacl::io::BFCircuit::Op::INV: { + const auto& iw0 = wires_.operator[](gate.iw[0]); + wires_[gate.ow[0]] = iw0 ^ inv_constant; + break; + } + case yacl::io::BFCircuit::Op::EQ: { + wires_[gate.ow[0]] = gate.iw[0]; + break; + } + case yacl::io::BFCircuit::Op::EQW: { + const auto& iw0 = wires_.operator[](gate.iw[0]); + wires_[gate.ow[0]] = iw0; + break; + } + case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ + YACL_THROW("Unimplemented MAND gate"); + break; + } + default: + YACL_THROW("Unknown Gate Type: {}", (int)gate.op); + } + } + } + void sendOutput() { + size_t index = wires_.size(); + int start = index - circ_.now[0]; + lctx->Send( + 0, + yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * 256), + "output"); + std::cout << "sendOutput" << std::endl; + // for(int i = start; i < index; i++){ + // cout << wires_[i]<<" "; + // } + // cout << endl; + } + void onLineOT(){ + // vector choices(96); + + + yacl::dynamic_bitset choices; + choices.append(input); + + yacl::dynamic_bitset ot = ot_recv.CopyBitBuf(); + ot.resize(choices.size()); + + yacl::dynamic_bitset masked_choices = ot ^ choices; + lctx->Send(0, yacl::ByteContainerView(masked_choices.data(), sizeof(uint128_t)), "masked_choice"); + + auto buf = lctx->Recv(lctx->NextRank(), ""); + std::vector batch_recv(num_ot); + std::memcpy(batch_recv.data(), buf.data(), buf.size()); + for (uint32_t j = 0; j < num_ot; ++j) { + auto idx = num_ot + j; + wires_[idx] = batch_recv[j][choices[j]] ^ ot_recv.GetBlock(j); + } + } +}; \ No newline at end of file diff --git a/examples/gc/sha256_garbler.h b/examples/gc/sha256_garbler.h index 3c7cdee4..333492e8 100644 --- a/examples/gc/sha256_garbler.h +++ b/examples/gc/sha256_garbler.h @@ -46,19 +46,7 @@ inline uint128_t Aes128(uint128_t k, uint128_t m) { } -template , int> = 0> -inline T RandLtN(T n) { - // see: nist-sp800-90A, Appendix A.5.3 - // efficiency: constant-round - auto required_size = - sizeof(T) + (YACL_MODULE_SECPARAM_S_UINT("rand") + 7) / 8; - auto rand_bytes = SecureRandBytes(required_size); - math::MPInt r; - r.FromMagBytes(rand_bytes, Endian::little); - math::MPInt::Mod(r, math::MPInt(n), &r); - return r.Get(); -} + class GarblerSHA256 { public: std::shared_ptr lctx; @@ -71,72 +59,18 @@ class GarblerSHA256 { std::vector gb_value; yacl::io::BFCircuit circ_; //根据电路改 - uint128_t table[36663][2]; + uint128_t table[135073][2]; //输入数据类型需要修改 uint128_t input; uint128_t input_EV; - + vector message; //num_ot根据输入改 - const int num_ot = 128; - yacl::crypto::OtSendStore ot_send = OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); + const int num_ot = 768; + yacl::crypto::OtSendStore ot_send = yacl::crypto::OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); + - constexpr std::array GetSha256InitialHashValues() { - return {0x19, 0xcd, 0xe0, 0x5b, 0xab, 0xd9, 0x83, 0x1f, 0x8c, 0x68, 0x05, - 0x9b, 0x7f, 0x52, 0x0e, 0x51, 0x3a, 0xf5, 0x4f, 0xa5, 0x72, 0xf3, - 0x6e, 0x3c, 0x85, 0xae, 0x67, 0xbb, 0x67, 0xe6, 0x09, 0x6a}; - } - std::vector PrepareSha256Input( - ByteContainerView input) { - constexpr size_t kFixPadSize = 1; // in bytes - constexpr size_t kMsgLenSize = sizeof(uint64_t); // in bytes - constexpr size_t kMsgBlockSize = 64; // in bytes - const auto kInitSha256Bytes = GetSha256InitialHashValues(); - - uint64_t input_size = input.size(); // in bytes - uint64_t zero_padding_size = - (input_size + kFixPadSize + kMsgLenSize) % kMsgBlockSize == 0 - ? 0 - : kMsgBlockSize - - (input_size + kFixPadSize + kMsgLenSize) % kMsgBlockSize; - uint64_t message_size = - input_size + kFixPadSize + zero_padding_size + kMsgLenSize; - uint64_t result_size = message_size + kInitSha256Bytes.size(); - - // TODO: support arbitrary large input - YACL_ENFORCE(message_size == kMsgBlockSize); - - // Declare the result byte-vector - size_t offset = 0; - std::vector result(result_size); - - // the next 64 bits should be the byte length of input message - uint64_t input_bitnum = input_size * 8; // in bits - std::memcpy(result.data() + offset, &input_bitnum, sizeof(input_bitnum)); - offset += sizeof(uint64_t); - - // zero padding (result vector has zero initialization) - // ... should doing nothing ... - offset += zero_padding_size; - - // additional padding bit-'1' (as a mark) - result[offset] = 0x80; - offset += kFixPadSize; - - // original input message - auto input_reverse = std::vector(input.begin(), input.end()); - std::reverse(input_reverse.begin(), input_reverse.end()); - std::memcpy(result.data() + offset, input_reverse.data(), input_size); - offset += input_size; - - // initial hash values - std::memcpy(result.data() + offset, kInitSha256Bytes.data(), - kInitSha256Bytes.size()); - // offset += kInitSha256Bytes.size(); - - return result; - } void setup() { // 通信环境初始化 size_t world_size = 2; @@ -182,43 +116,81 @@ class GarblerSHA256 { wires_.resize(circ_.nw); //输入位数有关 - auto message = crypto::FastRandBytes(crypto::RandLtN(32)); - auto in_buf = io::BuiltinBFCircuit::PrepareSha256Input(message); - - // input = yacl::crypto::FastRandU128(); - // std::cout << "input of garbler:" << input << std::endl; - - // //输入位数有关 + message = crypto::FastRandBytes(crypto::RandLtN(32)); + auto in_buf = io::BuiltinBFCircuit::PrepareSha256Input(message); //是不是直接可以当成ByteContainerView???先试试 + // cout << "size" << in_buf.size() << endl; + // sha256_result = vector(32); + auto sha256_result = crypto::Sha256Hash().Update(message).CumulativeHash(); + for(int i = 0; i < 32; i++){ + cout < bi_val; + bi_val.resize(circ_.nw); + std::memcpy(bi_val.data(), in_buf.data(), in_buf.size()); + for(int i = 0; i < 768; i++){ + + wires_[i] = bi_val[i]; + // cout << bi_val[i] << " "; + // cout << wires_[i] <<" "; + + } + // cout << endl; + // for(int i = 0; i < 768; i++){ + // cout << wires_[i] <<" "; + // } + // cout << endl; + // cout << endl; // yacl::dynamic_bitset bi_val; // bi_val.append(input); // 直接转换为二进制 输入线路在前64位 - // // 混淆过程 - // int num_of_input_wires = 0; - // for (size_t i = 0; i < circ_.niv; ++i) { - // num_of_input_wires += circ_.niw[i]; - // } + // 混淆过程 + int num_of_input_wires = 0; + for (size_t i = 0; i < circ_.niv; ++i) { + num_of_input_wires += circ_.niw[i]; + } - // random_uint128_t(gb_value.data(), num_of_input_wires); + random_uint128_t(gb_value.data(), num_of_input_wires); - // // 前64位 直接置换 garbler + // 前64位 直接置换 garbler + + for(int i = 0; i < 768; i++){ + + wires_[i] = gb_value[i] ^ (select_mask_[bool(wires_[i])] & delta); + + } + // for (int i = 0; i < circ_.niw[0]; i++) { // wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); // } - // lctx->Send(1, - // yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), - // "garbleInput1"); + lctx->Send(1, + yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), + "garbleInput1"); + + std::cout << "sendInput1" << std::endl; + - // std::cout << "sendInput1" << std::endl; - // // lctx->Send( - // // 1, - // // yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), - // // "garbleInput2"); - // // std::cout << "sendInput2" << std::endl; + //输送到wires + std::memcpy(gb_value.data(), in_buf.data(), in_buf.size()); - // // onlineOT(); + + lctx->Send(1, + yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), + "garbleInput1"); + + std::cout << "sendInput1" << std::endl; + + // lctx->Send( + // 1, + // yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), + // "garbleInput2"); + // std::cout << "sendInput2" << std::endl; + + // onlineOT(); // yacl::Buffer r = lctx->Recv(1, "Input1"); @@ -318,16 +290,44 @@ class GarblerSHA256 { int start = index - circ_.now[0]; yacl::Buffer r = lctx->Recv(1, "output"); - const uint128_t* buffer_data = r.data(); + // vector out(96); - memcpy(wires_.data() + start, buffer_data, sizeof(uint128_t) * num_ot); + memcpy(wires_.data() + start, r.data(), sizeof(uint128_t) * 256); std::cout << "recvOutput" << std::endl; + // for(int i = start; i < index; i++){ + // cout << wires_[i]<<" "; + // } + // cout << endl; + const auto out_size = 32; + std::vector out(out_size); + + for (size_t i = 0; i < out_size; ++i) { + dynamic_bitset result(8); + for (size_t j = 0; j < 8; ++j) { + result[j] = getLSB(wires_[index - 8 + j]) ^ getLSB(gb_value[index - 8 + j]); + } + out[out_size - i - 1] = *(static_cast(result.data())); + index -= 8; + } + std::reverse(out.begin(), out.end()); + + auto sha256_result = crypto::Sha256Hash().Update(message).CumulativeHash(); + + if(sha256_result.size() == out.size() && std::equal(out.begin(), out.end(), sha256_result.begin())) cout<<"YES!!!"< result(1); - finalize(absl::MakeSpan(result)); + // std::vector result(1); + // finalize(absl::MakeSpan(result)); // std::cout << "MPC结果:" << ReverseBytes(result[0]) << std::endl; // std::cout << "明文结果:" << Aes128(ReverseBytes(input), ReverseBytes(input_EV)) << std::endl; //待修改 } diff --git a/examples/gc/test_split.cc b/examples/gc/test_split.cc index 0d883ce1..c192c421 100644 --- a/examples/gc/test_split.cc +++ b/examples/gc/test_split.cc @@ -6,9 +6,10 @@ // #include "absl/std::strings/escaping.h" #include "absl/types/span.h" -#include "examples/gc/aes_128_evaluator.h" + #include "examples/gc/sha256_garbler.h" +#include "examples/gc/sha256_evaluator.h" #include "fmt/format.h" #include "yacl/kernel/ot_kernel.h" #include "yacl/kernel/type/ot_store_utils.h" @@ -28,7 +29,7 @@ std::shared_ptr circ_; int main() { // 初始化 GarblerSHA256* garbler = new GarblerSHA256(); - EvaluatorAES* evaluator = new EvaluatorAES(); + EvaluatorSHA256* evaluator = new EvaluatorSHA256(); std::future thread1 = std::async([&] { garbler->setup(); }); std::future thread2 = std::async([&] { evaluator->setup(); }); @@ -39,40 +40,40 @@ int main() { // 电路读取 std::string pth = fmt::format("{0}/yacl/io/circuit/data/{1}.txt", - std::filesystem::current_path().string(), "aes_128"); + std::filesystem::current_path().string(), "sha256"); yacl::io::CircuitReader reader(pth); reader.ReadMeta(); reader.ReadAllGates(); circ_ = reader.StealCirc(); // 指针 // 输入处理 - garbler->inputProcess(*circ_); - // thread1 = std::async([&] { garbler->inputProcess(*circ_); }); - // thread2 = std::async([&] { evaluator->inputProcess(*circ_); }); - // thread1.get(); - // thread2.get(); + // garbler->inputProcess(*circ_); + thread1 = std::async([&] { garbler->inputProcess(*circ_); }); + thread2 = std::async([&] { evaluator->inputProcess(*circ_); }); + thread1.get(); + thread2.get(); - // // OT + // // OT **************因为SHA256场景中输入都在混淆方,所以不需要进行OT*************** // thread1 = std::async([&] { evaluator -> onLineOT();}); // thread2 = std::async([&] { garbler -> onlineOT(); }); // thread1.get(); // thread2.get(); - // // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator - // garbler->GB(); - // garbler->sendTable(); + // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator + garbler->GB(); + garbler->sendTable(); - // evaluator->recvTable(); + evaluator->recvTable(); - // // // 计算方进行计算 按拓扑顺序进行计算 - // evaluator->EV(); + // // 计算方进行计算 按拓扑顺序进行计算 + evaluator->EV(); // // // evaluator发送计算结果 garbler进行DE操作 - // evaluator->sendOutput(); + evaluator->sendOutput(); - // garbler->decode(); + garbler->decode(); return 0; From 2cae51d8ad9d8e772b790e8aed00c43c1bafe4ba Mon Sep 17 00:00:00 2001 From: gitCoder1024 Date: Mon, 3 Mar 2025 20:56:49 +0800 Subject: [PATCH 21/27] reconstruct ok --- examples/gc/sha256_evaluator.h | 27 +----------- examples/gc/sha256_garbler.h | 77 ++-------------------------------- 2 files changed, 6 insertions(+), 98 deletions(-) diff --git a/examples/gc/sha256_evaluator.h b/examples/gc/sha256_evaluator.h index b74278a4..c5306f72 100644 --- a/examples/gc/sha256_evaluator.h +++ b/examples/gc/sha256_evaluator.h @@ -97,14 +97,7 @@ class EvaluatorSHA256 { gb_value.resize(circ_.nw); wires_.resize(circ_.nw); - //输入位数有关 - // yacl::dynamic_bitset bi_val; - // //输入位数有关 - // input = yacl::crypto::FastRandU128(); - // std::cout << "input of evaluator:" << input << std::endl; - // bi_val.append(input); // 直接转换为二进制 输入线路在前64位 - // 接收garbler混淆值 yacl::Buffer r = lctx->Recv(0, "garbleInput1"); const uint128_t* buffer_data = r.data(); @@ -113,20 +106,7 @@ class EvaluatorSHA256 { std::cout << "recvInput1" << std::endl; - // 对evaluator自己的输入值进行混淆 - // r = lctx->Recv(0, "garbleInput2"); - // buffer_data = r.data(); - // for (int i = 0; i < circ_.niw[1]; i++) { - // wires_[i + circ_.niw[0]] = - // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); - - // } - // std::cout << "recvInput2" << std::endl; - - // onLineOT(); - - //输入位数有关 - // lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint128_t)), "Input1"); + } void recvTable() { @@ -214,10 +194,7 @@ class EvaluatorSHA256 { yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * 256), "output"); std::cout << "sendOutput" << std::endl; - // for(int i = start; i < index; i++){ - // cout << wires_[i]<<" "; - // } - // cout << endl; + } void onLineOT(){ // vector choices(96); diff --git a/examples/gc/sha256_garbler.h b/examples/gc/sha256_garbler.h index 333492e8..8735a1e0 100644 --- a/examples/gc/sha256_garbler.h +++ b/examples/gc/sha256_garbler.h @@ -35,7 +35,6 @@ using OtMsgPair = std::array; using OtChoices = dynamic_bitset; } - uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); uint128_t select_mask_[2] = {0, all_one_uint128_t_}; @@ -45,8 +44,6 @@ inline uint128_t Aes128(uint128_t k, uint128_t m) { return enc.Encrypt(m); } - - class GarblerSHA256 { public: std::shared_ptr lctx; @@ -81,7 +78,6 @@ class GarblerSHA256 { const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); ctx_desc.parties.push_back({id, host}); } - lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, 0); @@ -117,9 +113,7 @@ class GarblerSHA256 { //输入位数有关 message = crypto::FastRandBytes(crypto::RandLtN(32)); - auto in_buf = io::BuiltinBFCircuit::PrepareSha256Input(message); //是不是直接可以当成ByteContainerView???先试试 - // cout << "size" << in_buf.size() << endl; - // sha256_result = vector(32); + auto in_buf = io::BuiltinBFCircuit::PrepareSha256Input(message); auto sha256_result = crypto::Sha256Hash().Update(message).CumulativeHash(); for(int i = 0; i < 32; i++){ cout < bi_val; bi_val.resize(circ_.nw); std::memcpy(bi_val.data(), in_buf.data(), in_buf.size()); - for(int i = 0; i < 768; i++){ - - wires_[i] = bi_val[i]; - // cout << bi_val[i] << " "; - // cout << wires_[i] <<" "; - - } - // cout << endl; - // for(int i = 0; i < 768; i++){ - // cout << wires_[i] <<" "; - // } - // cout << endl; - // cout << endl; - // yacl::dynamic_bitset bi_val; - // bi_val.append(input); // 直接转换为二进制 输入线路在前64位 // 混淆过程 int num_of_input_wires = 0; @@ -153,51 +132,17 @@ class GarblerSHA256 { random_uint128_t(gb_value.data(), num_of_input_wires); - - // 前64位 直接置换 garbler - for(int i = 0; i < 768; i++){ - wires_[i] = gb_value[i] ^ (select_mask_[bool(wires_[i])] & delta); + wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); } - // for (int i = 0; i < circ_.niw[0]; i++) { - // wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); - // } - lctx->Send(1, yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), "garbleInput1"); std::cout << "sendInput1" << std::endl; - - - - //输送到wires - std::memcpy(gb_value.data(), in_buf.data(), in_buf.size()); - - - lctx->Send(1, - yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), - "garbleInput1"); - - std::cout << "sendInput1" << std::endl; - - // lctx->Send( - // 1, - // yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), - // "garbleInput2"); - // std::cout << "sendInput2" << std::endl; - - // onlineOT(); - - // yacl::Buffer r = lctx->Recv(1, "Input1"); - - // //输入位数有关 - // const uint128_t* buffer_data = r.data(); - // input_EV = *buffer_data; - } @@ -294,10 +239,7 @@ class GarblerSHA256 { memcpy(wires_.data() + start, r.data(), sizeof(uint128_t) * 256); std::cout << "recvOutput" << std::endl; - // for(int i = start; i < index; i++){ - // cout << wires_[i]<<" "; - // } - // cout << endl; + const auto out_size = 32; std::vector out(out_size); @@ -318,18 +260,7 @@ class GarblerSHA256 { cout < result(1); - // finalize(absl::MakeSpan(result)); - // std::cout << "MPC结果:" << ReverseBytes(result[0]) << std::endl; - // std::cout << "明文结果:" << Aes128(ReverseBytes(input), ReverseBytes(input_EV)) << std::endl; //待修改 + } From f8b2191716ce4199667b9e3f4f7f109bc323f9e6 Mon Sep 17 00:00:00 2001 From: gitCoder1024 <201810111240@stu.shmtu.edu.cn> Date: Thu, 6 Mar 2025 21:42:56 +0800 Subject: [PATCH 22/27] gtest failed --- examples/gc/BUILD.bazel | 14 ++--- examples/gc/aes_128_evaluator.h | 18 +++--- examples/gc/aes_128_garbler.h | 21 ++++--- examples/gc/gc_test.cc | 94 +++++++++++++++++++++++++++---- examples/gc/sha256_evaluator.h | 15 ++--- examples/gc/sha256_garbler.h | 19 +++---- examples/gc/test_split.cc | 34 ++++++----- examples/psi/cpp/ecdh_psi.cc | 2 +- examples/psi/cpp/ecdh_psi_main.cc | 4 +- examples/psi/cpp/ecdh_psi_test.cc | 2 +- 10 files changed, 153 insertions(+), 70 deletions(-) diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel index dfaa903e..fffb5e0a 100644 --- a/examples/gc/BUILD.bazel +++ b/examples/gc/BUILD.bazel @@ -1,4 +1,4 @@ -load("//bazel:yacl.bzl", "OMP_CFLAGS", "OMP_DEPS", "OMP_LINKFLAGS", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") +load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") package(default_visibility = ["//visibility:public"]) cc_library( @@ -19,13 +19,6 @@ cc_library( ) - - - - - - - cc_library( name = "utils", srcs = ["utils.cc"], @@ -215,6 +208,7 @@ cc_binary( ":evaluator", ":sha256_garbler", ":sha256_evaluator", + "aes_128_garbler", ":aes_128_evaluator", "//yacl/base:byte_container_view", "//yacl/base:dynamic_bitset", @@ -231,7 +225,7 @@ cc_binary( ], ) -cc_binary( +yacl_cc_test( name = "gc_test", srcs = ["gc_test.cc"], copts = [ @@ -247,6 +241,8 @@ cc_binary( ":sha256_garbler", ":sha256_evaluator", ":aes_128_evaluator", + "aes_128_garbler", + "//yacl/crypto/block_cipher:symmetric_crypto", "//yacl/base:byte_container_view", "//yacl/base:dynamic_bitset", "//yacl/crypto/rand", diff --git a/examples/gc/aes_128_evaluator.h b/examples/gc/aes_128_evaluator.h index d34a7c3c..6711b360 100644 --- a/examples/gc/aes_128_evaluator.h +++ b/examples/gc/aes_128_evaluator.h @@ -32,10 +32,10 @@ using uint128_t = __uint128_t; using OtMsg = uint128_t; using OtMsgPair = std::array; using OtChoices = dynamic_bitset; + } -uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); -uint128_t select_mask[2] = {0, all_one_uint128_t}; + class EvaluatorAES { public: @@ -52,7 +52,9 @@ class EvaluatorAES { //根据电路改 uint128_t table[36663][2]; uint128_t input; - const int num_ot = 128; + int num_ot = 128; + uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); +uint128_t select_mask[2] = {0, all_one_uint128_t}; yacl::crypto::OtRecvStore ot_recv = OtRecvStore(num_ot, yacl::crypto::OtStoreType::Normal); @@ -92,7 +94,7 @@ class EvaluatorAES { mitccrh.setS(start_point); } - void inputProcess(yacl::io::BFCircuit param_circ_) { + uint128_t inputProcess(yacl::io::BFCircuit param_circ_) { circ_ = param_circ_; gb_value.resize(circ_.nw); wires_.resize(circ_.nw); @@ -127,13 +129,15 @@ class EvaluatorAES { //输入位数有关 lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint128_t)), "Input1"); + + return input; } void recvTable() { yacl::Buffer r = lctx->Recv(0, "table"); const uint128_t* buffer_data = r.data(); int k = 0; - for (int i = 0; i < circ_.ng; i++) { + for (size_t i = 0; i < circ_.ng; i++) { for (int j = 0; j < 2; j++) { table[i][j] = buffer_data[k]; k++; @@ -168,7 +172,7 @@ class EvaluatorAES { } void EV() { - for (int i = 0; i < circ_.gates.size(); i++) { + for (size_t i = 0; i < circ_.gates.size(); i++) { auto gate = circ_.gates[i]; switch (gate.op) { case yacl::io::BFCircuit::Op::XOR: { @@ -229,7 +233,7 @@ class EvaluatorAES { auto buf = lctx->Recv(lctx->NextRank(), ""); std::vector batch_recv(num_ot); std::memcpy(batch_recv.data(), buf.data(), buf.size()); - for (uint32_t j = 0; j < num_ot; ++j) { + for (int j = 0; j < num_ot; ++j) { auto idx = num_ot + j; wires_[idx] = batch_recv[j][choices[j]] ^ ot_recv.GetBlock(j); } diff --git a/examples/gc/aes_128_garbler.h b/examples/gc/aes_128_garbler.h index c58b378e..4b53f7a8 100644 --- a/examples/gc/aes_128_garbler.h +++ b/examples/gc/aes_128_garbler.h @@ -30,11 +30,11 @@ using uint128_t = __uint128_t; using OtMsg = uint128_t; using OtMsgPair = std::array; using OtChoices = dynamic_bitset; + } -uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); -uint128_t select_mask_[2] = {0, all_one_uint128_t_}; + inline uint128_t Aes128(uint128_t k, uint128_t m) { crypto::SymmetricCrypto enc(crypto::SymmetricCrypto::CryptoType::AES128_ECB, @@ -71,7 +71,9 @@ class GarblerAES { uint128_t input_EV; //num_ot根据输入改 - const int num_ot = 128; + int num_ot = 128; + uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); +uint128_t select_mask_[2] = {0, all_one_uint128_t_}; yacl::crypto::OtSendStore ot_send = OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); @@ -116,7 +118,7 @@ class GarblerAES { } // 包扩 输入值生成和混淆,garbler混淆值的发送 - void inputProcess(yacl::io::BFCircuit param_circ_) { + uint128_t inputProcess(yacl::io::BFCircuit param_circ_) { circ_ = param_circ_; gb_value.resize(circ_.nw); wires_.resize(circ_.nw); @@ -139,7 +141,7 @@ class GarblerAES { // 前64位 直接置换 garbler - for (int i = 0; i < circ_.niw[0]; i++) { + for (size_t i = 0; i < circ_.niw[0]; i++) { wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); } @@ -163,7 +165,7 @@ class GarblerAES { const uint128_t* buffer_data = r.data(); input_EV = *buffer_data; - + return input; } uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, @@ -203,7 +205,7 @@ class GarblerAES { } void GB() { - for (int i = 0; i < circ_.gates.size(); i++) { + for (size_t i = 0; i < circ_.gates.size(); i++) { auto gate = circ_.gates[i]; switch (gate.op) { case yacl::io::BFCircuit::Op::XOR: { @@ -249,7 +251,7 @@ class GarblerAES { "table"); std::cout << "sendTable" << std::endl; } - void decode() { + uint128_t decode() { // 现接收计算结果 size_t index = wires_.size(); int start = index - circ_.now[0]; @@ -267,6 +269,7 @@ class GarblerAES { finalize(absl::MakeSpan(result)); std::cout << "MPC结果:" << ReverseBytes(result[0]) << std::endl; std::cout << "明文结果:" << Aes128(ReverseBytes(input), ReverseBytes(input_EV)) << std::endl; //待修改 + return result[0]; } @@ -305,7 +308,7 @@ class GarblerAES { std::vector batch_send(num_ot); - for (uint32_t j = 0; j < num_ot; ++j) { + for (int j = 0; j < num_ot; ++j) { auto idx = num_ot + j; if (!masked_choices[j]) { batch_send[j][0] = ot_send.GetBlock(j, 0) ^ gb_value[idx]; diff --git a/examples/gc/gc_test.cc b/examples/gc/gc_test.cc index ae4b5adc..275cacb7 100644 --- a/examples/gc/gc_test.cc +++ b/examples/gc/gc_test.cc @@ -1,7 +1,6 @@ -#pragma once -#include "gtest/gtest.h" + #include #include #include @@ -10,27 +9,40 @@ // #include "absl/std::strings/escaping.h" #include "absl/types/span.h" - +#include "examples/gc/aes_128_evaluator.h" +#include "examples/gc/aes_128_garbler.h" #include "examples/gc/sha256_garbler.h" #include "examples/gc/sha256_evaluator.h" #include "fmt/format.h" +#include "gtest/gtest.h" #include "yacl/kernel/ot_kernel.h" #include "yacl/kernel/type/ot_store_utils.h" - - - +#include "yacl/crypto/block_cipher/symmetric_crypto.h" namespace examples::gc{ - - +inline uint128_t Aes128(uint128_t k, uint128_t m) { + crypto::SymmetricCrypto enc(crypto::SymmetricCrypto::CryptoType::AES128_ECB, + k); + return enc.Encrypt(m); +} +uint128_t ReverseBytes(uint128_t x) { + auto byte_view = ByteContainerView(&x, sizeof(x)); + uint128_t ret = 0; + auto buf = std::vector(sizeof(ret)); + for (size_t i = 0; i < byte_view.size(); ++i) { + buf[byte_view.size() - i - 1] = byte_view[i]; + } + std::memcpy(&ret, buf.data(), buf.size()); + return ret; +} -std::shared_ptr circ_; TEST(GCTest, SHA256Test) { + std::shared_ptr circ_; // 初始化 GarblerSHA256* garbler = new GarblerSHA256(); EvaluatorSHA256* evaluator = new EvaluatorSHA256(); @@ -53,7 +65,7 @@ TEST(GCTest, SHA256Test) { // 输入处理 // garbler->inputProcess(*circ_); - vector sha256_result; + vector sha256_result; thread1 = std::async([&] { sha256_result = garbler->inputProcess(*circ_); }); thread2 = std::async([&] { evaluator->inputProcess(*circ_); }); thread1.get(); @@ -85,4 +97,64 @@ TEST(GCTest, SHA256Test) { EXPECT_TRUE(std::equal(gc_result.begin(), gc_result.end(), sha256_result.begin())); } -} \ No newline at end of file + +TEST(GCTest, AESTest) { + std::shared_ptr circ_; + // 初始化 + GarblerAES* garbler = new GarblerAES(); + EvaluatorAES * evaluator = new EvaluatorAES(); + + std::future thread1 = std::async([&] { garbler->setup(); }); + std::future thread2 = std::async([&] { evaluator->setup(); }); + thread1.get(); + thread2.get(); + + + // 电路读取 + std::string pth = + fmt::format("{0}/yacl/io/circuit/data/{1}.txt", + std::filesystem::current_path().string(), "aes_128"); + yacl::io::CircuitReader reader(pth); + reader.ReadMeta(); + reader.ReadAllGates(); + circ_ = reader.StealCirc(); // 指针 + + // 输入处理 + // garbler->inputProcess(*circ_); + + uint128_t key; + uint128_t message; + thread1 = std::async([&] { key = garbler->inputProcess(*circ_); }); + thread2 = std::async([&] { message = evaluator->inputProcess(*circ_); }); + thread1.get(); + thread2.get(); + + // OT + thread1 = std::async([&] { evaluator -> onLineOT();}); + thread2 = std::async([&] { garbler -> onlineOT(); }); + thread1.get(); + thread2.get(); + + + // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator + garbler->GB(); + garbler->sendTable(); + + evaluator->recvTable(); + + + // // 计算方进行计算 按拓扑顺序进行计算 + evaluator->EV(); + + // // // evaluator发送计算结果 garbler进行DE操作 + evaluator->sendOutput(); + + uint128_t gc_result = garbler->decode(); + auto aes = Aes128(ReverseBytes(key), ReverseBytes(message)); + EXPECT_EQ(ReverseBytes(gc_result), aes); + +} + +} + + diff --git a/examples/gc/sha256_evaluator.h b/examples/gc/sha256_evaluator.h index c5306f72..8c26c07e 100644 --- a/examples/gc/sha256_evaluator.h +++ b/examples/gc/sha256_evaluator.h @@ -32,10 +32,10 @@ using uint128_t = __uint128_t; using OtMsg = uint128_t; using OtMsgPair = std::array; using OtChoices = dynamic_bitset; + } -uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); -uint128_t select_mask[2] = {0, all_one_uint128_t}; + class EvaluatorSHA256 { public: @@ -52,10 +52,11 @@ class EvaluatorSHA256 { //根据电路改 uint128_t table[135073][2]; uint128_t input; - const int num_ot = 768; + int num_ot = 768; yacl::crypto::OtRecvStore ot_recv = OtRecvStore(num_ot, yacl::crypto::OtStoreType::Normal); - + uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); + uint128_t select_mask[2] = {0, all_one_uint128_t}; void setup() { // 通信环境初始化 size_t world_size = 2; @@ -113,7 +114,7 @@ class EvaluatorSHA256 { yacl::Buffer r = lctx->Recv(0, "table"); const uint128_t* buffer_data = r.data(); int k = 0; - for (int i = 0; i < circ_.ng; i++) { + for (size_t i = 0; i < circ_.ng; i++) { for (int j = 0; j < 2; j++) { table[i][j] = buffer_data[k]; k++; @@ -148,7 +149,7 @@ class EvaluatorSHA256 { } void EV() { - for (int i = 0; i < circ_.gates.size(); i++) { + for (size_t i = 0; i < circ_.gates.size(); i++) { auto gate = circ_.gates[i]; switch (gate.op) { case yacl::io::BFCircuit::Op::XOR: { @@ -212,7 +213,7 @@ class EvaluatorSHA256 { auto buf = lctx->Recv(lctx->NextRank(), ""); std::vector batch_recv(num_ot); std::memcpy(batch_recv.data(), buf.data(), buf.size()); - for (uint32_t j = 0; j < num_ot; ++j) { + for (int j = 0; j < num_ot; ++j) { auto idx = num_ot + j; wires_[idx] = batch_recv[j][choices[j]] ^ ot_recv.GetBlock(j); } diff --git a/examples/gc/sha256_garbler.h b/examples/gc/sha256_garbler.h index 5e60cdad..733918af 100644 --- a/examples/gc/sha256_garbler.h +++ b/examples/gc/sha256_garbler.h @@ -33,16 +33,12 @@ using uint128_t = __uint128_t; using OtMsg = uint128_t; using OtMsgPair = std::array; using OtChoices = dynamic_bitset; + } -uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); -uint128_t select_mask_[2] = {0, all_one_uint128_t_}; -inline uint128_t Aes128(uint128_t k, uint128_t m) { - crypto::SymmetricCrypto enc(crypto::SymmetricCrypto::CryptoType::AES128_ECB, - k); - return enc.Encrypt(m); -} + + class GarblerSHA256 { public: @@ -63,7 +59,10 @@ class GarblerSHA256 { uint128_t input_EV; vector message; //num_ot根据输入改 - const int num_ot = 768; + int num_ot = 768; +uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); +uint128_t select_mask_[2] = {0, all_one_uint128_t_}; + yacl::crypto::OtSendStore ot_send = yacl::crypto::OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); @@ -185,7 +184,7 @@ class GarblerSHA256 { } void GB() { - for (int i = 0; i < circ_.gates.size(); i++) { + for (size_t i = 0; i < circ_.gates.size(); i++) { auto gate = circ_.gates[i]; switch (gate.op) { case yacl::io::BFCircuit::Op::XOR: { @@ -304,7 +303,7 @@ class GarblerSHA256 { std::vector batch_send(num_ot); - for (uint32_t j = 0; j < num_ot; ++j) { + for (int j = 0; j < num_ot; ++j) { auto idx = num_ot + j; if (!masked_choices[j]) { batch_send[j][0] = ot_send.GetBlock(j, 0) ^ gb_value[idx]; diff --git a/examples/gc/test_split.cc b/examples/gc/test_split.cc index c192c421..a19e395d 100644 --- a/examples/gc/test_split.cc +++ b/examples/gc/test_split.cc @@ -7,7 +7,8 @@ // #include "absl/std::strings/escaping.h" #include "absl/types/span.h" - +#include "examples/gc/aes_128_evaluator.h" +#include "examples/gc/aes_128_garbler.h" #include "examples/gc/sha256_garbler.h" #include "examples/gc/sha256_evaluator.h" #include "fmt/format.h" @@ -21,15 +22,17 @@ namespace { using uint128_t = __uint128_t; } -std::shared_ptr circ_; + int main() { // 初始化 - GarblerSHA256* garbler = new GarblerSHA256(); - EvaluatorSHA256* evaluator = new EvaluatorSHA256(); + std::shared_ptr circ_; + // 初始化 + GarblerAES* garbler = new GarblerAES(); + EvaluatorAES * evaluator = new EvaluatorAES(); std::future thread1 = std::async([&] { garbler->setup(); }); std::future thread2 = std::async([&] { evaluator->setup(); }); @@ -40,7 +43,7 @@ int main() { // 电路读取 std::string pth = fmt::format("{0}/yacl/io/circuit/data/{1}.txt", - std::filesystem::current_path().string(), "sha256"); + std::filesystem::current_path().string(), "aes_128"); yacl::io::CircuitReader reader(pth); reader.ReadMeta(); reader.ReadAllGates(); @@ -48,16 +51,19 @@ int main() { // 输入处理 // garbler->inputProcess(*circ_); - thread1 = std::async([&] { garbler->inputProcess(*circ_); }); - thread2 = std::async([&] { evaluator->inputProcess(*circ_); }); + + uint128_t key; + uint128_t message; + thread1 = std::async([&] { key = garbler->inputProcess(*circ_); }); + thread2 = std::async([&] { message = evaluator->inputProcess(*circ_); }); thread1.get(); thread2.get(); - // // OT **************因为SHA256场景中输入都在混淆方,所以不需要进行OT*************** - // thread1 = std::async([&] { evaluator -> onLineOT();}); - // thread2 = std::async([&] { garbler -> onlineOT(); }); - // thread1.get(); - // thread2.get(); + // OT + thread1 = std::async([&] { evaluator -> onLineOT();}); + thread2 = std::async([&] { garbler -> onlineOT(); }); + thread1.get(); + thread2.get(); // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator @@ -73,7 +79,9 @@ int main() { // // // evaluator发送计算结果 garbler进行DE操作 evaluator->sendOutput(); - garbler->decode(); + uint128_t gc_result = garbler->decode(); + // auto aes = Aes128(ReverseBytes(key), ReverseBytes(message)); + // EXPECT_EQ(ReverseBytes(gc_result), aes); return 0; diff --git a/examples/psi/cpp/ecdh_psi.cc b/examples/psi/cpp/ecdh_psi.cc index 9f28a12c..d52192ca 100644 --- a/examples/psi/cpp/ecdh_psi.cc +++ b/examples/psi/cpp/ecdh_psi.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "psi/cpp/ecdh_psi.h" +#include "examples/psi/cpp/ecdh_psi.h" #include #include diff --git a/examples/psi/cpp/ecdh_psi_main.cc b/examples/psi/cpp/ecdh_psi_main.cc index d79c11c7..e9b68eb6 100644 --- a/examples/psi/cpp/ecdh_psi_main.cc +++ b/examples/psi/cpp/ecdh_psi_main.cc @@ -16,8 +16,8 @@ #include #include "gflags/gflags.h" -#include "psi/cpp/ecdh_psi.h" -#include "psi/cpp/main_utils.h" +#include "examples/psi/cpp/ecdh_psi.h" +#include "examples/psi/cpp/main_utils.h" #include "yacl/link/context.h" #include "yacl/utils/serialize.h" diff --git a/examples/psi/cpp/ecdh_psi_test.cc b/examples/psi/cpp/ecdh_psi_test.cc index ad89ec0e..a1421f04 100644 --- a/examples/psi/cpp/ecdh_psi_test.cc +++ b/examples/psi/cpp/ecdh_psi_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "psi/cpp/ecdh_psi.h" +#include "examples/psi/cpp/ecdh_psi.h" #include From a26e60d41ab5873bc43876d0c2cacc2bdea02a77 Mon Sep 17 00:00:00 2001 From: gitCoder1024 <201810111240@stu.shmtu.edu.cn> Date: Mon, 31 Mar 2025 16:27:28 +0800 Subject: [PATCH 23/27] with comments --- docs/update_po.sh | 0 examples/gc/BUILD.bazel | 154 +- examples/gc/aes_128_evaluator.h | 69 +- examples/gc/aes_128_garbler.h | 130 +- examples/gc/evaluator.h | 231 -- examples/gc/garbler.h | 288 -- examples/gc/gc_test.cc | 54 +- examples/gc/mitccrh.h | 4 +- examples/gc/sha256.cc | 319 -- examples/gc/sha256_evaluator.h | 69 +- examples/gc/sha256_garbler.h | 176 +- examples/gc/test.cc | 524 --- examples/gc/test_split.cc | 88 - examples/gc/utils.cc | 14 - examples/gc/utils.h | 23 +- hs_err_pid1031794.log | 5591 +++++++++++++++++++++++++++++++ 16 files changed, 5784 insertions(+), 1950 deletions(-) mode change 100755 => 100644 docs/update_po.sh delete mode 100644 examples/gc/evaluator.h delete mode 100644 examples/gc/garbler.h delete mode 100644 examples/gc/sha256.cc delete mode 100644 examples/gc/test.cc delete mode 100644 examples/gc/test_split.cc delete mode 100644 examples/gc/utils.cc create mode 100644 hs_err_pid1031794.log diff --git a/docs/update_po.sh b/docs/update_po.sh old mode 100755 new mode 100644 diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel index fffb5e0a..6823ab0b 100644 --- a/examples/gc/BUILD.bazel +++ b/examples/gc/BUILD.bazel @@ -1,7 +1,8 @@ load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") package(default_visibility = ["//visibility:public"]) -cc_library( + +yacl_cc_library( name = "mitccrh", hdrs = [ "mitccrh.h", @@ -13,76 +14,19 @@ cc_library( ], deps = [ ":utils", + "//yacl/base:int128", "//yacl/crypto/aes:aes_opt", "//yacl/crypto/tools:crhash", ], ) - -cc_library( +yacl_cc_library( name = "utils", - srcs = ["utils.cc"], hdrs = ["utils.h"], deps = ["//yacl/math/mpint:mpint",], ) - - -cc_library( - name = "garbler", - hdrs = [ - "garbler.h", - ], - copts = [ - "-mavx", - "-maes", - "-mpclmul", - ], - deps = [ - ":mitccrh", - "//yacl/base:byte_container_view", - "//yacl/base:dynamic_bitset", - "//yacl/crypto/rand", - "//yacl/crypto/tools:prg", - "//yacl/io/circuit:bristol_fashion", - "//yacl/io/stream:file_io", - "//yacl/kernel/algorithms:base_ot", - "//yacl/kernel/algorithms:iknp_ote", - "//yacl/link:test_util", - "//yacl/utils:circuit_executor", - "//yacl/kernel:ot_kernel", - "//yacl/kernel/type:ot_store_utils", - ], -) - -cc_library( - name = "evaluator", - hdrs = [ - "evaluator.h", - ], - copts = [ - "-mavx", - "-maes", - "-mpclmul", - ], - deps = [ - ":mitccrh", - "//yacl/base:byte_container_view", - "//yacl/base:dynamic_bitset", - "//yacl/crypto/rand", - "//yacl/crypto/tools:prg", - "//yacl/io/circuit:bristol_fashion", - "//yacl/io/stream:file_io", - "//yacl/kernel/algorithms:base_ot", - "//yacl/kernel/algorithms:iknp_ote", - "//yacl/link:test_util", - "//yacl/utils:circuit_executor", - "//yacl/kernel:ot_kernel", - "//yacl/kernel/type:ot_store_utils", - ], -) - -cc_library( +yacl_cc_library( name = "aes_128_garbler", hdrs = [ "aes_128_garbler.h", @@ -96,20 +40,17 @@ cc_library( ":mitccrh", "//yacl/base:byte_container_view", "//yacl/base:dynamic_bitset", + "//yacl/base:int128", "//yacl/crypto/rand", - "//yacl/crypto/tools:prg", "//yacl/io/circuit:bristol_fashion", - "//yacl/io/stream:file_io", "//yacl/kernel/algorithms:base_ot", "//yacl/kernel/algorithms:iknp_ote", - "//yacl/link:test_util", - "//yacl/utils:circuit_executor", "//yacl/kernel:ot_kernel", "//yacl/kernel/type:ot_store_utils", ], ) -cc_library( +yacl_cc_library( name = "sha256_garbler", hdrs = [ "sha256_garbler.h", @@ -121,25 +62,16 @@ cc_library( ], deps = [ ":mitccrh", + "//yacl/base:int128", "//yacl/crypto/block_cipher:symmetric_crypto", - "//yacl/base:byte_container_view", "//yacl/base:dynamic_bitset", "//yacl/crypto/rand", - "//yacl/crypto/tools:prg", "//yacl/io/circuit:bristol_fashion", - "//yacl/io/stream:file_io", - "//yacl/kernel/algorithms:base_ot", - "//yacl/kernel/algorithms:iknp_ote", - "//yacl/link:test_util", - "//yacl/utils:circuit_executor", - "//yacl/kernel:ot_kernel", - "//yacl/kernel/type:ot_store_utils", - "//yacl/math/mpint" ], ) -cc_library( +yacl_cc_library( name = "sha256_evaluator", hdrs = [ "sha256_evaluator.h", @@ -151,22 +83,15 @@ cc_library( ], deps = [ ":mitccrh", + "//yacl/base:int128", "//yacl/base:byte_container_view", "//yacl/base:dynamic_bitset", "//yacl/crypto/rand", - "//yacl/crypto/tools:prg", "//yacl/io/circuit:bristol_fashion", - "//yacl/io/stream:file_io", - "//yacl/kernel/algorithms:base_ot", - "//yacl/kernel/algorithms:iknp_ote", - "//yacl/link:test_util", - "//yacl/utils:circuit_executor", - "//yacl/kernel:ot_kernel", - "//yacl/kernel/type:ot_store_utils", ], ) -cc_library( +yacl_cc_library( name = "aes_128_evaluator", hdrs = [ "aes_128_evaluator.h", @@ -178,48 +103,13 @@ cc_library( ], deps = [ ":mitccrh", + "//yacl/base:int128", "//yacl/base:byte_container_view", "//yacl/base:dynamic_bitset", "//yacl/crypto/rand", - "//yacl/crypto/tools:prg", - "//yacl/io/circuit:bristol_fashion", - "//yacl/io/stream:file_io", - "//yacl/kernel/algorithms:base_ot", - "//yacl/kernel/algorithms:iknp_ote", - "//yacl/link:test_util", - "//yacl/utils:circuit_executor", - "//yacl/kernel:ot_kernel", - "//yacl/kernel/type:ot_store_utils", - ], -) - -cc_binary( - name = "test_split", - srcs = ["test_split.cc"], - copts = [ - "-mavx", - "-maes", - "-mpclmul", - ], - data = ["//yacl/io/circuit:circuit_data"], - deps = [ - ":mitccrh", - ":garbler", - ":evaluator", - ":sha256_garbler", - ":sha256_evaluator", - "aes_128_garbler", - ":aes_128_evaluator", - "//yacl/base:byte_container_view", - "//yacl/base:dynamic_bitset", - "//yacl/crypto/rand", - "//yacl/crypto/tools:prg", "//yacl/io/circuit:bristol_fashion", - "//yacl/io/stream:file_io", "//yacl/kernel/algorithms:base_ot", "//yacl/kernel/algorithms:iknp_ote", - "//yacl/link:test_util", - "//yacl/utils:circuit_executor", "//yacl/kernel:ot_kernel", "//yacl/kernel/type:ot_store_utils", ], @@ -235,26 +125,10 @@ yacl_cc_test( ], data = ["//yacl/io/circuit:circuit_data"], deps = [ - ":mitccrh", - ":garbler", - ":evaluator", ":sha256_garbler", ":sha256_evaluator", ":aes_128_evaluator", - "aes_128_garbler", + ":aes_128_garbler", "//yacl/crypto/block_cipher:symmetric_crypto", - "//yacl/base:byte_container_view", - "//yacl/base:dynamic_bitset", - "//yacl/crypto/rand", - "//yacl/crypto/tools:prg", - "//yacl/io/circuit:bristol_fashion", - "//yacl/io/stream:file_io", - "//yacl/kernel/algorithms:base_ot", - "//yacl/kernel/algorithms:iknp_ote", - "//yacl/link:test_util", - "//yacl/utils:circuit_executor", - "//yacl/kernel:ot_kernel", - "//yacl/kernel/type:ot_store_utils", ], -) - +) \ No newline at end of file diff --git a/examples/gc/aes_128_evaluator.h b/examples/gc/aes_128_evaluator.h index 6711b360..1b08c513 100644 --- a/examples/gc/aes_128_evaluator.h +++ b/examples/gc/aes_128_evaluator.h @@ -1,41 +1,30 @@ #pragma once -#include -#include -#include #include -#include "absl/types/span.h" #include "examples/gc/mitccrh.h" #include "fmt/format.h" #include "yacl/base/byte_container_view.h" #include "yacl/base/dynamic_bitset.h" -#include "yacl/base/exception.h" +#include "yacl/base/int128.h" #include "yacl/crypto/rand/rand.h" #include "yacl/io/circuit/bristol_fashion.h" -#include "yacl/io/stream/file_io.h" #include "yacl/kernel/algorithms/base_ot.h" #include "yacl/kernel/algorithms/iknp_ote.h" +#include "yacl/kernel/ot_kernel.h" #include "yacl/kernel/type/ot_store_utils.h" #include "yacl/link/context.h" #include "yacl/link/factory.h" -#include "yacl/link/test_util.h" -#include "yacl/utils/circuit_executor.h" -#include "yacl/kernel/ot_kernel.h" -#include "yacl/kernel/type/ot_store_utils.h" - using namespace std; using namespace yacl; using namespace yacl::crypto; namespace { -using uint128_t = __uint128_t; + using OtMsg = uint128_t; using OtMsgPair = std::array; using OtChoices = dynamic_bitset; -} - - +} // namespace class EvaluatorAES { public: @@ -48,15 +37,16 @@ class EvaluatorAES { std::vector gb_value; yacl::io::BFCircuit circ_; std::shared_ptr lctx; - - //根据电路改 + + // 根据电路改 uint128_t table[36663][2]; uint128_t input; int num_ot = 128; uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); -uint128_t select_mask[2] = {0, all_one_uint128_t}; + uint128_t select_mask[2] = {0, all_one_uint128_t}; - yacl::crypto::OtRecvStore ot_recv = OtRecvStore(num_ot, yacl::crypto::OtStoreType::Normal); + yacl::crypto::OtRecvStore ot_recv = + OtRecvStore(num_ot, yacl::crypto::OtStoreType::Normal); void setup() { // 通信环境初始化 @@ -65,17 +55,17 @@ uint128_t select_mask[2] = {0, all_one_uint128_t}; for (size_t rank = 0; rank < world_size; rank++) { const auto id = fmt::format("id-{}", rank); - const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); + const auto host = fmt::format("127.0.0.1:{}", 10010 + rank); ctx_desc.parties.push_back({id, host}); } - lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, - 1); + lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, 1); lctx->ConnectToMesh(); - //OT off-line + // OT off-line const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; - yacl::crypto::OtKernel kernel1(yacl::crypto::OtKernel::Role::Receiver, ext_algorithm); + yacl::crypto::OtKernel kernel1(yacl::crypto::OtKernel::Role::Receiver, + ext_algorithm); kernel1.init(lctx); kernel1.eval_rot(lctx, num_ot, &ot_recv); @@ -99,10 +89,10 @@ uint128_t select_mask[2] = {0, all_one_uint128_t}; gb_value.resize(circ_.nw); wires_.resize(circ_.nw); - //输入位数有关 + // 输入位数有关 yacl::dynamic_bitset bi_val; - - //输入位数有关 + + // 输入位数有关 input = yacl::crypto::FastRandU128(); std::cout << "input of evaluator:" << input << std::endl; bi_val.append(input); // 直接转换为二进制 输入线路在前64位 @@ -121,19 +111,18 @@ uint128_t select_mask[2] = {0, all_one_uint128_t}; // for (int i = 0; i < circ_.niw[1]; i++) { // wires_[i + circ_.niw[0]] = // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); - + // } // std::cout << "recvInput2" << std::endl; // onLineOT(); - //输入位数有关 + // 输入位数有关 lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint128_t)), "Input1"); - + return input; } void recvTable() { - yacl::Buffer r = lctx->Recv(0, "table"); const uint128_t* buffer_data = r.data(); int k = 0; @@ -145,10 +134,9 @@ uint128_t select_mask[2] = {0, all_one_uint128_t}; } std::cout << "recvTable" << std::endl; - } - //未检查 + // 未检查 uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { uint128_t HA, HB, W; @@ -213,14 +201,13 @@ uint128_t select_mask[2] = {0, all_one_uint128_t}; void sendOutput() { size_t index = wires_.size(); int start = index - circ_.now[0]; - lctx->Send( - 0, - yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * num_ot), - "output"); + lctx->Send(0, + yacl::ByteContainerView(wires_.data() + start, + sizeof(uint128_t) * num_ot), + "output"); std::cout << "sendOutput" << std::endl; } - void onLineOT(){ - + void onLineOT() { yacl::dynamic_bitset choices; choices.append(input); @@ -228,7 +215,9 @@ uint128_t select_mask[2] = {0, all_one_uint128_t}; ot.resize(choices.size()); yacl::dynamic_bitset masked_choices = ot ^ choices; - lctx->Send(0, yacl::ByteContainerView(masked_choices.data(), sizeof(uint128_t)), "masked_choice"); + lctx->Send( + 0, yacl::ByteContainerView(masked_choices.data(), sizeof(uint128_t)), + "masked_choice"); auto buf = lctx->Recv(lctx->NextRank(), ""); std::vector batch_recv(num_ot); diff --git a/examples/gc/aes_128_garbler.h b/examples/gc/aes_128_garbler.h index 4b53f7a8..3d73531a 100644 --- a/examples/gc/aes_128_garbler.h +++ b/examples/gc/aes_128_garbler.h @@ -1,7 +1,5 @@ #pragma once -#include -#include -#include + #include #include "absl/types/span.h" @@ -10,29 +8,18 @@ #include "yacl/base/byte_container_view.h" #include "yacl/base/dynamic_bitset.h" -#include "yacl/base/exception.h" +#include "yacl/base/int128.h" #include "yacl/crypto/rand/rand.h" #include "yacl/io/circuit/bristol_fashion.h" -#include "yacl/io/stream/file_io.h" #include "yacl/kernel/algorithms/base_ot.h" #include "yacl/kernel/algorithms/iknp_ote.h" +#include "yacl/kernel/ot_kernel.h" #include "yacl/kernel/type/ot_store_utils.h" #include "yacl/link/context.h" #include "yacl/link/factory.h" -#include "yacl/link/test_util.h" -#include "yacl/utils/circuit_executor.h" -#include "yacl/kernel/ot_kernel.h" -#include "yacl/kernel/type/ot_store_utils.h" + using namespace std; using namespace yacl; -namespace { -using uint128_t = __uint128_t; -using OtMsg = uint128_t; -using OtMsgPair = std::array; -using OtChoices = dynamic_bitset; - -} - @@ -42,7 +29,7 @@ inline uint128_t Aes128(uint128_t k, uint128_t m) { return enc.Encrypt(m); } - uint128_t ReverseBytes(uint128_t x) { +uint128_t ReverseBytes(uint128_t x) { auto byte_view = ByteContainerView(&x, sizeof(x)); uint128_t ret = 0; auto buf = std::vector(sizeof(ret)); @@ -63,21 +50,19 @@ class GarblerAES { std::vector wires_; std::vector gb_value; yacl::io::BFCircuit circ_; - //根据电路改 + // 根据电路改 uint128_t table[36663][2]; - //输入数据类型需要修改 + // 输入数据类型需要修改 uint128_t input; uint128_t input_EV; - //num_ot根据输入改 + // num_ot根据输入改 int num_ot = 128; uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); -uint128_t select_mask_[2] = {0, all_one_uint128_t_}; - yacl::crypto::OtSendStore ot_send = OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); - - - + uint128_t select_mask_[2] = {0, all_one_uint128_t_}; + yacl::crypto::OtSendStore ot_send = + OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); void setup() { // 通信环境初始化 @@ -86,25 +71,34 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; for (size_t rank = 0; rank < world_size; rank++) { const auto id = fmt::format("id-{}", rank); - const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); + const auto host = fmt::format("127.0.0.1:{}", 10010 + rank); ctx_desc.parties.push_back({id, host}); } - - lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, - 0); + lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, 0); lctx->ConnectToMesh(); - //OT off-line + // OT off-line const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; - yacl::crypto::OtKernel kernel0(yacl::crypto::OtKernel::Role::Sender, ext_algorithm); + yacl::crypto::OtKernel kernel0(yacl::crypto::OtKernel::Role::Sender, + ext_algorithm); kernel0.init(lctx); kernel0.eval_rot(lctx, num_ot, &ot_send); // delta, inv_constant, start_point 初始化并发送给evaluator uint128_t tmp[3]; - random_uint128_t(tmp, 3); + // random_uint128_t(tmp, 3); + for(int i = 0; i < 3; i++){ + std::random_device rd; + std::mt19937_64 eng(rd()); + std::uniform_int_distribution distr; + + uint64_t high = distr(eng); + uint64_t low = distr(eng); + + tmp[i] = MakeUint128(high, low); + } tmp[0] = tmp[0] | 1; lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 3), "tmp"); std::cout << "tmpSend" << std::endl; @@ -123,11 +117,11 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; gb_value.resize(circ_.nw); wires_.resize(circ_.nw); - //输入位数有关 + // 输入位数有关 input = yacl::crypto::FastRandU128(); std::cout << "input of garbler:" << input << std::endl; - //输入位数有关 + // 输入位数有关 yacl::dynamic_bitset bi_val; bi_val.append(input); // 直接转换为二进制 输入线路在前64位 @@ -136,40 +130,43 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; for (size_t i = 0; i < circ_.niv; ++i) { num_of_input_wires += circ_.niw[i]; } - - random_uint128_t(gb_value.data(), num_of_input_wires); - + // random_uint128_t(gb_value.data(), num_of_input_wires); + for(int i = 0; i < num_of_input_wires; i++){ + std::random_device rd; + std::mt19937_64 eng(rd()); + std::uniform_int_distribution distr; + + uint64_t high = distr(eng); + uint64_t low = distr(eng); + + gb_value[i] = MakeUint128(high, low); + } + // 前64位 直接置换 garbler for (size_t i = 0; i < circ_.niw[0]; i++) { wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); } - lctx->Send(1, - yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), - "garbleInput1"); + lctx->Send( + 1, yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), + "garbleInput1"); std::cout << "sendInput1" << std::endl; - // lctx->Send( - // 1, - // yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), - // "garbleInput2"); - // std::cout << "sendInput2" << std::endl; - // onlineOT(); yacl::Buffer r = lctx->Recv(1, "Input1"); - //输入位数有关 + // 输入位数有关 const uint128_t* buffer_data = r.data(); input_EV = *buffer_data; - + return input; } uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, - uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { + uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { bool pa = getLSB(LA0); bool pb = getLSB(LB0); @@ -201,10 +198,8 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; W0 = W0 ^ HLB0; W0 = W0 ^ (select_mask_[pb] & tmp); return W0; - } void GB() { - for (size_t i = 0; i < circ_.gates.size(); i++) { auto gate = circ_.gates[i]; switch (gate.op) { @@ -217,8 +212,8 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; case yacl::io::BFCircuit::Op::AND: { const auto& iw0 = gb_value.operator[](gate.iw[0]); const auto& iw1 = gb_value.operator[](gate.iw[1]); - gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, - table[i], &mitccrh); + gb_value[gate.ow[0]] = + GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, table[i], &mitccrh); break; } case yacl::io::BFCircuit::Op::INV: { @@ -267,21 +262,16 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; // 线路有关 输出位数 std::vector result(1); finalize(absl::MakeSpan(result)); - std::cout << "MPC结果:" << ReverseBytes(result[0]) << std::endl; - std::cout << "明文结果:" << Aes128(ReverseBytes(input), ReverseBytes(input_EV)) << std::endl; //待修改 + std::cout << "MPC结果:" << ReverseBytes(result[0]) << std::endl; + std::cout << "明文结果:" + << Aes128(ReverseBytes(input), ReverseBytes(input_EV)) + << std::endl; // 待修改 return result[0]; } - - /******** - * - * - * 可能有bug - * - * **********/ template - void finalize(absl::Span outputs) { - // YACL_ENFORCE(outputs.size() >= circ_->nov); + void finalize(absl::Span outputs) { + // YACL_ENFORCE(outputs.size() >= circ_->nov); size_t index = wires_.size(); @@ -291,16 +281,15 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; int wire_index = index - circ_.now[i] + j; result[j] = getLSB(wires_[wire_index]) ^ getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 - // 对应的混淆电路计算为LSB ^ d - // 输出线路在后xx位 + // 对应的混淆电路计算为LSB ^ + // d 输出线路在后xx位 } - + outputs[circ_.nov - i - 1] = *(T*)result.data(); index -= circ_.now[i]; } } - void onlineOT(){ - + void onlineOT() { auto buf = lctx->Recv(1, "masked_choice"); dynamic_bitset masked_choices(num_ot); @@ -324,5 +313,4 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; ByteContainerView(batch_send.data(), sizeof(uint128_t) * num_ot * 2), ""); } - }; \ No newline at end of file diff --git a/examples/gc/evaluator.h b/examples/gc/evaluator.h deleted file mode 100644 index fbeaaa1a..00000000 --- a/examples/gc/evaluator.h +++ /dev/null @@ -1,231 +0,0 @@ -#pragma once -#include -#include -#include -#include - -#include "absl/types/span.h" -#include "examples/gc/mitccrh.h" -#include "fmt/format.h" - -#include "yacl/base/byte_container_view.h" -#include "yacl/base/dynamic_bitset.h" -#include "yacl/base/exception.h" -#include "yacl/crypto/rand/rand.h" -#include "yacl/io/circuit/bristol_fashion.h" -#include "yacl/io/stream/file_io.h" -#include "yacl/kernel/algorithms/base_ot.h" -#include "yacl/kernel/algorithms/iknp_ote.h" -#include "yacl/kernel/type/ot_store_utils.h" -#include "yacl/link/context.h" -#include "yacl/link/factory.h" -#include "yacl/link/test_util.h" -#include "yacl/utils/circuit_executor.h" -#include "yacl/kernel/ot_kernel.h" -#include "yacl/kernel/type/ot_store_utils.h" - -using namespace std; -using namespace yacl; -using namespace yacl::crypto; -namespace { -using uint128_t = __uint128_t; -using OtMsg = uint128_t; -using OtMsgPair = std::array; -using OtChoices = dynamic_bitset; -} - -uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); -uint128_t select_mask[2] = {0, all_one_uint128_t}; - -class Evaluator { - public: - uint128_t delta; - uint128_t inv_constant; - uint128_t start_point; - MITCCRH<8> mitccrh; - - std::vector wires_; - std::vector gb_value; - yacl::io::BFCircuit circ_; - std::shared_ptr lctx; - uint128_t table[376][2]; - uint64_t input; - - const int num_ot = 64; - yacl::crypto::OtRecvStore ot_recv = OtRecvStore(num_ot, yacl::crypto::OtStoreType::Normal); - - void setup() { - // 通信环境初始化 - size_t world_size = 2; - yacl::link::ContextDesc ctx_desc; - - for (size_t rank = 0; rank < world_size; rank++) { - const auto id = fmt::format("id-{}", rank); - const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); - ctx_desc.parties.push_back({id, host}); - } - - lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, - 1); - lctx->ConnectToMesh(); - - //OT off-line - const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; - yacl::crypto::OtKernel kernel1(yacl::crypto::OtKernel::Role::Receiver, ext_algorithm); - kernel1.init(lctx); - kernel1.eval_rot(lctx, num_ot, &ot_recv); - - uint128_t tmp[3]; - // delta, inv_constant, start_point 接收 - yacl::Buffer r = lctx->Recv(0, "tmp"); - const uint128_t* buffer_data = r.data(); - memcpy(tmp, buffer_data, sizeof(uint128_t) * 3); - std::cout << "tmpRecv" << std::endl; - - delta = tmp[0]; - inv_constant = tmp[1]; - start_point = tmp[2]; - - // 秘钥生成 - mitccrh.setS(start_point); - } - - void inputProcess(yacl::io::BFCircuit param_circ_) { - circ_ = param_circ_; - gb_value.resize(circ_.nw); - wires_.resize(circ_.nw); - - yacl::dynamic_bitset bi_val; - - - input = yacl::crypto::FastRandU64(); - std::cout << "input of evaluator:" << input << std::endl; - bi_val.append(input); // 直接转换为二进制 输入线路在前64位 - // 接收garbler混淆值 - yacl::Buffer r = lctx->Recv(0, "garbleInput1"); - - const uint128_t* buffer_data = r.data(); - - memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * 64); - - std::cout << "recvInput1" << std::endl; - - // 对evaluator自己的输入值进行混淆 - // r = lctx->Recv(0, "garbleInput2"); - // buffer_data = r.data(); - // for (int i = 0; i < circ_.niw[1]; i++) { - // wires_[i + circ_.niw[0]] = - // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); - - // } - // std::cout << "recvInput2" << std::endl; - - // onLineOT(); - - lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint64_t)), "Input1"); - } - void recvTable() { - - yacl::Buffer r = lctx->Recv(0, "table"); - const uint128_t* buffer_data = r.data(); - int k = 0; - for (int i = 0; i < circ_.ng; i++) { - for (int j = 0; j < 2; j++) { - table[i][j] = buffer_data[k]; - k++; - } - } - - std::cout << "recvTable" << std::endl; - - } - uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, - MITCCRH<8>* mitccrh_pointer) { - uint128_t HA, HB, W; - int sa, sb; - - sa = getLSB(A); - sb = getLSB(B); - - uint128_t H[2]; - H[0] = A; - H[1] = B; - mitccrh_pointer->hash<2, 1>(H); - HA = H[0]; - HB = H[1]; - - W = HA ^ HB; - W = W ^ (select_mask[sa] & table_item[0]); - W = W ^ (select_mask[sb] & table_item[1]); - W = W ^ (select_mask[sb] & A); - return W; - } - - void EV() { - for (int i = 0; i < circ_.gates.size(); i++) { - auto gate = circ_.gates[i]; - switch (gate.op) { - case yacl::io::BFCircuit::Op::XOR: { - const auto& iw0 = wires_.operator[](gate.iw[0]); // 取到具体值 - const auto& iw1 = wires_.operator[](gate.iw[1]); - wires_[gate.ow[0]] = iw0 ^ iw1; - break; - } - case yacl::io::BFCircuit::Op::AND: { - const auto& iw0 = wires_.operator[](gate.iw[0]); - const auto& iw1 = wires_.operator[](gate.iw[1]); - wires_[gate.ow[0]] = EVAND(iw0, iw1, table[i], &mitccrh); - break; - } - case yacl::io::BFCircuit::Op::INV: { - const auto& iw0 = wires_.operator[](gate.iw[0]); - wires_[gate.ow[0]] = iw0 ^ inv_constant; - break; - } - case yacl::io::BFCircuit::Op::EQ: { - wires_[gate.ow[0]] = gate.iw[0]; - break; - } - case yacl::io::BFCircuit::Op::EQW: { - const auto& iw0 = wires_.operator[](gate.iw[0]); - wires_[gate.ow[0]] = iw0; - break; - } - case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ - YACL_THROW("Unimplemented MAND gate"); - break; - } - default: - YACL_THROW("Unknown Gate Type: {}", (int)gate.op); - } - } - } - void sendOutput() { - size_t index = wires_.size(); - int start = index - circ_.now[0]; - lctx->Send( - 0, - yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * 64), - "output"); - std::cout << "sendOutput" << std::endl; - } - void onLineOT(){ - - yacl::dynamic_bitset choices; - choices.append(input); - - yacl::dynamic_bitset ot = ot_recv.CopyBitBuf(); - ot.resize(choices.size()); - - yacl::dynamic_bitset masked_choices = ot ^ choices; - lctx->Send(0, yacl::ByteContainerView(masked_choices.data(), sizeof(uint128_t)), "masked_choice"); - - auto buf = lctx->Recv(lctx->NextRank(), ""); - std::vector batch_recv(64); - std::memcpy(batch_recv.data(), buf.data(), buf.size()); - for (uint32_t j = 0; j < 64; ++j) { - auto idx = 64 + j; - wires_[idx] = batch_recv[j][choices[j]] ^ ot_recv.GetBlock(j); - } - } -}; \ No newline at end of file diff --git a/examples/gc/garbler.h b/examples/gc/garbler.h deleted file mode 100644 index 1302c274..00000000 --- a/examples/gc/garbler.h +++ /dev/null @@ -1,288 +0,0 @@ -#pragma once -#include -#include -#include -#include - -#include "absl/types/span.h" -#include "examples/gc/mitccrh.h" -#include "fmt/format.h" - -#include "yacl/base/byte_container_view.h" -#include "yacl/base/dynamic_bitset.h" -#include "yacl/base/exception.h" -#include "yacl/crypto/rand/rand.h" -#include "yacl/io/circuit/bristol_fashion.h" -#include "yacl/io/stream/file_io.h" -#include "yacl/kernel/algorithms/base_ot.h" -#include "yacl/kernel/algorithms/iknp_ote.h" -#include "yacl/kernel/type/ot_store_utils.h" -#include "yacl/link/context.h" -#include "yacl/link/factory.h" -#include "yacl/link/test_util.h" -#include "yacl/utils/circuit_executor.h" -#include "yacl/kernel/ot_kernel.h" -#include "yacl/kernel/type/ot_store_utils.h" -using namespace std; -using namespace yacl; -namespace { -using uint128_t = __uint128_t; -using OtMsg = uint128_t; -using OtMsgPair = std::array; -using OtChoices = dynamic_bitset; -} -uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); -uint128_t select_mask_[2] = {0, all_one_uint128_t_}; -class Garbler { - public: - std::shared_ptr lctx; - uint128_t delta; - uint128_t inv_constant; - uint128_t start_point; - MITCCRH<8> mitccrh; - - std::vector wires_; - std::vector gb_value; - yacl::io::BFCircuit circ_; - uint128_t table[376][2]; - uint64_t input; - uint64_t input_EV; - - const int num_ot = 64; - yacl::crypto::OtSendStore ot_send = OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); - - - void setup() { - // 通信环境初始化 - size_t world_size = 2; - yacl::link::ContextDesc ctx_desc; - - for (size_t rank = 0; rank < world_size; rank++) { - const auto id = fmt::format("id-{}", rank); - const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); - ctx_desc.parties.push_back({id, host}); - } - - - lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, - 0); - lctx->ConnectToMesh(); - - //OT off-line - const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; - yacl::crypto::OtKernel kernel0(yacl::crypto::OtKernel::Role::Sender, ext_algorithm); - kernel0.init(lctx); - kernel0.eval_rot(lctx, num_ot, &ot_send); - - // delta, inv_constant, start_point 初始化并发送给evaluator - uint128_t tmp[3]; - - random_uint128_t(tmp, 3); - tmp[0] = tmp[0] | 1; - lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 3), "tmp"); - std::cout << "tmpSend" << std::endl; - - delta = tmp[0]; - inv_constant = tmp[1] ^ delta; - start_point = tmp[2]; - - // 秘钥生成 - mitccrh.setS(start_point); - } - - // 包扩 输入值生成和混淆,garbler混淆值的发送 - void inputProcess(yacl::io::BFCircuit param_circ_) { - circ_ = param_circ_; - gb_value.resize(circ_.nw); - wires_.resize(circ_.nw); - - input = yacl::crypto::FastRandU64(); - std::cout << "input of garbler:" << input << std::endl; - - yacl::dynamic_bitset bi_val; - bi_val.append(input); // 直接转换为二进制 输入线路在前64位 - - // 混淆过程 - int num_of_input_wires = 0; - for (size_t i = 0; i < circ_.niv; ++i) { - num_of_input_wires += circ_.niw[i]; - } - - random_uint128_t(gb_value.data(), num_of_input_wires); - - - // 前64位 直接置换 garbler - for (int i = 0; i < circ_.niw[0]; i++) { - wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); - } - - lctx->Send(1, - yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * 64), - "garbleInput1"); - - std::cout << "sendInput1" << std::endl; - - // lctx->Send( - // 1, - // yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), - // "garbleInput2"); - // std::cout << "sendInput2" << std::endl; - - // onlineOT(); - - yacl::Buffer r = lctx->Recv(1, "Input1"); - - const uint64_t* buffer_data = r.data(); - input_EV = *buffer_data; - - - } - - uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, - uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { - bool pa = getLSB(LA0); - bool pb = getLSB(LB0); - - uint128_t HLA0, HA1, HLB0, HB1; - uint128_t tmp, W0; - uint128_t H[4]; - - H[0] = LA0; - H[1] = A1; - H[2] = LB0; - H[3] = B1; - - mitccrh_pointer->hash<2, 2>(H); - - HLA0 = H[0]; - HA1 = H[1]; - HLB0 = H[2]; - HB1 = H[3]; - - table_item[0] = HLA0 ^ HA1; - table_item[0] = table_item[0] ^ (select_mask_[pb] & delta); - - W0 = HLA0; - W0 = W0 ^ (select_mask_[pa] & table_item[0]); - - tmp = HLB0 ^ HB1; - table_item[1] = tmp ^ LA0; - - W0 = W0 ^ HLB0; - W0 = W0 ^ (select_mask_[pb] & tmp); - return W0; - - } - void GB() { - - for (int i = 0; i < circ_.gates.size(); i++) { - auto gate = circ_.gates[i]; - switch (gate.op) { - case yacl::io::BFCircuit::Op::XOR: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 - const auto& iw1 = gb_value.operator[](gate.iw[1]); - gb_value[gate.ow[0]] = iw0 ^ iw1; - break; - } - case yacl::io::BFCircuit::Op::AND: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); - const auto& iw1 = gb_value.operator[](gate.iw[1]); - gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, - table[i], &mitccrh); - break; - } - case yacl::io::BFCircuit::Op::INV: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); - gb_value[gate.ow[0]] = iw0 ^ inv_constant; - break; - } - case yacl::io::BFCircuit::Op::EQ: { - gb_value[gate.ow[0]] = gate.iw[0]; - break; - } - case yacl::io::BFCircuit::Op::EQW: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); - gb_value[gate.ow[0]] = iw0; - break; - } - case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ - YACL_THROW("Unimplemented MAND gate"); - break; - } - default: - YACL_THROW("Unknown Gate Type: {}", (int)gate.op); - } - } - } - - void sendTable() { - lctx->Send(1, - yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_.ng), - "table"); - std::cout << "sendTable" << std::endl; - } - void decode() { - // 现接收计算结果 - size_t index = wires_.size(); - int start = index - circ_.now[0]; - - yacl::Buffer r = lctx->Recv(1, "output"); - const uint128_t* buffer_data = r.data(); - - memcpy(wires_.data() + start, buffer_data, sizeof(uint128_t) * 64); - std::cout << "recvOutput" << std::endl; - - // decode - std::vector result(1); - finalize(absl::MakeSpan(result)); - std::cout << "MPC结果:" << result[0] << std::endl; - std::cout << "明文结果:" << input + input_EV << std::endl; - } - - template - void finalize(absl::Span outputs) { - // YACL_ENFORCE(outputs.size() >= circ_->nov); - - size_t index = wires_.size(); - - for (size_t i = 0; i < circ_.nov; ++i) { - yacl::dynamic_bitset result(circ_.now[i]); - for (size_t j = 0; j < circ_.now[i]; ++j) { - int wire_index = index - circ_.now[i] + j; - result[j] = getLSB(wires_[wire_index]) ^ - getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 - // 对应的混淆电路计算为LSB ^ d - // 输出线路在后xx位 - } - - outputs[circ_.nov - i - 1] = *(T*)result.data(); - index -= circ_.now[i]; - } - } - void onlineOT(){ - - auto buf = lctx->Recv(1, "masked_choice"); - - dynamic_bitset masked_choices(64); - std::memcpy(masked_choices.data(), buf.data(), buf.size()); - - std::vector batch_send(64); - - for (uint32_t j = 0; j < 64; ++j) { - auto idx = 64 + j; - if (!masked_choices[j]) { - batch_send[j][0] = ot_send.GetBlock(j, 0) ^ gb_value[idx]; - batch_send[j][1] = ot_send.GetBlock(j, 1) ^ gb_value[idx] ^ delta; - } else { - batch_send[j][0] = ot_send.GetBlock(j, 1) ^ gb_value[idx]; - batch_send[j][1] = ot_send.GetBlock(j, 0) ^ gb_value[idx] ^ delta; - } - } - - lctx->SendAsync( - lctx->NextRank(), - ByteContainerView(batch_send.data(), sizeof(uint128_t) * 64 * 2), - ""); - } - -}; \ No newline at end of file diff --git a/examples/gc/gc_test.cc b/examples/gc/gc_test.cc index 275cacb7..041ea243 100644 --- a/examples/gc/gc_test.cc +++ b/examples/gc/gc_test.cc @@ -1,28 +1,17 @@ - -#include -#include -#include #include -// #include "absl/std::strings/escaping.h" -#include "absl/types/span.h" - #include "examples/gc/aes_128_evaluator.h" #include "examples/gc/aes_128_garbler.h" -#include "examples/gc/sha256_garbler.h" #include "examples/gc/sha256_evaluator.h" +#include "examples/gc/sha256_garbler.h" #include "fmt/format.h" #include "gtest/gtest.h" -#include "yacl/kernel/ot_kernel.h" -#include "yacl/kernel/type/ot_store_utils.h" -#include "yacl/crypto/block_cipher/symmetric_crypto.h" - - -namespace examples::gc{ +#include "yacl/crypto/block_cipher/symmetric_crypto.h" +namespace examples::gc { inline uint128_t Aes128(uint128_t k, uint128_t m) { crypto::SymmetricCrypto enc(crypto::SymmetricCrypto::CryptoType::AES128_ECB, @@ -51,8 +40,7 @@ TEST(GCTest, SHA256Test) { std::future thread2 = std::async([&] { evaluator->setup(); }); thread1.get(); thread2.get(); - - + // 电路读取 std::string pth = fmt::format("{0}/yacl/io/circuit/data/{1}.txt", @@ -71,45 +59,36 @@ TEST(GCTest, SHA256Test) { thread1.get(); thread2.get(); - // // OT **************因为SHA256场景中输入都在混淆方,所以不需要进行OT*************** - // thread1 = std::async([&] { evaluator -> onLineOT();}); - // thread2 = std::async([&] { garbler -> onlineOT(); }); - // thread1.get(); - // thread2.get(); - - // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator garbler->GB(); garbler->sendTable(); evaluator->recvTable(); - // // 计算方进行计算 按拓扑顺序进行计算 evaluator->EV(); // // // evaluator发送计算结果 garbler进行DE操作 evaluator->sendOutput(); - + vector gc_result = garbler->decode(); EXPECT_EQ(sha256_result.size(), gc_result.size()); - EXPECT_TRUE(std::equal(gc_result.begin(), gc_result.end(), sha256_result.begin())); - + EXPECT_TRUE( + std::equal(gc_result.begin(), gc_result.end(), sha256_result.begin())); } TEST(GCTest, AESTest) { std::shared_ptr circ_; // 初始化 GarblerAES* garbler = new GarblerAES(); - EvaluatorAES * evaluator = new EvaluatorAES(); + EvaluatorAES* evaluator = new EvaluatorAES(); std::future thread1 = std::async([&] { garbler->setup(); }); std::future thread2 = std::async([&] { evaluator->setup(); }); thread1.get(); thread2.get(); - - + // 电路读取 std::string pth = fmt::format("{0}/yacl/io/circuit/data/{1}.txt", @@ -129,32 +108,27 @@ TEST(GCTest, AESTest) { thread1.get(); thread2.get(); - // OT - thread1 = std::async([&] { evaluator -> onLineOT();}); - thread2 = std::async([&] { garbler -> onlineOT(); }); + // OT + thread1 = std::async([&] { evaluator->onLineOT(); }); + thread2 = std::async([&] { garbler->onlineOT(); }); thread1.get(); thread2.get(); - // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator garbler->GB(); garbler->sendTable(); evaluator->recvTable(); - // // 计算方进行计算 按拓扑顺序进行计算 evaluator->EV(); // // // evaluator发送计算结果 garbler进行DE操作 evaluator->sendOutput(); - + uint128_t gc_result = garbler->decode(); auto aes = Aes128(ReverseBytes(key), ReverseBytes(message)); EXPECT_EQ(ReverseBytes(gc_result), aes); - -} - } - +} // namespace examples::gc diff --git a/examples/gc/mitccrh.h b/examples/gc/mitccrh.h index c31f41f7..eebf73b1 100644 --- a/examples/gc/mitccrh.h +++ b/examples/gc/mitccrh.h @@ -2,7 +2,7 @@ #include #include "utils.h" - +#include "yacl/base/int128.h" #include "yacl/crypto/aes/aes_opt.h" #include "yacl/crypto/tools/crhash.h" /* @@ -38,7 +38,7 @@ class MITCCRH { void renew_ks() { for (int i = 0; i < BatchSize; ++i) - keys[i] = start_point ^ make_uint128_t(gid++, 0); + keys[i] = start_point ^ yacl::MakeUint128(gid++, (uint64_t)0); yacl::crypto::AES_opt_key_schedule(keys, scheduled_key); key_used = 0; } diff --git a/examples/gc/sha256.cc b/examples/gc/sha256.cc deleted file mode 100644 index ebb86573..00000000 --- a/examples/gc/sha256.cc +++ /dev/null @@ -1,319 +0,0 @@ -#include -// #include - -#include - -#include "absl/strings/escaping.h" - -#include "yacl/base/byte_container_view.h" -#include "yacl/base/dynamic_bitset.h" -#include "yacl/crypto/block_cipher/symmetric_crypto.h" -#include "yacl/crypto/hash/hash_utils.h" -#include "yacl/crypto/rand/rand.h" -#include "yacl/io/circuit/bristol_fashion.h" -#include "yacl/utils/circuit_executor.h" - -// using namespace std; -// using namespace yacl; -// void sha256_preprocess(uint8_t *input_data, size_t input_len, -// uint8_t **padded_data, size_t *padded_len) { -// size_t pad_len = input_len + 1 + 8; // +1 for 0x80 and +8 for length -// size_t rem = pad_len % 64; -// if (rem > 0) { -// pad_len += (64 - rem); -// } - -// // Allocate memory for padded data -// *padded_data = (uint8_t *)malloc(pad_len); -// *padded_len = pad_len; - -// // Copy original data -// memcpy(*padded_data, input_data, input_len); - -// // Append the "1" bit (0x80) -// (*padded_data)[input_len] = 0x80; - -// // Append zeros -// memset(*padded_data + input_len + 1, 0, pad_len - input_len - 9); - -// // Append original length in bits (big-endian) -// uint64_t bit_len = input_len * 8; -// for (int i = 0; i < 8; ++i) { -// (*padded_data)[pad_len - 1 - i] = (bit_len >> (i * 8)) & 0xff; -// } -// } - -uint8_t reverse_bits(uint8_t byte) { - byte = (byte & 0xF0) >> 4 | (byte & 0x0F) << 4; - byte = (byte & 0xCC) >> 2 | (byte & 0x33) << 2; - byte = (byte & 0xAA) >> 1 | (byte & 0x55) << 1; - return byte; -} - -std::vector preprocess(const std::vector &message) { - // 步骤 1: 填充消息 - size_t original_length = message.size() * 8; // 原始消息的比特长度 - std::vector padded_message = message; - - // 添加 1 位 - padded_message.push_back(0x80); - - // 添加 0 位,直到长度为 448 位(56 字节) - while ((padded_message.size() * 8) % 512 != 448) { - padded_message.push_back(0x00); - } - // std::cout << "11 " << padded_message.size() * 8 << endl; - // std::cout << "origin_len" << original_length << endl; - // vector temp; - // 添加原始消息长度(64 位) - for (int i = 7; i >= 0; --i) { - padded_message.push_back((original_length >> (i * 8)) & 0xFF); - // temp.push_back((original_length >> (i * 8)) & 0xFF); - } - // std::cout << "len:"; - // for (int i = 0; i < temp.size(); i++) { - // bitset<8> b(temp[i]); - // std::cout << b << ' '; - // } - // std::cout << endl; - - return padded_message; -} - -// uint128_t ReverseBytes(uint128_t x) { -// auto byte_view = ByteContainerView(&x, sizeof(x)); -// uint128_t ret = 0; -// auto buf = std::vector(sizeof(ret)); -// for (size_t i = 0; i < byte_view.size(); ++i) { -// buf[byte_view.size() - i - 1] = byte_view[i]; -// } -// std::memcpy(&ret, buf.data(), buf.size()); -// return ret; -// } - -// std::string uint128ToBinaryString(__uint128_t value) { -// std::string result; -// for (int i = 127; i >= 0; --i) { -// result += ((value >> i) & 1) ? '1' : '0'; -// } -// return result; -// } - -// uint128_t CopyDataAsUint128(const uint8_t *data, bool flag) { -// uint128_t ret; -// int len = flag ? sizeof(uint128_t) / 2 : sizeof(uint128_t); -// for (int idx = 0; idx < len; ++idx) { -// reinterpret_cast(&ret)[idx] = data[idx]; -// // std::cout << uint128ToBinaryString(ret) << endl; -// } -// return ret; -// } - -// std::vector stringToBinary(const std::string &str) { -// std::vector binaryData(str.begin(), str.end()); -// return binaryData; -// } - -// std::string uint128ToString(__uint128_t value) { -// if (value == 0) return "0"; - -// std::string result; -// while (value > 0) { -// result.insert(result.begin(), '0' + static_cast(value % 10)); -// value /= 10; -// } -// return result; -// } - -// template -// void PlainExecutor::Finalize(absl::Span outputs) { -// // YACL_ENFORCE(outputs.size() >= circ_->nov); - -// size_t index = wires_.size(); -// for (size_t i = 0; i < circ_->nov; ++i) { -// int half_num_wire = circ_->now[i] / 2; - -// dynamic_bitset result(circ_->now[i]); - -// for (size_t j = 0; j < circ_->now[i]; ++j) { -// result[j % 128] = -// wires_[index - circ_->now[i] + -// j]; // 得到的是逆序的二进制值 对应的混淆电路计算为 -// // LSB ^ d 输出线路在后xx位 -// if (j % 128 == 127) { -// outputs[circ_->nov - i - 1] = -// *(uint128_t*)result.data(); // 先得到最后位置上的 -// index -= circ_->now[i]; -// std::cout << std::hex << outputs[circ_->nov - i - 1] << "\t"; -// } -// } -// } -// std::cout << endl; -// } - -// template -// void PlainExecutor::SetupInputs( -// vector inputs_bi) { // Span方便指针的使用 -// // YACL_ENFORCE(inputs.size() == circ_->niv); -// for (auto input : inputs_bi) { -// wires_.append( -// std::bitset<8>(input).begin(), -// std::bitset<8>(input).end()); // 直接转换为二进制 输入线路在前128位 -// } -// wires_.resize(circ_->nw); -// } - -// #include - -// std::vector stringToBinary(const std::string& str) { -// std::vector binaryData(str.begin(), str.end()); -// return binaryData; -// } - -// int main() { -// std::string str = "Hello"; -// std::vector binaryData = stringToBinary(str); - -// // 打印二进制数据 -// for (uint8_t byte : binaryData) { -// std::std::cout << std::bitset<8>(byte) << " "; -// } -// std::std::cout << std::endl; - -// return 0; -// } - -// void get_sha256_initial_hash_values(uint32_t hash[8]) { -// // SHA256 的初始哈希值(每个值为 32 位) -// hash[0] = 0x6a09e667; -// hash[1] = 0xbb67ae85; -// hash[2] = 0x3c6ef372; -// hash[3] = 0xa54ff53a; -// hash[4] = 0x510e527f; -// hash[5] = 0x9b05688c; -// hash[6] = 0x1f83d9ab; -// hash[7] = 0x5be0cd19; -// } -int main() { - // const char *data = "Hello, OpenSSL!"; - // size_t data_len = strlen(data); - - // // 进行 SHA256 预处理 - // uint8_t *padded_data; - // size_t padded_len; - // sha256_preprocess((uint8_t *)data, data_len, &padded_data, &padded_len); - // std::cout << "预处理:"; - // for (int i = 0; i < 64; i++) { - // std::cout << std::hex << static_cast(padded_data[i]); - // } - // std::cout << endl; - - // vector data_vec(padded_data, padded_data + 64); - - std::string input; - std::cout << "请输入:"; - std::cin >> input; - std::vector message(input.begin(), input.end()); - - // 预处理消息 - std::vector data_vec = preprocess(message); - - // std::vector hash_vec = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, - // 0xa54ff53a, 0x510e527f, 0x9b05688c, - // 0x1f83d9ab, 0x5be0cd19}; - - /* - Initial hash value, reference: - https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf - Section 5.3 - */ - std::vector byte_hash_vec = { - 0x6a, 0x09, 0xe6, 0x67, 0xbb, 0x67, 0xae, 0x85, 0x3c, 0x6e, 0xf3, - 0x72, 0xa5, 0x4f, 0xf5, 0x3a, 0x51, 0x0e, 0x52, 0x7f, 0x9b, 0x05, - 0x68, 0x8c, 0x1f, 0x83, 0xd9, 0xab, 0x5b, 0xe0, 0xcd, 0x19}; - - // 遍历 hash_vec 并将每个 uint32_t 分解为 4 个字节存储到 byte_hash_vec 中 - // for (uint32_t value : hash_vec) { - // byte_hash_vec.push_back(value >> 24 & 0xFF); - // byte_hash_vec.push_back((value >> 16) & 0xFF); - // byte_hash_vec.push_back((value >> 8) & 0xFF); - // byte_hash_vec.push_back((value) & 0xFF); - // } - for (auto &elem : data_vec) { - elem = reverse_bits(elem); - } - for (auto &elem : byte_hash_vec) { - elem = reverse_bits(elem); - } -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - - reverse(data_vec.begin(), data_vec.end()); - - reverse(byte_hash_vec.begin(), byte_hash_vec.end()); -#endif - // std::cout << "hash"; - // for (int i = 0; i < 32; i++) { - // bitset<8> b(byte_hash_vec[i]); - // std::cout << b; - // } - // std::cout << endl; - - std::vector input_vec; - - for (auto &elem : data_vec) { - input_vec.push_back(elem); - } - for (auto &elem : byte_hash_vec) { - input_vec.push_back(elem); - } - - // std::vector output_vec(input_vec.size() / 16); - - // for (size_t i = 0; i < output_vec.size(); ++i) { - // uint128_t value = 0; - // for (size_t j = 0; j < 16; ++j) { - // value |= static_cast(input_vec[i * 16 + j]) << (j * 8); - // } - // output_vec[i] = value; - // } - - // for (auto &elem : output_vec) { - // bitset<128> b(elem); - // std::cout << b; - // } - // std::cout << endl; - - std::vector result(32); - std::string pth_str = fmt::format("{}/yacl/io/circuit/data/sha256.txt", - std::filesystem::current_path().string()); - yacl::PlainExecutor exec; - // std::cout << "指针内容:" << *(uint8_t *)input_vec.data() << endl; - - exec.LoadCircuitFile(pth_str); - exec.wires_.resize(exec.circ_->nw); - for (size_t i = 0; i < input_vec.size(); ++i) { - for (int j = 0; j < 8; ++j) { - exec.wires_[i * 8 + j] = (input_vec[i] >> (7 - j)) & 1; // 逐位赋值 - } - } - - // exec.SetupInputs(absl::MakeSpan(input_vec)); // 拼成一个vector - - exec.Exec(); - - exec.Finalize(absl::MakeSpan(result)); - - reverse(result.begin(), result.end()); - for (int i = 0; i < 32; i++) { - std::cout << std::hex << std::setw(2) << std::setfill('0') - << static_cast(result[i]); - // std::cout << result[i]; - // bitset<8> bits(result[i]); - // std::cout << bits; - } - std::cout << std::endl; - // std::cout << std::hex << static_cast(result[1]) << "\t" << result[0] - // << endl; - - return 0; -} \ No newline at end of file diff --git a/examples/gc/sha256_evaluator.h b/examples/gc/sha256_evaluator.h index 8c26c07e..3a671301 100644 --- a/examples/gc/sha256_evaluator.h +++ b/examples/gc/sha256_evaluator.h @@ -1,41 +1,21 @@ #pragma once -#include -#include -#include + #include -#include "absl/types/span.h" #include "examples/gc/mitccrh.h" #include "fmt/format.h" #include "yacl/base/byte_container_view.h" #include "yacl/base/dynamic_bitset.h" -#include "yacl/base/exception.h" +#include "yacl/base/int128.h" #include "yacl/crypto/rand/rand.h" #include "yacl/io/circuit/bristol_fashion.h" -#include "yacl/io/stream/file_io.h" -#include "yacl/kernel/algorithms/base_ot.h" -#include "yacl/kernel/algorithms/iknp_ote.h" -#include "yacl/kernel/type/ot_store_utils.h" #include "yacl/link/context.h" #include "yacl/link/factory.h" #include "yacl/link/test_util.h" -#include "yacl/utils/circuit_executor.h" -#include "yacl/kernel/ot_kernel.h" -#include "yacl/kernel/type/ot_store_utils.h" - using namespace std; using namespace yacl; using namespace yacl::crypto; -namespace { -using uint128_t = __uint128_t; -using OtMsg = uint128_t; -using OtMsgPair = std::array; -using OtChoices = dynamic_bitset; - -} - - class EvaluatorSHA256 { public: @@ -48,13 +28,12 @@ class EvaluatorSHA256 { std::vector gb_value; yacl::io::BFCircuit circ_; std::shared_ptr lctx; - - //根据电路改 + + // 根据电路改 uint128_t table[135073][2]; uint128_t input; - int num_ot = 768; + int num_ot = 768; - yacl::crypto::OtRecvStore ot_recv = OtRecvStore(num_ot, yacl::crypto::OtStoreType::Normal); uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); uint128_t select_mask[2] = {0, all_one_uint128_t}; void setup() { @@ -68,16 +47,9 @@ class EvaluatorSHA256 { ctx_desc.parties.push_back({id, host}); } - lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, - 1); + lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, 1); lctx->ConnectToMesh(); - //OT off-line - const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; - yacl::crypto::OtKernel kernel1(yacl::crypto::OtKernel::Role::Receiver, ext_algorithm); - kernel1.init(lctx); - kernel1.eval_rot(lctx, num_ot, &ot_recv); - uint128_t tmp[3]; // delta, inv_constant, start_point 接收 yacl::Buffer r = lctx->Recv(0, "tmp"); @@ -98,7 +70,6 @@ class EvaluatorSHA256 { gb_value.resize(circ_.nw); wires_.resize(circ_.nw); - yacl::Buffer r = lctx->Recv(0, "garbleInput1"); const uint128_t* buffer_data = r.data(); @@ -106,11 +77,8 @@ class EvaluatorSHA256 { memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * num_ot); std::cout << "recvInput1" << std::endl; - - } void recvTable() { - yacl::Buffer r = lctx->Recv(0, "table"); const uint128_t* buffer_data = r.data(); int k = 0; @@ -122,10 +90,9 @@ class EvaluatorSHA256 { } std::cout << "recvTable" << std::endl; - } - //未检查 + // 未检查 uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { uint128_t HA, HB, W; @@ -195,27 +162,5 @@ class EvaluatorSHA256 { yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * 256), "output"); std::cout << "sendOutput" << std::endl; - - } - void onLineOT(){ - // vector choices(96); - - - yacl::dynamic_bitset choices; - choices.append(input); - - yacl::dynamic_bitset ot = ot_recv.CopyBitBuf(); - ot.resize(choices.size()); - - yacl::dynamic_bitset masked_choices = ot ^ choices; - lctx->Send(0, yacl::ByteContainerView(masked_choices.data(), sizeof(uint128_t)), "masked_choice"); - - auto buf = lctx->Recv(lctx->NextRank(), ""); - std::vector batch_recv(num_ot); - std::memcpy(batch_recv.data(), buf.data(), buf.size()); - for (int j = 0; j < num_ot; ++j) { - auto idx = num_ot + j; - wires_[idx] = batch_recv[j][choices[j]] ^ ot_recv.GetBlock(j); - } } }; \ No newline at end of file diff --git a/examples/gc/sha256_garbler.h b/examples/gc/sha256_garbler.h index 733918af..8a9c8da2 100644 --- a/examples/gc/sha256_garbler.h +++ b/examples/gc/sha256_garbler.h @@ -1,7 +1,5 @@ #pragma once -#include -#include -#include + #include #include "absl/types/span.h" @@ -10,32 +8,17 @@ #include "yacl/base/byte_container_view.h" #include "yacl/base/dynamic_bitset.h" -#include "yacl/base/exception.h" +#include "yacl/base/int128.h" +#include "yacl/crypto/block_cipher/symmetric_crypto.h" +#include "yacl/crypto/hash/ssl_hash.h" #include "yacl/crypto/rand/rand.h" #include "yacl/io/circuit/bristol_fashion.h" -#include "yacl/io/stream/file_io.h" -#include "yacl/kernel/algorithms/base_ot.h" -#include "yacl/kernel/algorithms/iknp_ote.h" -#include "yacl/kernel/type/ot_store_utils.h" #include "yacl/link/context.h" #include "yacl/link/factory.h" -#include "yacl/link/test_util.h" -#include "yacl/crypto/block_cipher/symmetric_crypto.h" -#include "yacl/utils/circuit_executor.h" -#include "yacl/kernel/ot_kernel.h" -#include "yacl/kernel/type/ot_store_utils.h" -#include "yacl/math/mpint/mp_int.h" -#include "yacl/crypto/hash/ssl_hash.h" + using namespace std; using namespace yacl; -namespace { -using uint128_t = __uint128_t; -using OtMsg = uint128_t; -using OtMsgPair = std::array; -using OtChoices = dynamic_bitset; - -} - +// bazel test //examples/gc:gc_test @@ -51,21 +34,20 @@ class GarblerSHA256 { std::vector wires_; std::vector gb_value; yacl::io::BFCircuit circ_; - //根据电路改 + // 根据电路改 uint128_t table[135073][2]; - //输入数据类型需要修改 + // 输入数据类型需要修改 uint128_t input; uint128_t input_EV; vector message; - //num_ot根据输入改 + // num_ot根据输入改 int num_ot = 768; -uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); -uint128_t select_mask_[2] = {0, all_one_uint128_t_}; - - yacl::crypto::OtSendStore ot_send = yacl::crypto::OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); - + uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); + uint128_t select_mask_[2] = {0, all_one_uint128_t_}; + yacl::crypto::OtSendStore ot_send = + yacl::crypto::OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); void setup() { // 通信环境初始化 @@ -77,21 +59,24 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); ctx_desc.parties.push_back({id, host}); } - - lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, - 0); - lctx->ConnectToMesh(); - //OT off-line - const auto ext_algorithm = yacl::crypto::OtKernel::ExtAlgorithm::SoftSpoken; - yacl::crypto::OtKernel kernel0(yacl::crypto::OtKernel::Role::Sender, ext_algorithm); - kernel0.init(lctx); - kernel0.eval_rot(lctx, num_ot, &ot_send); + lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, 0); + lctx->ConnectToMesh(); // delta, inv_constant, start_point 初始化并发送给evaluator uint128_t tmp[3]; - random_uint128_t(tmp, 3); + // random_uint128_t(tmp, 3); + for(int i = 0; i < 3; i++){ + std::random_device rd; + std::mt19937_64 eng(rd()); + std::uniform_int_distribution distr; + + uint64_t high = distr(eng); + uint64_t low = distr(eng); + + tmp[i] = MakeUint128(high, low); + } tmp[0] = tmp[0] | 1; lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 3), "tmp"); std::cout << "tmpSend" << std::endl; @@ -110,15 +95,15 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; gb_value.resize(circ_.nw); wires_.resize(circ_.nw); - //输入位数有关 + // 输入位数有关 message = crypto::FastRandBytes(crypto::RandLtN(32)); - auto in_buf = io::BuiltinBFCircuit::PrepareSha256Input(message); + auto in_buf = io::BuiltinBFCircuit::PrepareSha256Input(message); auto sha256_result = crypto::Sha256Hash().Update(message).CumulativeHash(); - for(int i = 0; i < 32; i++){ - cout < bi_val; bi_val.resize(circ_.nw); std::memcpy(bi_val.data(), in_buf.data(), in_buf.size()); @@ -128,27 +113,34 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; for (size_t i = 0; i < circ_.niv; ++i) { num_of_input_wires += circ_.niw[i]; } - - random_uint128_t(gb_value.data(), num_of_input_wires); - for(int i = 0; i < 768; i++){ - - wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); - + // random_uint128_t(gb_value.data(), num_of_input_wires); + for(int i = 0; i < num_of_input_wires; i++){ + std::random_device rd; + std::mt19937_64 eng(rd()); + std::uniform_int_distribution distr; + + uint64_t high = distr(eng); + uint64_t low = distr(eng); + + gb_value[i] = MakeUint128(high, low); } - lctx->Send(1, - yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), - "garbleInput1"); + for (int i = 0; i < 768; i++) { + wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); + } + + lctx->Send( + 1, yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), + "garbleInput1"); std::cout << "sendInput1" << std::endl; return sha256_result; - } uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, - uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { + uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { bool pa = getLSB(LA0); bool pb = getLSB(LB0); @@ -180,10 +172,8 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; W0 = W0 ^ HLB0; W0 = W0 ^ (select_mask_[pb] & tmp); return W0; - } void GB() { - for (size_t i = 0; i < circ_.gates.size(); i++) { auto gate = circ_.gates[i]; switch (gate.op) { @@ -196,8 +186,8 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; case yacl::io::BFCircuit::Op::AND: { const auto& iw0 = gb_value.operator[](gate.iw[0]); const auto& iw1 = gb_value.operator[](gate.iw[1]); - gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, - table[i], &mitccrh); + gb_value[gate.ow[0]] = + GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, table[i], &mitccrh); break; } case yacl::io::BFCircuit::Op::INV: { @@ -230,7 +220,7 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; "table"); std::cout << "sendTable" << std::endl; } - vector decode() { + vector decode() { // 现接收计算结果 size_t index = wires_.size(); int start = index - circ_.now[0]; @@ -240,14 +230,15 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; memcpy(wires_.data() + start, r.data(), sizeof(uint128_t) * 256); std::cout << "recvOutput" << std::endl; - + const auto out_size = 32; std::vector out(out_size); for (size_t i = 0; i < out_size; ++i) { dynamic_bitset result(8); for (size_t j = 0; j < 8; ++j) { - result[j] = getLSB(wires_[index - 8 + j]) ^ getLSB(gb_value[index - 8 + j]); + result[j] = + getLSB(wires_[index - 8 + j]) ^ getLSB(gb_value[index - 8 + j]); } out[out_size - i - 1] = *(static_cast(result.data())); index -= 8; @@ -255,28 +246,17 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; std::reverse(out.begin(), out.end()); auto sha256_result = crypto::Sha256Hash().Update(message).CumulativeHash(); - - if(sha256_result.size() == out.size() && std::equal(out.begin(), out.end(), sha256_result.begin())) cout<<"YES!!!"< - void finalize(absl::Span outputs) { - // YACL_ENFORCE(outputs.size() >= circ_->nov); + void finalize(absl::Span outputs) { + // YACL_ENFORCE(outputs.size() >= circ_->nov); size_t index = wires_.size(); @@ -286,38 +266,12 @@ uint128_t select_mask_[2] = {0, all_one_uint128_t_}; int wire_index = index - circ_.now[i] + j; result[j] = getLSB(wires_[wire_index]) ^ getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 - // 对应的混淆电路计算为LSB ^ d - // 输出线路在后xx位 + // 对应的混淆电路计算为LSB ^ + // d 输出线路在后xx位 } - + outputs[circ_.nov - i - 1] = *(T*)result.data(); index -= circ_.now[i]; } } - void onlineOT(){ - - auto buf = lctx->Recv(1, "masked_choice"); - - dynamic_bitset masked_choices(num_ot); - std::memcpy(masked_choices.data(), buf.data(), buf.size()); - - std::vector batch_send(num_ot); - - for (int j = 0; j < num_ot; ++j) { - auto idx = num_ot + j; - if (!masked_choices[j]) { - batch_send[j][0] = ot_send.GetBlock(j, 0) ^ gb_value[idx]; - batch_send[j][1] = ot_send.GetBlock(j, 1) ^ gb_value[idx] ^ delta; - } else { - batch_send[j][0] = ot_send.GetBlock(j, 1) ^ gb_value[idx]; - batch_send[j][1] = ot_send.GetBlock(j, 0) ^ gb_value[idx] ^ delta; - } - } - - lctx->SendAsync( - lctx->NextRank(), - ByteContainerView(batch_send.data(), sizeof(uint128_t) * num_ot * 2), - ""); - } - }; \ No newline at end of file diff --git a/examples/gc/test.cc b/examples/gc/test.cc deleted file mode 100644 index 6b2c3064..00000000 --- a/examples/gc/test.cc +++ /dev/null @@ -1,524 +0,0 @@ - -#include -#include -#include -#include - -// #include "absl/std::strings/escaping.h" -#include "absl/types/span.h" -#include "examples/gc/mitccrh.h" -#include "fmt/format.h" - -#include "yacl/base/byte_container_view.h" -#include "yacl/base/dynamic_bitset.h" -#include "yacl/base/exception.h" -#include "yacl/crypto/rand/rand.h" -#include "yacl/io/circuit/bristol_fashion.h" -#include "yacl/io/stream/file_io.h" -#include "yacl/kernel/algorithms/base_ot.h" -#include "yacl/kernel/algorithms/iknp_ote.h" -// #include "yacl/kernel/ot_kernel.h" -#include "yacl/kernel/type/ot_store_utils.h" -#include "yacl/link/context.h" -#include "yacl/link/factory.h" -#include "yacl/link/test_util.h" -#include "yacl/utils/circuit_executor.h" - -using namespace std; -using namespace yacl; -namespace { -using uint128_t = __uint128_t; -} - -const uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); -const uint128_t select_mask[2] = {0, all_one_uint128_t}; - -std::shared_ptr circ_; -std::vector wires_; -std::vector gb_value; - -// enum class Op { -// adder64, √ -// aes_128, √ -// divide64, √ -// mult2_64, -// mult64, √ -// neg64, √ -// sha256, -// sub64, √ -// udivide64, √ -// zero_equal √ -// } - -inline uint128_t Aes128(uint128_t k, uint128_t m) { - yacl::crypto::SymmetricCrypto enc( - yacl::crypto::SymmetricCrypto::CryptoType::AES128_ECB, k); - return enc.Encrypt(m); -} - -uint128_t ReverseBytes(uint128_t x) { - auto byte_view = yacl::ByteContainerView(&x, sizeof(x)); - uint128_t ret = 0; - auto buf = std::vector(sizeof(ret)); - for (size_t i = 0; i < byte_view.size(); ++i) { - buf[byte_view.size() - i - 1] = byte_view[i]; - } - std::memcpy(&ret, buf.data(), buf.size()); - return ret; -} - -uint128_t GBAND(uint128_t LA0, uint128_t A1, uint128_t LB0, uint128_t B1, - uint128_t delta, uint128_t* table, MITCCRH<8>* mitccrh) { - bool pa = getLSB(LA0); - bool pb = getLSB(LB0); - - uint128_t HLA0, HA1, HLB0, HB1; - uint128_t tmp, W0; - uint128_t H[4]; - - H[0] = LA0; - H[1] = A1; - H[2] = LB0; - H[3] = B1; - - mitccrh->hash<2, 2>(H); - - HLA0 = H[0]; - HA1 = H[1]; - HLB0 = H[2]; - HB1 = H[3]; - - table[0] = HLA0 ^ HA1; - table[0] = table[0] ^ (select_mask[pb] & delta); - - W0 = HLA0; - W0 = W0 ^ (select_mask[pa] & table[0]); - - tmp = HLB0 ^ HB1; - table[1] = tmp ^ LA0; - - W0 = W0 ^ HLB0; - W0 = W0 ^ (select_mask[pb] & tmp); - return W0; -} - -uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table, - MITCCRH<8>* mitccrh) { - uint128_t HA, HB, W; - int sa, sb; - - sa = getLSB(A); - sb = getLSB(B); - - uint128_t H[2]; - H[0] = A; - H[1] = B; - mitccrh->hash<2, 1>(H); - HA = H[0]; - HB = H[1]; - - W = HA ^ HB; - W = W ^ (select_mask[sa] & table[0]); - W = W ^ (select_mask[sb] & table[1]); - W = W ^ (select_mask[sb] & A); - return W; -} - -template -void finalize(absl::Span outputs) { - // YACL_ENFORCE(outputs.size() >= circ_->nov); - - size_t index = wires_.size(); - - for (size_t i = 0; i < circ_->nov; ++i) { - yacl::dynamic_bitset result(circ_->now[i]); - for (size_t j = 0; j < circ_->now[i]; ++j) { - int wire_index = index - circ_->now[i] + j; - result[j] = getLSB(wires_[wire_index]) ^ - getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 - // 对应的混淆电路计算为LSB ^ d - // 输出线路在后xx位 - } - // std::cout << "输出:" << result.data() << std::endl; - outputs[circ_->nov - i - 1] = *(uint128_t*)result.data(); - index -= circ_->now[i]; - } -} - -int main(int argc, char* argv[]) { - int FLAGS_rank = std::stoi(argv[1]); - - size_t world_size = 2; - yacl::link::ContextDesc ctx_desc; - - for (size_t rank = 0; rank < world_size; rank++) { - const auto id = fmt::format("id-{}", rank); - const auto host = fmt::format("127.0.0.1:{}", 10086 + rank); - ctx_desc.parties.push_back({id, host}); - } - - auto lctx = yacl::link::FactoryBrpc().CreateContext( - ctx_desc, FLAGS_rank); // yacl::link::test - lctx->ConnectToMesh(); - - // 参与方的设置,需要参照halfgate_gen/eva和sh_gen/eva 以下是一些用到的变量 - // constant[2] 0为全局delta 1为not门用到的public label - // 秘钥相关 mitch 秘钥初始化start_point, shared_prg - - // tmp[0]后续用作delta tmp[1]用作秘钥start_point - uint128_t tmp[2]; - - // tmp和constant的发送可以放在setup里,专门写一个函数 - if (FLAGS_rank == 0) { - random_uint128_t(tmp, 2); - lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 2), "tmp"); - std::cout << "tmpSend" << std::endl; - } else { - yacl::Buffer r = lctx->Recv(0, "tmp"); - const uint128_t* buffer_data = r.data(); - memcpy(tmp, buffer_data, sizeof(uint128_t) * 2); - std::cout << "tmpRecv" << std::endl; - } - - tmp[0] = tmp[0] | 1; // 已确保LSB为1 - uint128_t delta = tmp[0]; // 统一全局Delta - - uint128_t constant[3]; - - if (FLAGS_rank == 0) { - random_uint128_t(constant, 2); - lctx->Send(1, yacl::ByteContainerView(constant, sizeof(uint128_t) * 3), - "constant"); - std::cout << "constantSend" << std::endl; - } else { - yacl::Buffer r = lctx->Recv(0, "constant"); - const uint128_t* buffer_data = r.data(); - memcpy(constant, buffer_data, sizeof(uint128_t) * 3); - std::cout << "constantRecv" << std::endl; - } - - constant[2] = constant[1] ^ delta; // gen方使用 constant[1]为eva方使用 - - MITCCRH<8> mitccrh; // 密钥生成和加密 8为Batch_size, schedule_key长度 - mitccrh.setS(tmp[1]); // 秘钥生成start_point - - // 电路读取 - std::string operate; - std::cin >> operate; - - std::string pth = - fmt::format("{0}/yacl/io/circuit/data/{1}.txt", - std::filesystem::current_path().string(), operate); - yacl::io::CircuitReader reader(pth); - reader.ReadMeta(); - reader.ReadAllGates(); - circ_ = reader.StealCirc(); // 指针 - - // aes_128随机初始化输入值 - // std::vector inputs = {crypto::FastRandU128(), - // crypto::FastRandU128()}; - // std::vector result(1); - // 其余情况 - uint64_t input = yacl::crypto::FastRandU64(); - std::cout << "input:" << input << std::endl; - uint64_t input1; - - std::vector result(1); - - // int2bool 还是得老老实实进行GB完整过程,主要目的是存储d[] - // 用dynamic_bitset转化为二进制后,再进行混淆得到混淆值,后面的直接按电路顺序计算 - // 生成的table 存储 vector< vector(2)> > (num_gate) 存储时把gate_ID记录下来 - - // aes_128 - // dynamic_bitset bi_val; - // 其余情况 - yacl::dynamic_bitset bi_val; - - bi_val.append(input); // 直接转换为二进制 输入线路在前64位 - - // ***************GB阶段*************** - - // 初始化 - gb_value.resize(circ_->nw); - uint128_t table[circ_->ng][2]; - - // 混淆过程 - int num_of_input_wires = 0; - for (size_t i = 0; i < circ_->niv; ++i) { - num_of_input_wires += circ_->niw[i]; - } - - // random_uint128_t(gb_value.data(), circ_->niw[0]); - random_uint128_t(gb_value.data(), num_of_input_wires); - - /******** EN阶段 *********/ - - wires_.resize(circ_->nw); - // 前64位 直接置换 garbler - for (int i = 0; i < circ_->niw[0]; i++) { - wires_[i] = gb_value[i] ^ (select_mask[bi_val[i]] & delta); - } - - if (FLAGS_rank == 0) { - lctx->Send(1, - yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * 64), - "garbleInput1"); - std::cout << "sendInput1" << std::endl; - - } else { - - yacl::Buffer r = lctx->Recv(0, "garbleInput1"); - - const uint128_t* buffer_data = r.data(); - memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * 64); - std::cout << "recvInput1" << std::endl; - - } - if (FLAGS_rank == 0) { - lctx->Send(1, yacl::ByteContainerView(&input, sizeof(uint64_t)), "Input1"); - std::cout << "Input1OriginSend" << std::endl; - - } else { - yacl::Buffer r = lctx->Recv(0, "Input1"); - - const uint64_t* buffer_data = r.data(); - input1 = *buffer_data; - std::cout << "Input1OriginRecv:" << input1 << std::endl; - } - - // ************混淆方进行发送********* - // int num_ot = 64; - // vector> send_blocks; - // vector recv_blocks(num_ot); - // dynamic_bitset choices(num_ot); - // for (int i = 64; i < 128; i++) { - // send_blocks.push_back({gb_value[i], gb_value[i] ^ delta}); - // choices.push_back(bi_val[i]); - // } - - // yacl::crypto::BaseOtSend(lctx, absl::MakeSpan(send_blocks)); - // yacl::crypto::BaseOtRecv(lctx, bi_val, absl::MakeSpan(recv_blocks)); - - // for (int i = 0; i < num_ot; i++) { - // if (send_blocks[i][choices[i]] != recv_blocks[i]) { - // cout << "**********OT错误************"; - // break; - // } - // } - - if (operate != "neg64" && operate != "zero_equal") { - // for (int i = circ_->niw[0]; i < circ_->niw[0] + circ_->niw[1]; i++) { - // // gb_value[i] = send_out[i - 64][0]; - // // wires_[i] = recv_out[i - 64]; - // // if (send_out[i - 64][0] ^ delta == send_out[i - 64][1]) - // // std::cout << true << std::endl; - - // wires_[i] = gb_value[i] ^ (select_mask[bi_val[i]] & delta); - // } - - // 发送混淆值让 计算方 自己选 - if (FLAGS_rank == 0) { - lctx->Send( - 1, - yacl::ByteContainerView(gb_value.data() + 64, sizeof(uint128_t) * 64), - "garbleInput2"); - std::cout << "sendInput2" << std::endl; - - } else { - yacl::Buffer r = lctx->Recv(0, "garbleInput2"); - const uint128_t* buffer_data = r.data(); - for (int i = 0; i < circ_->niw[1]; i++) { - // gb_value[i] = send_out[i - 64][0]; - // wires_[i] = recv_out[i - 64]; - // if (send_out[i - 64][0] ^ delta == send_out[i - 64][1]) - // std::cout << true << std::endl; - - wires_[i + circ_->niw[0]] = - buffer_data[i] ^ (select_mask[bi_val[i]] & delta); - } - std::cout << "recvInput2" << std::endl; - } - } - std::cout << "输入线路值:"; - for (int i = 0; i < 64; i++) { - std::cout << bi_val[i]; - } - std::cout << std::endl; - -if(FLAGS_rank == 0){ - for (int i = 0; i < circ_->gates.size(); i++) { - auto gate = circ_->gates[i]; - switch (gate.op) { - case yacl::io::BFCircuit::Op::XOR: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 - const auto& iw1 = gb_value.operator[](gate.iw[1]); - gb_value[gate.ow[0]] = iw0 ^ iw1; - break; - } - case yacl::io::BFCircuit::Op::AND: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); - const auto& iw1 = gb_value.operator[](gate.iw[1]); - gb_value[gate.ow[0]] = GBAND(iw0, iw0 ^ delta, iw1, iw1 ^ delta, delta, - table[i], &mitccrh); - break; - } - case yacl::io::BFCircuit::Op::INV: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); - gb_value[gate.ow[0]] = iw0 ^ constant[2]; - break; - } - case yacl::io::BFCircuit::Op::EQ: { - gb_value[gate.ow[0]] = gate.iw[0]; - break; - } - case yacl::io::BFCircuit::Op::EQW: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); - gb_value[gate.ow[0]] = iw0; - break; - } - case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ - YACL_THROW("Unimplemented MAND gate"); - break; - } - default: - YACL_THROW("Unknown Gate Type: {}", (int)gate.op); - } - } - } - - // 发送混淆表 - if (FLAGS_rank == 0) { - lctx->Send( - 1, yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_->ng), - "table"); - - std::cout << "sendTable" << std::endl; - // std::cout << "table0" << table[132][0]; - - } else { - yacl::Buffer r = lctx->Recv(0, "table"); - const uint128_t* buffer_data = r.data(); - int k = 0; - for (int i = 0; i < circ_->ng; i++) { - for (int j = 0; j < 2; j++) { - table[i][j] = buffer_data[k]; - k++; - } - } - - - std::cout << "recvTable" << std::endl; - // std::cout << "table0" << table[132][0]; - } - - // 计算方进行计算 按拓扑顺序进行计算 -if(FLAGS_rank == 1){ - for (int i = 0; i < circ_->gates.size(); i++) { - auto gate = circ_->gates[i]; - switch (gate.op) { - case yacl::io::BFCircuit::Op::XOR: { - const auto& iw0 = wires_.operator[](gate.iw[0]); // 取到具体值 - const auto& iw1 = wires_.operator[](gate.iw[1]); - wires_[gate.ow[0]] = iw0 ^ iw1; - break; - } - case yacl::io::BFCircuit::Op::AND: { - const auto& iw0 = wires_.operator[](gate.iw[0]); - const auto& iw1 = wires_.operator[](gate.iw[1]); - wires_[gate.ow[0]] = EVAND(iw0, iw1, table[i], &mitccrh); - break; - } - case yacl::io::BFCircuit::Op::INV: { - const auto& iw0 = wires_.operator[](gate.iw[0]); - wires_[gate.ow[0]] = iw0 ^ constant[1]; - break; - } - case yacl::io::BFCircuit::Op::EQ: { - wires_[gate.ow[0]] = gate.iw[0]; - break; - } - case yacl::io::BFCircuit::Op::EQW: { - const auto& iw0 = wires_.operator[](gate.iw[0]); - wires_[gate.ow[0]] = iw0; - break; - } - case yacl::io::BFCircuit::Op::MAND: { /* multiple ANDs */ - YACL_THROW("Unimplemented MAND gate"); - break; - } - default: - YACL_THROW("Unknown Gate Type: {}", (int)gate.op); - } - } - } - - // 识别输出线路 进行DE操作 - // *********Finalize应该由谁来做,怎么做 - size_t index = wires_.size(); - int start = index - circ_->now[0]; - if (FLAGS_rank == 1) { - lctx->Send( - 0, - yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * 64), - "output"); - std::cout << "sendOutput" << std::endl; - // std::cout << "output:" << wires_[index - 1] << std::endl; - - } else { - yacl::Buffer r = lctx->Recv(1, "output"); - const uint128_t* buffer_data = r.data(); - - memcpy(wires_.data() + start, buffer_data, sizeof(uint128_t) * 64); - // for (int i = 0; i < circ_->niw[1]; i++) { - // // gb_value[i] = send_out[i - 64][0]; - // // wires_[i] = recv_out[i - 64]; - // // if (send_out[i - 64][0] ^ delta == send_out[i - 64][1]) - // // std::cout << true << std::endl; - - // wires_[i + circ_->niw[0]] = - // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); - // } - std::cout << "recvOutput" << std::endl; - // std::cout << "output:" << wires_[index - 1] << std::endl; - } - - // 检查计算结果是否正确 - // std::cout << inputs[0] << " " << inputs[1] << std::endl; - if (FLAGS_rank == 1) { - std::cout << "明文计算结果:"; - if (operate == "adder64") { - std::cout << input1 + input << std::endl; - } else if (operate == "divide64") { - std::cout << static_cast(input1) / static_cast(input) - << std::endl; - } else if (operate == "udivide64") { - std::cout << input1 / input << std::endl; - } else if (operate == "mult64") { - std::cout << input1 * input << std::endl; - } else if (operate == "neg64") { - std::cout << -input1 << std::endl; - } else if (operate == "sub64") { - std::cout << input1 - input << std::endl; - } else if (operate == "aes_128") { - std::cout << Aes128(ReverseBytes(input1), ReverseBytes(input)) - << std::endl; - result[0] = ReverseBytes(result[0]); - } else { - std::cout << "else" << std::endl; - } - } else { - finalize(absl::MakeSpan(result)); - std::cout << "MPC结果:" << result[0] << std::endl; - } - - /* WHEN */ - // PlainExecutor exec; - // exec.LoadCircuitFile(io::BuiltinBFCircuit::Add64Path()); - // exec.SetupInputs(absl::MakeSpan(inputs)); // En - // exec.Exec(); - // exec.Finalize(absl::MakeSpan(result)); - - /* THEN 验证计算结果 */ - - return 0; -} diff --git a/examples/gc/test_split.cc b/examples/gc/test_split.cc deleted file mode 100644 index a19e395d..00000000 --- a/examples/gc/test_split.cc +++ /dev/null @@ -1,88 +0,0 @@ -#pragma once -#include -#include -#include -#include - -// #include "absl/std::strings/escaping.h" -#include "absl/types/span.h" - -#include "examples/gc/aes_128_evaluator.h" -#include "examples/gc/aes_128_garbler.h" -#include "examples/gc/sha256_garbler.h" -#include "examples/gc/sha256_evaluator.h" -#include "fmt/format.h" -#include "yacl/kernel/ot_kernel.h" -#include "yacl/kernel/type/ot_store_utils.h" - -using namespace std; -using namespace yacl; -using namespace yacl::crypto; -namespace { -using uint128_t = __uint128_t; -} - - - - - - -int main() { - // 初始化 - std::shared_ptr circ_; - // 初始化 - GarblerAES* garbler = new GarblerAES(); - EvaluatorAES * evaluator = new EvaluatorAES(); - - std::future thread1 = std::async([&] { garbler->setup(); }); - std::future thread2 = std::async([&] { evaluator->setup(); }); - thread1.get(); - thread2.get(); - - - // 电路读取 - std::string pth = - fmt::format("{0}/yacl/io/circuit/data/{1}.txt", - std::filesystem::current_path().string(), "aes_128"); - yacl::io::CircuitReader reader(pth); - reader.ReadMeta(); - reader.ReadAllGates(); - circ_ = reader.StealCirc(); // 指针 - - // 输入处理 - // garbler->inputProcess(*circ_); - - uint128_t key; - uint128_t message; - thread1 = std::async([&] { key = garbler->inputProcess(*circ_); }); - thread2 = std::async([&] { message = evaluator->inputProcess(*circ_); }); - thread1.get(); - thread2.get(); - - // OT - thread1 = std::async([&] { evaluator -> onLineOT();}); - thread2 = std::async([&] { garbler -> onlineOT(); }); - thread1.get(); - thread2.get(); - - - // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator - garbler->GB(); - garbler->sendTable(); - - evaluator->recvTable(); - - - // // 计算方进行计算 按拓扑顺序进行计算 - evaluator->EV(); - - // // // evaluator发送计算结果 garbler进行DE操作 - evaluator->sendOutput(); - - uint128_t gc_result = garbler->decode(); - // auto aes = Aes128(ReverseBytes(key), ReverseBytes(message)); - // EXPECT_EQ(ReverseBytes(gc_result), aes); - - - return 0; -} \ No newline at end of file diff --git a/examples/gc/utils.cc b/examples/gc/utils.cc deleted file mode 100644 index 9a92db24..00000000 --- a/examples/gc/utils.cc +++ /dev/null @@ -1,14 +0,0 @@ -#include "utils.h" - -void random_uint128_t(uint128_t* data, int nblocks) { - for (int i = 0; i < nblocks; i++) { - std::random_device rd; - std::mt19937_64 eng(rd()); - std::uniform_int_distribution distr; - - uint64_t high = distr(eng); - uint64_t low = distr(eng); - - data[i] = make_uint128_t(high, low); - } -} diff --git a/examples/gc/utils.h b/examples/gc/utils.h index 3eb7dcfb..3e38de14 100644 --- a/examples/gc/utils.h +++ b/examples/gc/utils.h @@ -1,33 +1,16 @@ #include #include #include -#include "yacl/math/mpint/mp_int.h" + #include #include #include #include #include -using uint128_t = __uint128_t; -using block = uint128_t; - -template -inline void int_to_bool(bool* data, T input, int len); - -inline uint128_t make_uint128_t(uint64_t high, uint64_t low) { - return (static_cast(high) << 64) | low; -} - -void random_uint128_t(uint128_t* data, int nblocks = 1); +#include "yacl/math/mpint/mp_int.h" -template -inline void int_to_bool(bool* data, T input, int len) { - for (int i = 0; i < len; ++i) { - data[i] = (input & 1) == 1; - input >>= 1; - } -} +using uint128_t = __uint128_t; // get the Least Significant Bit of uint128_t inline bool getLSB(const uint128_t& x) { return (x & 1) == 1; } - diff --git a/hs_err_pid1031794.log b/hs_err_pid1031794.log new file mode 100644 index 00000000..245a5b2f --- /dev/null +++ b/hs_err_pid1031794.log @@ -0,0 +1,5591 @@ +# +# A fatal error has been detected by the Java Runtime Environment: +# +# SIGBUS (0x7) at pc=0x0000713e03436e94, pid=1031794, tid=1031931 +# +# JRE version: OpenJDK Runtime Environment Zulu21.38+21-CA (21.0.5+11) (build 21.0.5+11-LTS) +# Java VM: OpenJDK 64-Bit Server VM Zulu21.38+21-CA (21.0.5+11-LTS, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) +# Problematic frame: +# J 5386 c1 net.starlark.java.eval.Starlark.trimDocString(Ljava/lang/String;)Ljava/lang/String; (261 bytes) @ 0x0000713e03436e94 [0x0000713e03435fc0+0x0000000000000ed4] +# +# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/dase212/lxy/yacl/core.1031794) +# +# If you would like to submit a bug report, please visit: +# http://www.azul.com/support/ +# + +--------------- S U M M A R Y ------------ + +Command Line: --add-opens=java.base/java.lang=ALL-UNNAMED -Xverify:none -Djava.util.logging.config.file=/home/dase212/.cache/bazel/_bazel_dase212/b3aa481a2afc88cf641c64afb43eb882/javalog.properties -Dcom.google.devtools.build.lib.util.LogHandlerQuerier.class=com.google.devtools.build.lib.util.SimpleLogHandler$HandlerQuerier -XX:-MaxFDLimit -Djava.library.path=/home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib:/home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/server:/home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/ -Dfile.encoding=ISO-8859-1 -Duser.country= -Duser.language= -Duser.variant= /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/A-server.jar --max_idle_secs=10800 --noshutdown_on_low_sys_mem --connect_timeout_secs=30 --output_user_root=/home/dase212/.cache/bazel/_bazel_dase212 --install_base=/home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459 --install_md5=bd3f2062f72dd67fde166eda94178459 --output_base=/home/dase212/.cache/bazel/_bazel_dase212/b3aa481a2afc88cf641c64afb43eb882 --workspace_directory=/home/dase212/lxy/yacl --default_system_javabase= --failure_detail_out=/home/dase212/.cache/bazel/_bazel_dase212/b3aa481a2afc88cf641c64afb43eb882/failure_detail.rawproto --expand_configs_in_place --idle_server_tasks --write_command_log --nowatchfs --nofatal_event_bus_exceptions --nowindows_enable_symlinks --client_debug=false --product_name=Bazel --option_sources= + +Host: AMD Ryzen Threadripper PRO 7945WX 12-Cores, 24 cores, 250G, Ubuntu 24.04.1 LTS +Time: Tue Mar 25 15:38:59 2025 CST elapsed time: 0.968887 seconds (0d 0h 0m 0s) + +--------------- T H R E A D --------------- + +Current thread (0x0000713c54001110): JavaThread "skyframe-evaluator-12" daemon [_thread_in_Java, id=1031931, stack(0x0000713dca200000,0x0000713dca300000) (1024K)] + +Stack: [0x0000713dca200000,0x0000713dca300000], sp=0x0000713dca2fcb90, free space=1010k +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +J 5386 c1 net.starlark.java.eval.Starlark.trimDocString(Ljava/lang/String;)Ljava/lang/String; (261 bytes) @ 0x0000713e03436e94 [0x0000713e03435fc0+0x0000000000000ed4] +j com.google.devtools.build.lib.bazel.repository.starlark.StarlarkRepositoryModule$$Lambda+0x00000008005ec590.apply(Ljava/lang/Object;)Ljava/lang/Object;+4 +J 4744 c1 java.util.Optional.map(Ljava/util/function/Function;)Ljava/util/Optional; java.base@21.0.5 (30 bytes) @ 0x0000713e032a3764 [0x0000713e032a3520+0x0000000000000244] +j com.google.devtools.build.lib.bazel.repository.starlark.StarlarkRepositoryModule.repositoryRule(Lnet/starlark/java/eval/StarlarkCallable;Ljava/lang/Object;Ljava/lang/Boolean;Lnet/starlark/java/eval/Sequence;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Object;Lnet/starlark/java/eval/StarlarkThread;)Lnet/starlark/java/eval/StarlarkCallable;+428 +j java.lang.invoke.LambdaForm$DMH+0x00000008005e9400.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+26 java.base@21.0.5 +j java.lang.invoke.LambdaForm$MH+0x00000008005eac00.invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+195 java.base@21.0.5 +J 3379 c1 jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; java.base@21.0.5 (92 bytes) @ 0x0000713e02fbf784 [0x0000713e02fbef20+0x0000000000000864] +J 4029 c1 net.starlark.java.eval.MethodDescriptor.call(Ljava/lang/Object;[Ljava/lang/Object;Lnet/starlark/java/eval/Mutability;)Ljava/lang/Object; (373 bytes) @ 0x0000713e03136184 [0x0000713e03135ba0+0x00000000000005e4] +J 4026 c1 net.starlark.java.eval.BuiltinFunction.fastcall(Lnet/starlark/java/eval/StarlarkThread;[Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (53 bytes) @ 0x0000713e031255f4 [0x0000713e03125360+0x0000000000000294] +J 3931 c1 net.starlark.java.eval.Starlark.fastcall(Lnet/starlark/java/eval/StarlarkThread;Ljava/lang/Object;[Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (143 bytes) @ 0x0000713e030e7f7c [0x0000713e030e70e0+0x0000000000000e9c] +J 5209 c1 net.starlark.java.eval.Eval.evalCall(Lnet/starlark/java/eval/StarlarkThread$Frame;Lnet/starlark/java/syntax/CallExpression;)Ljava/lang/Object; (579 bytes) @ 0x0000713e033c5b6c [0x0000713e033c1000+0x0000000000004b6c] +J 5453 c2 net.starlark.java.eval.Eval.eval(Lnet/starlark/java/eval/StarlarkThread$Frame;Lnet/starlark/java/syntax/Expression;)Ljava/lang/Object; (322 bytes) @ 0x0000713e0a7f0320 [0x0000713e0a7efa40+0x00000000000008e0] +J 5262 c1 net.starlark.java.eval.Eval.execAssignment(Lnet/starlark/java/eval/StarlarkThread$Frame;Lnet/starlark/java/syntax/AssignmentStatement;)V (48 bytes) @ 0x0000713e033e77ac [0x0000713e033e7620+0x000000000000018c] +J 4065 c1 net.starlark.java.eval.Eval.exec(Lnet/starlark/java/eval/StarlarkThread$Frame;Lnet/starlark/java/syntax/Statement;)Lnet/starlark/java/syntax/TokenKind; (246 bytes) @ 0x0000713e0314aa5c [0x0000713e031499c0+0x000000000000109c] +J 5389 c1 net.starlark.java.eval.Eval.execStatements(Lnet/starlark/java/eval/StarlarkThread$Frame;Ljava/util/List;Z)Lnet/starlark/java/syntax/TokenKind; (171 bytes) @ 0x0000713e0342d904 [0x0000713e0342d440+0x00000000000004c4] +J 5458 c1 net.starlark.java.eval.StarlarkFunction.fastcall(Lnet/starlark/java/eval/StarlarkThread;[Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (127 bytes) @ 0x0000713e0347301c [0x0000713e03471d20+0x00000000000012fc] +J 3931 c1 net.starlark.java.eval.Starlark.fastcall(Lnet/starlark/java/eval/StarlarkThread;Ljava/lang/Object;[Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (143 bytes) @ 0x0000713e030e7f7c [0x0000713e030e70e0+0x0000000000000e9c] +J 5466 c1 net.starlark.java.eval.Starlark.execFileProgram(Lnet/starlark/java/syntax/Program;Lnet/starlark/java/eval/Module;Lnet/starlark/java/eval/StarlarkThread;)Ljava/lang/Object; (74 bytes) @ 0x0000713e0347b7d4 [0x0000713e0347b340+0x0000000000000494] +j com.google.devtools.build.lib.skyframe.BzlLoadFunction.execAndExport(Lnet/starlark/java/syntax/Program;Lcom/google/devtools/build/lib/cmdline/Label;Lcom/google/devtools/build/lib/events/EventHandler;Lnet/starlark/java/eval/Module;Lnet/starlark/java/eval/StarlarkThread;)V+16 +j com.google.devtools.build.lib.skyframe.BzlLoadFunction.executeBzlFile(Lnet/starlark/java/syntax/Program;Lcom/google/devtools/build/lib/cmdline/Label;Lnet/starlark/java/eval/Module;Ljava/util/Map;Lcom/google/devtools/build/lib/packages/BzlInitThreadContext;Lnet/starlark/java/eval/StarlarkSemantics;Lcom/google/devtools/build/lib/events/ExtendedEventHandler;Lcom/google/devtools/build/lib/cmdline/Label$RepoMappingRecorder;)V+103 +j com.google.devtools.build.lib.skyframe.BzlLoadFunction.computeInternalWithCompiledBzl(Lcom/google/devtools/build/lib/skyframe/BzlLoadValue$Key;Lcom/google/devtools/build/lib/skyframe/BzlCompileValue;Lcom/google/devtools/build/lib/skyframe/StarlarkBuiltinsValue;Lcom/google/devtools/build/skyframe/SkyFunction$Environment;Lcom/google/devtools/build/lib/skyframe/BzlLoadFunction$InliningState;)Lcom/google/devtools/build/lib/skyframe/BzlLoadValue;+621 +J 5587 c1 com.google.devtools.build.lib.skyframe.BzlLoadFunction.computeInternal(Lcom/google/devtools/build/lib/skyframe/BzlLoadValue$Key;Lcom/google/devtools/build/skyframe/SkyFunction$Environment;Lcom/google/devtools/build/lib/skyframe/BzlLoadFunction$InliningState;)Lcom/google/devtools/build/lib/skyframe/BzlLoadValue; (163 bytes) @ 0x0000713e034d862c [0x0000713e034d7ea0+0x000000000000078c] +J 5586 c1 com.google.devtools.build.lib.skyframe.BzlLoadFunction.compute(Lcom/google/devtools/build/skyframe/SkyKey;Lcom/google/devtools/build/skyframe/SkyFunction$Environment;)Lcom/google/devtools/build/skyframe/SkyValue; (30 bytes) @ 0x0000713e034d491c [0x0000713e034d46e0+0x000000000000023c] +J 4878 c1 com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run()V (1927 bytes) @ 0x0000713e033238dc [0x0000713e03322500+0x00000000000013dc] +J 4120 c1 com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run()V (215 bytes) @ 0x0000713e0317ac7c [0x0000713e0317a2a0+0x00000000000009dc] +J 4889 c1 java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec()Z java.base@21.0.5 (11 bytes) @ 0x0000713e032fce54 [0x0000713e032fcd40+0x0000000000000114] +J 4267 c1 java.util.concurrent.ForkJoinTask.doExec()I java.base@21.0.5 (37 bytes) @ 0x0000713e031a7144 [0x0000713e031a7000+0x0000000000000144] +J 5524 c2 java.util.concurrent.ForkJoinPool.scan(Ljava/util/concurrent/ForkJoinPool$WorkQueue;II)I java.base@21.0.5 (263 bytes) @ 0x0000713e0a7f58f0 [0x0000713e0a7f5600+0x00000000000002f0] +j java.util.concurrent.ForkJoinPool.runWorker(Ljava/util/concurrent/ForkJoinPool$WorkQueue;)V+35 java.base@21.0.5 +j java.util.concurrent.ForkJoinWorkerThread.run()V+31 java.base@21.0.5 +v ~StubRoutines::call_stub 0x0000713e09e5fcc6 +V [libjvm.so+0x919f35] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x2f5 +V [libjvm.so+0x91b8b2] JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*)+0x1d2 +V [libjvm.so+0x9f34fe] thread_entry(JavaThread*, JavaThread*)+0x8e +V [libjvm.so+0x931f40] JavaThread::thread_main_inner()+0x1e0 +V [libjvm.so+0xf86b88] Thread::call_run()+0xa8 +V [libjvm.so+0xd103ba] thread_native_entry(Thread*)+0xda +C [libc.so.6+0x9caa4] + +siginfo: si_signo: 7 (SIGBUS), si_code: 4 (unknown), si_addr: 0x00000000df3d1000 + +Registers: +RAX=0x00000000df3d16c8, RBX=0x00000000df3d16c8, RCX=0x0000000000000000, RDX=0x0000000000000027 +RSP=0x0000713dca2fcb90, RBP=0x0000713dca2fcd00, RSI=0x00000000df3d16f0, RDI=0x00000000df3d11d6 +R8 =0x0000000000000007, R9 =0x00000000df3d16f0, R10=0x00000000df3d16c8, R11=0x0000000000000000 +R12=0x0000000000000000, R13=0x00000000df3d16e0, R14=0x0000000800058dc0, R15=0x0000713c54001110 +RIP=0x0000713e03436e94, EFLAGS=0x0000000000000213, CSGSFS=0x002b000000000033, ERR=0x0000000000000004 + TRAPNO=0x000000000000000e + + +Register to memory mapping: + +RAX= +[error occurred during error reporting (printing register info), id 0x7, SIGBUS (0x7) at pc=0x0000713e1add35d1] +RBX= +[error occurred during error reporting (printing register info, attempt 2), id 0x7, SIGBUS (0x7) at pc=0x0000713e1add35d1] +RCX=0x0 is null +RDX=0x0000000000000027 is an unknown value +RSP=0x0000713dca2fcb90 is pointing into the stack for thread: 0x0000713c54001110 +RBP=0x0000713dca2fcd00 is pointing into the stack for thread: 0x0000713c54001110 +RSI= +[error occurred during error reporting (printing register info, attempt 3), id 0x7, SIGBUS (0x7) at pc=0x0000713e1add35d1] +Top of Stack: (sp=0x0000713dca2fcb90) +0x0000713dca2fcb90: 00000000df3d1440 0000713db6ce7150 +0x0000713dca2fcba0: 0000000000000000 0000713dca2fcbc0 +0x0000713dca2fcbb0: 0000713dca2fcc18 0000713e09e67180 +0x0000713dca2fcbc0: 00000000df397c80 00000000df3d0c80 +0x0000713dca2fcbd0: 0000713dca2fcbd0 0000713db6ce75d2 +0x0000713dca2fcbe0: 0000000000000004 0000713db6ce7718 +0x0000713dca2fcbf0: 0000000000000000 000000011b5fdb28 +0x0000713dca2fcc00: 0000713db6ce7608 0000000000000000 +0x0000713dca2fcc10: 0000713dca2fcc28 0000713dca2fcc90 +0x0000713dca2fcc20: 0000713e09e67180 0000000000000000 +0x0000713dca2fcc30: 00000000df3d1430 00000000a22264b0 +0x0000713dca2fcc40: 00000000df3d0db8 00000000df3d1440 +0x0000713dca2fcc50: 00000000df3d1470 0000000e00000000 +0x0000713dca2fcc60: 00000000df3d11a8 0000000000000000 +0x0000713dca2fcc70: 000000011b5fe7f8 0000713db6ce8068 +0x0000713dca2fcc80: 0000000000000000 0000713dca2fcca0 +0x0000713dca2fcc90: 0000713dca2fccf0 0000713e09e6774e +0x0000713dca2fcca0: 0000713dca2fcd00 0000713e09e672f2 +0x0000713dca2fccb0: 00000000df35e0d8 0000713dca2fccb8 +0x0000713dca2fccc0: 0000713db6e39d8c 0000000000000003 +0x0000713dca2fccd0: 0000713db6e39e40 0000000000000000 +0x0000713dca2fcce0: 00000000df29a590 0000713db6e39d90 +0x0000713dca2fccf0: 0000713dca2fccb0 0000713dca2fcd20 +0x0000713dca2fcd00: 0000713dca2fce30 0000713e032a3764 +0x0000713dca2fcd10: 00000000df35e0d8 00000000df29a8f0 +0x0000713dca2fcd20: 0000713dca2fcdc0 0000000000000003 +0x0000713dca2fcd30: 0000713db4fa1668 0000713c54001110 +0x0000713dca2fcd40: 0000713e09e66a90 0000000000000000 +0x0000713dca2fcd50: 0000000000000000 0000713dca2fce30 +0x0000713dca2fcd60: 0000713dca2fcdc0 00000000df35e0d8 +0x0000713dca2fcd70: 00000000a0001830 000000000000007e +0x0000713dca2fcd80: 0000713dca2fce30 0000713e0a7358cc + +Instructions: (pc=0x0000713e03436e94) +0x0000713e03436d94: 83 82 00 04 00 00 01 e9 63 00 00 00 48 83 ba e8 +0x0000713e03436da4: 03 00 00 00 75 17 48 89 9a e8 03 00 00 48 c7 82 +0x0000713e03436db4: f0 03 00 00 01 00 00 00 e9 42 00 00 00 48 83 ba +0x0000713e03436dc4: f8 03 00 00 00 75 17 48 89 9a f8 03 00 00 48 c7 +0x0000713e03436dd4: 82 00 04 00 00 01 00 00 00 e9 21 00 00 00 e9 1c +0x0000713e03436de4: 00 00 00 48 ba b0 a4 de b6 3d 71 00 00 48 83 aa +0x0000713e03436df4: d8 03 00 00 01 e9 32 11 00 00 e9 00 00 00 00 48 +0x0000713e03436e04: 8b f8 48 be c8 f5 0c a2 00 00 00 00 48 ba b0 a4 +0x0000713e03436e14: de b6 3d 71 00 00 48 83 82 10 04 00 00 01 48 be +0x0000713e03436e24: 38 d9 de b6 3d 71 00 00 8b 96 f4 00 00 00 83 c2 +0x0000713e03436e34: 02 89 96 f4 00 00 00 81 e2 fe ff 1f 00 85 d2 0f +0x0000713e03436e44: 84 f0 10 00 00 48 be 38 d9 de b6 3d 71 00 00 ff +0x0000713e03436e54: 86 38 01 00 00 48 be 38 d9 de b6 3d 71 00 00 48 +0x0000713e03436e64: 83 86 b8 01 00 00 01 48 ba b0 64 22 a2 00 00 00 +0x0000713e03436e74: 00 48 8b f7 48 89 bc 24 d0 00 00 00 0f 1f 80 00 +0x0000713e03436e84: 00 00 00 e8 d4 4b fb ff 0f 1f 84 00 fc 13 00 0d +0x0000713e03436e94: 48 3b 00 48 8b c8 48 ba b0 a4 de b6 3d 71 00 00 +0x0000713e03436ea4: 48 83 82 48 04 00 00 01 48 b9 08 5a 5d b4 3d 71 +0x0000713e03436eb4: 00 00 8b 91 f4 00 00 00 83 c2 02 89 91 f4 00 00 +0x0000713e03436ec4: 00 81 e2 fe ff 1f 00 85 d2 0f 84 8c 10 00 00 8b +0x0000713e03436ed4: 48 14 48 c1 e1 03 8b 51 0c 85 d2 48 b9 08 5a 5d +0x0000713e03436ee4: b4 3d 71 00 00 48 c7 c6 38 01 00 00 75 07 48 c7 +0x0000713e03436ef4: c6 48 01 00 00 48 8b 3c 31 48 8d 7f 01 48 89 3c +0x0000713e03436f04: 31 0f 85 1a 00 00 00 48 b9 08 5a 5d b4 3d 71 00 +0x0000713e03436f14: 00 ff 81 58 01 00 00 b9 01 00 00 00 e9 05 00 00 +0x0000713e03436f24: 00 b9 00 00 00 00 83 e1 01 85 c9 48 b9 b0 a4 de +0x0000713e03436f34: b6 3d 71 00 00 48 c7 c6 90 04 00 00 74 07 48 c7 +0x0000713e03436f44: c6 80 04 00 00 48 8b 3c 31 48 8d 7f 01 48 89 3c +0x0000713e03436f54: 31 0f 84 0c 00 00 00 8b bc 24 c8 00 00 00 e9 ea +0x0000713e03436f64: 01 00 00 48 8b bc 24 d0 00 00 00 48 3b 07 48 8b +0x0000713e03436f74: cf 48 be b0 a4 de b6 3d 71 00 00 48 83 86 a0 04 +0x0000713e03436f84: 00 00 01 48 b9 60 2d 3e b4 3d 71 00 00 8b b1 f4 + + +Stack slot to memory mapping: + +stack at sp + 0 slots: +[error occurred during error reporting (inspecting top of stack), id 0x7, SIGBUS (0x7) at pc=0x0000713e1add35d1] +stack at sp + 1 slots: {method} {0x0000713db6ce7150} '' '(Lcom/google/common/collect/StandardTable;)V' in 'com/google/common/collect/StandardTable$CellIterator' +stack at sp + 2 slots: 0x0 is null +stack at sp + 3 slots: 0x0000713dca2fcbc0 is pointing into the stack for thread: 0x0000713c54001110 +stack at sp + 4 slots: 0x0000713dca2fcc18 is pointing into the stack for thread: 0x0000713c54001110 +stack at sp + 5 slots: 0x0000713e09e67180 is at code_begin+1184 in an Interpreter codelet +return entry points [0x0000713e09e66ce0, 0x0000713e09e67880] 2976 bytes +stack at sp + 6 slots: 0x00000000df397c80 is an oop: com.google.common.collect.HashBasedTable +{0x00000000df397c80} - klass: 'com/google/common/collect/HashBasedTable' + - ---- fields (total size 5 words): + - private transient 'cellSet' 'Ljava/util/Set;' @12 a 'com/google/common/collect/AbstractTable$CellSet'{0x00000000df3bbda0} (0x1be777b4) + - private transient 'values' 'Ljava/util/Collection;' @16 null (0x00000000) + - final 'backingMap' 'Ljava/util/Map;' @20 a 'java/util/LinkedHashMap'{0x00000000df397ca8} (0x1be72f95) + - final 'factory' 'Lcom/google/common/base/Supplier;' @24 a 'com/google/common/collect/HashBasedTable$Factory'{0x00000000df397ce8} (0x1be72f9d) + - private transient 'columnKeySet' 'Ljava/util/Set;' @28 null (0x00000000) + - private transient 'rowMap' 'Ljava/util/Map;' @32 null (0x00000000) + - private transient 'columnMap' 'Lcom/google/common/collect/StandardTable$ColumnMap;' @36 null (0x00000000) +stack at sp + 7 slots: 0x00000000df3d0c80 is an oop: com.google.common.collect.StandardTable$CellIterator +{0x00000000df3d0c80} - klass: 'com/google/common/collect/StandardTable$CellIterator' + - ---- fields (total size 4 words): + - final 'rowIterator' 'Ljava/util/Iterator;' @12 a 'java/util/LinkedHashMap$LinkedEntryIterator'{0x00000000df3d0ca0} (0x1be7a194) + - 'rowEntry' 'Ljava/util/Map$Entry;' @16 null (0x00000000) + - 'columnIterator' 'Ljava/util/Iterator;' @20 a 'com/google/common/collect/Iterators$EmptyModifiableIterator'{0x000000011b61fc98} (0x236c3f93) + - final synthetic 'this$0' 'Lcom/google/common/collect/StandardTable;' @24 a 'com/google/common/collect/HashBasedTable'{0x00000000df397c80} (0x1be72f90) + + +Compiled method (c1) 974 5386 3 net.starlark.java.eval.Starlark::trimDocString (261 bytes) + total in heap [0x0000713e03435a90,0x0000713e034391f0] = 14176 + relocation [0x0000713e03435be8,0x0000713e03435fb8] = 976 + main code [0x0000713e03435fc0,0x0000713e034382f8] = 9016 + stub code [0x0000713e034382f8,0x0000713e03438480] = 392 + oops [0x0000713e03438480,0x0000713e034384b0] = 48 + metadata [0x0000713e034384b0,0x0000713e034385c0] = 272 + scopes data [0x0000713e034385c0,0x0000713e03438bd0] = 1552 + scopes pcs [0x0000713e03438bd0,0x0000713e03439180] = 1456 + dependencies [0x0000713e03439180,0x0000713e03439190] = 16 + nul chk table [0x0000713e03439190,0x0000713e034391f0] = 96 + +[Constant Pool (empty)] + +[MachCode] +[Verified Entry Point] + # {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark' + # parm0: rsi:rsi = 'java/lang/String' + # [sp+0x120] (sp of caller) + 0x0000713e03435fc0: 8984 2400 | c0fe ff55 | 4881 ec10 | 0100 0090 | 4181 7f20 | 0500 0000 + + 0x0000713e03435fd8: ; {runtime_call StubRoutines (final stubs)} + 0x0000713e03435fd8: 7405 e841 + + 0x0000713e03435fdc: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03435fdc: f2a5 0648 | bab0 a4de | b63d 7100 | 008b baf4 | 0000 0083 | c702 89ba | f400 0000 | 81e7 fe07 + 0x0000713e03435ffc: 0000 85ff | 0f84 531c + + 0x0000713e03436004: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436004: 0000 48ba | b0a4 deb6 | 3d71 0000 | 4883 8238 | 0100 0001 | ba08 0000 + + 0x0000713e0343601c: ; {static_call} + 0x0000713e0343601c: 0066 90e8 + + 0x0000713e03436020: ; ImmutableOopMap {} + ;*invokestatic expandTabs {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@3 (line 584) + 0x0000713e03436020: d623 0000 + + 0x0000713e03436024: ; {other} + 0x0000713e03436024: 0f1f 8400 | 9405 0000 + + 0x0000713e0343602c: ; implicit exception: dispatches to 0x0000713e03437c7a + 0x0000713e0343602c: 483b 0048 + + 0x0000713e03436030: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436030: 8bf0 48bf | b0a4 deb6 | 3d71 0000 | 4883 8748 | 0100 0001 + + 0x0000713e03436044: ; {metadata(method data for {method} {0x0000713db400d528} 'lines' '()Ljava/util/stream/Stream;' in 'java/lang/String')} + 0x0000713e03436044: 48be e0ff | b3b6 3d71 | 0000 8bbe | f400 0000 | 83c7 0289 | bef4 0000 | 0081 e7fe | ff1f 0085 + 0x0000713e03436064: ff0f 8414 | 1c00 0048 + + 0x0000713e0343606c: ; {metadata(method data for {method} {0x0000713db400d528} 'lines' '()Ljava/util/stream/Stream;' in 'java/lang/String')} + 0x0000713e0343606c: 8bf0 48bf | e0ff b3b6 | 3d71 0000 | 4883 8738 | 0100 0001 + + 0x0000713e03436080: ; {metadata(method data for {method} {0x0000713db400f480} 'isLatin1' '()Z' in 'java/lang/String')} + 0x0000713e03436080: 48be 7855 | 2db4 3d71 | 0000 8bbe | f400 0000 | 83c7 0289 | bef4 0000 | 0081 e7fe | ff1f 0085 + 0x0000713e034360a0: ff0f 84f9 + + 0x0000713e034360a4: ; {metadata(method data for {method} {0x0000713db400f480} 'isLatin1' '()Z' in 'java/lang/String')} + 0x0000713e034360a4: 1b00 0048 | be78 552d | b43d 7100 | 00ff 8648 | 0100 000f | be70 1085 + + 0x0000713e034360bc: ; {metadata(method data for {method} {0x0000713db400f480} 'isLatin1' '()Z' in 'java/lang/String')} + 0x0000713e034360bc: f648 be78 | 552d b43d | 7100 0048 | c7c7 5801 | 0000 7507 | 48c7 c768 | 0100 0048 | 8b1c 3e48 + 0x0000713e034360dc: 8d5b 0148 | 891c 3e0f | 851a 0000 + + 0x0000713e034360e8: ; {metadata(method data for {method} {0x0000713db400f480} 'isLatin1' '()Z' in 'java/lang/String')} + 0x0000713e034360e8: 0048 be78 | 552d b43d | 7100 00ff | 8678 0100 | 00be 0100 | 0000 e905 | 0000 00be | 0000 0000 + 0x0000713e03436108: 83e6 0185 + + 0x0000713e0343610c: ; {metadata(method data for {method} {0x0000713db400d528} 'lines' '()Ljava/util/stream/Stream;' in 'java/lang/String')} + 0x0000713e0343610c: f648 bee0 | ffb3 b63d | 7100 0048 | c7c7 7001 | 0000 7407 | 48c7 c780 | 0100 0048 | 8b1c 3e48 + 0x0000713e0343612c: 8d5b 0148 | 891c 3e0f | 84a0 0000 | 008b 7014 | 48c1 e603 + + 0x0000713e03436140: ; {metadata(method data for {method} {0x0000713db400d528} 'lines' '()Ljava/util/stream/Stream;' in 'java/lang/String')} + 0x0000713e03436140: 48bf e0ff | b3b6 3d71 | 0000 4883 | 8790 0100 + + 0x0000713e03436150: ; {metadata(method data for {method} {0x0000713db4188200} 'lines' '([B)Ljava/util/stream/Stream;' in 'java/lang/StringLatin1')} + 0x0000713e03436150: 0001 48bf | e801 b4b6 | 3d71 0000 | 8b9f f400 | 0000 83c3 | 0289 9ff4 | 0000 0081 | e3fe ff1f + 0x0000713e03436170: 0085 db0f | 8448 1b00 + + 0x0000713e03436178: ; {metadata(method data for {method} {0x0000713db4188200} 'lines' '([B)Ljava/util/stream/Stream;' in 'java/lang/StringLatin1')} + 0x0000713e03436178: 0048 bfe8 | 01b4 b63d | 7100 0048 | 8387 3801 | 0000 010f + + 0x0000713e0343618c: ; {static_call} + 0x0000713e0343618c: 1f40 00e8 + + 0x0000713e03436190: ; ImmutableOopMap {} + ;*invokestatic spliterator {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.StringLatin1::lines@1 + ; - java.lang.String::lines@11 + ; - net.starlark.java.eval.Starlark::trimDocString@6 (line 584) + 0x0000713e03436190: 7522 0000 + + 0x0000713e03436194: ; {other} + 0x0000713e03436194: 0f1f 8400 | 0407 0001 + + 0x0000713e0343619c: ; {metadata(method data for {method} {0x0000713db4188200} 'lines' '([B)Ljava/util/stream/Stream;' in 'java/lang/StringLatin1')} + 0x0000713e0343619c: 48be e801 | b4b6 3d71 | 0000 4883 | 8648 0100 | 0001 488b | f0ba 0000 + + 0x0000713e034361b4: ; {static_call} + 0x0000713e034361b4: 0000 90e8 + + 0x0000713e034361b8: ; ImmutableOopMap {} + ;*invokestatic stream {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.StringLatin1::lines@5 + ; - java.lang.String::lines@11 + ; - net.starlark.java.eval.Starlark::trimDocString@6 (line 584) + 0x0000713e034361b8: c40c 9dff + + 0x0000713e034361bc: ; {other} + 0x0000713e034361bc: 0f1f 8400 | 2c07 0002 + + 0x0000713e034361c4: ; {metadata(method data for {method} {0x0000713db400d528} 'lines' '()Ljava/util/stream/Stream;' in 'java/lang/String')} + 0x0000713e034361c4: 48be e0ff | b3b6 3d71 | 0000 ff86 | a001 0000 | e97b 0000 | 008b 7014 | 48c1 e603 + + 0x0000713e034361e0: ; {metadata(method data for {method} {0x0000713db400d528} 'lines' '()Ljava/util/stream/Stream;' in 'java/lang/String')} + 0x0000713e034361e0: 48bf e0ff | b3b6 3d71 | 0000 4883 | 87b8 0100 + + 0x0000713e034361f0: ; {metadata(method data for {method} {0x0000713db455b9e8} 'lines' '([B)Ljava/util/stream/Stream;' in 'java/lang/StringUTF16')} + 0x0000713e034361f0: 0001 48bf | f804 b4b6 | 3d71 0000 | 8b9f f400 | 0000 83c3 | 0289 9ff4 | 0000 0081 | e3fe ff1f + 0x0000713e03436210: 0085 db0f | 84c9 1a00 | 0066 0f1f + + 0x0000713e0343621c: ; {static_call} + 0x0000713e0343621c: 4400 00e8 + + 0x0000713e03436220: ; ImmutableOopMap {} + ;*invokestatic spliterator {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.StringUTF16::lines@1 + ; - java.lang.String::lines@21 + ; - net.starlark.java.eval.Starlark::trimDocString@6 (line 584) + 0x0000713e03436220: 5c7f a706 + + 0x0000713e03436224: ; {other} + 0x0000713e03436224: 0f1f 8400 | 9407 0003 + + 0x0000713e0343622c: ; {metadata(method data for {method} {0x0000713db455b9e8} 'lines' '([B)Ljava/util/stream/Stream;' in 'java/lang/StringUTF16')} + 0x0000713e0343622c: 48be f804 | b4b6 3d71 | 0000 4883 | 8648 0100 | 0001 488b | f0ba 0000 + + 0x0000713e03436244: ; {static_call} + 0x0000713e03436244: 0000 90e8 + + 0x0000713e03436248: ; ImmutableOopMap {} + ;*invokestatic stream {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.StringUTF16::lines@5 + ; - java.lang.String::lines@21 + ; - net.starlark.java.eval.Starlark::trimDocString@6 (line 584) + 0x0000713e03436248: 347f a706 + + 0x0000713e0343624c: ; {other} + 0x0000713e0343624c: 0f1f 8400 | bc07 0004 + + 0x0000713e03436254: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436254: 48ba b0a4 | deb6 3d71 | 0000 4883 | 8280 0100 + + 0x0000713e03436264: ; {metadata(method data for {method} {0x0000713db4546c10} 'toImmutableList' '()Ljava/util/stream/Collector;' in 'com/google/common/collect/ImmutableList')} + 0x0000713e03436264: 0001 48ba | f02d abb6 | 3d71 0000 | 8bb2 f400 | 0000 83c6 | 0289 b2f4 | 0000 0081 | e6fe ff1f + 0x0000713e03436284: 0085 f60f | 8476 1a00 + + 0x0000713e0343628c: ; {metadata(method data for {method} {0x0000713db4546c10} 'toImmutableList' '()Ljava/util/stream/Collector;' in 'com/google/common/collect/ImmutableList')} + 0x0000713e0343628c: 0048 baf0 | 2dab b63d | 7100 0048 | 8382 3801 + + 0x0000713e0343629c: ; {metadata(method data for {method} {0x0000713db4ce4320} 'toImmutableList' '()Ljava/util/stream/Collector;' in 'com/google/common/collect/CollectCollectors')} + 0x0000713e0343629c: 0000 0148 | ba70 2fab | b63d 7100 | 008b b2f4 | 0000 0083 | c602 89b2 | f400 0000 | 81e6 feff + 0x0000713e034362bc: 1f00 85f6 | 0f84 5e1a | 0000 4885 | c00f 8429 + + 0x0000713e034362cc: ; {metadata('java/util/stream/ReferencePipeline')} + 0x0000713e034362cc: 0000 0048 | bb10 0c0d | 0008 0000 | 008b 7808 | 49ba 0000 | 0000 0800 | 0000 4903 | fa48 3b5f + 0x0000713e034362ec: 480f 8552 | 1a00 00e9 | 0000 0000 | 488b d048 | 3b00 488b + + 0x0000713e03436300: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436300: d048 beb0 | a4de b63d | 7100 008b | 5208 49ba | 0000 0000 | 0800 0000 | 4903 d248 | 3b96 a001 + 0x0000713e03436320: 0000 750d | 4883 86a8 | 0100 0001 | e960 0000 | 0048 3b96 | b001 0000 | 750d 4883 | 86b8 0100 + 0x0000713e03436340: 0001 e94a | 0000 0048 | 83be a001 | 0000 0075 | 1748 8996 | a001 0000 | 48c7 86a8 | 0100 0001 + 0x0000713e03436360: 0000 00e9 | 2900 0000 | 4883 beb0 | 0100 0000 | 7517 4889 | 96b0 0100 | 0048 c786 | b801 0000 + 0x0000713e03436380: 0100 0000 | e908 0000 | 0048 8386 | 9001 0000 + + 0x0000713e03436390: ; {oop(a 'java/util/stream/Collectors$CollectorImpl'{0x00000000a0323cf0})} + 0x0000713e03436390: 0148 baf0 | 3c32 a000 | 0000 0048 + + 0x0000713e0343639c: ; {optimized virtual_call} + 0x0000713e0343639c: 8bf0 90e8 + + 0x0000713e034363a0: ; ImmutableOopMap {} + ;*invokeinterface collect {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@12 (line 584) + 0x0000713e034363a0: bcc1 e0ff + + 0x0000713e034363a4: ; {other} + 0x0000713e034363a4: 0f1f 8400 | 1409 0005 | 4885 c075 + + 0x0000713e034363b0: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e034363b0: 1648 bbb0 | a4de b63d | 7100 0080 | 8bc1 0100 | 0001 e9cd + + 0x0000713e034363c4: ; {metadata('com/google/common/collect/ImmutableList')} + 0x0000713e034363c4: 0000 0048 | bfd0 6d08 | 0008 0000 | 008b 5808 | 49ba 0000 | 0000 0800 | 0000 4903 | da48 3b7b + 0x0000713e034363e4: 480f 858d + + 0x0000713e034363e8: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e034363e8: 0000 0048 | bbb0 a4de | b63d 7100 | 008b 7808 | 49ba 0000 | 0000 0800 | 0000 4903 | fa48 3bbb + 0x0000713e03436408: d801 0000 | 750d 4883 | 83e0 0100 | 0001 e979 | 0000 0048 | 3bbb e801 | 0000 750d | 4883 83f0 + 0x0000713e03436428: 0100 0001 | e963 0000 | 0048 83bb | d801 0000 | 0075 1748 | 89bb d801 | 0000 48c7 | 83e0 0100 + 0x0000713e03436448: 0001 0000 | 00e9 4200 | 0000 4883 | bbe8 0100 | 0000 7517 | 4889 bbe8 | 0100 0048 | c783 f001 + 0x0000713e03436468: 0000 0100 | 0000 e921 | 0000 00e9 | 1c00 0000 + + 0x0000713e03436478: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436478: 48bb b0a4 | deb6 3d71 | 0000 4883 | abc8 0100 | 0001 e9c0 | 1800 00e9 | 0000 0000 | 488b f848 + 0x0000713e03436498: 89bc 24a0 | 0000 0048 | 3b07 488b + + 0x0000713e034364a4: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e034364a4: f748 bbb0 | a4de b63d | 7100 008b | 7608 49ba | 0000 0000 | 0800 0000 | 4903 f248 | 3bb3 1002 + 0x0000713e034364c4: 0000 750d | 4883 8318 | 0200 0001 | e960 0000 | 0048 3bb3 | 2002 0000 | 750d 4883 | 8328 0200 + 0x0000713e034364e4: 0001 e94a | 0000 0048 | 83bb 1002 | 0000 0075 | 1748 89b3 | 1002 0000 | 48c7 8318 | 0200 0001 + 0x0000713e03436504: 0000 00e9 | 2900 0000 | 4883 bb20 | 0200 0000 | 7517 4889 | b320 0200 | 0048 c783 | 2802 0000 + 0x0000713e03436524: 0100 0000 | e908 0000 | 0048 8383 | 0002 0000 | 0148 8bf7 | 0f1f 4400 | 0048 b8ff | ffff ffff + 0x0000713e03436544: ; {virtual_call} + 0x0000713e03436544: ffff ffe8 + + 0x0000713e03436548: ; ImmutableOopMap {[160]=Oop } + ;*invokevirtual isEmpty {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@22 (line 585) + 0x0000713e03436548: 043b b506 + + 0x0000713e0343654c: ; {other} + 0x0000713e0343654c: 0f1f 8400 | bc0a 0006 + + 0x0000713e03436554: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436554: 85c0 48ba | b0a4 deb6 | 3d71 0000 | 48c7 c648 | 0200 0075 | 0748 c7c6 | 3802 0000 | 488b 3c32 + 0x0000713e03436574: 488d 7f01 | 4889 3c32 | 0f85 6816 | 0000 488b | bc24 a000 + + 0x0000713e03436588: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436588: 0000 48ba | b0a4 deb6 | 3d71 0000 | 8b7f 0849 | ba00 0000 | 0008 0000 | 0049 03fa | 483b ba68 + 0x0000713e034365a8: 0200 0075 | 0d48 8382 | 7002 0000 | 01e9 6000 | 0000 483b | ba78 0200 | 0075 0d48 | 8382 8002 + 0x0000713e034365c8: 0000 01e9 | 4a00 0000 | 4883 ba68 | 0200 0000 | 7517 4889 | ba68 0200 | 0048 c782 | 7002 0000 + 0x0000713e034365e8: 0100 0000 | e929 0000 | 0048 83ba | 7802 0000 | 0075 1748 | 89ba 7802 | 0000 48c7 | 8280 0200 + 0x0000713e03436608: 0001 0000 | 00e9 0800 | 0000 4883 | 8258 0200 | 0001 ba00 | 0000 0048 | 8bb4 24a0 | 0000 0066 + 0x0000713e03436628: 0f1f 4400 | 0048 b8ff | ffff ffff + + 0x0000713e03436634: ; {virtual_call} + 0x0000713e03436634: ffff ffe8 + + 0x0000713e03436638: ; ImmutableOopMap {[160]=Oop } + ;*invokevirtual get {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@37 (line 589) + 0x0000713e03436638: 8c66 d606 + + 0x0000713e0343663c: ; {other} + 0x0000713e0343663c: 0f1f 8400 | ac0b 0007 | 4885 c075 + + 0x0000713e03436648: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436648: 1648 bfb0 | a4de b63d | 7100 0080 | 8f89 0200 | 0001 e9cc + + 0x0000713e0343665c: ; {metadata('java/lang/String')} + 0x0000713e0343665c: 0000 0048 | bb48 1d04 | 0008 0000 | 008b 5008 | 49ba 0000 | 0000 0800 | 0000 4903 | d248 3bda + 0x0000713e0343667c: 0f85 8d00 + + 0x0000713e03436680: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436680: 0000 48bf | b0a4 deb6 | 3d71 0000 | 8b58 0849 | ba00 0000 | 0008 0000 | 0049 03da | 483b 9fa0 + 0x0000713e034366a0: 0200 0075 | 0d48 8387 | a802 0000 | 01e9 7900 | 0000 483b | 9fb0 0200 | 0075 0d48 | 8387 b802 + 0x0000713e034366c0: 0000 01e9 | 6300 0000 | 4883 bfa0 | 0200 0000 | 7517 4889 | 9fa0 0200 | 0048 c787 | a802 0000 + 0x0000713e034366e0: 0100 0000 | e942 0000 | 0048 83bf | b002 0000 | 0075 1748 | 899f b002 | 0000 48c7 | 87b8 0200 + 0x0000713e03436700: 0001 0000 | 00e9 2100 | 0000 e91c + + 0x0000713e0343670c: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e0343670c: 0000 0048 | bfb0 a4de | b63d 7100 | 0048 83af | 9002 0000 | 01e9 3716 | 0000 e900 | 0000 0048 + 0x0000713e0343672c: ; {oop(a 'net/starlark/java/eval/StringModule'{0x00000000a20cf5c8})} + 0x0000713e0343672c: 8bf0 48ba | c8f5 0ca2 | 0000 0000 + + 0x0000713e03436738: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436738: 48bf b0a4 | deb6 3d71 | 0000 4883 | 87c8 0200 + + 0x0000713e03436748: ; {metadata(method data for {method} {0x0000713db6a75268} 'strip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03436748: 0001 48ba | 90c5 deb6 | 3d71 0000 | 8bba f400 | 0000 83c7 | 0289 baf4 | 0000 0081 | e7fe ff1f + 0x0000713e03436768: 0085 ff0f | 84f5 1500 + + 0x0000713e03436770: ; {metadata(method data for {method} {0x0000713db6a75268} 'strip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03436770: 0048 ba90 | c5de b63d | 7100 00ff | 8238 0100 + + 0x0000713e03436780: ; {metadata(method data for {method} {0x0000713db6a75268} 'strip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03436780: 0048 ba90 | c5de b63d | 7100 0048 | 8382 b801 + + 0x0000713e03436790: ; {metadata(method data for {method} {0x0000713db6a74e80} 'stringStrip' '(Ljava/lang/String;Lcom/google/common/base/CharMatcher;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03436790: 0000 0148 | ba38 cade | b63d 7100 | 008b baf4 | 0000 0083 | c702 89ba | f400 0000 | 81e7 feff + 0x0000713e034367b0: 1f00 85ff | 0f84 cd15 + + 0x0000713e034367b8: ; {metadata(method data for {method} {0x0000713db6a74e80} 'stringStrip' '(Ljava/lang/String;Lcom/google/common/base/CharMatcher;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e034367b8: 0000 48ba | 38ca deb6 | 3d71 0000 | 4883 8238 | 0100 0001 + + 0x0000713e034367cc: ; {oop(a 'com/google/common/base/CharMatcher$AnyOf'{0x00000000a22264b0})} + 0x0000713e034367cc: 48bf b064 | 22a2 0000 | 0000 488b | d748 89bc | 24a8 0000 | 0066 0f1f + + 0x0000713e034367e4: ; {static_call} + 0x0000713e034367e4: 4400 00e8 + + 0x0000713e034367e8: ; ImmutableOopMap {[160]=Oop [168]=Oop } + ;*invokestatic stringRStrip {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.StringModule::stringStrip@2 (line 213) + ; - net.starlark.java.eval.StringModule::strip@23 (line 292) + ; - net.starlark.java.eval.Starlark::trimDocString@46 (line 589) + 0x0000713e034367e8: 74ff faff + + 0x0000713e034367ec: ; {other} + 0x0000713e034367ec: 0f1f 8400 | 5c0d 0008 + + 0x0000713e034367f4: ; {metadata(method data for {method} {0x0000713db6a74e80} 'stringStrip' '(Ljava/lang/String;Lcom/google/common/base/CharMatcher;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e034367f4: 48be 38ca | deb6 3d71 | 0000 4883 | 8648 0100 | 0001 488b | f048 8b94 | 24a8 0000 | 0066 0f1f + 0x0000713e03436814: ; {static_call} + 0x0000713e03436814: 4400 00e8 + + 0x0000713e03436818: ; ImmutableOopMap {[160]=Oop } + ;*invokestatic stringLStrip {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.StringModule::stringStrip@6 (line 213) + ; - net.starlark.java.eval.StringModule::strip@23 (line 292) + ; - net.starlark.java.eval.Starlark::trimDocString@46 (line 589) + 0x0000713e03436818: 4452 fbff + + 0x0000713e0343681c: ; {other} + 0x0000713e0343681c: 0f1f 8400 | 8c0d 0009 | 4889 8424 | b000 0000 | 488b bc24 | a000 0000 + + 0x0000713e03436834: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436834: 48ba b0a4 | deb6 3d71 | 0000 4883 | 8200 0300 + + 0x0000713e03436844: ; {metadata(method data for {method} {0x0000713db4cb91d8} 'skip' '(Ljava/lang/Iterable;I)Ljava/lang/Iterable;' in 'com/google/common/collect/Iterables')} + 0x0000713e03436844: 0001 48ba | e8cc deb6 | 3d71 0000 | 8bb2 f400 | 0000 83c6 | 0289 b2f4 | 0000 0081 | e6fe ff1f + 0x0000713e03436864: 0085 f60f | 843b 1500 + + 0x0000713e0343686c: ; {metadata(method data for {method} {0x0000713db4cb91d8} 'skip' '(Ljava/lang/Iterable;I)Ljava/lang/Iterable;' in 'com/google/common/collect/Iterables')} + 0x0000713e0343686c: 0048 bae8 | ccde b63d | 7100 0048 | 8382 3801 + + 0x0000713e0343687c: ; {metadata(method data for {method} {0x0000713db4552568} 'checkNotNull' '(Ljava/lang/Object;)Ljava/lang/Object;' in 'com/google/common/base/Preconditions')} + 0x0000713e0343687c: 0000 0148 | bab0 90e2 | b43d 7100 | 008b b2f4 | 0000 0083 | c602 89b2 | f400 0000 | 81e6 feff + 0x0000713e0343689c: 1f00 85f6 | 0f84 2315 | 0000 4885 + + 0x0000713e034368a8: ; {metadata(method data for {method} {0x0000713db4552568} 'checkNotNull' '(Ljava/lang/Object;)Ljava/lang/Object;' in 'com/google/common/base/Preconditions')} + 0x0000713e034368a8: ff48 bab0 | 90e2 b43d | 7100 0048 | c7c6 4801 | 0000 7407 | 48c7 c638 | 0100 0048 | 8b0c 3248 + 0x0000713e034368c8: 8d49 0148 | 890c 320f | 8435 1300 + + 0x0000713e034368d4: ; {metadata(method data for {method} {0x0000713db4cb91d8} 'skip' '(Ljava/lang/Iterable;I)Ljava/lang/Iterable;' in 'com/google/common/collect/Iterables')} + 0x0000713e034368d4: 0048 bae8 | ccde b63d | 7100 00ff | 8258 0100 + + 0x0000713e034368e4: ; {metadata(method data for {method} {0x0000713db4cb91d8} 'skip' '(Ljava/lang/Iterable;I)Ljava/lang/Iterable;' in 'com/google/common/collect/Iterables')} + 0x0000713e034368e4: 0048 bae8 | ccde b63d | 7100 00ff | 8268 0100 + + 0x0000713e034368f4: ; {metadata(method data for {method} {0x0000713db4cb91d8} 'skip' '(Ljava/lang/Iterable;I)Ljava/lang/Iterable;' in 'com/google/common/collect/Iterables')} + 0x0000713e034368f4: 0048 bae8 | ccde b63d | 7100 0048 | 8382 8001 + + 0x0000713e03436904: ; {metadata(method data for {method} {0x0000713db454ec40} 'checkArgument' '(ZLjava/lang/Object;)V' in 'com/google/common/base/Preconditions')} + 0x0000713e03436904: 0000 0148 | bad0 0547 | b53d 7100 | 008b b2f4 | 0000 0083 | c602 89b2 | f400 0000 | 81e6 feff + 0x0000713e03436924: 1f00 85f6 | 0f84 bc14 + + 0x0000713e0343692c: ; {metadata(method data for {method} {0x0000713db454ec40} 'checkArgument' '(ZLjava/lang/Object;)V' in 'com/google/common/base/Preconditions')} + 0x0000713e0343692c: 0000 48ba | d005 47b5 | 3d71 0000 | ff82 3801 + + 0x0000713e0343693c: ; {metadata('com/google/common/collect/Iterables$6')} + 0x0000713e0343693c: 0000 48ba | b058 5200 | 0800 0000 | 488b df49 | 8b87 b801 | 0000 488d | 7818 493b | bfc8 0100 + 0x0000713e0343695c: 000f 87a8 | 1400 0049 | 89bf b801 | 0000 48c7 | 0001 0000 | 0048 8bca | 49ba 0000 | 0000 0800 + 0x0000713e0343697c: 0000 492b | ca89 4808 | 4833 c989 | 480c 4833 | c948 8948 | 1048 8984 | 24b8 0000 | 0048 8bf0 + 0x0000713e0343699c: ; {metadata(method data for {method} {0x0000713db4cb91d8} 'skip' '(Ljava/lang/Iterable;I)Ljava/lang/Iterable;' in 'com/google/common/collect/Iterables')} + 0x0000713e0343699c: 48bf e8cc | deb6 3d71 | 0000 4883 | 8790 0100 + + 0x0000713e034369ac: ; {metadata(method data for {method} {0x0000713db6a7a5e0} '' '(Ljava/lang/Iterable;I)V' in 'com/google/common/collect/Iterables$6')} + 0x0000713e034369ac: 0001 48be | 78d2 deb6 | 3d71 0000 | 8bbe f400 | 0000 83c7 | 0289 bef4 | 0000 0081 | e7fe ff1f + 0x0000713e034369cc: 0085 ff0f | 8443 1400 | 0041 0fbe | 7740 85f6 | 0f85 5714 | 0000 4c8b | d349 c1ea | 0344 8950 + 0x0000713e034369ec: 1448 8bf0 | 4833 f348 | c1ee 1848 | 83fe 000f | 8557 1400 | 00c7 4010 | 0100 0000 + + 0x0000713e03436a08: ; {metadata(method data for {method} {0x0000713db6a7a5e0} '' '(Ljava/lang/Iterable;I)V' in 'com/google/common/collect/Iterables$6')} + 0x0000713e03436a08: 488b f048 | bf78 d2de | b63d 7100 | 0048 8387 | 3801 0000 + + 0x0000713e03436a1c: ; {metadata(method data for {method} {0x0000713db5174dd0} '' '()V' in 'com/google/common/collect/FluentIterable')} + 0x0000713e03436a1c: 0148 be10 | 59d1 b63d | 7100 008b | bef4 0000 | 0083 c702 | 89be f400 | 0000 81e7 | feff 1f00 + 0x0000713e03436a3c: 85ff 0f84 | 2c14 0000 + + 0x0000713e03436a44: ; {metadata(method data for {method} {0x0000713db5174dd0} '' '()V' in 'com/google/common/collect/FluentIterable')} + 0x0000713e03436a44: 488b f048 | bf10 59d1 | b63d 7100 | 0048 8387 | 3801 0000 + + 0x0000713e03436a58: ; {metadata(method data for {method} {0x0000713db4000630} '' '()V' in 'java/lang/Object')} + 0x0000713e03436a58: 0148 be28 | 4025 b43d | 7100 008b | bef4 0000 | 0083 c702 | 89be f400 | 0000 81e7 | feff 1f00 + 0x0000713e03436a78: 85ff 0f84 | 1114 0000 + + 0x0000713e03436a80: ; {metadata(method data for {method} {0x0000713db5174dd0} '' '()V' in 'com/google/common/collect/FluentIterable')} + 0x0000713e03436a80: 48be 1059 | d1b6 3d71 | 0000 4883 | 8648 0100 + + 0x0000713e03436a90: ; {metadata(method data for {method} {0x0000713db5179fc0} 'absent' '()Lcom/google/common/base/Optional;' in 'com/google/common/base/Optional')} + 0x0000713e03436a90: 0001 48be | 5024 c8b6 | 3d71 0000 | 8bbe f400 | 0000 83c7 | 0289 bef4 | 0000 0081 | e7fe ff1f + 0x0000713e03436ab0: 0085 ff0f | 84f9 1300 + + 0x0000713e03436ab8: ; {metadata(method data for {method} {0x0000713db5179fc0} 'absent' '()Lcom/google/common/base/Optional;' in 'com/google/common/base/Optional')} + 0x0000713e03436ab8: 0048 be50 | 24c8 b63d | 7100 0048 | 8386 3801 + + 0x0000713e03436ac8: ; {metadata(method data for {method} {0x0000713db517b398} 'withType' '()Lcom/google/common/base/Optional;' in 'com/google/common/base/Absent')} + 0x0000713e03436ac8: 0000 0148 | bed0 25c8 | b63d 7100 | 008b bef4 | 0000 0083 | c702 89be | f400 0000 | 81e7 feff + 0x0000713e03436ae8: 1f00 85ff | 0f84 e113 | 0000 410f | be77 4085 | f60f 85f5 + + 0x0000713e03436afc: ; {oop(a 'com/google/common/base/Absent'{0x00000000a04e0ff8})} + 0x0000713e03436afc: 1300 0049 | baf8 0f4e | a000 0000 | 0049 c1ea | 0344 8950 + + 0x0000713e03436b10: ; {oop(a 'com/google/common/base/Absent'{0x00000000a04e0ff8})} + 0x0000713e03436b10: 0c48 bef8 | 0f4e a000 | 0000 0048 | 8bf8 4833 | fe48 c1ef | 1848 83ff | 000f 85e4 | 1300 0048 + 0x0000713e03436b30: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436b30: 8bf0 48bb | b0a4 deb6 | 3d71 0000 + + 0x0000713e03436b3c: ; {metadata('com/google/common/collect/Iterables$6')} + 0x0000713e03436b3c: 49ba b058 | 5200 0800 | 0000 4c89 | 9320 0300 | 0048 8383 | 2803 0000 | 0148 8bf0 | 0f1f 8000 + 0x0000713e03436b5c: ; {optimized virtual_call} + 0x0000713e03436b5c: 0000 00e8 + + 0x0000713e03436b60: ; ImmutableOopMap {[176]=Oop [184]=Oop } + ;*invokeinterface iterator {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@62 (line 592) + 0x0000713e03436b60: 1cce faff + + 0x0000713e03436b64: ; {other} + 0x0000713e03436b64: 0f1f 8400 | d410 000a | 4889 8424 | c000 0000 | bfff ffff | 7f89 bc24 | c800 0000 + + 0x0000713e03436b80: ; implicit exception: dispatches to 0x0000713e03437f2b + 0x0000713e03436b80: 483b 0048 + + 0x0000713e03436b84: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436b84: 8bf0 48bb | b0a4 deb6 | 3d71 0000 | 8b76 0849 | ba00 0000 | 0008 0000 | 0049 03f2 | 483b b358 + 0x0000713e03436ba4: 0300 0075 | 0d48 8383 | 6003 0000 | 01e9 6000 | 0000 483b | b368 0300 | 0075 0d48 | 8383 7003 + 0x0000713e03436bc4: 0000 01e9 | 4a00 0000 | 4883 bb58 | 0300 0000 | 7517 4889 | b358 0300 | 0048 c783 | 6003 0000 + 0x0000713e03436be4: 0100 0000 | e929 0000 | 0048 83bb | 6803 0000 | 0075 1748 | 89b3 6803 | 0000 48c7 | 8370 0300 + 0x0000713e03436c04: 0001 0000 | 00e9 0800 | 0000 4883 | 8348 0300 | 0001 488b | f00f 1f40 | 0048 b840 | ac22 703c + 0x0000713e03436c24: ; {virtual_call} + 0x0000713e03436c24: 7100 00e8 + + 0x0000713e03436c28: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop } + ;*invokeinterface hasNext {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@71 (line 592) + 0x0000713e03436c28: 6c39 b506 + + 0x0000713e03436c2c: ; {other} + 0x0000713e03436c2c: 0f1f 8400 | 9c11 000b + + 0x0000713e03436c34: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436c34: 85c0 48be | b0a4 deb6 | 3d71 0000 | 48c7 c780 | 0300 0074 | 0748 c7c7 | 9003 0000 | 488b 1c3e + 0x0000713e03436c54: 488d 5b01 | 4889 1c3e | 0f84 4405 | 0000 488b | 8424 c000 + + 0x0000713e03436c68: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436c68: 0000 48be | b0a4 deb6 | 3d71 0000 | 8b40 0849 | ba00 0000 | 0008 0000 | 0049 03c2 | 483b 86b0 + 0x0000713e03436c88: 0300 0075 | 0d48 8386 | b803 0000 | 01e9 6000 | 0000 483b | 86c0 0300 | 0075 0d48 | 8386 c803 + 0x0000713e03436ca8: 0000 01e9 | 4a00 0000 | 4883 beb0 | 0300 0000 | 7517 4889 | 86b0 0300 | 0048 c786 | b803 0000 + 0x0000713e03436cc8: 0100 0000 | e929 0000 | 0048 83be | c003 0000 | 0075 1748 | 8986 c003 | 0000 48c7 | 86c8 0300 + 0x0000713e03436ce8: 0001 0000 | 00e9 0800 | 0000 4883 | 86a0 0300 | 0001 488b | b424 c000 | 0000 6666 | 9048 b8a0 + 0x0000713e03436d08: 3b05 483c + + 0x0000713e03436d0c: ; {virtual_call} + 0x0000713e03436d0c: 7100 00e8 + + 0x0000713e03436d10: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop } + ;*invokeinterface next {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@81 (line 592) + 0x0000713e03436d10: fc5e d606 + + 0x0000713e03436d14: ; {other} + 0x0000713e03436d14: 0f1f 8400 | 8412 000c | 4885 c075 + + 0x0000713e03436d20: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436d20: 1648 bab0 | a4de b63d | 7100 0080 | 8ad1 0300 | 0001 e9cc + + 0x0000713e03436d34: ; {metadata('java/lang/String')} + 0x0000713e03436d34: 0000 0048 | bb48 1d04 | 0008 0000 | 008b 7008 | 49ba 0000 | 0000 0800 | 0000 4903 | f248 3bde + 0x0000713e03436d54: 0f85 8d00 + + 0x0000713e03436d58: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436d58: 0000 48ba | b0a4 deb6 | 3d71 0000 | 8b58 0849 | ba00 0000 | 0008 0000 | 0049 03da | 483b 9ae8 + 0x0000713e03436d78: 0300 0075 | 0d48 8382 | f003 0000 | 01e9 7900 | 0000 483b | 9af8 0300 | 0075 0d48 | 8382 0004 + 0x0000713e03436d98: 0000 01e9 | 6300 0000 | 4883 bae8 | 0300 0000 | 7517 4889 | 9ae8 0300 | 0048 c782 | f003 0000 + 0x0000713e03436db8: 0100 0000 | e942 0000 | 0048 83ba | f803 0000 | 0075 1748 | 899a f803 | 0000 48c7 | 8200 0400 + 0x0000713e03436dd8: 0001 0000 | 00e9 2100 | 0000 e91c + + 0x0000713e03436de4: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436de4: 0000 0048 | bab0 a4de | b63d 7100 | 0048 83aa | d803 0000 | 01e9 3211 | 0000 e900 | 0000 0048 + 0x0000713e03436e04: ; {oop(a 'net/starlark/java/eval/StringModule'{0x00000000a20cf5c8})} + 0x0000713e03436e04: 8bf8 48be | c8f5 0ca2 | 0000 0000 + + 0x0000713e03436e10: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436e10: 48ba b0a4 | deb6 3d71 | 0000 4883 | 8210 0400 + + 0x0000713e03436e20: ; {metadata(method data for {method} {0x0000713db6a74f88} 'lstrip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03436e20: 0001 48be | 38d9 deb6 | 3d71 0000 | 8b96 f400 | 0000 83c2 | 0289 96f4 | 0000 0081 | e2fe ff1f + 0x0000713e03436e40: 0085 d20f | 84f0 1000 + + 0x0000713e03436e48: ; {metadata(method data for {method} {0x0000713db6a74f88} 'lstrip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03436e48: 0048 be38 | d9de b63d | 7100 00ff | 8638 0100 + + 0x0000713e03436e58: ; {metadata(method data for {method} {0x0000713db6a74f88} 'lstrip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03436e58: 0048 be38 | d9de b63d | 7100 0048 | 8386 b801 + + 0x0000713e03436e68: ; {oop(a 'com/google/common/base/CharMatcher$AnyOf'{0x00000000a22264b0})} + 0x0000713e03436e68: 0000 0148 | bab0 6422 | a200 0000 | 0048 8bf7 | 4889 bc24 | d000 0000 | 0f1f 8000 + + 0x0000713e03436e84: ; {static_call} + 0x0000713e03436e84: 0000 00e8 + + 0x0000713e03436e88: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop [208]=Oop } + ;*invokestatic stringLStrip {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.StringModule::lstrip@23 (line 239) + ; - net.starlark.java.eval.Starlark::trimDocString@99 (line 593) + 0x0000713e03436e88: d44b fbff + + 0x0000713e03436e8c: ; {other} + 0x0000713e03436e8c: 0f1f 8400 | fc13 000d + + 0x0000713e03436e94: ; implicit exception: dispatches to 0x0000713e03437f5a + 0x0000713e03436e94: 483b 0048 + + 0x0000713e03436e98: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436e98: 8bc8 48ba | b0a4 deb6 | 3d71 0000 | 4883 8248 | 0400 0001 + + 0x0000713e03436eac: ; {metadata(method data for {method} {0x0000713db4009b60} 'isEmpty' '()Z' in 'java/lang/String')} + 0x0000713e03436eac: 48b9 085a | 5db4 3d71 | 0000 8b91 | f400 0000 | 83c2 0289 | 91f4 0000 | 0081 e2fe | ff1f 0085 + 0x0000713e03436ecc: d20f 848c | 1000 008b | 4814 48c1 | e103 8b51 + + 0x0000713e03436edc: ; {metadata(method data for {method} {0x0000713db4009b60} 'isEmpty' '()Z' in 'java/lang/String')} + 0x0000713e03436edc: 0c85 d248 | b908 5a5d | b43d 7100 | 0048 c7c6 | 3801 0000 | 7507 48c7 | c648 0100 | 0048 8b3c + 0x0000713e03436efc: 3148 8d7f | 0148 893c | 310f 851a + + 0x0000713e03436f08: ; {metadata(method data for {method} {0x0000713db4009b60} 'isEmpty' '()Z' in 'java/lang/String')} + 0x0000713e03436f08: 0000 0048 | b908 5a5d | b43d 7100 | 00ff 8158 | 0100 00b9 | 0100 0000 | e905 0000 | 00b9 0000 + 0x0000713e03436f28: 0000 83e1 + + 0x0000713e03436f2c: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436f2c: 0185 c948 | b9b0 a4de | b63d 7100 | 0048 c7c6 | 9004 0000 | 7407 48c7 | c680 0400 | 0048 8b3c + 0x0000713e03436f4c: 3148 8d7f | 0148 893c | 310f 840c | 0000 008b | bc24 c800 | 0000 e9ea | 0100 0048 | 8bbc 24d0 + 0x0000713e03436f6c: 0000 0048 | 3b07 488b + + 0x0000713e03436f74: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03436f74: cf48 beb0 | a4de b63d | 7100 0048 | 8386 a004 + + 0x0000713e03436f84: ; {metadata(method data for {method} {0x0000713db4009ab0} 'length' '()I' in 'java/lang/String')} + 0x0000713e03436f84: 0000 0148 | b960 2d3e | b43d 7100 | 008b b1f4 | 0000 0083 | c602 89b1 | f400 0000 | 81e6 feff + 0x0000713e03436fa4: 1f00 85f6 | 0f84 dc0f | 0000 8b4f | 1448 c1e1 | 038b 710c + + 0x0000713e03436fb8: ; {metadata(method data for {method} {0x0000713db4009ab0} 'length' '()I' in 'java/lang/String')} + 0x0000713e03436fb8: 488b cf48 | bb60 2d3e | b43d 7100 | 0048 8383 | 3801 0000 + + 0x0000713e03436fcc: ; {metadata(method data for {method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e03436fcc: 0148 b9b8 | 2532 b43d | 7100 008b | 99f4 0000 | 0083 c302 | 8999 f400 | 0000 81e3 | feff 1f00 + 0x0000713e03436fec: 85db 0f84 | bc0f 0000 + + 0x0000713e03436ff4: ; {metadata(method data for {method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e03436ff4: 48b9 b825 | 32b4 3d71 | 0000 ff81 | 4801 0000 | 0fbe 4f10 + + 0x0000713e03437008: ; {metadata(method data for {method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e03437008: 48bf b825 | 32b4 3d71 | 0000 ff87 | 5801 0000 | c1e1 18c1 | f918 d3fe + + 0x0000713e03437020: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437020: 488b c848 | bfb0 a4de | b63d 7100 | 0048 8387 | d804 0000 + + 0x0000713e03437034: ; {metadata(method data for {method} {0x0000713db4009ab0} 'length' '()I' in 'java/lang/String')} + 0x0000713e03437034: 0148 b960 | 2d3e b43d | 7100 008b | b9f4 0000 | 0083 c702 | 89b9 f400 | 0000 81e7 | feff 1f00 + 0x0000713e03437054: 85ff 0f84 | 750f 0000 + + 0x0000713e0343705c: ; {metadata(method data for {method} {0x0000713db4009ab0} 'length' '()I' in 'java/lang/String')} + 0x0000713e0343705c: 488b c848 | bf60 2d3e | b43d 7100 | 0048 8387 | 3801 0000 + + 0x0000713e03437070: ; {metadata(method data for {method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e03437070: 0148 b9b8 | 2532 b43d | 7100 008b | b9f4 0000 | 0083 c702 | 89b9 f400 | 0000 81e7 | feff 1f00 + 0x0000713e03437090: 85ff 0f84 | 5a0f 0000 + + 0x0000713e03437098: ; {metadata(method data for {method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e03437098: 48b9 b825 | 32b4 3d71 | 0000 ff81 | 4801 0000 | 0fbe 4810 + + 0x0000713e034370ac: ; {metadata(method data for {method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e034370ac: 48bf b825 | 32b4 3d71 | 0000 ff87 | 5801 0000 | c1e1 18c1 | f918 d3fa + + 0x0000713e034370c4: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e034370c4: 2bf2 48ba | b0a4 deb6 | 3d71 0000 | 4883 8210 | 0500 0001 + + 0x0000713e034370d8: ; {metadata(method data for {method} {0x0000713db418dd40} 'min' '(II)I' in 'java/lang/Math')} + 0x0000713e034370d8: 48ba 0873 | 43b4 3d71 | 0000 8bba | f400 0000 | 83c7 0289 | baf4 0000 | 0081 e7fe | ff1f 0085 + 0x0000713e034370f8: ff0f 8414 | 0f00 003b | b424 c800 + + 0x0000713e03437104: ; {metadata(method data for {method} {0x0000713db418dd40} 'min' '(II)I' in 'java/lang/Math')} + 0x0000713e03437104: 0000 48ba | 0873 43b4 | 3d71 0000 | 48c7 c738 | 0100 007f | 0748 c7c7 | 4801 0000 | 488b 043a + 0x0000713e03437124: 488d 4001 | 4889 043a | 0f8f 1500 + + 0x0000713e03437130: ; {metadata(method data for {method} {0x0000713db418dd40} 'min' '(II)I' in 'java/lang/Math')} + 0x0000713e03437130: 0000 48ba | 0873 43b4 | 3d71 0000 | ff82 5801 | 0000 e907 | 0000 008b | b424 c800 | 0000 488b + 0x0000713e03437150: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437150: fe48 bab0 | a4de b63d | 7100 008b | b2f8 0000 | 0083 c602 | 89b2 f800 | 0000 81e6 | fe3f 0000 + 0x0000713e03437170: 85f6 0f84 | bc0e 0000 | 4d8b 9758 + + 0x0000713e0343717c: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop } + ;*goto {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) net.starlark.java.eval.Starlark::trimDocString@134 (line 598) + ; {poll} + 0x0000713e0343717c: 0400 0041 + + 0x0000713e03437180: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437180: 8502 48ba | b0a4 deb6 | 3d71 0000 | ff82 2005 | 0000 89bc | 24c8 0000 | 0048 8b84 | 24c0 0000 + 0x0000713e034371a0: 00e9 daf9 | ffff 8bbc | 24c8 0000 | 0081 ffff + + 0x0000713e034371b0: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e034371b0: ffff 7f48 | bab0 a4de | b63d 7100 | 0048 c7c6 | 3805 0000 | 7507 48c7 | c648 0500 | 0048 8b04 + 0x0000713e034371d0: 3248 8d40 | 0148 8904 | 320f 8505 | 0000 00bf | 0000 0000 | 89bc 24cc + + 0x0000713e034371e8: ; {metadata('java/lang/StringBuilder')} + 0x0000713e034371e8: 0000 0048 | bac8 1305 | 0008 0000 | 0049 8b87 | b801 0000 | 488d 7818 | 493b bfc8 | 0100 000f + 0x0000713e03437208: 8748 0e00 | 0049 89bf | b801 0000 | 48c7 0001 | 0000 0048 | 8bca 49ba | 0000 0000 | 0800 0000 + 0x0000713e03437228: 492b ca89 | 4808 4833 | c989 480c | 4833 c948 | 8948 1048 | 8984 24d8 | 0000 0048 + + 0x0000713e03437244: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437244: 8bd0 48be | b0a4 deb6 | 3d71 0000 | 4883 8658 | 0500 0001 + + 0x0000713e03437258: ; {metadata(method data for {method} {0x0000713db40c9450} '' '()V' in 'java/lang/StringBuilder')} + 0x0000713e03437258: 48ba 3037 | 2eb4 3d71 | 0000 8bb2 | f400 0000 | 83c6 0289 | b2f4 0000 | 0081 e6fe | ff1f 0085 + 0x0000713e03437278: f60f 84e3 | 0d00 0048 + + 0x0000713e03437280: ; {metadata(method data for {method} {0x0000713db40c9450} '' '()V' in 'java/lang/StringBuilder')} + 0x0000713e03437280: 8bd0 48be | 3037 2eb4 | 3d71 0000 | 4883 8638 | 0100 0001 | ba10 0000 | 0048 8bf0 + + 0x0000713e0343729c: ; {optimized virtual_call} + 0x0000713e0343729c: 6666 90e8 + + 0x0000713e034372a0: ; ImmutableOopMap {[176]=Oop [184]=Oop [216]=Oop } + ;*invokespecial {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.StringBuilder::@3 + ; - net.starlark.java.eval.Starlark::trimDocString@152 (line 603) + 0x0000713e034372a0: 1c0f 1c07 + + 0x0000713e034372a4: ; {other} + 0x0000713e034372a4: 0f1f 8400 | 1418 000f | 488b 8424 | d800 0000 + + 0x0000713e034372b4: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e034372b4: 48ba b0a4 | deb6 3d71 | 0000 4883 | 8268 0500 + + 0x0000713e034372c4: ; {metadata(method data for {method} {0x0000713db40c9890} 'append' '(Ljava/lang/String;)Ljava/lang/StringBuilder;' in 'java/lang/StringBuilder')} + 0x0000713e034372c4: 0001 48ba | f045 2eb4 | 3d71 0000 | 8bb2 f400 | 0000 83c6 | 0289 b2f4 | 0000 0081 | e6fe ff1f + 0x0000713e034372e4: 0085 f60f | 8496 0d00 | 0048 8b84 | 24d8 0000 + + 0x0000713e034372f4: ; {metadata(method data for {method} {0x0000713db40c9890} 'append' '(Ljava/lang/String;)Ljava/lang/StringBuilder;' in 'java/lang/StringBuilder')} + 0x0000713e034372f4: 0048 baf0 | 452e b43d | 7100 0048 | 8382 3801 | 0000 0148 | 8b94 24b0 | 0000 0048 | 8bb4 24d8 + 0x0000713e03437314: ; {optimized virtual_call} + 0x0000713e03437314: 0000 00e8 + + 0x0000713e03437318: ; ImmutableOopMap {[184]=Oop [216]=Oop } + ;*invokespecial append {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.StringBuilder::append@2 + ; - net.starlark.java.eval.Starlark::trimDocString@160 (line 604) + 0x0000713e03437318: 64d5 1a07 + + 0x0000713e0343731c: ; {other} + 0x0000713e0343731c: 0f1f 8400 | 8c18 0010 | 488b 8424 | b800 0000 + + 0x0000713e0343732c: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e0343732c: 48be b0a4 | deb6 3d71 + + 0x0000713e03437334: ; {metadata('com/google/common/collect/Iterables$6')} + 0x0000713e03437334: 0000 49ba | b058 5200 | 0800 0000 | 4c89 96b0 | 0500 0048 | 8386 b805 | 0000 0148 | 8bb4 24b8 + 0x0000713e03437354: ; {optimized virtual_call} + 0x0000713e03437354: 0000 00e8 + + 0x0000713e03437358: ; ImmutableOopMap {[216]=Oop } + ;*invokeinterface iterator {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@165 (line 605) + 0x0000713e03437358: 24c6 faff + + 0x0000713e0343735c: ; {other} + 0x0000713e0343735c: 0f1f 8400 | cc18 0011 | 4889 8424 | e000 0000 | 0f1f 4000 + + 0x0000713e03437370: ; implicit exception: dispatches to 0x0000713e034380a4 + 0x0000713e03437370: 483b 0048 + + 0x0000713e03437374: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437374: 8bf0 48ba | b0a4 deb6 | 3d71 0000 | 8b76 0849 | ba00 0000 | 0008 0000 | 0049 03f2 | 483b b2e8 + 0x0000713e03437394: 0500 0075 | 0d48 8382 | f005 0000 | 01e9 6000 | 0000 483b | b2f8 0500 | 0075 0d48 | 8382 0006 + 0x0000713e034373b4: 0000 01e9 | 4a00 0000 | 4883 bae8 | 0500 0000 | 7517 4889 | b2e8 0500 | 0048 c782 | f005 0000 + 0x0000713e034373d4: 0100 0000 | e929 0000 | 0048 83ba | f805 0000 | 0075 1748 | 89b2 f805 | 0000 48c7 | 8200 0600 + 0x0000713e034373f4: 0001 0000 | 00e9 0800 | 0000 4883 | 82d8 0500 | 0001 488b | f00f 1f40 | 0048 b870 | ac22 703c + 0x0000713e03437414: ; {virtual_call} + 0x0000713e03437414: 7100 00e8 + + 0x0000713e03437418: ; ImmutableOopMap {[216]=Oop [224]=Oop } + ;*invokeinterface hasNext {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@174 (line 605) + 0x0000713e03437418: 7c31 b506 + + 0x0000713e0343741c: ; {other} + 0x0000713e0343741c: 0f1f 8400 | 8c19 0012 + + 0x0000713e03437424: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437424: 85c0 48be | b0a4 deb6 | 3d71 0000 | 48c7 c710 | 0600 0074 | 0748 c7c7 | 2006 0000 | 488b 1c3e + 0x0000713e03437444: 488d 5b01 | 4889 1c3e | 0f84 f005 | 0000 488b | b424 e000 + + 0x0000713e03437458: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437458: 0000 48bf | b0a4 deb6 | 3d71 0000 | 8b76 0849 | ba00 0000 | 0008 0000 | 0049 03f2 | 483b b740 + 0x0000713e03437478: 0600 0075 | 0d48 8387 | 4806 0000 | 01e9 6000 | 0000 483b | b750 0600 | 0075 0d48 | 8387 5806 + 0x0000713e03437498: 0000 01e9 | 4a00 0000 | 4883 bf40 | 0600 0000 | 7517 4889 | b740 0600 | 0048 c787 | 4806 0000 + 0x0000713e034374b8: 0100 0000 | e929 0000 | 0048 83bf | 5006 0000 | 0075 1748 | 89b7 5006 | 0000 48c7 | 8758 0600 + 0x0000713e034374d8: 0001 0000 | 00e9 0800 | 0000 4883 | 8730 0600 | 0001 488b | b424 e000 | 0000 6666 | 9048 b8d0 + 0x0000713e034374f8: 3b05 483c + + 0x0000713e034374fc: ; {virtual_call} + 0x0000713e034374fc: 7100 00e8 + + 0x0000713e03437500: ; ImmutableOopMap {[216]=Oop [224]=Oop } + ;*invokeinterface next {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@184 (line 605) + 0x0000713e03437500: 0c57 d606 + + 0x0000713e03437504: ; {other} + 0x0000713e03437504: 0f1f 8400 | 741a 0013 | 4885 c075 + + 0x0000713e03437510: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437510: 1648 beb0 | a4de b63d | 7100 0080 | 8e61 0600 | 0001 e9cc + + 0x0000713e03437524: ; {metadata('java/lang/String')} + 0x0000713e03437524: 0000 0048 | bb48 1d04 | 0008 0000 | 008b 5008 | 49ba 0000 | 0000 0800 | 0000 4903 | d248 3bda + 0x0000713e03437544: 0f85 8d00 + + 0x0000713e03437548: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437548: 0000 48be | b0a4 deb6 | 3d71 0000 | 8b58 0849 | ba00 0000 | 0008 0000 | 0049 03da | 483b 9e78 + 0x0000713e03437568: 0600 0075 | 0d48 8386 | 8006 0000 | 01e9 7900 | 0000 483b | 9e88 0600 | 0075 0d48 | 8386 9006 + 0x0000713e03437588: 0000 01e9 | 6300 0000 | 4883 be78 | 0600 0000 | 7517 4889 | 9e78 0600 | 0048 c786 | 8006 0000 + 0x0000713e034375a8: 0100 0000 | e942 0000 | 0048 83be | 8806 0000 | 0075 1748 | 899e 8806 | 0000 48c7 | 8690 0600 + 0x0000713e034375c8: 0001 0000 | 00e9 2100 | 0000 e91c + + 0x0000713e034375d4: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e034375d4: 0000 0048 | beb0 a4de | b63d 7100 | 0048 83ae | 6806 0000 | 01e9 bb0a | 0000 e900 | 0000 0048 + 0x0000713e034375f4: 8bf8 488b | 8424 d800 + + 0x0000713e034375fc: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e034375fc: 0000 48ba | b0a4 deb6 | 3d71 0000 | 4883 82a0 | 0600 0001 + + 0x0000713e03437610: ; {metadata(method data for {method} {0x0000713db40cd2f0} 'length' '()I' in 'java/lang/StringBuilder')} + 0x0000713e03437610: 48ba 8093 | 5db4 3d71 | 0000 8bb2 | f400 0000 | 83c6 0289 | b2f4 0000 | 0081 e6fe | ff1f 0085 + 0x0000713e03437630: f60f 847b | 0a00 0048 | 8b84 24d8 + + 0x0000713e0343763c: ; {metadata(method data for {method} {0x0000713db40cd2f0} 'length' '()I' in 'java/lang/StringBuilder')} + 0x0000713e0343763c: 0000 0048 | ba80 935d | b43d 7100 | 0048 8382 | 3801 0000 | 0148 8b84 | 24d8 0000 | 008b 500c + 0x0000713e0343765c: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e0343765c: 85d2 48ba | b0a4 deb6 | 3d71 0000 | 48c7 c6d8 | 0600 007e | 0748 c7c6 | e806 0000 | 488b 1c32 + 0x0000713e0343767c: 488d 5b01 | 4889 1c32 | 0f8e 8200 | 0000 4889 | bc24 e800 | 0000 488b + + 0x0000713e03437694: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437694: d048 beb0 | a4de b63d | 7100 0048 | 8386 f806 + + 0x0000713e034376a4: ; {metadata(method data for {method} {0x0000713db40c9890} 'append' '(Ljava/lang/String;)Ljava/lang/StringBuilder;' in 'java/lang/StringBuilder')} + 0x0000713e034376a4: 0000 0148 | baf0 452e | b43d 7100 | 008b b2f4 | 0000 0083 | c602 89b2 | f400 0000 | 81e6 feff + 0x0000713e034376c4: 1f00 85f6 | 0f84 050a | 0000 488b + + 0x0000713e034376d0: ; {metadata(method data for {method} {0x0000713db40c9890} 'append' '(Ljava/lang/String;)Ljava/lang/StringBuilder;' in 'java/lang/StringBuilder')} + 0x0000713e034376d0: d048 bef0 | 452e b43d | 7100 0048 | 8386 3801 + + 0x0000713e034376e0: ; {oop("\x0A"{0x00000000a0377258})} + 0x0000713e034376e0: 0000 0148 | ba58 7237 | a000 0000 | 0048 8bf0 | 0f1f 8000 + + 0x0000713e034376f4: ; {optimized virtual_call} + 0x0000713e034376f4: 0000 00e8 + + 0x0000713e034376f8: ; ImmutableOopMap {[216]=Oop [224]=Oop [232]=Oop } + ;*invokespecial append {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.StringBuilder::append@2 + ; - net.starlark.java.eval.Starlark::trimDocString@207 (line 608) + 0x0000713e034376f8: 84d1 1a07 + + 0x0000713e034376fc: ; {other} + 0x0000713e034376fc: 0f1f 8400 | 6c1c 0014 | 488b bc24 | e800 0000 + + 0x0000713e0343770c: ; implicit exception: dispatches to 0x0000713e034380f4 + 0x0000713e0343770c: 483b 0748 + + 0x0000713e03437710: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437710: 8bcf 48ba | b0a4 deb6 | 3d71 0000 | 4883 8230 | 0700 0001 + + 0x0000713e03437724: ; {metadata(method data for {method} {0x0000713db4009ab0} 'length' '()I' in 'java/lang/String')} + 0x0000713e03437724: 48b9 602d | 3eb4 3d71 | 0000 8b91 | f400 0000 | 83c2 0289 | 91f4 0000 | 0081 e2fe | ff1f 0085 + 0x0000713e03437744: d20f 84ae | 0900 008b | 4f14 48c1 | e103 8b51 | 0c48 8bcf + + 0x0000713e03437758: ; {metadata(method data for {method} {0x0000713db4009ab0} 'length' '()I' in 'java/lang/String')} + 0x0000713e03437758: 48be 602d | 3eb4 3d71 | 0000 4883 | 8638 0100 + + 0x0000713e03437768: ; {metadata(method data for {method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e03437768: 0001 48b9 | b825 32b4 | 3d71 0000 | 8bb1 f400 | 0000 83c6 | 0289 b1f4 | 0000 0081 | e6fe ff1f + 0x0000713e03437788: 0085 f60f | 848e 0900 + + 0x0000713e03437790: ; {metadata(method data for {method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e03437790: 0048 b9b8 | 2532 b43d | 7100 00ff | 8148 0100 | 000f be4f + + 0x0000713e034377a4: ; {metadata(method data for {method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e034377a4: 1048 beb8 | 2532 b43d | 7100 00ff | 8658 0100 | 00c1 e118 | c1f9 1848 | 8bf2 d3fe | 3bb4 24cc + 0x0000713e034377c4: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e034377c4: 0000 0048 | b9b0 a4de | b63d 7100 | 0048 c7c3 | 6807 0000 | 7e07 48c7 | c378 0700 | 0048 8b04 + 0x0000713e034377e4: 1948 8d40 | 0148 8904 | 190f 8e01 | 0200 0048 + + 0x0000713e034377f4: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e034377f4: 8bcf 48bb | b0a4 deb6 | 3d71 0000 | 4883 8388 | 0700 0001 + + 0x0000713e03437808: ; {metadata(method data for {method} {0x0000713db400bba0} 'substring' '(I)Ljava/lang/String;' in 'java/lang/String')} + 0x0000713e03437808: 48b9 887f | bbb4 3d71 | 0000 8b99 | f400 0000 | 83c3 0289 | 99f4 0000 | 0081 e3fe | ff1f 0085 + 0x0000713e03437828: db0f 8411 | 0900 0048 + + 0x0000713e03437830: ; {metadata(method data for {method} {0x0000713db400bba0} 'substring' '(I)Ljava/lang/String;' in 'java/lang/String')} + 0x0000713e03437830: 8bcf 48bb | 887f bbb4 | 3d71 0000 | 4883 8338 | 0100 0001 + + 0x0000713e03437844: ; {metadata(method data for {method} {0x0000713db4009ab0} 'length' '()I' in 'java/lang/String')} + 0x0000713e03437844: 48b9 602d | 3eb4 3d71 | 0000 8b99 | f400 0000 | 83c3 0289 | 99f4 0000 | 0081 e3fe | ff1f 0085 + 0x0000713e03437864: db0f 84f6 | 0800 0048 + + 0x0000713e0343786c: ; {metadata(method data for {method} {0x0000713db4009ab0} 'length' '()I' in 'java/lang/String')} + 0x0000713e0343786c: 8bcf 48bb | 602d 3eb4 | 3d71 0000 | 4883 8338 | 0100 0001 + + 0x0000713e03437880: ; {metadata(method data for {method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e03437880: 48b9 b825 | 32b4 3d71 | 0000 8b99 | f400 0000 | 83c3 0289 | 99f4 0000 | 0081 e3fe | ff1f 0085 + 0x0000713e034378a0: db0f 84db + + 0x0000713e034378a4: ; {metadata(method data for {method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e034378a4: 0800 0048 | bab8 2532 | b43d 7100 | 00ff 8248 + + 0x0000713e034378b4: ; {metadata(method data for {method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e034378b4: 0100 0048 | bab8 2532 | b43d 7100 | 00ff 8258 | 0100 0048 + + 0x0000713e034378c8: ; {metadata(method data for {method} {0x0000713db400bba0} 'substring' '(I)Ljava/lang/String;' in 'java/lang/String')} + 0x0000713e034378c8: 8bd7 48b9 | 887f bbb4 | 3d71 0000 | 4883 8170 | 0100 0001 | 8b94 24cc | 0000 0048 | 8bce 488b + 0x0000713e034378e8: f766 0f1f + + 0x0000713e034378ec: ; {optimized virtual_call} + 0x0000713e034378ec: 4400 00e8 + + 0x0000713e034378f0: ; ImmutableOopMap {[216]=Oop [224]=Oop } + ;*invokevirtual substring {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::substring@6 + ; - net.starlark.java.eval.Starlark::trimDocString@230 (line 611) + 0x0000713e034378f0: 0c84 1a07 + + 0x0000713e034378f4: ; {other} + 0x0000713e034378f4: 0f1f 8400 | 641e 0015 + + 0x0000713e034378fc: ; {oop(a 'net/starlark/java/eval/StringModule'{0x00000000a20cf5c8})} + 0x0000713e034378fc: 48be c8f5 | 0ca2 0000 + + 0x0000713e03437904: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437904: 0000 48ba | b0a4 deb6 | 3d71 0000 | 4883 82c0 | 0700 0001 + + 0x0000713e03437918: ; {metadata(method data for {method} {0x0000713db6a750f8} 'rstrip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03437918: 48be 9804 | dab6 3d71 | 0000 8b96 | f400 0000 | 83c2 0289 | 96f4 0000 | 0081 e2fe | ff1f 0085 + 0x0000713e03437938: d20f 8464 + + 0x0000713e0343793c: ; {metadata(method data for {method} {0x0000713db6a750f8} 'rstrip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e0343793c: 0800 0048 | be98 04da | b63d 7100 | 00ff 8638 + + 0x0000713e0343794c: ; {metadata(method data for {method} {0x0000713db6a750f8} 'rstrip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e0343794c: 0100 0048 | be98 04da | b63d 7100 | 0048 8386 | b801 0000 + + 0x0000713e03437960: ; {oop(a 'com/google/common/base/CharMatcher$AnyOf'{0x00000000a22264b0})} + 0x0000713e03437960: 0148 bab0 | 6422 a200 | 0000 0048 + + 0x0000713e0343796c: ; {static_call} + 0x0000713e0343796c: 8bf0 90e8 + + 0x0000713e03437970: ; ImmutableOopMap {[216]=Oop [224]=Oop } + ;*invokestatic stringRStrip {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.StringModule::rstrip@23 (line 265) + ; - net.starlark.java.eval.Starlark::trimDocString@236 (line 611) + 0x0000713e03437970: eced faff + + 0x0000713e03437974: ; {other} + 0x0000713e03437974: 0f1f 8400 | e41e 0016 | 488b 9424 | d800 0000 + + 0x0000713e03437984: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437984: 48be b0a4 | deb6 3d71 | 0000 4883 | 86f8 0700 + + 0x0000713e03437994: ; {metadata(method data for {method} {0x0000713db40c9890} 'append' '(Ljava/lang/String;)Ljava/lang/StringBuilder;' in 'java/lang/StringBuilder')} + 0x0000713e03437994: 0001 48ba | f045 2eb4 | 3d71 0000 | 8bb2 f400 | 0000 83c6 | 0289 b2f4 | 0000 0081 | e6fe ff1f + 0x0000713e034379b4: 0085 f60f | 8407 0800 | 0048 8b94 | 24d8 0000 + + 0x0000713e034379c4: ; {metadata(method data for {method} {0x0000713db40c9890} 'append' '(Ljava/lang/String;)Ljava/lang/StringBuilder;' in 'java/lang/StringBuilder')} + 0x0000713e034379c4: 0048 bef0 | 452e b43d | 7100 0048 | 8386 3801 | 0000 0148 | 8bd0 488b | b424 d800 | 0000 0f1f + 0x0000713e034379e4: ; {optimized virtual_call} + 0x0000713e034379e4: 4400 00e8 + + 0x0000713e034379e8: ; ImmutableOopMap {[216]=Oop [224]=Oop } + ;*invokespecial append {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.StringBuilder::append@2 + ; - net.starlark.java.eval.Starlark::trimDocString@239 (line 611) + 0x0000713e034379e8: 94ce 1a07 + + 0x0000713e034379ec: ; {other} + 0x0000713e034379ec: 0f1f 8400 | 5c1f 0017 + + 0x0000713e034379f4: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e034379f4: 48ba b0a4 | deb6 3d71 | 0000 8bb2 | f800 0000 | 83c6 0289 | b2f8 0000 | 0081 e6fe | 3f00 0085 + 0x0000713e03437a14: f60f 84ca | 0700 004d | 8b97 5804 + + 0x0000713e03437a20: ; ImmutableOopMap {[216]=Oop [224]=Oop } + ;*goto {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) net.starlark.java.eval.Starlark::trimDocString@243 (line 613) + ; {poll} + 0x0000713e03437a20: 0000 4185 + + 0x0000713e03437a24: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437a24: 0248 bab0 | a4de b63d | 7100 00ff | 8230 0800 | 0048 8b84 | 24e0 0000 | 00e9 2ef9 | ffff 488b + 0x0000713e03437a44: 9c24 d800 | 0000 488b + + 0x0000713e03437a4c: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437a4c: c348 bab0 | a4de b63d | 7100 0048 | 8382 4808 + + 0x0000713e03437a5c: ; {metadata(method data for {method} {0x0000713db40cb068} 'toString' '()Ljava/lang/String;' in 'java/lang/StringBuilder')} + 0x0000713e03437a5c: 0000 0148 | ba20 542e | b43d 7100 | 008b b2f4 | 0000 0083 | c602 89b2 | f400 0000 | 81e6 feff + 0x0000713e03437a7c: 1f00 85f6 | 0f84 8007 + + 0x0000713e03437a84: ; {metadata('java/lang/String')} + 0x0000713e03437a84: 0000 48ba | 481d 0400 | 0800 0000 | 498b 87b8 | 0100 0048 | 8d78 1849 | 3bbf c801 | 0000 0f87 + 0x0000713e03437aa4: 7f07 0000 | 4989 bfb8 | 0100 0048 | c700 0100 | 0000 488b | ca49 ba00 | 0000 0008 | 0000 0049 + 0x0000713e03437ac4: 2bca 8948 | 0848 33c9 | 8948 0c48 | 33c9 4889 | 4810 488b + + 0x0000713e03437ad8: ; {metadata(method data for {method} {0x0000713db40cb068} 'toString' '()Ljava/lang/String;' in 'java/lang/StringBuilder')} + 0x0000713e03437ad8: d048 b920 | 542e b43d | 7100 0048 | 8381 3801 + + 0x0000713e03437ae8: ; {metadata(method data for {method} {0x0000713db4009a00} '' '(Ljava/lang/StringBuilder;)V' in 'java/lang/String')} + 0x0000713e03437ae8: 0000 0148 | bab8 552e | b43d 7100 | 008b 8af4 | 0000 0083 | c102 898a | f400 0000 | 81e1 feff + 0x0000713e03437b08: 1f00 85c9 | 0f84 2207 | 0000 488b + + 0x0000713e03437b14: ; {metadata(method data for {method} {0x0000713db4009a00} '' '(Ljava/lang/StringBuilder;)V' in 'java/lang/String')} + 0x0000713e03437b14: d048 b9b8 | 552e b43d | 7100 0048 | 8381 3801 | 0000 0148 + + 0x0000713e03437b28: ; {oop(nullptr)} + 0x0000713e03437b28: 8bd3 48b9 | 0000 0000 | 0000 0000 | 488b f048 | 8984 24f0 + + 0x0000713e03437b3c: ; {optimized virtual_call} + 0x0000713e03437b3c: 0000 00e8 + + 0x0000713e03437b40: ; ImmutableOopMap {[240]=Oop } + ;*invokespecial {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::@3 + ; - java.lang.StringBuilder::toString@5 + ; - net.starlark.java.eval.Starlark::trimDocString@251 (line 615) + 0x0000713e03437b40: 9cf9 1b07 + + 0x0000713e03437b44: ; {other} + 0x0000713e03437b44: 0f1f 8400 | b420 0019 + + 0x0000713e03437b4c: ; {oop(a 'net/starlark/java/eval/StringModule'{0x00000000a20cf5c8})} + 0x0000713e03437b4c: 48be c8f5 | 0ca2 0000 + + 0x0000713e03437b54: ; {metadata(method data for {method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437b54: 0000 48ba | b0a4 deb6 | 3d71 0000 | 4883 8280 | 0800 0001 + + 0x0000713e03437b68: ; {metadata(method data for {method} {0x0000713db6a750f8} 'rstrip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03437b68: 48be 9804 | dab6 3d71 | 0000 8b96 | f400 0000 | 83c2 0289 | 96f4 0000 | 0081 e2fe | ff1f 0085 + 0x0000713e03437b88: d20f 84c6 + + 0x0000713e03437b8c: ; {metadata(method data for {method} {0x0000713db6a750f8} 'rstrip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03437b8c: 0600 0048 | be98 04da | b63d 7100 | 00ff 8638 | 0100 0048 | 8b84 24f0 + + 0x0000713e03437ba4: ; {metadata(method data for {method} {0x0000713db6a750f8} 'rstrip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03437ba4: 0000 0048 | be98 04da | b63d 7100 | 0048 8386 | b801 0000 + + 0x0000713e03437bb8: ; {oop(a 'com/google/common/base/CharMatcher$AnyOf'{0x00000000a22264b0})} + 0x0000713e03437bb8: 0148 bab0 | 6422 a200 | 0000 0048 + + 0x0000713e03437bc4: ; {static_call} + 0x0000713e03437bc4: 8bf0 90e8 + + 0x0000713e03437bc8: ; ImmutableOopMap {} + ;*invokestatic stringRStrip {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.StringModule::rstrip@23 (line 265) + ; - net.starlark.java.eval.Starlark::trimDocString@257 (line 615) + 0x0000713e03437bc8: 94eb faff + + 0x0000713e03437bcc: ; {other} + 0x0000713e03437bcc: 0f1f 8400 | 3c21 001a | 4881 c410 | 0100 005d + + 0x0000713e03437bdc: ; {poll_return} + 0x0000713e03437bdc: 493b a750 | 0400 000f | 878d 0600 + + 0x0000713e03437be8: ; {oop(""{0x00000000a0002e10})} + 0x0000713e03437be8: 00c3 48b8 | 102e 00a0 | 0000 0000 | 4881 c410 | 0100 005d + + 0x0000713e03437bfc: ; {poll_return} + 0x0000713e03437bfc: 493b a750 | 0400 000f | 8783 0600 | 00c3 660f | 1f44 0000 + + 0x0000713e03437c10: ; {no_reloc} + 0x0000713e03437c10: e99c 0600 | 0000 0000 | 0000 e99c | 0600 0048 + + 0x0000713e03437c20: ; {metadata(method data for {method} {0x0000713db4552568} 'checkNotNull' '(Ljava/lang/Object;)Ljava/lang/Object;' in 'com/google/common/base/Preconditions')} + 0x0000713e03437c20: 8bf0 48ba | b090 e2b4 | 3d71 0000 | 4883 8258 | 0100 0001 | 488b f048 | 8984 24f8 + + 0x0000713e03437c3c: ; {optimized virtual_call} + 0x0000713e03437c3c: 0000 00e8 + + 0x0000713e03437c40: ; ImmutableOopMap {[160]=Oop [176]=Oop [248]=Oop } + ;*invokespecial {reexecute=0 rethrow=0 return_oop=0} + ; - com.google.common.base.Preconditions::checkNotNull@8 (line 903) + ; - com.google.common.collect.Iterables::skip@1 (line 905) + ; - net.starlark.java.eval.Starlark::trimDocString@52 (line 590) + 0x0000713e03437c40: 3c5b a706 + + 0x0000713e03437c44: ; {other} + 0x0000713e03437c44: 0f1f 8400 | b421 001b | 488b 8424 | f800 0000 | e98c 0600 + + 0x0000713e03437c58: ; {metadata({method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03437c58: 0049 ba90 | ef01 b53d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e03437c70: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437c70: e80b 70b4 + + 0x0000713e03437c74: ; ImmutableOopMap {rsi=Oop } + ;*synchronization entry + ; - net.starlark.java.eval.Starlark::trimDocString@-1 (line 584) + 0x0000713e03437c74: 06e9 8ce3 + + 0x0000713e03437c78: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e03437c78: ffff e8a1 + + 0x0000713e03437c7c: ; ImmutableOopMap {rax=Oop } + ;*invokevirtual lines {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@6 (line 584) + ; {metadata({method} {0x0000713db400d528} 'lines' '()Ljava/util/stream/Stream;' in 'java/lang/String')} + 0x0000713e03437c7c: 16b4 0649 | ba28 d500 | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e03437c94: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437c94: ffff e8e5 + + 0x0000713e03437c98: ; ImmutableOopMap {rax=Oop } + ;*synchronization entry + ; - java.lang.String::lines@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@6 (line 584) + 0x0000713e03437c98: 6fb4 06e9 | cbe3 ffff + + 0x0000713e03437ca0: ; {metadata({method} {0x0000713db400f480} 'isLatin1' '()Z' in 'java/lang/String')} + 0x0000713e03437ca0: 49ba 80f4 | 00b4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e03437cb4: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437cb4: ffff ffe8 + + 0x0000713e03437cb8: ; ImmutableOopMap {rax=Oop } + ;*synchronization entry + ; - java.lang.String::isLatin1@-1 + ; - java.lang.String::lines@1 + ; - net.starlark.java.eval.Starlark::trimDocString@6 (line 584) + 0x0000713e03437cb8: c46f b406 | e9e6 e3ff + + 0x0000713e03437cc0: ; {metadata({method} {0x0000713db4188200} 'lines' '([B)Ljava/util/stream/Stream;' in 'java/lang/StringLatin1')} + 0x0000713e03437cc0: ff49 ba00 | 8218 b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e03437cd8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437cd8: e8a3 6fb4 + + 0x0000713e03437cdc: ; ImmutableOopMap {rsi=Oop } + ;*synchronization entry + ; - java.lang.StringLatin1::lines@-1 + ; - java.lang.String::lines@11 + ; - net.starlark.java.eval.Starlark::trimDocString@6 (line 584) + 0x0000713e03437cdc: 06e9 97e4 + + 0x0000713e03437ce0: ; {metadata({method} {0x0000713db455b9e8} 'lines' '([B)Ljava/util/stream/Stream;' in 'java/lang/StringUTF16')} + 0x0000713e03437ce0: ffff 49ba | e8b9 55b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e03437cf8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437cf8: ffe8 826f + + 0x0000713e03437cfc: ; ImmutableOopMap {rsi=Oop } + ;*synchronization entry + ; - java.lang.StringUTF16::lines@-1 + ; - java.lang.String::lines@21 + ; - net.starlark.java.eval.Starlark::trimDocString@6 (line 584) + 0x0000713e03437cfc: b406 e916 + + 0x0000713e03437d00: ; {metadata({method} {0x0000713db4546c10} 'toImmutableList' '()Ljava/util/stream/Collector;' in 'com/google/common/collect/ImmutableList')} + 0x0000713e03437d00: e5ff ff49 | ba10 6c54 | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e03437d18: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437d18: ffff e861 + + 0x0000713e03437d1c: ; ImmutableOopMap {rax=Oop } + ;*synchronization entry + ; - com.google.common.collect.ImmutableList::toImmutableList@-1 (line 76) + ; - net.starlark.java.eval.Starlark::trimDocString@9 (line 584) + 0x0000713e03437d1c: 6fb4 06e9 | 69e5 ffff + + 0x0000713e03437d24: ; {metadata({method} {0x0000713db4ce4320} 'toImmutableList' '()Ljava/util/stream/Collector;' in 'com/google/common/collect/CollectCollectors')} + 0x0000713e03437d24: 49ba 2043 | ceb4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e03437d38: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437d38: ffff ffe8 + + 0x0000713e03437d3c: ; ImmutableOopMap {rax=Oop } + ;*synchronization entry + ; - com.google.common.collect.CollectCollectors::toImmutableList@-1 (line 75) + ; - com.google.common.collect.ImmutableList::toImmutableList@0 (line 76) + ; - net.starlark.java.eval.Starlark::trimDocString@9 (line 584) + 0x0000713e03437d3c: 406f b406 | e981 e5ff + + 0x0000713e03437d44: ; {runtime_call throw_incompatible_class_change_error Runtime1 stub} + 0x0000713e03437d44: ffe8 d640 + + 0x0000713e03437d48: ; ImmutableOopMap {rax=Oop } + ;*invokeinterface collect {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@12 (line 584) + ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e03437d48: b406 e8d1 + + 0x0000713e03437d4c: ; ImmutableOopMap {rax=Oop } + ;*invokeinterface collect {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@12 (line 584) + 0x0000713e03437d4c: 15b4 0648 + + 0x0000713e03437d50: ; {runtime_call throw_class_cast_exception Runtime1 stub} + 0x0000713e03437d50: 8904 24e8 + + 0x0000713e03437d54: ; ImmutableOopMap {} + ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@17 (line 584) + 0x0000713e03437d54: c83d b406 + + 0x0000713e03437d58: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e03437d58: e8c3 15b4 + + 0x0000713e03437d5c: ; ImmutableOopMap {rdi=Oop [160]=Oop } + ;*invokevirtual isEmpty {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@22 (line 585) + 0x0000713e03437d5c: 0648 8904 + + 0x0000713e03437d60: ; {runtime_call throw_class_cast_exception Runtime1 stub} + 0x0000713e03437d60: 24e8 ba3d + + 0x0000713e03437d64: ; ImmutableOopMap {[160]=Oop } + ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@40 (line 589) + ; {metadata({method} {0x0000713db6a75268} 'strip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03437d64: b406 49ba | 6852 a7b6 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e03437d7c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437d7c: ffe8 fe6e + + 0x0000713e03437d80: ; ImmutableOopMap {rsi=Oop [160]=Oop } + ;*synchronization entry + ; - net.starlark.java.eval.StringModule::strip@-1 (line 291) + ; - net.starlark.java.eval.Starlark::trimDocString@46 (line 589) + 0x0000713e03437d80: b406 e9ea + + 0x0000713e03437d84: ; {metadata({method} {0x0000713db6a74e80} 'stringStrip' '(Ljava/lang/String;Lcom/google/common/base/CharMatcher;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03437d84: e9ff ff49 | ba80 4ea7 | b63d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e03437d9c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437d9c: ffff e8dd + + 0x0000713e03437da0: ; ImmutableOopMap {rsi=Oop [160]=Oop } + ;*synchronization entry + ; - net.starlark.java.eval.StringModule::stringStrip@-1 (line 213) + ; - net.starlark.java.eval.StringModule::strip@23 (line 292) + ; - net.starlark.java.eval.Starlark::trimDocString@46 (line 589) + 0x0000713e03437da0: 6eb4 06e9 | 12ea ffff + + 0x0000713e03437da8: ; {metadata({method} {0x0000713db4cb91d8} 'skip' '(Ljava/lang/Iterable;I)Ljava/lang/Iterable;' in 'com/google/common/collect/Iterables')} + 0x0000713e03437da8: 49ba d891 | cbb4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e03437dbc: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437dbc: ffff ffe8 + + 0x0000713e03437dc0: ; ImmutableOopMap {rax=Oop rdi=Oop [160]=Oop [176]=Oop } + ;*synchronization entry + ; - com.google.common.collect.Iterables::skip@-1 (line 905) + ; - net.starlark.java.eval.Starlark::trimDocString@52 (line 590) + 0x0000713e03437dc0: bc6e b406 | e9a4 eaff + + 0x0000713e03437dc8: ; {metadata({method} {0x0000713db4552568} 'checkNotNull' '(Ljava/lang/Object;)Ljava/lang/Object;' in 'com/google/common/base/Preconditions')} + 0x0000713e03437dc8: ff49 ba68 | 2555 b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e03437de0: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437de0: e89b 6eb4 + + 0x0000713e03437de4: ; ImmutableOopMap {rax=Oop rdi=Oop [160]=Oop [176]=Oop } + ;*synchronization entry + ; - com.google.common.base.Preconditions::checkNotNull@-1 (line 902) + ; - com.google.common.collect.Iterables::skip@1 (line 905) + ; - net.starlark.java.eval.Starlark::trimDocString@52 (line 590) + 0x0000713e03437de4: 06e9 bcea + + 0x0000713e03437de8: ; {metadata({method} {0x0000713db454ec40} 'checkArgument' '(ZLjava/lang/Object;)V' in 'com/google/common/base/Preconditions')} + 0x0000713e03437de8: ffff 49ba | 40ec 54b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e03437e00: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437e00: ffe8 7a6e + + 0x0000713e03437e04: ; ImmutableOopMap {rax=Oop rdi=Oop [160]=Oop [176]=Oop } + ;*synchronization entry + ; - com.google.common.base.Preconditions::checkArgument@-1 (line 142) + ; - com.google.common.collect.Iterables::skip@16 (line 906) + ; - net.starlark.java.eval.Starlark::trimDocString@52 (line 590) + 0x0000713e03437e04: b406 e923 | ebff ff48 + + 0x0000713e03437e0c: ; {runtime_call fast_new_instance Runtime1 stub} + 0x0000713e03437e0c: 8bd2 e8ed + + 0x0000713e03437e10: ; ImmutableOopMap {rbx=Oop [160]=Oop [176]=Oop } + ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - com.google.common.collect.Iterables::skip@19 (line 908) + ; - net.starlark.java.eval.Starlark::trimDocString@52 (line 590) + 0x0000713e03437e10: 1eb4 06e9 | 79eb ffff + + 0x0000713e03437e18: ; {metadata({method} {0x0000713db6a7a5e0} '' '(Ljava/lang/Iterable;I)V' in 'com/google/common/collect/Iterables$6')} + 0x0000713e03437e18: 49ba e0a5 | a7b6 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e03437e2c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437e2c: ffff ffe8 + + 0x0000713e03437e30: ; ImmutableOopMap {rbx=Oop rax=Oop [160]=Oop [176]=Oop [184]=Oop } + ;*synchronization entry + ; - com.google.common.collect.Iterables$6::@-1 (line 908) + ; - com.google.common.collect.Iterables::skip@25 (line 908) + ; - net.starlark.java.eval.Starlark::trimDocString@52 (line 590) + 0x0000713e03437e30: 4c6e b406 | e99c ebff | ff8b 7014 | 48c1 e603 | 4883 fe00 | 0f84 98eb | ffff 4889 + + 0x0000713e03437e4c: ; {runtime_call g1_pre_barrier_slow} + 0x0000713e03437e4c: 3424 e8ad | 7db4 06e9 | 8aeb ffff | 4883 fb00 | 0f84 9feb | ffff 4889 + + 0x0000713e03437e64: ; {runtime_call g1_post_barrier_slow} + 0x0000713e03437e64: 0424 e815 | 81b4 06e9 | 91eb ffff + + 0x0000713e03437e70: ; {metadata({method} {0x0000713db5174dd0} '' '()V' in 'com/google/common/collect/FluentIterable')} + 0x0000713e03437e70: 49ba d04d | 17b5 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e03437e84: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437e84: ffff ffe8 + + 0x0000713e03437e88: ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop } + ;*synchronization entry + ; - com.google.common.collect.FluentIterable::@-1 (line 122) + ; - com.google.common.collect.Iterables$6::@11 (line 908) + ; - com.google.common.collect.Iterables::skip@25 (line 908) + ; - net.starlark.java.eval.Starlark::trimDocString@52 (line 590) + 0x0000713e03437e88: f46d b406 | e9b3 ebff + + 0x0000713e03437e90: ; {metadata({method} {0x0000713db4000630} '' '()V' in 'java/lang/Object')} + 0x0000713e03437e90: ff49 ba30 | 0600 b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e03437ea8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437ea8: e8d3 6db4 + + 0x0000713e03437eac: ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop } + ;*synchronization entry + ; - java.lang.Object::@-1 + ; - com.google.common.collect.FluentIterable::@1 (line 122) + ; - com.google.common.collect.Iterables$6::@11 (line 908) + ; - com.google.common.collect.Iterables::skip@25 (line 908) + ; - net.starlark.java.eval.Starlark::trimDocString@52 (line 590) + 0x0000713e03437eac: 06e9 ceeb + + 0x0000713e03437eb0: ; {metadata({method} {0x0000713db5179fc0} 'absent' '()Lcom/google/common/base/Optional;' in 'com/google/common/base/Optional')} + 0x0000713e03437eb0: ffff 49ba | c09f 17b5 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e03437ec8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437ec8: ffe8 b26d + + 0x0000713e03437ecc: ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop } + ;*synchronization entry + ; - com.google.common.base.Optional::absent@-1 (line 96) + ; - com.google.common.collect.FluentIterable::@5 (line 123) + ; - com.google.common.collect.Iterables$6::@11 (line 908) + ; - com.google.common.collect.Iterables::skip@25 (line 908) + ; - net.starlark.java.eval.Starlark::trimDocString@52 (line 590) + 0x0000713e03437ecc: b406 e9e6 + + 0x0000713e03437ed0: ; {metadata({method} {0x0000713db517b398} 'withType' '()Lcom/google/common/base/Optional;' in 'com/google/common/base/Absent')} + 0x0000713e03437ed0: ebff ff49 | ba98 b317 | b53d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e03437ee8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437ee8: ffff e891 + + 0x0000713e03437eec: ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop } + ;*synchronization entry + ; - com.google.common.base.Absent::withType@-1 (line 32) + ; - com.google.common.base.Optional::absent@0 (line 96) + ; - com.google.common.collect.FluentIterable::@5 (line 123) + ; - com.google.common.collect.Iterables$6::@11 (line 908) + ; - com.google.common.collect.Iterables::skip@25 (line 908) + ; - net.starlark.java.eval.Starlark::trimDocString@52 (line 590) + 0x0000713e03437eec: 6db4 06e9 | feeb ffff | 8b70 0c48 | c1e6 0348 | 83fe 000f | 84fa ebff | ff48 8934 + + 0x0000713e03437f08: ; {runtime_call g1_pre_barrier_slow} + 0x0000713e03437f08: 24e8 f27c | b406 e9ec | ebff ff48 | 83fe 000f | 8412 ecff | ff48 8904 + + 0x0000713e03437f20: ; {runtime_call g1_post_barrier_slow} + 0x0000713e03437f20: 24e8 5a80 | b406 e904 + + 0x0000713e03437f28: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e03437f28: ecff ffe8 + + 0x0000713e03437f2c: ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*invokeinterface hasNext {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@71 (line 592) + 0x0000713e03437f2c: f013 b406 | 4889 0424 + + 0x0000713e03437f34: ; {runtime_call throw_class_cast_exception Runtime1 stub} + 0x0000713e03437f34: e8e7 3bb4 + + 0x0000713e03437f38: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop } + ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@86 (line 592) + ; {metadata({method} {0x0000713db6a74f88} 'lstrip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03437f38: 0649 ba88 | 4fa7 b63d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e03437f50: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437f50: e82b 6db4 + + 0x0000713e03437f54: ; ImmutableOopMap {rdi=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*synchronization entry + ; - net.starlark.java.eval.StringModule::lstrip@-1 (line 238) + ; - net.starlark.java.eval.Starlark::trimDocString@99 (line 593) + 0x0000713e03437f54: 06e9 efee + + 0x0000713e03437f58: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e03437f58: ffff e8c1 + + 0x0000713e03437f5c: ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop [192]=Oop [208]=Oop } + ;*invokevirtual isEmpty {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@106 (line 594) + ; {metadata({method} {0x0000713db4009b60} 'isEmpty' '()Z' in 'java/lang/String')} + 0x0000713e03437f5c: 13b4 0649 | ba60 9b00 | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e03437f74: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437f74: ffff e805 + + 0x0000713e03437f78: ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop [192]=Oop [208]=Oop } + ;*synchronization entry + ; - java.lang.String::isEmpty@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@106 (line 594) + 0x0000713e03437f78: 6db4 06e9 | 53ef ffff + + 0x0000713e03437f80: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e03437f80: e89b 13b4 + + 0x0000713e03437f84: ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop [192]=Oop [208]=Oop } + ;*arraylength {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::isEmpty@4 + ; - net.starlark.java.eval.Starlark::trimDocString@106 (line 594) + ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e03437f84: 06e8 9613 + + 0x0000713e03437f88: ; ImmutableOopMap {rdi=Oop rax=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*invokevirtual length {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@114 (line 595) + ; {metadata({method} {0x0000713db4009ab0} 'length' '()I' in 'java/lang/String')} + 0x0000713e03437f88: b406 49ba | b09a 00b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e03437fa0: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437fa0: ffe8 da6c + + 0x0000713e03437fa4: ; ImmutableOopMap {rdi=Oop rax=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*synchronization entry + ; - java.lang.String::length@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@114 (line 595) + 0x0000713e03437fa4: b406 e903 + + 0x0000713e03437fa8: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e03437fa8: f0ff ffe8 + + 0x0000713e03437fac: ; ImmutableOopMap {rdi=Oop rax=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*arraylength {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@4 + ; - net.starlark.java.eval.Starlark::trimDocString@114 (line 595) + 0x0000713e03437fac: 7013 b406 + + 0x0000713e03437fb0: ; {metadata({method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e03437fb0: 49ba 10f3 | 00b4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e03437fc4: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437fc4: ffff ffe8 + + 0x0000713e03437fc8: ; ImmutableOopMap {rdi=Oop rax=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*synchronization entry + ; - java.lang.String::coder@-1 + ; - java.lang.String::length@6 + ; - net.starlark.java.eval.Starlark::trimDocString@114 (line 595) + 0x0000713e03437fc8: b46c b406 | e923 f0ff + + 0x0000713e03437fd0: ; {metadata({method} {0x0000713db4009ab0} 'length' '()I' in 'java/lang/String')} + 0x0000713e03437fd0: ff49 bab0 | 9a00 b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e03437fe8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03437fe8: e893 6cb4 + + 0x0000713e03437fec: ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*synchronization entry + ; - java.lang.String::length@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@119 (line 595) + 0x0000713e03437fec: 06e9 6af0 + + 0x0000713e03437ff0: ; {metadata({method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e03437ff0: ffff 49ba | 10f3 00b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e03438008: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03438008: ffe8 726c + + 0x0000713e0343800c: ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*synchronization entry + ; - java.lang.String::coder@-1 + ; - java.lang.String::length@6 + ; - net.starlark.java.eval.Starlark::trimDocString@119 (line 595) + 0x0000713e0343800c: b406 e985 + + 0x0000713e03438010: ; {metadata({method} {0x0000713db418dd40} 'min' '(II)I' in 'java/lang/Math')} + 0x0000713e03438010: f0ff ff49 | ba40 dd18 | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e03438028: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03438028: ffff e851 + + 0x0000713e0343802c: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop } + ;*synchronization entry + ; - java.lang.Math::min@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@129 (line 596) + 0x0000713e0343802c: 6cb4 06e9 | cbf0 ffff + + 0x0000713e03438034: ; {metadata({method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e03438034: 49ba 90ef | 01b5 3d71 | 0000 4c89 | 5424 0848 | c704 2486 + + 0x0000713e03438048: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03438048: 0000 00e8 + + 0x0000713e0343804c: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop } + ;*goto {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) net.starlark.java.eval.Starlark::trimDocString@134 (line 598) + 0x0000713e0343804c: 306c b406 | e923 f1ff | ff48 8bd2 + + 0x0000713e03438058: ; {runtime_call fast_new_instance Runtime1 stub} + 0x0000713e03438058: e8a3 1cb4 + + 0x0000713e0343805c: ; ImmutableOopMap {[176]=Oop [184]=Oop } + ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@148 (line 603) + 0x0000713e0343805c: 06e9 d9f1 + + 0x0000713e03438060: ; {metadata({method} {0x0000713db40c9450} '' '()V' in 'java/lang/StringBuilder')} + 0x0000713e03438060: ffff 49ba | 5094 0cb4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e03438078: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03438078: ffe8 026c + + 0x0000713e0343807c: ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop [216]=Oop } + ;*synchronization entry + ; - java.lang.StringBuilder::@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@152 (line 603) + 0x0000713e0343807c: b406 e9fc + + 0x0000713e03438080: ; {metadata({method} {0x0000713db40c9890} 'append' '(Ljava/lang/String;)Ljava/lang/StringBuilder;' in 'java/lang/StringBuilder')} + 0x0000713e03438080: f1ff ff49 | ba90 980c | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e03438098: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03438098: ffff e8e1 + + 0x0000713e0343809c: ; ImmutableOopMap {[176]=Oop [184]=Oop [216]=Oop } + ;*synchronization entry + ; - java.lang.StringBuilder::append@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@160 (line 604) + 0x0000713e0343809c: 6bb4 06e9 | 49f2 ffff + + 0x0000713e034380a4: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e034380a4: e877 12b4 + + 0x0000713e034380a8: ; ImmutableOopMap {rax=Oop [216]=Oop [224]=Oop } + ;*invokeinterface hasNext {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@174 (line 605) + 0x0000713e034380a8: 0648 8904 + + 0x0000713e034380ac: ; {runtime_call throw_class_cast_exception Runtime1 stub} + 0x0000713e034380ac: 24e8 6e3a + + 0x0000713e034380b0: ; ImmutableOopMap {[216]=Oop [224]=Oop } + ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@189 (line 605) + ; {metadata({method} {0x0000713db40cd2f0} 'length' '()I' in 'java/lang/StringBuilder')} + 0x0000713e034380b0: b406 49ba | f0d2 0cb4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e034380c8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e034380c8: ffe8 b26b + + 0x0000713e034380cc: ; ImmutableOopMap {rdi=Oop [216]=Oop [224]=Oop } + ;*synchronization entry + ; - java.lang.StringBuilder::length@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@196 (line 607) + 0x0000713e034380cc: b406 e964 + + 0x0000713e034380d0: ; {metadata({method} {0x0000713db40c9890} 'append' '(Ljava/lang/String;)Ljava/lang/StringBuilder;' in 'java/lang/StringBuilder')} + 0x0000713e034380d0: f5ff ff49 | ba90 980c | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e034380e8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e034380e8: ffff e891 + + 0x0000713e034380ec: ; ImmutableOopMap {rax=Oop [216]=Oop [224]=Oop [232]=Oop } + ;*synchronization entry + ; - java.lang.StringBuilder::append@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@207 (line 608) + 0x0000713e034380ec: 6bb4 06e9 | daf5 ffff + + 0x0000713e034380f4: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e034380f4: e827 12b4 + + 0x0000713e034380f8: ; ImmutableOopMap {rdi=Oop [216]=Oop [224]=Oop } + ;*invokevirtual length {reexecute=0 rethrow=0 return_oop=0} + ; - net.starlark.java.eval.Starlark::trimDocString@213 (line 610) + ; {metadata({method} {0x0000713db4009ab0} 'length' '()I' in 'java/lang/String')} + 0x0000713e034380f8: 0649 bab0 | 9a00 b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e03438110: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03438110: e86b 6bb4 + + 0x0000713e03438114: ; ImmutableOopMap {rdi=Oop [216]=Oop [224]=Oop } + ;*synchronization entry + ; - java.lang.String::length@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@213 (line 610) + 0x0000713e03438114: 06e9 31f6 + + 0x0000713e03438118: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e03438118: ffff e801 + + 0x0000713e0343811c: ; ImmutableOopMap {rdi=Oop [216]=Oop [224]=Oop } + ;*arraylength {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@4 + ; - net.starlark.java.eval.Starlark::trimDocString@213 (line 610) + ; {metadata({method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e0343811c: 12b4 0649 | ba10 f300 | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e03438134: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03438134: ffff e845 + + 0x0000713e03438138: ; ImmutableOopMap {rdi=Oop [216]=Oop [224]=Oop } + ;*synchronization entry + ; - java.lang.String::coder@-1 + ; - java.lang.String::length@6 + ; - net.starlark.java.eval.Starlark::trimDocString@213 (line 610) + 0x0000713e03438138: 6bb4 06e9 | 51f6 ffff + + 0x0000713e03438140: ; {metadata({method} {0x0000713db400bba0} 'substring' '(I)Ljava/lang/String;' in 'java/lang/String')} + 0x0000713e03438140: 49ba a0bb | 00b4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e03438154: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03438154: ffff ffe8 + + 0x0000713e03438158: ; ImmutableOopMap {rdi=Oop [216]=Oop [224]=Oop } + ;*synchronization entry + ; - java.lang.String::substring@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@230 (line 611) + 0x0000713e03438158: 246b b406 | e9ce f6ff + + 0x0000713e03438160: ; {metadata({method} {0x0000713db4009ab0} 'length' '()I' in 'java/lang/String')} + 0x0000713e03438160: ff49 bab0 | 9a00 b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e03438178: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03438178: e803 6bb4 + + 0x0000713e0343817c: ; ImmutableOopMap {rdi=Oop [216]=Oop [224]=Oop } + ;*synchronization entry + ; - java.lang.String::length@-1 + ; - java.lang.String::substring@3 + ; - net.starlark.java.eval.Starlark::trimDocString@230 (line 611) + 0x0000713e0343817c: 06e9 e9f6 + + 0x0000713e03438180: ; {metadata({method} {0x0000713db400f310} 'coder' '()B' in 'java/lang/String')} + 0x0000713e03438180: ffff 49ba | 10f3 00b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e03438198: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03438198: ffe8 e26a + + 0x0000713e0343819c: ; ImmutableOopMap {rdi=Oop [216]=Oop [224]=Oop } + ;*synchronization entry + ; - java.lang.String::coder@-1 + ; - java.lang.String::length@6 + ; - java.lang.String::substring@3 + ; - net.starlark.java.eval.Starlark::trimDocString@230 (line 611) + 0x0000713e0343819c: b406 e904 + + 0x0000713e034381a0: ; {metadata({method} {0x0000713db6a750f8} 'rstrip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e034381a0: f7ff ff49 | baf8 50a7 | b63d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e034381b8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e034381b8: ffff e8c1 + + 0x0000713e034381bc: ; ImmutableOopMap {rax=Oop [216]=Oop [224]=Oop } + ;*synchronization entry + ; - net.starlark.java.eval.StringModule::rstrip@-1 (line 264) + ; - net.starlark.java.eval.Starlark::trimDocString@236 (line 611) + 0x0000713e034381bc: 6ab4 06e9 | 7bf7 ffff + + 0x0000713e034381c4: ; {metadata({method} {0x0000713db40c9890} 'append' '(Ljava/lang/String;)Ljava/lang/StringBuilder;' in 'java/lang/StringBuilder')} + 0x0000713e034381c4: 49ba 9098 | 0cb4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e034381d8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e034381d8: ffff ffe8 + + 0x0000713e034381dc: ; ImmutableOopMap {rax=Oop [216]=Oop [224]=Oop } + ;*synchronization entry + ; - java.lang.StringBuilder::append@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@239 (line 611) + 0x0000713e034381dc: a06a b406 | e9d8 f7ff + + 0x0000713e034381e4: ; {metadata({method} {0x0000713db501ef90} 'trimDocString' '(Ljava/lang/String;)Ljava/lang/String;' in 'net/starlark/java/eval/Starlark')} + 0x0000713e034381e4: ff49 ba90 | ef01 b53d | 7100 004c | 8954 2408 | 48c7 0424 | f300 0000 + + 0x0000713e034381fc: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e034381fc: e87f 6ab4 + + 0x0000713e03438200: ; ImmutableOopMap {[216]=Oop [224]=Oop } + ;*goto {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) net.starlark.java.eval.Starlark::trimDocString@243 (line 613) + 0x0000713e03438200: 06e9 15f8 + + 0x0000713e03438204: ; {metadata({method} {0x0000713db40cb068} 'toString' '()Ljava/lang/String;' in 'java/lang/StringBuilder')} + 0x0000713e03438204: ffff 49ba | 68b0 0cb4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e0343821c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e0343821c: ffe8 5e6a + + 0x0000713e03438220: ; ImmutableOopMap {rbx=Oop [216]=Oop } + ;*synchronization entry + ; - java.lang.StringBuilder::toString@-1 + ; - net.starlark.java.eval.Starlark::trimDocString@251 (line 615) + 0x0000713e03438220: b406 e95f | f8ff ff48 + + 0x0000713e03438228: ; {runtime_call fast_new_instance Runtime1 stub} + 0x0000713e03438228: 8bd2 e8d1 + + 0x0000713e0343822c: ; ImmutableOopMap {rbx=Oop [216]=Oop } + ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.StringBuilder::toString@0 + ; - net.starlark.java.eval.Starlark::trimDocString@251 (line 615) + 0x0000713e0343822c: 1ab4 06e9 | a2f8 ffff + + 0x0000713e03438234: ; {metadata({method} {0x0000713db4009a00} '' '(Ljava/lang/StringBuilder;)V' in 'java/lang/String')} + 0x0000713e03438234: 49ba 009a | 00b4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e03438248: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e03438248: ffff ffe8 + + 0x0000713e0343824c: ; ImmutableOopMap {rbx=Oop rax=Oop [216]=Oop } + ;*synchronization entry + ; - java.lang.String::@-1 + ; - java.lang.StringBuilder::toString@5 + ; - net.starlark.java.eval.Starlark::trimDocString@251 (line 615) + 0x0000713e0343824c: 306a b406 | e9bd f8ff + + 0x0000713e03438254: ; {metadata({method} {0x0000713db6a750f8} 'rstrip' '(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;' in 'net/starlark/java/eval/StringModule')} + 0x0000713e03438254: ff49 baf8 | 50a7 b63d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e0343826c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e0343826c: e80f 6ab4 + + 0x0000713e03438270: ; ImmutableOopMap {[240]=Oop } + ;*synchronization entry + ; - net.starlark.java.eval.StringModule::rstrip@-1 (line 264) + ; - net.starlark.java.eval.Starlark::trimDocString@257 (line 615) + 0x0000713e03438270: 06e9 19f9 + + 0x0000713e03438274: ; {internal_word} + 0x0000713e03438274: ffff 49ba | dc7b 4303 | 3e71 0000 | 4d89 9768 + + 0x0000713e03438284: ; {runtime_call SafepointBlob} + 0x0000713e03438284: 0400 00e9 | 74d1 a706 + + 0x0000713e0343828c: ; {internal_word} + 0x0000713e0343828c: 49ba fc7b | 4303 3e71 | 0000 4d89 | 9768 0400 + + 0x0000713e0343829c: ; {runtime_call SafepointBlob} + 0x0000713e0343829c: 00e9 5ed1 + + 0x0000713e034382a0: ; {metadata(nullptr)} + 0x0000713e034382a0: a706 48ba | 0000 0000 | 0000 0000 | b800 0f05 + + 0x0000713e034382b0: ; {runtime_call load_klass_patching Runtime1 stub} + 0x0000713e034382b0: 0ae8 ca57 + + 0x0000713e034382b4: ; ImmutableOopMap {[160]=Oop [176]=Oop } + ;*new {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) com.google.common.base.Preconditions::checkNotNull@4 (line 903) + ; - com.google.common.collect.Iterables::skip@1 (line 905) + ; - net.starlark.java.eval.Starlark::trimDocString@52 (line 590) + 0x0000713e034382b4: b406 e955 | f9ff ff48 + + 0x0000713e034382bc: ; {runtime_call new_instance Runtime1 stub} + 0x0000713e034382bc: 8bd2 e8bd + + 0x0000713e034382c0: ; ImmutableOopMap {[160]=Oop [176]=Oop } + ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - com.google.common.base.Preconditions::checkNotNull@4 (line 903) + ; - com.google.common.collect.Iterables::skip@1 (line 905) + ; - net.starlark.java.eval.Starlark::trimDocString@52 (line 590) + 0x0000713e034382c0: 16b4 06e9 | 57f9 ffff | 498b 8700 | 0500 0049 | c787 0005 | 0000 0000 | 0000 49c7 | 8708 0500 + 0x0000713e034382e0: 0000 0000 | 0048 81c4 | 1001 0000 + + 0x0000713e034382ec: ; {runtime_call unwind_exception Runtime1 stub} + 0x0000713e034382ec: 5de9 0e01 | b406 f4f4 | f4f4 f4f4 +[Stub Code] + 0x0000713e034382f8: ; {no_reloc} + 0x0000713e034382f8: 0f1f 4400 + + 0x0000713e034382fc: ; {static_stub} + 0x0000713e034382fc: 0048 bb00 | 0000 0000 + + 0x0000713e03438304: ; {runtime_call nmethod} + 0x0000713e03438304: 0000 00e9 | fbff ffff + + 0x0000713e0343830c: ; {static_stub} + 0x0000713e0343830c: 9048 bb00 | 0000 0000 + + 0x0000713e03438314: ; {runtime_call nmethod} + 0x0000713e03438314: 0000 00e9 | fbff ffff + + 0x0000713e0343831c: ; {static_stub} + 0x0000713e0343831c: 9048 bb00 | 0000 0000 + + 0x0000713e03438324: ; {runtime_call nmethod} + 0x0000713e03438324: 0000 00e9 | fbff ffff + + 0x0000713e0343832c: ; {static_stub} + 0x0000713e0343832c: 9048 bb00 | 0000 0000 + + 0x0000713e03438334: ; {runtime_call nmethod} + 0x0000713e03438334: 0000 00e9 | fbff ffff + + 0x0000713e0343833c: ; {static_stub} + 0x0000713e0343833c: 9048 bb00 | 0000 0000 + + 0x0000713e03438344: ; {runtime_call nmethod} + 0x0000713e03438344: 0000 00e9 | fbff ffff + + 0x0000713e0343834c: ; {static_stub} + 0x0000713e0343834c: 9048 bb00 | 0000 0000 + + 0x0000713e03438354: ; {runtime_call nmethod} + 0x0000713e03438354: 0000 00e9 | fbff ffff + + 0x0000713e0343835c: ; {static_stub} + 0x0000713e0343835c: 9048 bb00 | 0000 0000 + + 0x0000713e03438364: ; {runtime_call nmethod} + 0x0000713e03438364: 0000 00e9 | fbff ffff + + 0x0000713e0343836c: ; {static_stub} + 0x0000713e0343836c: 9048 bb00 | 0000 0000 + + 0x0000713e03438374: ; {runtime_call nmethod} + 0x0000713e03438374: 0000 00e9 | fbff ffff + + 0x0000713e0343837c: ; {static_stub} + 0x0000713e0343837c: 9048 bb00 | 0000 0000 + + 0x0000713e03438384: ; {runtime_call nmethod} + 0x0000713e03438384: 0000 00e9 | fbff ffff + + 0x0000713e0343838c: ; {static_stub} + 0x0000713e0343838c: 9048 bb00 | 0000 0000 + + 0x0000713e03438394: ; {runtime_call nmethod} + 0x0000713e03438394: 0000 00e9 | fbff ffff + + 0x0000713e0343839c: ; {static_stub} + 0x0000713e0343839c: 9048 bb00 | 0000 0000 + + 0x0000713e034383a4: ; {runtime_call nmethod} + 0x0000713e034383a4: 0000 00e9 | fbff ffff + + 0x0000713e034383ac: ; {static_stub} + 0x0000713e034383ac: 9048 bb00 | 0000 0000 + + 0x0000713e034383b4: ; {runtime_call nmethod} + 0x0000713e034383b4: 0000 00e9 | fbff ffff + + 0x0000713e034383bc: ; {static_stub} + 0x0000713e034383bc: 9048 bb00 | 0000 0000 + + 0x0000713e034383c4: ; {runtime_call nmethod} + 0x0000713e034383c4: 0000 00e9 | fbff ffff + + 0x0000713e034383cc: ; {static_stub} + 0x0000713e034383cc: 9048 bb00 | 0000 0000 + + 0x0000713e034383d4: ; {runtime_call nmethod} + 0x0000713e034383d4: 0000 00e9 | fbff ffff + + 0x0000713e034383dc: ; {static_stub} + 0x0000713e034383dc: 48bb 0000 | 0000 0000 + + 0x0000713e034383e4: ; {runtime_call nmethod} + 0x0000713e034383e4: 0000 e9fb + + 0x0000713e034383e8: ; {static_stub} + 0x0000713e034383e8: ffff ff48 | bb00 0000 | 0000 0000 + + 0x0000713e034383f4: ; {runtime_call nmethod} + 0x0000713e034383f4: 00e9 fbff + + 0x0000713e034383f8: ; {static_stub} + 0x0000713e034383f8: ffff 48bb | a8f1 01b5 | 3d71 0000 + + 0x0000713e03438404: ; {runtime_call I2C/C2I adapters} + 0x0000713e03438404: e97d aea7 + + 0x0000713e03438408: ; {static_stub} + 0x0000713e03438408: 0648 bb70 | 207f b63d + + 0x0000713e03438410: ; {runtime_call I2C/C2I adapters} + 0x0000713e03438410: 7100 00e9 | 6ba3 a706 + + 0x0000713e03438418: ; {static_stub} + 0x0000713e03438418: 48bb 0000 | 0000 0000 + + 0x0000713e03438420: ; {runtime_call nmethod} + 0x0000713e03438420: 0000 e9fb + + 0x0000713e03438424: ; {static_stub} + 0x0000713e03438424: ffff ff48 | bb00 0000 | 0000 0000 + + 0x0000713e03438430: ; {runtime_call nmethod} + 0x0000713e03438430: 00e9 fbff + + 0x0000713e03438434: ; {static_stub} + 0x0000713e03438434: ffff 48bb | 0000 0000 | 0000 0000 + + 0x0000713e03438440: ; {runtime_call nmethod} + 0x0000713e03438440: e9fb ffff + + 0x0000713e03438444: ; {static_stub} + 0x0000713e03438444: ff48 bb00 | 0000 0000 + + 0x0000713e0343844c: ; {runtime_call nmethod} + 0x0000713e0343844c: 0000 00e9 | fbff ffff +[Exception Handler] + 0x0000713e03438454: ; {runtime_call handle_exception_from_callee Runtime1 stub} + 0x0000713e03438454: e8a7 30b4 + + 0x0000713e03438458: ; {external_word} + 0x0000713e03438458: 0648 bf21 | 7e72 1b3e | 7100 0048 + + 0x0000713e03438464: ; {runtime_call MacroAssembler::debug64(char*, long, long*)} + 0x0000713e03438464: 83e4 f0e8 | 54d0 dc17 + + 0x0000713e0343846c: ; {section_word} + 0x0000713e0343846c: f449 ba6d | 8443 033e | 7100 0041 + + 0x0000713e03438478: ; {runtime_call DeoptimizationBlob} + 0x0000713e03438478: 52e9 22e4 | a706 f4f4 +[/MachCode] + + +Compiled method (c1) 1004 4744 3 java.util.Optional::map (30 bytes) + total in heap [0x0000713e032a3310,0x0000713e032a3de0] = 2768 + relocation [0x0000713e032a3468,0x0000713e032a3510] = 168 + main code [0x0000713e032a3520,0x0000713e032a3bb0] = 1680 + stub code [0x0000713e032a3bb0,0x0000713e032a3c00] = 80 + metadata [0x0000713e032a3c00,0x0000713e032a3c38] = 56 + scopes data [0x0000713e032a3c38,0x0000713e032a3cd8] = 160 + scopes pcs [0x0000713e032a3cd8,0x0000713e032a3dc8] = 240 + dependencies [0x0000713e032a3dc8,0x0000713e032a3dd0] = 8 + nul chk table [0x0000713e032a3dd0,0x0000713e032a3de0] = 16 + +[Constant Pool (empty)] + +[MachCode] +[Entry Point] + # {method} {0x0000713db42f6e48} 'map' '(Ljava/util/function/Function;)Ljava/util/Optional;' in 'java/util/Optional' + # this: rsi:rsi = 'java/util/Optional' + # parm0: rdx:rdx = 'java/util/function/Function' + # [sp+0x90] (sp of caller) + 0x0000713e032a3520: 448b 5608 | 49bb 0000 | 0000 0800 | 0000 4d03 | d34c 3bd0 + + 0x0000713e032a3534: ; {runtime_call ic_miss_stub} + 0x0000713e032a3534: 0f85 469d | c006 660f | 1f44 0000 +[Verified Entry Point] + 0x0000713e032a3540: 8984 2400 | c0fe ff55 | 4881 ec80 | 0000 0090 | 4181 7f20 | 0500 0000 + + 0x0000713e032a3558: ; {runtime_call StubRoutines (final stubs)} + 0x0000713e032a3558: 7405 e8c1 + + 0x0000713e032a355c: ; {metadata(method data for {method} {0x0000713db42f6e48} 'map' '(Ljava/util/function/Function;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a355c: 1cbf 0648 | bf10 34b2 | b63d 7100 | 008b 9ff4 | 0000 0083 | c302 899f | f400 0000 | 81e3 fe07 + 0x0000713e032a357c: 0000 85db | 0f84 7804 + + 0x0000713e032a3584: ; {metadata(method data for {method} {0x0000713db42f6e48} 'map' '(Ljava/util/function/Function;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a3584: 0000 48bf | 1034 b2b6 | 3d71 0000 | 4883 8738 | 0100 0001 + + 0x0000713e032a3598: ; {metadata(method data for {method} {0x0000713db416dc28} 'requireNonNull' '(Ljava/lang/Object;)Ljava/lang/Object;' in 'java/util/Objects')} + 0x0000713e032a3598: 48bf 6053 | 33b4 3d71 | 0000 8b9f | f400 0000 | 83c3 0289 | 9ff4 0000 | 0081 e3fe | ff1f 0085 + 0x0000713e032a35b8: db0f 8460 | 0400 0048 + + 0x0000713e032a35c0: ; {metadata(method data for {method} {0x0000713db416dc28} 'requireNonNull' '(Ljava/lang/Object;)Ljava/lang/Object;' in 'java/util/Objects')} + 0x0000713e032a35c0: 85d2 48bf | 6053 33b4 | 3d71 0000 | 48c7 c348 | 0100 0074 | 0748 c7c3 | 3801 0000 | 488b 041f + 0x0000713e032a35e0: 488d 4001 | 4889 041f | 0f84 6d03 | 0000 488b + + 0x0000713e032a35f0: ; {metadata(method data for {method} {0x0000713db42f6e48} 'map' '(Ljava/util/function/Function;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a35f0: fe48 bb10 | 34b2 b63d | 7100 0048 | 8383 4801 + + 0x0000713e032a3600: ; {metadata(method data for {method} {0x0000713db42f6b08} 'isEmpty' '()Z' in 'java/util/Optional')} + 0x0000713e032a3600: 0000 0148 | bf28 e67f | b63d 7100 | 008b 9ff4 | 0000 0083 | c302 899f | f400 0000 | 81e3 feff + 0x0000713e032a3620: 1f00 85db | 0f84 1604 | 0000 8b76 | 0c48 c1e6 | 0348 85f6 + + 0x0000713e032a3634: ; {metadata(method data for {method} {0x0000713db42f6b08} 'isEmpty' '()Z' in 'java/util/Optional')} + 0x0000713e032a3634: 48bf 28e6 | 7fb6 3d71 | 0000 48c7 | c338 0100 | 0075 0748 | c7c3 4801 | 0000 488b | 041f 488d + 0x0000713e032a3654: 4001 4889 | 041f 0f85 | 1a00 0000 + + 0x0000713e032a3660: ; {metadata(method data for {method} {0x0000713db42f6b08} 'isEmpty' '()Z' in 'java/util/Optional')} + 0x0000713e032a3660: 48bf 28e6 | 7fb6 3d71 | 0000 ff87 | 5801 0000 | bf01 0000 | 00e9 0500 | 0000 bf00 | 0000 0083 + 0x0000713e032a3680: e701 85ff + + 0x0000713e032a3684: ; {metadata(method data for {method} {0x0000713db42f6e48} 'map' '(Ljava/util/function/Function;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a3684: 48bf 1034 | b2b6 3d71 | 0000 48c7 | c390 0100 | 0075 0748 | c7c3 8001 | 0000 488b | 041f 488d + 0x0000713e032a36a4: 4001 4889 | 041f 0f85 | 5202 0000 + + 0x0000713e032a36b0: ; implicit exception: dispatches to 0x0000713e032a3a61 + 0x0000713e032a36b0: 483b 0248 + + 0x0000713e032a36b4: ; {metadata(method data for {method} {0x0000713db42f6e48} 'map' '(Ljava/util/function/Function;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a36b4: 8bfa 48bb | 1034 b2b6 | 3d71 0000 | 8b7f 0849 | ba00 0000 | 0008 0000 | 0049 03fa | 483b bbc0 + 0x0000713e032a36d4: 0100 0075 | 0d48 8383 | c801 0000 | 01e9 6000 | 0000 483b | bbd0 0100 | 0075 0d48 | 8383 d801 + 0x0000713e032a36f4: 0000 01e9 | 4a00 0000 | 4883 bbc0 | 0100 0000 | 7517 4889 | bbc0 0100 | 0048 c783 | c801 0000 + 0x0000713e032a3714: 0100 0000 | e929 0000 | 0048 83bb | d001 0000 | 0075 1748 | 89bb d001 | 0000 48c7 | 83d8 0100 + 0x0000713e032a3734: 0001 0000 | 00e9 0800 | 0000 4883 | 83b0 0100 | 0001 488b | da48 8bd6 | 488b f366 | 0f1f 4400 + 0x0000713e032a3754: 0048 b8a0 | 9601 703c + + 0x0000713e032a375c: ; {virtual_call} + 0x0000713e032a375c: 7100 00e8 + + 0x0000713e032a3760: ; ImmutableOopMap {} + ;*invokeinterface apply {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.Optional::map@21 + 0x0000713e032a3760: 1c69 ce06 + + 0x0000713e032a3764: ; {other} + 0x0000713e032a3764: 0f1f 8400 | 5404 0000 + + 0x0000713e032a376c: ; {metadata(method data for {method} {0x0000713db42f6e48} 'map' '(Ljava/util/function/Function;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a376c: 488b d848 | ba10 34b2 | b63d 7100 | 0048 8382 | e801 0000 + + 0x0000713e032a3780: ; {metadata(method data for {method} {0x0000713db42f68c0} 'ofNullable' '(Ljava/lang/Object;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a3780: 0148 bac8 | 37b2 b63d | 7100 008b | b2f4 0000 | 0083 c602 | 89b2 f400 | 0000 81e6 | feff 1f00 + 0x0000713e032a37a0: 85f6 0f84 | be02 0000 + + 0x0000713e032a37a8: ; {metadata(method data for {method} {0x0000713db42f68c0} 'ofNullable' '(Ljava/lang/Object;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a37a8: 4885 db48 | bac8 37b2 | b63d 7100 | 0048 c7c6 | 3801 0000 | 7507 48c7 | c648 0100 | 0048 8b3c + 0x0000713e032a37c8: 3248 8d7f | 0148 893c | 320f 851f + + 0x0000713e032a37d4: ; {metadata(method data for {method} {0x0000713db42f68c0} 'ofNullable' '(Ljava/lang/Object;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a37d4: 0000 0048 | bac8 37b2 | b63d 7100 | 00ff 8258 + + 0x0000713e032a37e4: ; {oop(a 'java/util/Optional'{0x00000000a0007f18})} + 0x0000713e032a37e4: 0100 0048 | bb18 7f00 | a000 0000 | 00e9 f300 + + 0x0000713e032a37f4: ; {metadata('java/util/Optional')} + 0x0000713e032a37f4: 0000 48ba | 5806 0200 | 0800 0000 | 498b 87b8 | 0100 0048 | 8d78 1049 | 3bbf c801 | 0000 0f87 + 0x0000713e032a3814: 6f02 0000 | 4989 bfb8 | 0100 0048 | c700 0100 | 0000 488b | ca49 ba00 | 0000 0008 | 0000 0049 + 0x0000713e032a3834: 2bca 8948 | 0848 33c9 | 8948 0c48 | 33c9 488b + + 0x0000713e032a3844: ; {metadata(method data for {method} {0x0000713db42f68c0} 'ofNullable' '(Ljava/lang/Object;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a3844: d048 bec8 | 37b2 b63d | 7100 0048 | 8386 7001 + + 0x0000713e032a3854: ; {metadata(method data for {method} {0x0000713db42f6758} '' '(Ljava/lang/Object;)V' in 'java/util/Optional')} + 0x0000713e032a3854: 0000 0148 | bac8 0b79 | b43d 7100 | 008b b2f4 | 0000 0083 | c602 89b2 | f400 0000 | 81e6 feff + 0x0000713e032a3874: 1f00 85f6 | 0f84 1602 | 0000 488b + + 0x0000713e032a3880: ; {metadata(method data for {method} {0x0000713db42f6758} '' '(Ljava/lang/Object;)V' in 'java/util/Optional')} + 0x0000713e032a3880: d048 bec8 | 0b79 b43d | 7100 0048 | 8386 3801 + + 0x0000713e032a3890: ; {metadata(method data for {method} {0x0000713db4000630} '' '()V' in 'java/lang/Object')} + 0x0000713e032a3890: 0000 0148 | ba28 4025 | b43d 7100 | 008b b2f4 | 0000 0083 | c602 89b2 | f400 0000 | 81e6 feff + 0x0000713e032a38b0: 1f00 85f6 | 0f84 fb01 | 0000 410f | be57 4085 | d20f 850f | 0200 004c | 8bd3 49c1 | ea03 4489 + 0x0000713e032a38d0: 500c 488b | d048 33d3 | 48c1 ea18 | 4883 fa00 | 0f85 0f02 | 0000 488b | d848 8bc3 | 4881 c480 + 0x0000713e032a38f0: 0000 005d + + 0x0000713e032a38f4: ; {poll_return} + 0x0000713e032a38f4: 493b a750 | 0400 000f | 870c 0200 + + 0x0000713e032a3900: ; {metadata(method data for {method} {0x0000713db42f6e48} 'map' '(Ljava/util/function/Function;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a3900: 00c3 48b8 | 1034 b2b6 | 3d71 0000 | 4883 80a0 | 0100 0001 + + 0x0000713e032a3914: ; {metadata(method data for {method} {0x0000713db42f66a8} 'empty' '()Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a3914: 48b8 3836 | d7b4 3d71 | 0000 8b90 | f400 0000 | 83c2 0289 | 90f4 0000 | 0081 e2fe | ff1f 0085 + 0x0000713e032a3934: d20f 84e8 + + 0x0000713e032a3938: ; {oop(a 'java/util/Optional'{0x00000000a0007f18})} + 0x0000713e032a3938: 0100 0048 | b818 7f00 | a000 0000 | 0048 81c4 | 8000 0000 + + 0x0000713e032a394c: ; {poll_return} + 0x0000713e032a394c: 5d49 3ba7 | 5004 0000 | 0f87 ea01 | 0000 c348 | 8954 2468 | 4889 7424 | 6066 6690 + + 0x0000713e032a3968: ; {no_reloc} + 0x0000713e032a3968: e9fc 0100 | 0000 0000 | 0000 498b | 87b8 0100 | 0048 8d78 | 3049 3bbf | c801 0000 | 0f87 e901 + 0x0000713e032a3988: 0000 4989 | bfb8 0100 | 0048 c700 | 0100 0000 | 488b ca49 | ba00 0000 | 0008 0000 | 0049 2bca + 0x0000713e032a39a8: 8948 0848 | 33c9 8948 | 0c48 33c9 | 4889 4810 | 4889 4818 | 4889 4820 | 4889 4828 + + 0x0000713e032a39c4: ; {metadata(method data for {method} {0x0000713db416dc28} 'requireNonNull' '(Ljava/lang/Object;)Ljava/lang/Object;' in 'java/util/Objects')} + 0x0000713e032a39c4: 488b f048 | bf60 5333 | b43d 7100 | 0048 8387 | 5801 0000 | 0148 8bf0 | 4889 4424 | 5866 0f1f + 0x0000713e032a39e4: ; {optimized virtual_call} + 0x0000713e032a39e4: 4400 00e8 + + 0x0000713e032a39e8: ; ImmutableOopMap {[88]=Oop [96]=Oop [104]=Oop } + ;*invokespecial {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.Objects::requireNonNull@8 + ; - java.util.Optional::map@1 + 0x0000713e032a39e8: 949d c006 + + 0x0000713e032a39ec: ; {other} + 0x0000713e032a39ec: 0f1f 8400 | dc06 0001 | 488b 4424 | 58e9 9f01 + + 0x0000713e032a39fc: ; {metadata({method} {0x0000713db42f6e48} 'map' '(Ljava/util/function/Function;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a39fc: 0000 49ba | 486e 2fb4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e032a3a14: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e032a3a14: ffe8 66b2 + + 0x0000713e032a3a18: ; ImmutableOopMap {rsi=Oop rdx=Oop } + ;*synchronization entry + ; - java.util.Optional::map@-1 + 0x0000713e032a3a18: cd06 e967 + + 0x0000713e032a3a1c: ; {metadata({method} {0x0000713db416dc28} 'requireNonNull' '(Ljava/lang/Object;)Ljava/lang/Object;' in 'java/util/Objects')} + 0x0000713e032a3a1c: fbff ff49 | ba28 dc16 | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e032a3a34: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e032a3a34: ffff e845 + + 0x0000713e032a3a38: ; ImmutableOopMap {rsi=Oop rdx=Oop } + ;*synchronization entry + ; - java.util.Objects::requireNonNull@-1 + ; - java.util.Optional::map@1 + 0x0000713e032a3a38: b2cd 06e9 | 7ffb ffff + + 0x0000713e032a3a40: ; {metadata({method} {0x0000713db42f6b08} 'isEmpty' '()Z' in 'java/util/Optional')} + 0x0000713e032a3a40: 49ba 086b | 2fb4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e032a3a54: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e032a3a54: ffff ffe8 + + 0x0000713e032a3a58: ; ImmutableOopMap {rsi=Oop rdx=Oop } + ;*synchronization entry + ; - java.util.Optional::isEmpty@-1 + ; - java.util.Optional::map@6 + 0x0000713e032a3a58: 24b2 cd06 | e9c9 fbff + + 0x0000713e032a3a60: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e032a3a60: ffe8 ba58 + + 0x0000713e032a3a64: ; ImmutableOopMap {rdx=Oop rsi=Oop } + ;*invokeinterface apply {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.Optional::map@21 + ; {metadata({method} {0x0000713db42f68c0} 'ofNullable' '(Ljava/lang/Object;)Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a3a64: cd06 49ba | c068 2fb4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e032a3a7c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e032a3a7c: ffe8 feb1 + + 0x0000713e032a3a80: ; ImmutableOopMap {rbx=Oop } + ;*synchronization entry + ; - java.util.Optional::ofNullable@-1 + ; - java.util.Optional::map@26 + 0x0000713e032a3a80: cd06 e921 | fdff ff48 + + 0x0000713e032a3a88: ; {runtime_call fast_new_instance Runtime1 stub} + 0x0000713e032a3a88: 8bd2 e871 + + 0x0000713e032a3a8c: ; ImmutableOopMap {rbx=Oop } + ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.Optional::ofNullable@10 + ; - java.util.Optional::map@26 + 0x0000713e032a3a8c: 62cd 06e9 | aefd ffff + + 0x0000713e032a3a94: ; {metadata({method} {0x0000713db42f6758} '' '(Ljava/lang/Object;)V' in 'java/util/Optional')} + 0x0000713e032a3a94: 49ba 5867 | 2fb4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e032a3aa8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e032a3aa8: ffff ffe8 + + 0x0000713e032a3aac: ; ImmutableOopMap {rbx=Oop rax=Oop } + ;*synchronization entry + ; - java.util.Optional::@-1 + ; - java.util.Optional::ofNullable@15 + ; - java.util.Optional::map@26 + 0x0000713e032a3aac: d0b1 cd06 | e9c9 fdff + + 0x0000713e032a3ab4: ; {metadata({method} {0x0000713db4000630} '' '()V' in 'java/lang/Object')} + 0x0000713e032a3ab4: ff49 ba30 | 0600 b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e032a3acc: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e032a3acc: e8af b1cd + + 0x0000713e032a3ad0: ; ImmutableOopMap {rbx=Oop rax=Oop } + ;*synchronization entry + ; - java.lang.Object::@-1 + ; - java.util.Optional::@1 + ; - java.util.Optional::ofNullable@15 + ; - java.util.Optional::map@26 + 0x0000713e032a3ad0: 06e9 e4fd | ffff 8b50 | 0c48 c1e2 | 0348 83fa | 000f 84e0 | fdff ff48 + + 0x0000713e032a3ae8: ; {runtime_call g1_pre_barrier_slow} + 0x0000713e032a3ae8: 8914 24e8 | 10c1 cd06 | e9d2 fdff | ff48 83fb | 000f 84e7 | fdff ff48 + + 0x0000713e032a3b00: ; {runtime_call g1_post_barrier_slow} + 0x0000713e032a3b00: 8904 24e8 | 78c4 cd06 | e9d9 fdff + + 0x0000713e032a3b0c: ; {internal_word} + 0x0000713e032a3b0c: ff49 baf4 | 382a 033e | 7100 004d | 8997 6804 + + 0x0000713e032a3b1c: ; {runtime_call SafepointBlob} + 0x0000713e032a3b1c: 0000 e9dd + + 0x0000713e032a3b20: ; {metadata({method} {0x0000713db42f66a8} 'empty' '()Ljava/util/Optional;' in 'java/util/Optional')} + 0x0000713e032a3b20: 18c1 0649 | baa8 662f | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e032a3b38: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e032a3b38: ffff e841 + + 0x0000713e032a3b3c: ; ImmutableOopMap {} + ;*synchronization entry + ; - java.util.Optional::empty@-1 + ; - java.util.Optional::map@12 + 0x0000713e032a3b3c: b1cd 06e9 | f7fd ffff + + 0x0000713e032a3b44: ; {internal_word} + 0x0000713e032a3b44: 49ba 4d39 | 2a03 3e71 | 0000 4d89 | 9768 0400 + + 0x0000713e032a3b54: ; {runtime_call SafepointBlob} + 0x0000713e032a3b54: 00e9 a618 + + 0x0000713e032a3b58: ; {metadata(nullptr)} + 0x0000713e032a3b58: c106 48ba | 0000 0000 | 0000 0000 | b800 0f05 + + 0x0000713e032a3b68: ; {runtime_call load_klass_patching Runtime1 stub} + 0x0000713e032a3b68: 0ae8 129f + + 0x0000713e032a3b6c: ; ImmutableOopMap {[96]=Oop [104]=Oop } + ;*new {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.util.Objects::requireNonNull@4 + ; - java.util.Optional::map@1 + 0x0000713e032a3b6c: cd06 e9f5 | fdff ff48 + + 0x0000713e032a3b74: ; {runtime_call fast_new_instance Runtime1 stub} + 0x0000713e032a3b74: 8bd2 e885 + + 0x0000713e032a3b78: ; ImmutableOopMap {[96]=Oop [104]=Oop } + ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.Objects::requireNonNull@4 + ; - java.util.Optional::map@1 + 0x0000713e032a3b78: 61cd 06e9 | 44fe ffff | 498b 8700 | 0500 0049 | c787 0005 | 0000 0000 | 0000 49c7 | 8708 0500 + 0x0000713e032a3b98: 0000 0000 | 0048 81c4 | 8000 0000 + + 0x0000713e032a3ba4: ; {runtime_call unwind_exception Runtime1 stub} + 0x0000713e032a3ba4: 5de9 5648 | cd06 f4f4 | f4f4 f4f4 +[Stub Code] + 0x0000713e032a3bb0: ; {no_reloc} + 0x0000713e032a3bb0: 0f1f 4400 + + 0x0000713e032a3bb4: ; {static_stub} + 0x0000713e032a3bb4: 0048 bb00 | 0000 0000 + + 0x0000713e032a3bbc: ; {runtime_call nmethod} + 0x0000713e032a3bbc: 0000 00e9 | fbff ffff + + 0x0000713e032a3bc4: ; {static_stub} + 0x0000713e032a3bc4: 48bb 0000 | 0000 0000 + + 0x0000713e032a3bcc: ; {runtime_call nmethod} + 0x0000713e032a3bcc: 0000 e9fb + + 0x0000713e032a3bd0: ; {runtime_call handle_exception_from_callee Runtime1 stub} + 0x0000713e032a3bd0: ffff ffe8 | 2879 cd06 + + 0x0000713e032a3bd8: ; {external_word} + 0x0000713e032a3bd8: 48bf 217e | 721b 3e71 | 0000 4883 + + 0x0000713e032a3be4: ; {runtime_call MacroAssembler::debug64(char*, long, long*)} + 0x0000713e032a3be4: e4f0 e8d5 | 18f6 17f4 +[Deopt Handler Code] + 0x0000713e032a3bec: ; {section_word} + 0x0000713e032a3bec: 49ba ec3b | 2a03 3e71 | 0000 4152 + + 0x0000713e032a3bf8: ; {runtime_call DeoptimizationBlob} + 0x0000713e032a3bf8: e9a3 2cc1 | 06f4 f4f4 +[/MachCode] + + +Compiled method (c1) 1009 3379 ! 3 jdk.internal.reflect.DirectMethodHandleAccessor::invoke (92 bytes) + total in heap [0x0000713e02fbea10,0x0000713e02fc3148] = 18232 + relocation [0x0000713e02fbeb68,0x0000713e02fbef18] = 944 + main code [0x0000713e02fbef20,0x0000713e02fc1a90] = 11120 + stub code [0x0000713e02fc1a90,0x0000713e02fc1b98] = 264 + oops [0x0000713e02fc1b98,0x0000713e02fc1bd0] = 56 + metadata [0x0000713e02fc1bd0,0x0000713e02fc1c48] = 120 + scopes data [0x0000713e02fc1c48,0x0000713e02fc21b0] = 1384 + scopes pcs [0x0000713e02fc21b0,0x0000713e02fc27b0] = 1536 + dependencies [0x0000713e02fc27b0,0x0000713e02fc27b8] = 8 + handler table [0x0000713e02fc27b8,0x0000713e02fc3088] = 2256 + nul chk table [0x0000713e02fc3088,0x0000713e02fc3148] = 192 + +[Constant Pool (empty)] + +[MachCode] +[Entry Point] + # {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor' + # this: rsi:rsi = 'jdk/internal/reflect/DirectMethodHandleAccessor' + # parm0: rdx:rdx = 'java/lang/Object' + # parm1: rcx:rcx = '[Ljava/lang/Object;' + # [sp+0x180] (sp of caller) + 0x0000713e02fbef20: 448b 5608 | 49bb 0000 | 0000 0800 | 0000 4d03 | d34c 3bd0 + + 0x0000713e02fbef34: ; {runtime_call ic_miss_stub} + 0x0000713e02fbef34: 0f85 46e3 | ee06 660f | 1f44 0000 +[Verified Entry Point] + 0x0000713e02fbef40: 8984 2400 | c0fe ff55 | 4881 ec70 | 0100 0090 | 4181 7f20 | 0500 0000 + + 0x0000713e02fbef58: ; {runtime_call StubRoutines (final stubs)} + 0x0000713e02fbef58: 7405 e8c1 | 62ed 0648 | 89b4 24b0 | 0000 0048 | 8994 24c0 | 0000 0048 | 898c 24b8 + + 0x0000713e02fbef74: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbef74: 0000 0048 | bfc0 a37b | b63d 7100 | 008b 9ff4 | 0000 0083 | c302 899f | f400 0000 | 81e3 fe07 + 0x0000713e02fbef94: 0000 85db | 0f84 8325 | 0000 488b + + 0x0000713e02fbefa0: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbefa0: fe48 bbc0 | a37b b63d | 7100 0048 | 8383 3801 + + 0x0000713e02fbefb0: ; {metadata(method data for {method} {0x0000713db476f868} 'isStatic' '()Z' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbefb0: 0000 0148 | bf28 a27b | b63d 7100 | 008b 9ff4 | 0000 0083 | c302 899f | f400 0000 | 81e3 feff + 0x0000713e02fbefd0: 1f00 85db | 0f84 6825 | 0000 8b7e | 1081 e700 | 0200 0081 | ff00 0200 + + 0x0000713e02fbefe8: ; {metadata(method data for {method} {0x0000713db476f868} 'isStatic' '()Z' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbefe8: 0048 bf28 | a27b b63d | 7100 0048 | c7c3 3801 | 0000 7507 | 48c7 c348 | 0100 0048 | 8b04 1f48 + 0x0000713e02fbf008: 8d40 0148 | 8904 1f0f | 851a 0000 + + 0x0000713e02fbf014: ; {metadata(method data for {method} {0x0000713db476f868} 'isStatic' '()Z' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf014: 0048 bf28 | a27b b63d | 7100 00ff | 8758 0100 | 00bf 0100 | 0000 e905 | 0000 00bf | 0000 0000 + 0x0000713e02fbf034: 83e7 0185 + + 0x0000713e02fbf038: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf038: ff48 bfc0 | a37b b63d | 7100 0048 | c7c3 7001 | 0000 7507 | 48c7 c380 | 0100 0048 | 8b04 1f48 + 0x0000713e02fbf058: 8d40 0148 | 8904 1f0f | 85d5 0000 | 0048 8bfe + + 0x0000713e02fbf068: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf068: 48bb c0a3 | 7bb6 3d71 | 0000 4883 | 8390 0100 + + 0x0000713e02fbf078: ; {metadata(method data for {method} {0x0000713db476faa8} 'checkReceiver' '(Ljava/lang/Object;)V' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf078: 0001 48bf | 40a8 7bb6 | 3d71 0000 | 8b9f f400 | 0000 83c3 | 0289 9ff4 | 0000 0081 | e3fe ff1f + 0x0000713e02fbf098: 0085 db0f | 84c2 2400 | 008b 7e14 | 48c1 e703 + + 0x0000713e02fbf0a8: ; implicit exception: dispatches to 0x0000713e02fc1584 + 0x0000713e02fbf0a8: 483b 0248 + + 0x0000713e02fbf0ac: ; {metadata(method data for {method} {0x0000713db476faa8} 'checkReceiver' '(Ljava/lang/Object;)V' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf0ac: 8bda 48b8 | 40a8 7bb6 | 3d71 0000 | 4883 8038 | 0100 0001 | 8b5a 0849 | ba00 0000 | 0008 0000 + 0x0000713e02fbf0cc: 0049 03da | 488b 5b70 | 488b 1b48 | 3b07 488b + + 0x0000713e02fbf0dc: ; {metadata(method data for {method} {0x0000713db476faa8} 'checkReceiver' '(Ljava/lang/Object;)V' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf0dc: c749 b840 | a87b b63d | 7100 0049 | 8380 7001 | 0000 0148 | 8bd3 488b + + 0x0000713e02fbf0f4: ; {optimized virtual_call} + 0x0000713e02fbf0f4: f766 90e8 + + 0x0000713e02fbf0f8: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop } + ;*invokevirtual isAssignableFrom {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::checkReceiver@8 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@9 + 0x0000713e02fbf0f8: 4482 5f07 + + 0x0000713e02fbf0fc: ; {other} + 0x0000713e02fbf0fc: 0f1f 8400 | ec06 0000 + + 0x0000713e02fbf104: ; {metadata(method data for {method} {0x0000713db476faa8} 'checkReceiver' '(Ljava/lang/Object;)V' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf104: 85c0 48be | 40a8 7bb6 | 3d71 0000 | 48c7 c2b8 | 0100 0074 | 0748 c7c2 | a801 0000 | 488b 3c16 + 0x0000713e02fbf124: 488d 7f01 | 4889 3c16 | 0f84 8f22 | 0000 488b | b424 b000 | 0000 8b56 + + 0x0000713e02fbf13c: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf13c: 0c48 bfc0 | a37b b63d | 7100 0048 | 8387 c801 | 0000 0148 | 8bf2 488b | 9424 b800 | 0000 0f1f + 0x0000713e02fbf15c: ; {static_call} + 0x0000713e02fbf15c: 4400 00e8 + + 0x0000713e02fbf160: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop } + ;*invokestatic checkArgumentCount {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@17 + 0x0000713e02fbf160: fca8 ffff + + 0x0000713e02fbf164: ; {other} + 0x0000713e02fbf164: 0f1f 8400 | 5407 0001 | 488b b424 | b000 0000 + + 0x0000713e02fbf174: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf174: 488b fe48 | bbc0 a37b | b63d 7100 | 0048 8383 | d801 0000 + + 0x0000713e02fbf188: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf188: 0148 bf70 | ad7b b63d | 7100 008b | 9ff4 0000 | 0083 c302 | 899f f400 | 0000 81e3 | feff 1f00 + 0x0000713e02fbf1a8: 85db 0f84 | de23 0000 + + 0x0000713e02fbf1b0: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf1b0: 8b7e 0c48 | bb70 ad7b | b63d 7100 | 0048 c7c0 | 4001 0000 | 85ff 488b | d048 c7c0 | 5001 0000 + 0x0000713e02fbf1d0: 480f 45c2 | 83ff 0148 | 8bd0 48c7 | c060 0100 | 0048 0f45 | c283 ff02 | 488b d048 | c7c0 7001 + 0x0000713e02fbf1f0: 0000 480f | 45c2 83ff | 0348 8bd0 | 48c7 c080 | 0100 0048 | 0f45 c248 | 8b14 0349 | c7c2 0100 + 0x0000713e02fbf210: 0000 4903 | d248 8914 | 0385 ff0f | 8479 1800 | 0083 ff01 | 0f84 f811 | 0000 83ff | 020f 842f + 0x0000713e02fbf230: 0b00 0083 | ff03 0f84 | 3606 0000 | 488b 9424 | c000 0000 | 8b7e 1848 | c1e7 0348 | 89bc 24c8 + 0x0000713e02fbf250: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf250: 0000 0048 | bb70 ad7b | b63d 7100 | 0048 8d9b | c003 0000 | 4885 d275 | 0ef6 4308 | 0175 4ff0 + 0x0000713e02fbf270: 4883 4b08 | 01eb 478b | 4208 49ba | 0000 0000 | 0800 0000 | 4903 c24c | 8bd0 4833 | 4308 48a9 + 0x0000713e02fbf290: fcff ffff | 7428 a802 | 7524 48f7 | 4308 feff | ffff 7416 | 498b c248 | 3343 0848 | a9fc ffff + 0x0000713e02fbf2b0: ff74 0b48 | 834b 0802 | eb04 4889 + + 0x0000713e02fbf2bc: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fbf2bc: 4308 48bb | b0b1 7bb6 | 3d71 0000 | 488d 9be0 | 0200 0048 | 85ff 750c | f603 0175 | 49f0 4883 + 0x0000713e02fbf2dc: 0b01 eb42 | 8b47 0849 | ba00 0000 | 0008 0000 | 0049 03c2 | 4c8b d048 | 3303 48a9 | fcff ffff + 0x0000713e02fbf2fc: 7424 a802 | 7520 48f7 | 03fe ffff | ff74 1449 | 8bc2 4833 | 0348 a9fc | ffff ff74 | 0948 830b + 0x0000713e02fbf31c: 02eb 0348 | 8903 4885 | d275 0ef6 | 4310 0175 | 4ff0 4883 | 4b10 01eb | 478b 4208 | 49ba 0000 + 0x0000713e02fbf33c: 0000 0800 | 0000 4903 | c24c 8bd0 | 4833 4310 | 48a9 fcff | ffff 7428 | a802 7524 | 48f7 4310 + 0x0000713e02fbf35c: feff ffff | 7416 498b | c248 3343 | 1048 a9fc | ffff ff74 | 0b48 834b | 1002 eb04 | 4889 4310 + 0x0000713e02fbf37c: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf37c: 48bb 70ad | 7bb6 3d71 | 0000 4883 | 8388 0300 + + 0x0000713e02fbf38c: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fbf38c: 0001 48bb | b0b1 7bb6 | 3d71 0000 | 8b83 f400 | 0000 83c0 | 0289 83f4 | 0000 0025 | feff 1f00 + 0x0000713e02fbf3ac: 85c0 0f84 | fb21 0000 + + 0x0000713e02fbf3b4: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fbf3b4: 48bb b0b1 | 7bb6 3d71 | 0000 488d | 9bb8 0100 | 0048 85ff | 750e f643 | 0801 754f | f048 834b + 0x0000713e02fbf3d4: 0801 eb47 | 8b47 0849 | ba00 0000 | 0008 0000 | 0049 03c2 | 4c8b d048 | 3343 0848 | a9fc ffff + 0x0000713e02fbf3f4: ff74 28a8 | 0275 2448 | f743 08fe | ffff ff74 | 1649 8bc2 | 4833 4308 | 48a9 fcff | ffff 740b + 0x0000713e02fbf414: 4883 4b08 | 02eb 0448 + + 0x0000713e02fbf41c: ; {oop(a 'java/lang/invoke/MethodType'{0x00000000a20beb60} = (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;)} + 0x0000713e02fbf41c: 8943 0848 | b860 eb0b | a200 0000 | 0048 85c0 | 750c f643 | 1801 7506 | f048 834b + + 0x0000713e02fbf438: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fbf438: 1801 48bb | b0b1 7bb6 | 3d71 0000 | 4883 83a8 | 0100 0001 + + 0x0000713e02fbf44c: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbf44c: 48bb 882a | d5b4 3d71 | 0000 8b8b | f400 0000 | 83c1 0289 | 8bf4 0000 | 0081 e1fe | ff1f 0085 + 0x0000713e02fbf46c: c90f 845d | 2100 0048 | 3b07 488b + + 0x0000713e02fbf478: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbf478: df48 b988 | 2ad5 b43d | 7100 008b | 5b08 49ba | 0000 0000 | 0800 0000 | 4903 da48 | 3b99 4801 + 0x0000713e02fbf498: 0000 750d | 4883 8150 | 0100 0001 | e960 0000 | 0048 3b99 | 5801 0000 | 750d 4883 | 8160 0100 + 0x0000713e02fbf4b8: 0001 e94a | 0000 0048 | 83b9 4801 | 0000 0075 | 1748 8999 | 4801 0000 | 48c7 8150 | 0100 0001 + 0x0000713e02fbf4d8: 0000 00e9 | 2900 0000 | 4883 b958 | 0100 0000 | 7517 4889 | 9958 0100 | 0048 c781 | 6001 0000 + 0x0000713e02fbf4f8: 0100 0000 | e908 0000 | 0048 8381 | 3801 0000 | 018b 5f10 | 48c1 e303 + + 0x0000713e02fbf510: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbf510: 483b d848 | b888 2ad5 | b43d 7100 | 0048 c7c1 | 8001 0000 | 7507 48c7 | c170 0100 | 004c 8b04 + 0x0000713e02fbf530: 084d 8d40 | 014c 8904 | 080f 8548 + + 0x0000713e02fbf53c: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fbf53c: 1a00 0048 | bbb0 b17b | b63d 7100 | 0048 8d9b | f001 0000 | 8b47 0849 | ba00 0000 | 0008 0000 + 0x0000713e02fbf55c: 0049 03c2 | 4c8b d048 | 3343 0848 | a9fc ffff | ff74 28a8 | 0275 2448 | f743 08fe | ffff ff74 + 0x0000713e02fbf57c: 1649 8bc2 | 4833 4308 | 48a9 fcff | ffff 740b | 4883 4b08 | 02eb 0448 + + 0x0000713e02fbf594: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fbf594: 8943 0848 | bbb0 b17b | b63d 7100 | 0048 8383 | e001 0000 + + 0x0000713e02fbf5a8: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbf5a8: 0148 bb28 | 1ed5 b43d | 7100 008b | 83f4 0000 | 0083 c002 | 8983 f400 | 0000 25fe | ff1f 0085 + 0x0000713e02fbf5c8: c00f 8427 + + 0x0000713e02fbf5cc: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbf5cc: 2000 0048 | bb28 1ed5 | b43d 7100 | 0048 8383 | 3801 0000 + + 0x0000713e02fbf5e0: ; {metadata(method data for {method} {0x0000713db437a270} 'isCompileConstant' '(Ljava/lang/Object;)Z' in 'java/lang/invoke/MethodHandleImpl')} + 0x0000713e02fbf5e0: 0148 bbb0 | 21d5 b43d | 7100 008b | 83f4 0000 | 0083 c002 | 8983 f400 | 0000 25fe | ff1f 0085 + 0x0000713e02fbf600: c00f 8410 + + 0x0000713e02fbf604: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbf604: 2000 0048 | bb28 1ed5 | b43d 7100 | 00ff 8348 | 0100 008b | 5f14 48c1 | e303 8b5b | 1c48 c1e3 + 0x0000713e02fbf624: 0348 85db + + 0x0000713e02fbf628: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbf628: 48bb 281e | d5b4 3d71 | 0000 48c7 | c068 0100 | 0075 0748 | c7c0 7801 | 0000 488b | 0c03 488d + 0x0000713e02fbf648: 4901 4889 | 0c03 0f85 | 2800 0000 + + 0x0000713e02fbf654: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbf654: 48bb 281e | d5b4 3d71 | 0000 4883 | 8388 0100 | 0001 488b | f766 0f1f + + 0x0000713e02fbf66c: ; {static_call} + 0x0000713e02fbf66c: 4400 00e8 + + 0x0000713e02fbf670: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop [200]=Oop } + ;*invokestatic maybeCustomize {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkCustomized@19 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@104 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fbf670: 4c4a bdff + + 0x0000713e02fbf674: ; {other} + 0x0000713e02fbf674: 0f1f 8400 | 640c 0002 | 488b 8c24 | b800 0000 | 488b 9424 | c000 0000 + + 0x0000713e02fbf68c: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fbf68c: 48be b0b1 | 7bb6 3d71 | 0000 488d | b640 0200 | 0048 85d2 | 750e f646 | 0801 7553 | f048 834e + 0x0000713e02fbf6ac: 0801 eb4b | 8b7a 0849 | ba00 0000 | 0008 0000 | 0049 03fa | 4c8b d748 | 337e 0848 | f7c7 fcff + 0x0000713e02fbf6cc: ffff 742b | 40f6 c702 | 7525 48f7 | 4608 feff | ffff 7417 | 498b fa48 | 337e 0848 | f7c7 fcff + 0x0000713e02fbf6ec: ffff 740b | 4883 4e08 | 02eb 0448 | 897e 0848 | 85c9 750e | f646 1801 | 7553 f048 | 834e 1801 + 0x0000713e02fbf70c: eb4b 8b79 | 0849 ba00 | 0000 0008 | 0000 0049 | 03fa 4c8b | d748 337e | 1848 f7c7 | fcff ffff + 0x0000713e02fbf72c: 742b 40f6 | c702 7525 | 48f7 4618 | feff ffff | 7417 498b | fa48 337e | 1848 f7c7 | fcff ffff + 0x0000713e02fbf74c: 740b 4883 | 4e18 02eb | 0448 897e | 1848 8bbc | 24c8 0000 + + 0x0000713e02fbf760: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fbf760: 0048 beb0 | b17b b63d | 7100 0048 | 8386 0802 | 0000 0148 | 8bb4 24c8 | 0000 000f + + 0x0000713e02fbf77c: ; {optimized virtual_call} + 0x0000713e02fbf77c: 1f40 00e8 + + 0x0000713e02fbf780: ; ImmutableOopMap {[176]=Oop } + ;*invokevirtual invokeBasic {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@20 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@104 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fbf780: fc15 5f07 + + 0x0000713e02fbf784: ; {other} + 0x0000713e02fbf784: 0f1f 8400 | 740d 0003 + + 0x0000713e02fbf78c: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fbf78c: 48be b0b1 | 7bb6 3d71 | 0000 488d | b660 0200 | 0048 85c0 | 750c f606 | 0175 4df0 | 4883 0e01 + 0x0000713e02fbf7ac: eb46 8b78 | 0849 ba00 | 0000 0008 | 0000 0049 | 03fa 4c8b | d748 333e | 48f7 c7fc | ffff ff74 + 0x0000713e02fbf7cc: 2740 f6c7 | 0275 2148 | f706 feff | ffff 7415 | 498b fa48 | 333e 48f7 | c7fc ffff | ff74 0948 + 0x0000713e02fbf7ec: 830e 02eb | 0348 893e + + 0x0000713e02fbf7f4: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf7f4: 48be 70ad | 7bb6 3d71 | 0000 488d | b6e0 0300 | 0048 85c0 | 750c f606 | 0175 4df0 | 4883 0e01 + 0x0000713e02fbf814: eb46 8b78 | 0849 ba00 | 0000 0008 | 0000 0049 | 03fa 4c8b | d748 333e | 48f7 c7fc | ffff ff74 + 0x0000713e02fbf834: 2740 f6c7 | 0275 2148 | f706 feff | ffff 7415 | 498b fa48 | 333e 48f7 | c7fc ffff | ff74 0948 + 0x0000713e02fbf854: 830e 02eb | 0348 893e | 4881 c470 | 0100 005d + + 0x0000713e02fbf864: ; {poll_return} + 0x0000713e02fbf864: 493b a750 | 0400 000f | 87cc 1d00 | 00c3 488b | 8c24 b800 | 0000 488b | 9424 c000 | 0000 8b7e + 0x0000713e02fbf884: 1848 c1e7 | 0348 89bc | 24d8 0000 | 0083 790c | 000f 86c2 | 1d00 008b | 5910 48c1 | e303 4889 + 0x0000713e02fbf8a4: 9c24 d000 | 0000 8379 | 0c01 0f86 | bb1d 0000 | 8b41 1448 | c1e0 0348 | 8984 24e0 | 0000 0083 + 0x0000713e02fbf8c4: 790c 020f | 86b4 1d00 | 008b 4918 | 48c1 e103 | 4889 8c24 | e800 0000 + + 0x0000713e02fbf8dc: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf8dc: 49b8 70ad | 7bb6 3d71 | 0000 4d8d | 8040 0300 | 0048 85d2 | 750f 41f6 | 4008 0175 | 54f0 4983 + 0x0000713e02fbf8fc: 4808 01eb | 4c44 8b4a | 0849 ba00 | 0000 0008 | 0000 004d | 03ca 4d8b | d14d 3348 | 0849 f7c1 + 0x0000713e02fbf91c: fcff ffff | 742b 41f6 | c102 7525 | 49f7 4008 | feff ffff | 7417 4d8b | ca4d 3348 | 0849 f7c1 + 0x0000713e02fbf93c: fcff ffff | 740b 4983 | 4808 02eb | 044d 8948 + + 0x0000713e02fbf94c: ; {metadata(method data for {method} {0x0000713db46482b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x000000080008cc00')} + 0x0000713e02fbf94c: 0849 b800 | 084e b53d | 7100 004d | 8d80 f002 | 0000 4885 | ff75 0b41 | f600 0175 | 05f0 4983 + 0x0000713e02fbf96c: 0801 4885 | d275 0d41 | f640 1001 | 7506 f049 | 8348 1001 + + 0x0000713e02fbf980: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbf980: 49b8 70ad | 7bb6 3d71 | 0000 4983 | 8008 0300 + + 0x0000713e02fbf990: ; {metadata(method data for {method} {0x0000713db46482b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x000000080008cc00')} + 0x0000713e02fbf990: 0001 49b8 | 0008 4eb5 | 3d71 0000 | 458b 88f4 | 0000 0041 | 83c1 0245 | 8988 f400 | 0000 4181 + 0x0000713e02fbf9b0: e1fe ff1f | 0045 85c9 | 0f84 d51c + + 0x0000713e02fbf9bc: ; {metadata(method data for {method} {0x0000713db46482b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x000000080008cc00')} + 0x0000713e02fbf9bc: 0000 49b8 | 0008 4eb5 | 3d71 0000 | 4d8d 80b8 | 0100 0048 | 85ff 750d | 41f6 4008 | 0175 06f0 + 0x0000713e02fbf9dc: 4983 4808 + + 0x0000713e02fbf9e0: ; {oop(a 'java/lang/invoke/MethodType'{0x00000000a0273fb0} = (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;)} + 0x0000713e02fbf9e0: 0149 b9b0 | 3f27 a000 | 0000 004d | 85c9 750d | 41f6 4018 | 0175 06f0 | 4983 4818 + + 0x0000713e02fbf9fc: ; {metadata(method data for {method} {0x0000713db46482b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x000000080008cc00')} + 0x0000713e02fbf9fc: 0149 b800 | 084e b53d | 7100 0049 | 8380 a801 + + 0x0000713e02fbfa0c: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbfa0c: 0000 0149 | b888 2ad5 | b43d 7100 | 0045 8b98 | f400 0000 | 4183 c302 | 4589 98f4 | 0000 0041 + 0x0000713e02fbfa2c: 81e3 feff | 1f00 4585 | db0f 8479 | 1c00 0048 | 3b07 4c8b + + 0x0000713e02fbfa40: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbfa40: c749 bb88 | 2ad5 b43d | 7100 0045 | 8b40 0849 | ba00 0000 | 0008 0000 | 004d 03c2 | 4d3b 8348 + 0x0000713e02fbfa60: 0100 0075 | 0d49 8383 | 5001 0000 | 01e9 6000 | 0000 4d3b | 8358 0100 | 0075 0d49 | 8383 6001 + 0x0000713e02fbfa80: 0000 01e9 | 4a00 0000 | 4983 bb48 | 0100 0000 | 7517 4d89 | 8348 0100 | 0049 c783 | 5001 0000 + 0x0000713e02fbfaa0: 0100 0000 | e929 0000 | 0049 83bb | 5801 0000 | 0075 174d | 8983 5801 | 0000 49c7 | 8360 0100 + 0x0000713e02fbfac0: 0001 0000 | 00e9 0800 | 0000 4983 | 8338 0100 | 0001 448b | 4710 49c1 | e003 4d3b + + 0x0000713e02fbfadc: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbfadc: c149 b988 | 2ad5 b43d | 7100 0049 | c7c3 8001 | 0000 7507 | 49c7 c370 | 0100 004f | 8b2c 194d + 0x0000713e02fbfafc: 8d6d 014f | 892c 190f | 853e 1400 + + 0x0000713e02fbfb08: ; {metadata(method data for {method} {0x0000713db46482b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x000000080008cc00')} + 0x0000713e02fbfb08: 0049 b800 | 084e b53d | 7100 0049 | 8380 e001 + + 0x0000713e02fbfb18: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbfb18: 0000 0149 | b828 1ed5 | b43d 7100 | 0045 8b88 | f400 0000 | 4183 c102 | 4589 88f4 | 0000 0041 + 0x0000713e02fbfb38: 81e1 feff | 1f00 4585 | c90f 8493 + + 0x0000713e02fbfb44: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbfb44: 1b00 0049 | b828 1ed5 | b43d 7100 | 0049 8380 | 3801 0000 + + 0x0000713e02fbfb58: ; {metadata(method data for {method} {0x0000713db437a270} 'isCompileConstant' '(Ljava/lang/Object;)Z' in 'java/lang/invoke/MethodHandleImpl')} + 0x0000713e02fbfb58: 0149 b8b0 | 21d5 b43d | 7100 0045 | 8b88 f400 | 0000 4183 | c102 4589 | 88f4 0000 | 0041 81e1 + 0x0000713e02fbfb78: feff 1f00 | 4585 c90f | 8476 1b00 + + 0x0000713e02fbfb84: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbfb84: 0049 b828 | 1ed5 b43d | 7100 0041 | ff80 4801 | 0000 448b | 4714 49c1 | e003 458b | 401c 49c1 + 0x0000713e02fbfba4: e003 4d85 + + 0x0000713e02fbfba8: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbfba8: c049 b828 | 1ed5 b43d | 7100 0049 | c7c1 6801 | 0000 7507 | 49c7 c178 | 0100 004f | 8b1c 084d + 0x0000713e02fbfbc8: 8d5b 014f | 891c 080f | 8527 0000 + + 0x0000713e02fbfbd4: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbfbd4: 0049 b828 | 1ed5 b43d | 7100 0049 | 8380 8801 | 0000 0148 | 8bf7 0f1f + + 0x0000713e02fbfbec: ; {static_call} + 0x0000713e02fbfbec: 4400 00e8 + + 0x0000713e02fbfbf0: ; ImmutableOopMap {[176]=Oop [192]=Oop [208]=Oop [216]=Oop [224]=Oop [232]=Oop } + ;*invokestatic maybeCustomize {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkCustomized@19 + ; - java.lang.invoke.LambdaForm$MH/0x000000080008cc00::invokeExact_MT@15 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@92 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fbfbf0: cc44 bdff + + 0x0000713e02fbfbf4: ; {other} + 0x0000713e02fbfbf4: 0f1f 8400 | e411 0004 | 488b 9c24 | d000 0000 | 488b 9424 | c000 0000 + + 0x0000713e02fbfc0c: ; {metadata(method data for {method} {0x0000713db46482b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x000000080008cc00')} + 0x0000713e02fbfc0c: 48b9 0008 | 4eb5 3d71 | 0000 488d | 8940 0200 | 0048 85d2 | 750c f641 | 0801 7506 | f048 8349 + 0x0000713e02fbfc2c: 0801 4885 | db75 0ef6 | 4118 0175 | 34f0 4883 | 4918 01eb | 2c44 8b43 | 0849 ba00 | 0000 0008 + 0x0000713e02fbfc4c: 0000 004d | 03c2 4d8b | d04c 3341 | 1849 f7c0 | fcff ffff | 740b 41f6 | c002 7505 | 4883 4918 + 0x0000713e02fbfc6c: 0248 8bbc | 24d8 0000 + + 0x0000713e02fbfc74: ; {metadata(method data for {method} {0x0000713db46482b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x000000080008cc00')} + 0x0000713e02fbfc74: 0048 b900 | 084e b53d | 7100 0048 | 8381 0802 | 0000 0148 | 8bcb 4c8b | 8424 e000 | 0000 4c8b + 0x0000713e02fbfc94: 8c24 e800 | 0000 488b | b424 d800 | 0000 0f1f + + 0x0000713e02fbfca4: ; {optimized virtual_call} + 0x0000713e02fbfca4: 4400 00e8 + + 0x0000713e02fbfca8: ; ImmutableOopMap {[176]=Oop } + ;*invokevirtual invokeBasic {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.LambdaForm$MH/0x000000080008cc00::invokeExact_MT@24 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@92 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fbfca8: d419 5f07 + + 0x0000713e02fbfcac: ; {other} + 0x0000713e02fbfcac: 0f1f 8400 | 9c12 0005 + + 0x0000713e02fbfcb4: ; {metadata(method data for {method} {0x0000713db46482b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x000000080008cc00')} + 0x0000713e02fbfcb4: 48be 0008 | 4eb5 3d71 | 0000 488d | b660 0200 | 0048 85c0 | 750a f606 | 0175 05f0 | 4883 0e01 + 0x0000713e02fbfcd4: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbfcd4: 48be 70ad | 7bb6 3d71 | 0000 488d | b660 0300 | 0048 85c0 | 750c f606 | 0175 4df0 | 4883 0e01 + 0x0000713e02fbfcf4: eb46 8b78 | 0849 ba00 | 0000 0008 | 0000 0049 | 03fa 4c8b | d748 333e | 48f7 c7fc | ffff ff74 + 0x0000713e02fbfd14: 2740 f6c7 | 0275 2148 | f706 feff | ffff 7415 | 498b fa48 | 333e 48f7 | c7fc ffff | ff74 0948 + 0x0000713e02fbfd34: 830e 02eb | 0348 893e + + 0x0000713e02fbfd3c: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbfd3c: 48be 70ad | 7bb6 3d71 | 0000 ff86 | 7003 0000 | 4881 c470 | 0100 005d + + 0x0000713e02fbfd54: ; {poll_return} + 0x0000713e02fbfd54: 493b a750 | 0400 000f | 87c0 1900 | 00c3 488b | 8c24 b800 | 0000 488b | 9424 c000 | 0000 8b7e + 0x0000713e02fbfd74: 1848 c1e7 | 0348 89bc | 24f8 0000 | 0083 790c | 000f 86b6 | 1900 008b | 5910 48c1 | e303 4889 + 0x0000713e02fbfd94: 9c24 f000 | 0000 8379 | 0c01 0f86 | af19 0000 | 8b41 1448 | c1e0 0348 | 8984 2400 + + 0x0000713e02fbfdb0: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbfdb0: 0100 0048 | b970 ad7b | b63d 7100 | 0048 8d89 | c002 0000 | 4885 d275 | 0ef6 4108 | 0175 54f0 + 0x0000713e02fbfdd0: 4883 4908 | 01eb 4c44 | 8b42 0849 | ba00 0000 | 0008 0000 | 004d 03c2 | 4d8b d04c | 3341 0849 + 0x0000713e02fbfdf0: f7c0 fcff | ffff 742b | 41f6 c002 | 7525 48f7 | 4108 feff | ffff 7417 | 4d8b c24c | 3341 0849 + 0x0000713e02fbfe10: f7c0 fcff | ffff 740b | 4883 4908 | 02eb 044c + + 0x0000713e02fbfe20: ; {metadata(method data for {method} {0x0000713db58af2b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x00000008002fe000')} + 0x0000713e02fbfe20: 8941 0848 | b900 c09c | b63d 7100 | 0048 8d89 | e802 0000 | 4885 ff75 | 0cf6 0101 | 754e f048 + 0x0000713e02fbfe40: 8309 01eb | 4744 8b47 | 0849 ba00 | 0000 0008 | 0000 004d | 03c2 4d8b | d04c 3301 | 49f7 c0fc + 0x0000713e02fbfe60: ffff ff74 | 2741 f6c0 | 0275 2148 | f701 feff | ffff 7415 | 4d8b c24c | 3301 49f7 | c0fc ffff + 0x0000713e02fbfe80: ff74 0948 | 8309 02eb | 034c 8901 | 4885 d275 | 0ef6 4110 | 0175 54f0 | 4883 4910 | 01eb 4c44 + 0x0000713e02fbfea0: 8b42 0849 | ba00 0000 | 0008 0000 | 004d 03c2 | 4d8b d04c | 3341 1049 | f7c0 fcff | ffff 742b + 0x0000713e02fbfec0: 41f6 c002 | 7525 48f7 | 4110 feff | ffff 7417 | 4d8b c24c | 3341 1049 | f7c0 fcff | ffff 740b + 0x0000713e02fbfee0: 4883 4910 | 02eb 044c + + 0x0000713e02fbfee8: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fbfee8: 8941 1048 | b970 ad7b | b63d 7100 | 0048 8381 | 8802 0000 + + 0x0000713e02fbfefc: ; {metadata(method data for {method} {0x0000713db58af2b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x00000008002fe000')} + 0x0000713e02fbfefc: 0148 b900 | c09c b63d | 7100 0044 | 8b81 f400 | 0000 4183 | c002 4489 | 81f4 0000 | 0041 81e0 + 0x0000713e02fbff1c: feff 1f00 | 4585 c00f | 843c 1800 + + 0x0000713e02fbff28: ; {metadata(method data for {method} {0x0000713db58af2b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x00000008002fe000')} + 0x0000713e02fbff28: 0048 b900 | c09c b63d | 7100 0048 | 8d89 b801 | 0000 4885 | ff75 0ef6 | 4108 0175 | 54f0 4883 + 0x0000713e02fbff48: 4908 01eb | 4c44 8b47 | 0849 ba00 | 0000 0008 | 0000 004d | 03c2 4d8b | d04c 3341 | 0849 f7c0 + 0x0000713e02fbff68: fcff ffff | 742b 41f6 | c002 7525 | 48f7 4108 | feff ffff | 7417 4d8b | c24c 3341 | 0849 f7c0 + 0x0000713e02fbff88: fcff ffff | 740b 4883 | 4908 02eb | 044c 8941 + + 0x0000713e02fbff98: ; {oop(a 'java/lang/invoke/MethodType'{0x00000000a0273da8} = (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;)} + 0x0000713e02fbff98: 0849 b8a8 | 3d27 a000 | 0000 004d | 85c0 750c | f641 1801 | 7506 f048 | 8349 1801 + + 0x0000713e02fbffb4: ; {metadata(method data for {method} {0x0000713db58af2b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x00000008002fe000')} + 0x0000713e02fbffb4: 48b9 00c0 | 9cb6 3d71 | 0000 4883 | 81a8 0100 + + 0x0000713e02fbffc4: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbffc4: 0001 48b9 | 882a d5b4 | 3d71 0000 | 448b 89f4 | 0000 0041 | 83c1 0244 | 8989 f400 | 0000 4181 + 0x0000713e02fbffe4: e1fe ff1f | 0045 85c9 | 0f84 9417 | 0000 483b | 0748 8bcf + + 0x0000713e02fbfff8: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fbfff8: 49b9 882a | d5b4 3d71 | 0000 8b49 | 0849 ba00 | 0000 0008 | 0000 0049 | 03ca 493b | 8948 0100 + 0x0000713e02fc0018: 0075 0d49 | 8381 5001 | 0000 01e9 | 6000 0000 | 493b 8958 | 0100 0075 | 0d49 8381 | 6001 0000 + 0x0000713e02fc0038: 01e9 4a00 | 0000 4983 | b948 0100 | 0000 7517 | 4989 8948 | 0100 0049 | c781 5001 | 0000 0100 + 0x0000713e02fc0058: 0000 e929 | 0000 0049 | 83b9 5801 | 0000 0075 | 1749 8989 | 5801 0000 | 49c7 8160 | 0100 0001 + 0x0000713e02fc0078: 0000 00e9 | 0800 0000 | 4983 8138 | 0100 0001 | 8b4f 1048 | c1e1 0349 + + 0x0000713e02fc0090: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0090: 3bc8 49b8 | 882a d5b4 | 3d71 0000 | 49c7 c180 | 0100 0075 | 0749 c7c1 | 7001 0000 | 4f8b 1c08 + 0x0000713e02fc00b0: 4d8d 5b01 | 4f89 1c08 | 0f85 490e + + 0x0000713e02fc00bc: ; {metadata(method data for {method} {0x0000713db58af2b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x00000008002fe000')} + 0x0000713e02fc00bc: 0000 48b9 | 00c0 9cb6 | 3d71 0000 | 488d 89f0 | 0100 0044 | 8b47 0849 | ba00 0000 | 0008 0000 + 0x0000713e02fc00dc: 004d 03c2 | 4d8b d04c | 3341 0849 | f7c0 fcff | ffff 742b | 41f6 c002 | 7525 48f7 | 4108 feff + 0x0000713e02fc00fc: ffff 7417 | 4d8b c24c | 3341 0849 | f7c0 fcff | ffff 740b | 4883 4908 | 02eb 044c + + 0x0000713e02fc0118: ; {metadata(method data for {method} {0x0000713db58af2b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x00000008002fe000')} + 0x0000713e02fc0118: 8941 0848 | b900 c09c | b63d 7100 | 0048 8381 | e001 0000 + + 0x0000713e02fc012c: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc012c: 0148 b928 | 1ed5 b43d | 7100 0044 | 8b81 f400 | 0000 4183 | c002 4489 | 81f4 0000 | 0041 81e0 + 0x0000713e02fc014c: feff 1f00 | 4585 c00f | 8453 1600 + + 0x0000713e02fc0158: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0158: 0048 b928 | 1ed5 b43d | 7100 0048 | 8381 3801 + + 0x0000713e02fc0168: ; {metadata(method data for {method} {0x0000713db437a270} 'isCompileConstant' '(Ljava/lang/Object;)Z' in 'java/lang/invoke/MethodHandleImpl')} + 0x0000713e02fc0168: 0000 0148 | b9b0 21d5 | b43d 7100 | 0044 8b81 | f400 0000 | 4183 c002 | 4489 81f4 | 0000 0041 + 0x0000713e02fc0188: 81e0 feff | 1f00 4585 | c00f 8436 + + 0x0000713e02fc0194: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0194: 1600 0048 | b928 1ed5 | b43d 7100 | 00ff 8148 | 0100 008b | 4f14 48c1 | e103 8b49 | 1c48 c1e1 + 0x0000713e02fc01b4: 0348 85c9 + + 0x0000713e02fc01b8: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc01b8: 48b9 281e | d5b4 3d71 | 0000 49c7 | c068 0100 | 0075 0749 | c7c0 7801 | 0000 4e8b | 0c01 4d8d + 0x0000713e02fc01d8: 4901 4e89 | 0c01 0f85 | 2800 0000 + + 0x0000713e02fc01e4: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc01e4: 48b9 281e | d5b4 3d71 | 0000 4883 | 8188 0100 | 0001 488b | f766 0f1f + + 0x0000713e02fc01fc: ; {static_call} + 0x0000713e02fc01fc: 4400 00e8 + + 0x0000713e02fc0200: ; ImmutableOopMap {[176]=Oop [192]=Oop [240]=Oop [248]=Oop [256]=Oop } + ;*invokestatic maybeCustomize {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkCustomized@19 + ; - java.lang.invoke.LambdaForm$MH/0x00000008002fe000::invokeExact_MT@15 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@72 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc0200: bc3e bdff + + 0x0000713e02fc0204: ; {other} + 0x0000713e02fc0204: 0f1f 8400 | f417 0006 | 488b 9c24 | f000 0000 | 488b 9424 | c000 0000 + + 0x0000713e02fc021c: ; {metadata(method data for {method} {0x0000713db58af2b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x00000008002fe000')} + 0x0000713e02fc021c: 48b9 00c0 | 9cb6 3d71 | 0000 488d | 8940 0200 | 0048 85d2 | 750e f641 | 0801 7554 | f048 8349 + 0x0000713e02fc023c: 0801 eb4c | 448b 4208 | 49ba 0000 | 0000 0800 | 0000 4d03 | c24d 8bd0 | 4c33 4108 | 49f7 c0fc + 0x0000713e02fc025c: ffff ff74 | 2b41 f6c0 | 0275 2548 | f741 08fe | ffff ff74 | 174d 8bc2 | 4c33 4108 | 49f7 c0fc + 0x0000713e02fc027c: ffff ff74 | 0b48 8349 | 0802 eb04 | 4c89 4108 | 4885 db75 | 0ef6 4118 | 0175 54f0 | 4883 4918 + 0x0000713e02fc029c: 01eb 4c44 | 8b43 0849 | ba00 0000 | 0008 0000 | 004d 03c2 | 4d8b d04c | 3341 1849 | f7c0 fcff + 0x0000713e02fc02bc: ffff 742b | 41f6 c002 | 7525 48f7 | 4118 feff | ffff 7417 | 4d8b c24c | 3341 1849 | f7c0 fcff + 0x0000713e02fc02dc: ffff 740b | 4883 4918 | 02eb 044c | 8941 1848 | 8bbc 24f8 + + 0x0000713e02fc02f0: ; {metadata(method data for {method} {0x0000713db58af2b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x00000008002fe000')} + 0x0000713e02fc02f0: 0000 0048 | b900 c09c | b63d 7100 | 0048 8381 | 0802 0000 | 0148 8bcb | 4c8b 8424 | 0001 0000 + 0x0000713e02fc0310: 488b b424 | f800 0000 | 0f1f 8000 + + 0x0000713e02fc031c: ; {optimized virtual_call} + 0x0000713e02fc031c: 0000 00e8 + + 0x0000713e02fc0320: ; ImmutableOopMap {[176]=Oop } + ;*invokevirtual invokeBasic {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.LambdaForm$MH/0x00000008002fe000::invokeExact_MT@22 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@72 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc0320: dc79 5f07 + + 0x0000713e02fc0324: ; {other} + 0x0000713e02fc0324: 0f1f 8400 | 1419 0007 + + 0x0000713e02fc032c: ; {metadata(method data for {method} {0x0000713db58af2b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x00000008002fe000')} + 0x0000713e02fc032c: 48be 00c0 | 9cb6 3d71 | 0000 488d | b660 0200 | 0048 85c0 | 750c f606 | 0175 4df0 | 4883 0e01 + 0x0000713e02fc034c: eb46 8b78 | 0849 ba00 | 0000 0008 | 0000 0049 | 03fa 4c8b | d748 333e | 48f7 c7fc | ffff ff74 + 0x0000713e02fc036c: 2740 f6c7 | 0275 2148 | f706 feff | ffff 7415 | 498b fa48 | 333e 48f7 | c7fc ffff | ff74 0948 + 0x0000713e02fc038c: 830e 02eb | 0348 893e + + 0x0000713e02fc0394: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc0394: 48be 70ad | 7bb6 3d71 | 0000 488d | b6e0 0200 | 0048 85c0 | 750c f606 | 0175 4df0 | 4883 0e01 + 0x0000713e02fc03b4: eb46 8b78 | 0849 ba00 | 0000 0008 | 0000 0049 | 03fa 4c8b | d748 333e | 48f7 c7fc | ffff ff74 + 0x0000713e02fc03d4: 2740 f6c7 | 0275 2148 | f706 feff | ffff 7415 | 498b fa48 | 333e 48f7 | c7fc ffff | ff74 0948 + 0x0000713e02fc03f4: 830e 02eb | 0348 893e + + 0x0000713e02fc03fc: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc03fc: 48be 70ad | 7bb6 3d71 | 0000 ff86 | f002 0000 | 4881 c470 | 0100 005d + + 0x0000713e02fc0414: ; {poll_return} + 0x0000713e02fc0414: 493b a750 | 0400 000f | 87d2 1300 | 00c3 488b | 8c24 b800 | 0000 488b | 9424 c000 | 0000 8b7e + 0x0000713e02fc0434: 1848 c1e7 | 0348 89bc | 2410 0100 | 0083 790c | 000f 86c8 | 1300 008b | 5910 48c1 | e303 4889 + 0x0000713e02fc0454: 9c24 0801 + + 0x0000713e02fc0458: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc0458: 0000 48b8 | 70ad 7bb6 | 3d71 0000 | 488d 8040 | 0200 0048 | 85d2 750e | f640 0801 | 7552 f048 + 0x0000713e02fc0478: 8348 0801 | eb4a 8b4a | 0849 ba00 | 0000 0008 | 0000 0049 | 03ca 4c8b | d148 3348 | 0848 f7c1 + 0x0000713e02fc0498: fcff ffff | 742a f6c1 | 0275 2548 | f740 08fe | ffff ff74 | 1749 8bca | 4833 4808 | 48f7 c1fc + 0x0000713e02fc04b8: ffff ff74 | 0b48 8348 | 0802 eb04 | 4889 4808 + + 0x0000713e02fc04c8: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc04c8: 48b8 b0b1 | 7bb6 3d71 | 0000 488d | 80e0 0200 | 0048 85ff | 750c f600 | 0175 4cf0 | 4883 0801 + 0x0000713e02fc04e8: eb45 8b4f | 0849 ba00 | 0000 0008 | 0000 0049 | 03ca 4c8b | d148 3308 | 48f7 c1fc | ffff ff74 + 0x0000713e02fc0508: 26f6 c102 | 7521 48f7 | 00fe ffff | ff74 1549 | 8bca 4833 | 0848 f7c1 | fcff ffff | 7409 4883 + 0x0000713e02fc0528: 0802 eb03 | 4889 0848 | 85d2 750e | f640 1001 | 7552 f048 | 8348 1001 | eb4a 8b4a | 0849 ba00 + 0x0000713e02fc0548: 0000 0008 | 0000 0049 | 03ca 4c8b | d148 3348 | 1048 f7c1 | fcff ffff | 742a f6c1 | 0275 2548 + 0x0000713e02fc0568: f740 10fe | ffff ff74 | 1749 8bca | 4833 4810 | 48f7 c1fc | ffff ff74 | 0b48 8348 | 1002 eb04 + 0x0000713e02fc0588: 4889 4810 + + 0x0000713e02fc058c: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc058c: 48b8 70ad | 7bb6 3d71 | 0000 4883 | 8008 0200 + + 0x0000713e02fc059c: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc059c: 0001 48b8 | b0b1 7bb6 | 3d71 0000 | 8b88 f400 | 0000 83c1 | 0289 88f4 | 0000 0081 | e1fe ff1f + 0x0000713e02fc05bc: 0085 c90f | 8460 1200 + + 0x0000713e02fc05c4: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc05c4: 0048 b8b0 | b17b b63d | 7100 0048 | 8d80 b801 | 0000 4885 | ff75 0ef6 | 4008 0175 | 52f0 4883 + 0x0000713e02fc05e4: 4808 01eb | 4a8b 4f08 | 49ba 0000 | 0000 0800 | 0000 4903 | ca4c 8bd1 | 4833 4808 | 48f7 c1fc + 0x0000713e02fc0604: ffff ff74 | 2af6 c102 | 7525 48f7 | 4008 feff | ffff 7417 | 498b ca48 | 3348 0848 | f7c1 fcff + 0x0000713e02fc0624: ffff 740b | 4883 4808 | 02eb 0448 + + 0x0000713e02fc0630: ; {oop(a 'java/lang/invoke/MethodType'{0x00000000a0004c10} = (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;)} + 0x0000713e02fc0630: 8948 0848 | b910 4c00 | a000 0000 | 0048 85c9 | 750c f640 | 1801 7506 | f048 8348 + + 0x0000713e02fc064c: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc064c: 1801 48b8 | b0b1 7bb6 | 3d71 0000 | 4883 80a8 | 0100 0001 + + 0x0000713e02fc0660: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0660: 48b8 882a | d5b4 3d71 | 0000 448b | 80f4 0000 | 0041 83c0 | 0244 8980 | f400 0000 | 4181 e0fe + 0x0000713e02fc0680: ff1f 0045 | 85c0 0f84 | ba11 0000 + + 0x0000713e02fc068c: ; implicit exception: dispatches to 0x0000713e02fc1867 + 0x0000713e02fc068c: 483b 0748 + + 0x0000713e02fc0690: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0690: 8bc7 49b8 | 882a d5b4 | 3d71 0000 | 8b40 0849 | ba00 0000 | 0008 0000 | 0049 03c2 | 493b 8048 + 0x0000713e02fc06b0: 0100 0075 | 0d49 8380 | 5001 0000 | 01e9 6000 | 0000 493b | 8058 0100 | 0075 0d49 | 8380 6001 + 0x0000713e02fc06d0: 0000 01e9 | 4a00 0000 | 4983 b848 | 0100 0000 | 7517 4989 | 8048 0100 | 0049 c780 | 5001 0000 + 0x0000713e02fc06f0: 0100 0000 | e929 0000 | 0049 83b8 | 5801 0000 | 0075 1749 | 8980 5801 | 0000 49c7 | 8060 0100 + 0x0000713e02fc0710: 0001 0000 | 00e9 0800 | 0000 4983 | 8038 0100 | 0001 8b47 | 1048 c1e0 | 0348 3bc1 + + 0x0000713e02fc072c: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc072c: 48b9 882a | d5b4 3d71 | 0000 49c7 | c080 0100 | 0075 0749 | c7c0 7001 | 0000 4e8b | 0c01 4d8d + 0x0000713e02fc074c: 4901 4e89 | 0c01 0f85 | 6f07 0000 + + 0x0000713e02fc0758: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc0758: 48b8 b0b1 | 7bb6 3d71 | 0000 488d | 80f0 0100 | 008b 4f08 | 49ba 0000 | 0000 0800 | 0000 4903 + 0x0000713e02fc0778: ca4c 8bd1 | 4833 4808 | 48f7 c1fc | ffff ff74 | 2af6 c102 | 7525 48f7 | 4008 feff | ffff 7417 + 0x0000713e02fc0798: 498b ca48 | 3348 0848 | f7c1 fcff | ffff 740b | 4883 4808 | 02eb 0448 + + 0x0000713e02fc07b0: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc07b0: 8948 0848 | b8b0 b17b | b63d 7100 | 0048 8380 | e001 0000 + + 0x0000713e02fc07c4: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc07c4: 0148 b828 | 1ed5 b43d | 7100 008b | 88f4 0000 | 0083 c102 | 8988 f400 | 0000 81e1 | feff 1f00 + 0x0000713e02fc07e4: 85c9 0f84 | 8010 0000 + + 0x0000713e02fc07ec: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc07ec: 48b8 281e | d5b4 3d71 | 0000 4883 | 8038 0100 + + 0x0000713e02fc07fc: ; {metadata(method data for {method} {0x0000713db437a270} 'isCompileConstant' '(Ljava/lang/Object;)Z' in 'java/lang/invoke/MethodHandleImpl')} + 0x0000713e02fc07fc: 0001 48b8 | b021 d5b4 | 3d71 0000 | 8b88 f400 | 0000 83c1 | 0289 88f4 | 0000 0081 | e1fe ff1f + 0x0000713e02fc081c: 0085 c90f | 8468 1000 + + 0x0000713e02fc0824: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0824: 0048 b828 | 1ed5 b43d | 7100 00ff | 8048 0100 | 008b 4714 | 48c1 e003 + + 0x0000713e02fc083c: ; implicit exception: dispatches to 0x0000713e02fc18ae + 0x0000713e02fc083c: 8b40 1c48 | c1e0 0348 + + 0x0000713e02fc0844: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0844: 85c0 48b8 | 281e d5b4 | 3d71 0000 | 48c7 c168 | 0100 0075 | 0748 c7c1 | 7801 0000 | 4c8b 0408 + 0x0000713e02fc0864: 4d8d 4001 | 4c89 0408 | 0f85 2200 + + 0x0000713e02fc0870: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0870: 0000 48b8 | 281e d5b4 | 3d71 0000 | 4883 8088 | 0100 0001 + + 0x0000713e02fc0884: ; {static_call} + 0x0000713e02fc0884: 488b f7e8 + + 0x0000713e02fc0888: ; ImmutableOopMap {[176]=Oop [192]=Oop [264]=Oop [272]=Oop } + ;*invokestatic maybeCustomize {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkCustomized@19 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@55 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc0888: 3438 bdff + + 0x0000713e02fc088c: ; {other} + 0x0000713e02fc088c: 0f1f 8400 | 7c1e 0008 | 488b 9c24 | 0801 0000 | 488b 9424 | c000 0000 + + 0x0000713e02fc08a4: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc08a4: 48b9 b0b1 | 7bb6 3d71 | 0000 488d | 8940 0200 | 0048 85d2 | 750e f641 | 0801 7553 | f048 8349 + 0x0000713e02fc08c4: 0801 eb4b | 8b72 0849 | ba00 0000 | 0008 0000 | 0049 03f2 | 4c8b d648 | 3371 0848 | f7c6 fcff + 0x0000713e02fc08e4: ffff 742b | 40f6 c602 | 7525 48f7 | 4108 feff | ffff 7417 | 498b f248 | 3371 0848 | f7c6 fcff + 0x0000713e02fc0904: ffff 740b | 4883 4908 | 02eb 0448 | 8971 0848 | 85db 750e | f641 1801 | 7553 f048 | 8349 1801 + 0x0000713e02fc0924: eb4b 8b73 | 0849 ba00 | 0000 0008 | 0000 0049 | 03f2 4c8b | d648 3371 | 1848 f7c6 | fcff ffff + 0x0000713e02fc0944: 742b 40f6 | c602 7525 | 48f7 4118 | feff ffff | 7417 498b | f248 3371 | 1848 f7c6 | fcff ffff + 0x0000713e02fc0964: 740b 4883 | 4918 02eb | 0448 8971 | 1848 8bbc | 2410 0100 + + 0x0000713e02fc0978: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc0978: 0048 b9b0 | b17b b63d | 7100 0048 | 8381 0802 | 0000 0148 | 8bcb 488b | b424 1001 + + 0x0000713e02fc0994: ; {optimized virtual_call} + 0x0000713e02fc0994: 0000 90e8 + + 0x0000713e02fc0998: ; ImmutableOopMap {[176]=Oop } + ;*invokevirtual invokeBasic {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@20 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@55 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc0998: e403 5f07 + + 0x0000713e02fc099c: ; {other} + 0x0000713e02fc099c: 0f1f 8400 | 8c1f 0009 + + 0x0000713e02fc09a4: ; {metadata(method data for {method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc09a4: 48be b0b1 | 7bb6 3d71 | 0000 488d | b660 0200 | 0048 85c0 | 750c f606 | 0175 4df0 | 4883 0e01 + 0x0000713e02fc09c4: eb46 8b78 | 0849 ba00 | 0000 0008 | 0000 0049 | 03fa 4c8b | d748 333e | 48f7 c7fc | ffff ff74 + 0x0000713e02fc09e4: 2740 f6c7 | 0275 2148 | f706 feff | ffff 7415 | 498b fa48 | 333e 48f7 | c7fc ffff | ff74 0948 + 0x0000713e02fc0a04: 830e 02eb | 0348 893e + + 0x0000713e02fc0a0c: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc0a0c: 48be 70ad | 7bb6 3d71 | 0000 488d | b660 0200 | 0048 85c0 | 750c f606 | 0175 4df0 | 4883 0e01 + 0x0000713e02fc0a2c: eb46 8b78 | 0849 ba00 | 0000 0008 | 0000 0049 | 03fa 4c8b | d748 333e | 48f7 c7fc | ffff ff74 + 0x0000713e02fc0a4c: 2740 f6c7 | 0275 2148 | f706 feff | ffff 7415 | 498b fa48 | 333e 48f7 | c7fc ffff | ff74 0948 + 0x0000713e02fc0a6c: 830e 02eb | 0348 893e + + 0x0000713e02fc0a74: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc0a74: 48be 70ad | 7bb6 3d71 | 0000 ff86 | 7002 0000 | 4881 c470 | 0100 005d + + 0x0000713e02fc0a8c: ; {poll_return} + 0x0000713e02fc0a8c: 493b a750 | 0400 000f | 871a 0e00 | 00c3 488b | 9424 c000 | 0000 8b7e | 1848 c1e7 | 0348 89bc + 0x0000713e02fc0aac: 2418 0100 + + 0x0000713e02fc0ab0: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc0ab0: 0048 bb70 | ad7b b63d | 7100 0048 | 8d9b d001 | 0000 4885 | d275 0ef6 | 4308 0175 | 4ff0 4883 + 0x0000713e02fc0ad0: 4b08 01eb | 478b 4208 | 49ba 0000 | 0000 0800 | 0000 4903 | c24c 8bd0 | 4833 4308 | 48a9 fcff + 0x0000713e02fc0af0: ffff 7428 | a802 7524 | 48f7 4308 | feff ffff | 7416 498b | c248 3343 | 0848 a9fc | ffff ff74 + 0x0000713e02fc0b10: 0b48 834b | 0802 eb04 | 4889 4308 + + 0x0000713e02fc0b1c: ; {metadata(method data for {method} {0x0000713db43a8500} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc0b1c: 48bb 38dc | 32b5 3d71 | 0000 488d | 9bc8 0200 | 0048 85ff | 750a f603 | 0175 05f0 | 4883 0b01 + 0x0000713e02fc0b3c: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc0b3c: 48bb 70ad | 7bb6 3d71 | 0000 4883 | 8398 0100 + + 0x0000713e02fc0b4c: ; {metadata(method data for {method} {0x0000713db43a8500} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc0b4c: 0001 48bb | 38dc 32b5 | 3d71 0000 | 8b83 f400 | 0000 83c0 | 0289 83f4 | 0000 0025 | feff 1f00 + 0x0000713e02fc0b6c: 85c0 0f84 | 550d 0000 + + 0x0000713e02fc0b74: ; {metadata(method data for {method} {0x0000713db43a8500} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc0b74: 48bb 38dc | 32b5 3d71 | 0000 488d | 9bb8 0100 | 0048 85ff | 750c f643 | 0801 7506 | f048 834b + 0x0000713e02fc0b94: ; {oop(a 'java/lang/invoke/MethodType'{0x00000000a0004bc0} = (Ljava/lang/Object;)Ljava/lang/Object;)} + 0x0000713e02fc0b94: 0801 48b8 | c04b 00a0 | 0000 0000 | 4885 c075 | 0cf6 4318 | 0175 06f0 | 4883 4b18 + + 0x0000713e02fc0bb0: ; {metadata(method data for {method} {0x0000713db43a8500} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc0bb0: 0148 bb38 | dc32 b53d | 7100 0048 | 8383 a801 + + 0x0000713e02fc0bc0: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0bc0: 0000 0148 | bb88 2ad5 | b43d 7100 | 008b 8bf4 | 0000 0083 | c102 898b | f400 0000 | 81e1 feff + 0x0000713e02fc0be0: 1f00 85c9 | 0f84 000d | 0000 483b | 0748 8bdf + + 0x0000713e02fc0bf0: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0bf0: 48b9 882a | d5b4 3d71 | 0000 8b5b | 0849 ba00 | 0000 0008 | 0000 0049 | 03da 483b | 9948 0100 + 0x0000713e02fc0c10: 0075 0d48 | 8381 5001 | 0000 01e9 | 6000 0000 | 483b 9958 | 0100 0075 | 0d48 8381 | 6001 0000 + 0x0000713e02fc0c30: 01e9 4a00 | 0000 4883 | b948 0100 | 0000 7517 | 4889 9948 | 0100 0048 | c781 5001 | 0000 0100 + 0x0000713e02fc0c50: 0000 e929 | 0000 0048 | 83b9 5801 | 0000 0075 | 1748 8999 | 5801 0000 | 48c7 8160 | 0100 0001 + 0x0000713e02fc0c70: 0000 00e9 | 0800 0000 | 4883 8138 | 0100 0001 | 8b5f 1048 | c1e3 0348 + + 0x0000713e02fc0c88: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0c88: 3bd8 48b8 | 882a d5b4 | 3d71 0000 | 48c7 c180 | 0100 0075 | 0748 c7c1 | 7001 0000 | 4c8b 0408 + 0x0000713e02fc0ca8: 4d8d 4001 | 4c89 0408 | 0f85 cb01 + + 0x0000713e02fc0cb4: ; {metadata(method data for {method} {0x0000713db43a8500} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc0cb4: 0000 48bb | 38dc 32b5 | 3d71 0000 | 4883 83e0 | 0100 0001 + + 0x0000713e02fc0cc8: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0cc8: 48bb 281e | d5b4 3d71 | 0000 8b83 | f400 0000 | 83c0 0289 | 83f4 0000 | 0025 feff | 1f00 85c0 + 0x0000713e02fc0ce8: 0f84 220c + + 0x0000713e02fc0cec: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0cec: 0000 48bb | 281e d5b4 | 3d71 0000 | 4883 8338 | 0100 0001 + + 0x0000713e02fc0d00: ; {metadata(method data for {method} {0x0000713db437a270} 'isCompileConstant' '(Ljava/lang/Object;)Z' in 'java/lang/invoke/MethodHandleImpl')} + 0x0000713e02fc0d00: 48bb b021 | d5b4 3d71 | 0000 8b83 | f400 0000 | 83c0 0289 | 83f4 0000 | 0025 feff | 1f00 85c0 + 0x0000713e02fc0d20: 0f84 0b0c + + 0x0000713e02fc0d24: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0d24: 0000 48bb | 281e d5b4 | 3d71 0000 | ff83 4801 | 0000 8b5f | 1448 c1e3 | 038b 5b1c | 48c1 e303 + 0x0000713e02fc0d44: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0d44: 4885 db48 | bb28 1ed5 | b43d 7100 | 0048 c7c0 | 6801 0000 | 7507 48c7 | c078 0100 | 0048 8b0c + 0x0000713e02fc0d64: 0348 8d49 | 0148 890c | 030f 8529 + + 0x0000713e02fc0d70: ; {metadata(method data for {method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0d70: 0000 0048 | bb28 1ed5 | b43d 7100 | 0048 8383 | 8801 0000 | 0148 8bf7 | 0f1f 8000 + + 0x0000713e02fc0d8c: ; {static_call} + 0x0000713e02fc0d8c: 0000 00e8 + + 0x0000713e02fc0d90: ; ImmutableOopMap {[176]=Oop [192]=Oop [280]=Oop } + ;*invokestatic maybeCustomize {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkCustomized@19 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@41 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc0d90: 2c33 bdff + + 0x0000713e02fc0d94: ; {other} + 0x0000713e02fc0d94: 0f1f 8400 | 8423 000a | 488b bc24 | 1801 0000 + + 0x0000713e02fc0da4: ; {metadata(method data for {method} {0x0000713db43a8500} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc0da4: 48ba 38dc | 32b5 3d71 | 0000 4883 | 8208 0200 | 0001 488b | 9424 c000 | 0000 488b | b424 1801 + 0x0000713e02fc0dc4: ; {optimized virtual_call} + 0x0000713e02fc0dc4: 0000 90e8 + + 0x0000713e02fc0dc8: ; ImmutableOopMap {[176]=Oop } + ;*invokevirtual invokeBasic {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@19 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@41 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc0dc8: b44a 5e07 + + 0x0000713e02fc0dcc: ; {other} + 0x0000713e02fc0dcc: 0f1f 8400 | bc23 000b + + 0x0000713e02fc0dd4: ; {metadata(method data for {method} {0x0000713db43a8500} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc0dd4: 48be 38dc | 32b5 3d71 | 0000 488d | b650 0200 | 0048 85c0 | 750a f606 | 0175 05f0 | 4883 0e01 + 0x0000713e02fc0df4: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc0df4: 48be 70ad | 7bb6 3d71 | 0000 488d | b6e0 0100 | 0048 85c0 | 750c f606 | 0175 4cf0 | 4883 0e01 + 0x0000713e02fc0e14: eb45 8b50 | 0849 ba00 | 0000 0008 | 0000 0049 | 03d2 4c8b | d248 3316 | 48f7 c2fc | ffff ff74 + 0x0000713e02fc0e34: 26f6 c202 | 7521 48f7 | 06fe ffff | ff74 1549 | 8bd2 4833 | 1648 f7c2 | fcff ffff | 7409 4883 + 0x0000713e02fc0e54: 0e02 eb03 + + 0x0000713e02fc0e58: ; {metadata(method data for {method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc0e58: 4889 1648 | be70 ad7b | b63d 7100 | 00ff 86f0 | 0100 0048 | 81c4 7001 + + 0x0000713e02fc0e70: ; {poll_return} + 0x0000713e02fc0e70: 0000 5d49 | 3ba7 5004 | 0000 0f87 | d70a 0000 + + 0x0000713e02fc0e80: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0e80: c348 be88 | 2ad5 b43d | 7100 0048 | 8386 9001 + + 0x0000713e02fc0e90: ; {oop(a 'java/lang/invoke/MethodType'{0x00000000a0004bc0} = (Ljava/lang/Object;)Ljava/lang/Object;)} + 0x0000713e02fc0e90: 0000 0148 | bac0 4b00 | a000 0000 | 0048 8bf3 | 0f1f 8000 + + 0x0000713e02fc0ea4: ; {static_call} + 0x0000713e02fc0ea4: 0000 00e8 + + 0x0000713e02fc0ea8: ; ImmutableOopMap {[176]=Oop [192]=Oop [280]=Oop } + ;*invokestatic newWrongMethodTypeException {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkExactType@12 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@41 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc0ea8: d4d2 ee06 + + 0x0000713e02fc0eac: ; {other} + 0x0000713e02fc0eac: 0f1f 8400 | 9c24 000c + + 0x0000713e02fc0eb4: ; implicit exception: dispatches to 0x0000713e02fc196d + ; ImmutableOopMap {rax=Oop [176]=Oop [192]=Oop [280]=Oop } + ;*athrow {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkExactType@15 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@41 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {section_word} + 0x0000713e02fc0eb4: 483b 0048 | bab7 0efc | 023e 7100 + + 0x0000713e02fc0ec0: ; {runtime_call handle_exception_nofpu Runtime1 stub} + 0x0000713e02fc0ec0: 00e8 ba9f + + 0x0000713e02fc0ec4: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0ec4: fb06 9048 | be88 2ad5 | b43d 7100 | 0048 8386 | 9001 0000 + + 0x0000713e02fc0ed8: ; {oop(a 'java/lang/invoke/MethodType'{0x00000000a0004c10} = (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;)} + 0x0000713e02fc0ed8: 0148 ba10 | 4c00 a000 | 0000 0048 + + 0x0000713e02fc0ee4: ; {static_call} + 0x0000713e02fc0ee4: 8bf0 90e8 + + 0x0000713e02fc0ee8: ; ImmutableOopMap {[176]=Oop [192]=Oop [264]=Oop [272]=Oop } + ;*invokestatic newWrongMethodTypeException {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkExactType@12 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@55 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc0ee8: 94d2 ee06 + + 0x0000713e02fc0eec: ; {other} + 0x0000713e02fc0eec: 0f1f 8400 | dc24 000e + + 0x0000713e02fc0ef4: ; implicit exception: dispatches to 0x0000713e02fc1972 + ; ImmutableOopMap {rax=Oop [176]=Oop [192]=Oop [264]=Oop [272]=Oop } + ;*athrow {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkExactType@15 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@55 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {section_word} + 0x0000713e02fc0ef4: 483b 0048 | baf7 0efc | 023e 7100 + + 0x0000713e02fc0f00: ; {runtime_call handle_exception_nofpu Runtime1 stub} + 0x0000713e02fc0f00: 00e8 7a9f + + 0x0000713e02fc0f04: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0f04: fb06 9048 | be88 2ad5 | b43d 7100 | 0048 8386 | 9001 0000 + + 0x0000713e02fc0f18: ; {oop(a 'java/lang/invoke/MethodType'{0x00000000a0273da8} = (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;)} + 0x0000713e02fc0f18: 0148 baa8 | 3d27 a000 | 0000 0048 + + 0x0000713e02fc0f24: ; {static_call} + 0x0000713e02fc0f24: 8bf1 90e8 + + 0x0000713e02fc0f28: ; ImmutableOopMap {[176]=Oop [192]=Oop [240]=Oop [248]=Oop [256]=Oop } + ;*invokestatic newWrongMethodTypeException {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkExactType@12 + ; - java.lang.invoke.LambdaForm$MH/0x00000008002fe000::invokeExact_MT@11 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@72 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc0f28: 54d2 ee06 + + 0x0000713e02fc0f2c: ; {other} + 0x0000713e02fc0f2c: 0f1f 8400 | 1c25 0010 + + 0x0000713e02fc0f34: ; implicit exception: dispatches to 0x0000713e02fc1977 + ; ImmutableOopMap {rax=Oop [176]=Oop [192]=Oop [240]=Oop [248]=Oop [256]=Oop } + ;*athrow {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkExactType@15 + ; - java.lang.invoke.LambdaForm$MH/0x00000008002fe000::invokeExact_MT@11 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@72 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {section_word} + 0x0000713e02fc0f34: 483b 0048 | ba37 0ffc | 023e 7100 + + 0x0000713e02fc0f40: ; {runtime_call handle_exception_nofpu Runtime1 stub} + 0x0000713e02fc0f40: 00e8 3a9f + + 0x0000713e02fc0f44: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0f44: fb06 9048 | be88 2ad5 | b43d 7100 | 0048 8386 | 9001 0000 + + 0x0000713e02fc0f58: ; {oop(a 'java/lang/invoke/MethodType'{0x00000000a0273fb0} = (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;)} + 0x0000713e02fc0f58: 0148 bab0 | 3f27 a000 | 0000 0049 + + 0x0000713e02fc0f64: ; {static_call} + 0x0000713e02fc0f64: 8bf0 90e8 + + 0x0000713e02fc0f68: ; ImmutableOopMap {[176]=Oop [192]=Oop [208]=Oop [216]=Oop [224]=Oop [232]=Oop } + ;*invokestatic newWrongMethodTypeException {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkExactType@12 + ; - java.lang.invoke.LambdaForm$MH/0x000000080008cc00::invokeExact_MT@11 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@92 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc0f68: 14d2 ee06 + + 0x0000713e02fc0f6c: ; {other} + 0x0000713e02fc0f6c: 0f1f 8400 | 5c25 0012 + + 0x0000713e02fc0f74: ; implicit exception: dispatches to 0x0000713e02fc197c + ; ImmutableOopMap {rax=Oop [176]=Oop [192]=Oop [208]=Oop [216]=Oop [224]=Oop [232]=Oop } + ;*athrow {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkExactType@15 + ; - java.lang.invoke.LambdaForm$MH/0x000000080008cc00::invokeExact_MT@11 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@92 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {section_word} + 0x0000713e02fc0f74: 483b 0048 | ba77 0ffc | 023e 7100 + + 0x0000713e02fc0f80: ; {runtime_call handle_exception_nofpu Runtime1 stub} + 0x0000713e02fc0f80: 00e8 fa9e + + 0x0000713e02fc0f84: ; {metadata(method data for {method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc0f84: fb06 9048 | be88 2ad5 | b43d 7100 | 0048 8386 | 9001 0000 + + 0x0000713e02fc0f98: ; {oop(a 'java/lang/invoke/MethodType'{0x00000000a20beb60} = (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;)} + 0x0000713e02fc0f98: 0148 ba60 | eb0b a200 | 0000 0048 + + 0x0000713e02fc0fa4: ; {static_call} + 0x0000713e02fc0fa4: 8bf3 90e8 + + 0x0000713e02fc0fa8: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop [200]=Oop } + ;*invokestatic newWrongMethodTypeException {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkExactType@12 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@104 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc0fa8: d4d1 ee06 + + 0x0000713e02fc0fac: ; {other} + 0x0000713e02fc0fac: 0f1f 8400 | 9c25 0014 + + 0x0000713e02fc0fb4: ; implicit exception: dispatches to 0x0000713e02fc1981 + ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop [192]=Oop [200]=Oop } + ;*athrow {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkExactType@15 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@104 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {section_word} + 0x0000713e02fc0fb4: 483b 0048 | bab7 0ffc | 023e 7100 + + 0x0000713e02fc0fc0: ; {runtime_call handle_exception_nofpu Runtime1 stub} + 0x0000713e02fc0fc0: 00e8 ba9e | fb06 9049 | 8b87 0005 | 0000 4d33 | d24d 8997 | 0005 0000 | 4d33 d24d | 8997 0805 + 0x0000713e02fc0fe0: 0000 488b | b424 b000 + + 0x0000713e02fc0fe8: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc0fe8: 0000 48ba | c0a3 7bb6 | 3d71 0000 | 4883 8288 | 0200 0001 + + 0x0000713e02fc0ffc: ; {metadata(method data for {method} {0x0000713db476f9e8} 'isIllegalArgument' '(Ljava/lang/RuntimeException;)Z' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc0ffc: 48be c8b5 | 7bb6 3d71 | 0000 8b96 | f400 0000 | 83c2 0289 | 96f4 0000 | 0081 e2fe | ff1f 0085 + 0x0000713e02fc101c: d20f 8463 + + 0x0000713e02fc1020: ; {oop(a 'java/lang/Class'{0x00000000a0638180} = 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc1020: 0900 0048 | be80 8163 | a000 0000 | 0048 8bd0 | 4889 8424 | 2001 0000 | 0f1f 8000 + + 0x0000713e02fc103c: ; {static_call} + 0x0000713e02fc103c: 0000 00e8 + + 0x0000713e02fc1040: ; ImmutableOopMap {[288]=Oop } + ;*invokestatic isIllegalArgument {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::isIllegalArgument@3 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@58 + 0x0000713e02fc1040: 3cd1 ee06 + + 0x0000713e02fc1044: ; {other} + 0x0000713e02fc1044: 0f1f 8400 | 3426 0016 | 83e0 0185 + + 0x0000713e02fc1050: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc1050: c048 b8c0 | a37b b63d | 7100 0048 | c7c6 c002 | 0000 7407 | 48c7 c6d0 | 0200 0048 | 8b14 3048 + 0x0000713e02fc1070: 8d52 0148 | 8914 300f | 84a4 0200 | 00e9 f701 | 0000 498b | 8700 0500 | 004d 33d2 | 4d89 9700 + 0x0000713e02fc1090: 0500 004d | 33d2 4d89 | 9708 0500 | 0048 8bb4 | 24b0 0000 + + 0x0000713e02fc10a4: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc10a4: 0048 bac0 | a37b b63d | 7100 0048 | 8382 1002 + + 0x0000713e02fc10b4: ; {metadata(method data for {method} {0x0000713db476f9e8} 'isIllegalArgument' '(Ljava/lang/RuntimeException;)Z' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc10b4: 0000 0148 | bec8 b57b | b63d 7100 | 008b 96f4 | 0000 0083 | c202 8996 | f400 0000 | 81e2 feff + 0x0000713e02fc10d4: 1f00 85d2 | 0f84 c908 + + 0x0000713e02fc10dc: ; {oop(a 'java/lang/Class'{0x00000000a0638180} = 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc10dc: 0000 48be | 8081 63a0 | 0000 0000 | 488b d048 | 8984 2428 | 0100 000f + + 0x0000713e02fc10f4: ; {static_call} + 0x0000713e02fc10f4: 1f40 00e8 + + 0x0000713e02fc10f8: ; ImmutableOopMap {[296]=Oop } + ;*invokestatic isIllegalArgument {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::isIllegalArgument@3 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@30 + 0x0000713e02fc10f8: 84d0 ee06 + + 0x0000713e02fc10fc: ; {other} + 0x0000713e02fc10fc: 0f1f 8400 | ec26 0017 | 83e0 0185 + + 0x0000713e02fc1108: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc1108: c048 bac0 | a37b b63d | 7100 0048 | c7c6 4802 | 0000 7407 | 48c7 c658 | 0200 0048 | 8b3c 3248 + 0x0000713e02fc1128: 8d7f 0148 | 893c 320f | 84a4 0000 | 0066 6690 + + 0x0000713e02fc1138: ; {no_reloc} + 0x0000713e02fc1138: e99a 0800 | 0000 0000 | 0000 498b | 87b8 0100 | 0048 8d78 | 2849 3bbf | c801 0000 | 0f87 8708 + 0x0000713e02fc1158: 0000 4989 | bfb8 0100 | 0048 c700 | 0100 0000 | 488b ca49 | ba00 0000 | 0008 0000 | 0049 2bca + 0x0000713e02fc1178: 8948 0848 | 33c9 8948 | 0c48 33c9 | 4889 4810 | 4889 4818 | 4889 4820 + + 0x0000713e02fc1190: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc1190: 488b d048 | bec0 a37b | b63d 7100 | 0048 8386 | 6802 0000 + + 0x0000713e02fc11a4: ; {oop("argument type mismatch"{0x00000000a0ab2460})} + 0x0000713e02fc11a4: 0148 ba60 | 24ab a000 | 0000 0048 | 8bf0 4889 | 8424 3001 | 0000 0f1f + + 0x0000713e02fc11bc: ; {optimized virtual_call} + 0x0000713e02fc11bc: 4400 00e8 + + 0x0000713e02fc11c0: ; ImmutableOopMap {[304]=Oop } + ;*invokespecial {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@42 + 0x0000713e02fc11c0: bcc5 ee06 + + 0x0000713e02fc11c4: ; {other} + 0x0000713e02fc11c4: 0f1f 8400 | b427 0018 | 488b 8424 | 3001 0000 | e9a5 0800 | 0048 8b9c | 2428 0100 + + 0x0000713e02fc11e0: ; {metadata('java/lang/reflect/InvocationTargetException')} + 0x0000713e02fc11e0: 0048 ba90 | f300 0008 | 0000 0049 | 8b87 b801 | 0000 488d | 7828 493b | bfc8 0100 | 000f 87eb + 0x0000713e02fc1200: 0700 0049 | 89bf b801 | 0000 48c7 | 0001 0000 | 0048 8bca | 49ba 0000 | 0000 0800 | 0000 492b + 0x0000713e02fc1220: ca89 4808 | 4833 c989 | 480c 4833 | c948 8948 | 1048 8948 | 1848 8948 | 2048 8bd0 + + 0x0000713e02fc123c: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc123c: 48be c0a3 | 7bb6 3d71 | 0000 4883 | 8678 0200 | 0001 488b | d348 8bf0 | 4889 8424 | 3801 0000 + 0x0000713e02fc125c: ; {optimized virtual_call} + 0x0000713e02fc125c: 6666 90e8 + + 0x0000713e02fc1260: ; ImmutableOopMap {[312]=Oop } + ;*invokespecial {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@51 + 0x0000713e02fc1260: 1cc5 ee06 + + 0x0000713e02fc1264: ; {other} + 0x0000713e02fc1264: 0f1f 8400 | 5428 0019 | 488b 8424 | 3801 0000 | e905 0800 | 000f 1f80 | 0000 0000 + + 0x0000713e02fc1280: ; {no_reloc} + 0x0000713e02fc1280: e985 0700 | 0000 0000 | 0000 498b | 87b8 0100 | 0048 8d78 | 2849 3bbf | c801 0000 | 0f87 7207 + 0x0000713e02fc12a0: 0000 4989 | bfb8 0100 | 0048 c700 | 0100 0000 | 488b ca49 | ba00 0000 | 0008 0000 | 0049 2bca + 0x0000713e02fc12c0: 8948 0848 | 33c9 8948 | 0c48 33c9 | 4889 4810 | 4889 4818 | 4889 4820 + + 0x0000713e02fc12d8: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc12d8: 488b d048 | bec0 a37b | b63d 7100 | 0048 8386 | e002 0000 | 0148 8b94 | 2420 0100 | 0048 8bf0 + 0x0000713e02fc12f8: 4889 8424 | 4001 0000 | 0f1f 8000 + + 0x0000713e02fc1304: ; {optimized virtual_call} + 0x0000713e02fc1304: 0000 00e8 + + 0x0000713e02fc1308: ; ImmutableOopMap {[320]=Oop } + ;*invokespecial {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@69 + 0x0000713e02fc1308: 74c4 ee06 + + 0x0000713e02fc130c: ; {other} + 0x0000713e02fc130c: 0f1f 8400 | fc28 001a | 488b 8424 | 4001 0000 | e95d 0700 | 0048 8b9c | 2420 0100 + + 0x0000713e02fc1328: ; {metadata('java/lang/reflect/InvocationTargetException')} + 0x0000713e02fc1328: 0048 ba90 | f300 0008 | 0000 0049 | 8b87 b801 | 0000 488d | 7828 493b | bfc8 0100 | 000f 87d6 + 0x0000713e02fc1348: 0600 0049 | 89bf b801 | 0000 48c7 | 0001 0000 | 0048 8bca | 49ba 0000 | 0000 0800 | 0000 492b + 0x0000713e02fc1368: ca89 4808 | 4833 c989 | 480c 4833 | c948 8948 | 1048 8948 | 1848 8948 | 2048 8bd0 + + 0x0000713e02fc1384: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc1384: 48be c0a3 | 7bb6 3d71 | 0000 4883 | 86f0 0200 | 0001 488b | d348 8bf0 | 4889 8424 | 4801 0000 + 0x0000713e02fc13a4: ; {optimized virtual_call} + 0x0000713e02fc13a4: 6666 90e8 + + 0x0000713e02fc13a8: ; ImmutableOopMap {[328]=Oop } + ;*invokespecial {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@78 + 0x0000713e02fc13a8: d4c3 ee06 + + 0x0000713e02fc13ac: ; {other} + 0x0000713e02fc13ac: 0f1f 8400 | 9c29 001b | 488b 8424 | 4801 0000 | e9bd 0600 | 000f 1f80 | 0000 0000 + + 0x0000713e02fc13c8: ; {no_reloc} + 0x0000713e02fc13c8: e970 0600 | 0000 0000 | 0000 498b | 87b8 0100 | 0048 8d78 | 2849 3bbf | c801 0000 | 0f87 5d06 + 0x0000713e02fc13e8: 0000 4989 | bfb8 0100 | 0048 c700 | 0100 0000 | 488b ca49 | ba00 0000 | 0008 0000 | 0049 2bca + 0x0000713e02fc1408: 8948 0848 | 33c9 8948 | 0c48 33c9 | 4889 4810 | 4889 4818 | 4889 4820 + + 0x0000713e02fc1420: ; {metadata(method data for {method} {0x0000713db476faa8} 'checkReceiver' '(Ljava/lang/Object;)V' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc1420: 488b d048 | be40 a87b | b63d 7100 | 0048 8386 | c801 0000 + + 0x0000713e02fc1434: ; {oop("object is not an instance of declaring class"{0x00000000a20cf550})} + 0x0000713e02fc1434: 0148 ba50 | f50c a200 | 0000 0048 | 8bf0 4889 | 8424 5001 | 0000 0f1f + + 0x0000713e02fc144c: ; {optimized virtual_call} + 0x0000713e02fc144c: 4400 00e8 + + 0x0000713e02fc1450: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop [336]=Oop } + ;*invokespecial {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::checkReceiver@20 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@9 + 0x0000713e02fc1450: 2cc3 ee06 + + 0x0000713e02fc1454: ; {other} + 0x0000713e02fc1454: 0f1f 8400 | 442a 001c | 488b 8424 | 5001 0000 | e915 0600 | 0049 8b87 | 0005 0000 | 4d33 d24d + 0x0000713e02fc1474: 8997 0005 | 0000 4d33 | d24d 8997 | 0805 0000 + + 0x0000713e02fc1484: ; {metadata('java/lang/reflect/InvocationTargetException')} + 0x0000713e02fc1484: 488b d848 | ba90 f300 | 0008 0000 | 0049 8b87 | b801 0000 | 488d 7828 | 493b bfc8 | 0100 000f + 0x0000713e02fc14a4: 87ab 0500 | 0049 89bf | b801 0000 | 48c7 0001 | 0000 0048 | 8bca 49ba | 0000 0000 | 0800 0000 + 0x0000713e02fc14c4: 492b ca89 | 4808 4833 | c989 480c | 4833 c948 | 8948 1048 | 8948 1848 | 8948 2048 + + 0x0000713e02fc14e0: ; {metadata(method data for {method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc14e0: 8bd0 48be | c0a3 7bb6 | 3d71 0000 | 4883 8600 | 0300 0001 | 488b d348 | 8bf0 4889 | 8424 5801 + 0x0000713e02fc1500: 0000 0f1f + + 0x0000713e02fc1504: ; {optimized virtual_call} + 0x0000713e02fc1504: 4400 00e8 + + 0x0000713e02fc1508: ; ImmutableOopMap {[344]=Oop } + ;*invokespecial {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@88 + 0x0000713e02fc1508: 74c2 ee06 + + 0x0000713e02fc150c: ; {other} + 0x0000713e02fc150c: 0f1f 8400 | fc2a 001d | 488b 8424 | 5801 0000 | e95d 0500 + + 0x0000713e02fc1520: ; {metadata({method} {0x0000713db476f318} 'invoke' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc1520: 0049 ba18 | f376 b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e02fc1538: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc1538: e843 d7fb + + 0x0000713e02fc153c: ; ImmutableOopMap {rsi=Oop rdx=Oop rcx=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*synchronization entry + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@-1 + 0x0000713e02fc153c: 06e9 5cda + + 0x0000713e02fc1540: ; {metadata({method} {0x0000713db476f868} 'isStatic' '()Z' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc1540: ffff 49ba | 68f8 76b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e02fc1558: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc1558: ffe8 22d7 + + 0x0000713e02fc155c: ; ImmutableOopMap {rsi=Oop rdx=Oop rcx=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*synchronization entry + ; - jdk.internal.reflect.DirectMethodHandleAccessor::isStatic@-1 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@1 + 0x0000713e02fc155c: fb06 e977 + + 0x0000713e02fc1560: ; {metadata({method} {0x0000713db476faa8} 'checkReceiver' '(Ljava/lang/Object;)V' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc1560: daff ff49 | baa8 fa76 | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e02fc1578: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc1578: ffff e801 + + 0x0000713e02fc157c: ; ImmutableOopMap {rsi=Oop rdx=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*synchronization entry + ; - jdk.internal.reflect.DirectMethodHandleAccessor::checkReceiver@-1 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@9 + 0x0000713e02fc157c: d7fb 06e9 | 1ddb ffff + + 0x0000713e02fc1584: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1584: e897 7dfb + + 0x0000713e02fc1588: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*invokevirtual getClass {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::checkReceiver@5 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@9 + ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1588: 06e8 927d + + 0x0000713e02fc158c: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*invokevirtual isAssignableFrom {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::checkReceiver@8 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@9 + ; {metadata({method} {0x0000713db476f610} 'invokeImpl' '(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc158c: fb06 49ba | 10f6 76b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e02fc15a4: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc15a4: ffe8 d6d6 + + 0x0000713e02fc15a8: ; ImmutableOopMap {rsi=Oop [176]=Oop [184]=Oop [192]=Oop } + ;*synchronization entry + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@-1 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc15a8: fb06 e901 + + 0x0000713e02fc15ac: ; {metadata({method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc15ac: dcff ff49 | ba78 883a | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e02fc15c4: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc15c4: ffff e8b5 + + 0x0000713e02fc15c8: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [200]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@-1 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@104 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc15c8: d6fb 06e9 | e4dd ffff + + 0x0000713e02fc15d0: ; {metadata({method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc15d0: 49ba 7821 | 38b4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e02fc15e4: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc15e4: ffff ffe8 + + 0x0000713e02fc15e8: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rax=Oop [176]=Oop [184]=Oop [192]=Oop [200]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers::checkExactType@-1 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@104 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc15e8: 94d6 fb06 | e982 deff + + 0x0000713e02fc15f0: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc15f0: ffe8 2a7d + + 0x0000713e02fc15f4: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rax=Oop [176]=Oop [184]=Oop [192]=Oop [200]=Oop } + ;*invokevirtual type {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkExactType@1 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@104 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {metadata({method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc15f4: fb06 49ba | 9828 38b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e02fc160c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc160c: ffe8 6ed6 + + 0x0000713e02fc1610: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [200]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers::checkCustomized@-1 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@104 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1610: fb06 e9b8 + + 0x0000713e02fc1614: ; {metadata({method} {0x0000713db437a270} 'isCompileConstant' '(Ljava/lang/Object;)Z' in 'java/lang/invoke/MethodHandleImpl')} + 0x0000713e02fc1614: dfff ff49 | ba70 a237 | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e02fc162c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc162c: ffff e84d + + 0x0000713e02fc1630: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [200]=Oop } + ;*synchronization entry + ; - java.lang.invoke.MethodHandleImpl::isCompileConstant@-1 + ; - java.lang.invoke.Invokers::checkCustomized@1 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@104 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1630: d6fb 06e9 | cfdf ffff + + 0x0000713e02fc1638: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1638: e8e3 7cfb + + 0x0000713e02fc163c: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [200]=Oop } + ;*getfield customized {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkCustomized@12 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@104 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {internal_word} + 0x0000713e02fc163c: 0649 ba64 | f8fb 023e | 7100 004d | 8997 6804 + + 0x0000713e02fc164c: ; {runtime_call SafepointBlob} + 0x0000713e02fc164c: 0000 e9ad + + 0x0000713e02fc1650: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1650: 3def 06e8 + + 0x0000713e02fc1654: ; ImmutableOopMap {rsi=Oop rdx=Oop rcx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [216]=Oop } + ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@85 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1654: c87c fb06 + + 0x0000713e02fc1658: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1658: e8c3 7cfb + + 0x0000713e02fc165c: ; ImmutableOopMap {rsi=Oop rdx=Oop rcx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [216]=Oop } + ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@85 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc165c: 0648 c704 | 2400 0000 | 0048 894c + + 0x0000713e02fc1668: ; {runtime_call throw_range_check_failed Runtime1 stub} + 0x0000713e02fc1668: 2408 e8b1 + + 0x0000713e02fc166c: ; ImmutableOopMap {rsi=Oop rdx=Oop rcx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [216]=Oop } + ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@85 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc166c: 73fb 0648 | c704 2401 | 0000 0048 | 894c 2408 + + 0x0000713e02fc167c: ; {runtime_call throw_range_check_failed Runtime1 stub} + 0x0000713e02fc167c: e89f 73fb + + 0x0000713e02fc1680: ; ImmutableOopMap {rsi=Oop rdx=Oop rcx=Oop rdi=Oop rbx=Oop [176]=Oop [184]=Oop [192]=Oop [208]=Oop [216]=Oop } + ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@88 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1680: 0648 c704 | 2402 0000 | 0048 894c + + 0x0000713e02fc168c: ; {runtime_call throw_range_check_failed Runtime1 stub} + 0x0000713e02fc168c: 2408 e88d + + 0x0000713e02fc1690: ; ImmutableOopMap {rsi=Oop rdx=Oop rcx=Oop rdi=Oop rbx=Oop rax=Oop [176]=Oop [184]=Oop [192]=Oop [208]=Oop [216]=Oop [224]=Oop } + ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@91 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {metadata({method} {0x0000713db46482b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x000000080008cc00')} + 0x0000713e02fc1690: 73fb 0649 | bab0 8264 | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e02fc16a8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc16a8: ffff e8d1 + + 0x0000713e02fc16ac: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rax=Oop rcx=Oop [176]=Oop [192]=Oop [208]=Oop [216]=Oop [224]=Oop [232]=Oop } + ;*synchronization entry + ; - java.lang.invoke.LambdaForm$MH/0x000000080008cc00::invokeExact_MT@-1 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@92 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc16ac: d5fb 06e9 | 0ae3 ffff + + 0x0000713e02fc16b4: ; {metadata({method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc16b4: 49ba 7821 | 38b4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e02fc16c8: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc16c8: ffff ffe8 + + 0x0000713e02fc16cc: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rax=Oop rcx=Oop r9=Oop [176]=Oop [192]=Oop [208]=Oop [216]=Oop [224]=Oop [232]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers::checkExactType@-1 + ; - java.lang.invoke.LambdaForm$MH/0x000000080008cc00::invokeExact_MT@11 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@92 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc16cc: b0d5 fb06 | e966 e3ff + + 0x0000713e02fc16d4: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc16d4: ffe8 467c + + 0x0000713e02fc16d8: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rax=Oop rcx=Oop r9=Oop [176]=Oop [192]=Oop [208]=Oop [216]=Oop [224]=Oop [232]=Oop } + ;*invokevirtual type {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkExactType@1 + ; - java.lang.invoke.LambdaForm$MH/0x000000080008cc00::invokeExact_MT@11 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@92 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {metadata({method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc16d8: fb06 49ba | 9828 38b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e02fc16f0: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc16f0: ffe8 8ad5 + + 0x0000713e02fc16f4: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rax=Oop rcx=Oop [176]=Oop [192]=Oop [208]=Oop [216]=Oop [224]=Oop [232]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers::checkCustomized@-1 + ; - java.lang.invoke.LambdaForm$MH/0x000000080008cc00::invokeExact_MT@15 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@92 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc16f4: fb06 e94c + + 0x0000713e02fc16f8: ; {metadata({method} {0x0000713db437a270} 'isCompileConstant' '(Ljava/lang/Object;)Z' in 'java/lang/invoke/MethodHandleImpl')} + 0x0000713e02fc16f8: e4ff ff49 | ba70 a237 | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e02fc1710: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc1710: ffff e869 + + 0x0000713e02fc1714: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rax=Oop rcx=Oop [176]=Oop [192]=Oop [208]=Oop [216]=Oop [224]=Oop [232]=Oop } + ;*synchronization entry + ; - java.lang.invoke.MethodHandleImpl::isCompileConstant@-1 + ; - java.lang.invoke.Invokers::checkCustomized@1 + ; - java.lang.invoke.LambdaForm$MH/0x000000080008cc00::invokeExact_MT@15 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@92 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1714: d5fb 06e9 | 69e4 ffff + + 0x0000713e02fc171c: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc171c: e8ff 7bfb + + 0x0000713e02fc1720: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rax=Oop rcx=Oop [176]=Oop [192]=Oop [208]=Oop [216]=Oop [224]=Oop [232]=Oop } + ;*getfield customized {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkCustomized@12 + ; - java.lang.invoke.LambdaForm$MH/0x000000080008cc00::invokeExact_MT@15 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@92 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {internal_word} + 0x0000713e02fc1720: 0649 ba54 | fdfb 023e | 7100 004d | 8997 6804 + + 0x0000713e02fc1730: ; {runtime_call SafepointBlob} + 0x0000713e02fc1730: 0000 e9c9 + + 0x0000713e02fc1734: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1734: 3cef 06e8 + + 0x0000713e02fc1738: ; ImmutableOopMap {rsi=Oop rcx=Oop rdx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [248]=Oop } + ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@68 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1738: e47b fb06 + + 0x0000713e02fc173c: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc173c: e8df 7bfb + + 0x0000713e02fc1740: ; ImmutableOopMap {rsi=Oop rcx=Oop rdx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [248]=Oop } + ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@68 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1740: 0648 c704 | 2400 0000 | 0048 894c + + 0x0000713e02fc174c: ; {runtime_call throw_range_check_failed Runtime1 stub} + 0x0000713e02fc174c: 2408 e8cd + + 0x0000713e02fc1750: ; ImmutableOopMap {rsi=Oop rcx=Oop rdx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [248]=Oop } + ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@68 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1750: 72fb 0648 | c704 2401 | 0000 0048 | 894c 2408 + + 0x0000713e02fc1760: ; {runtime_call throw_range_check_failed Runtime1 stub} + 0x0000713e02fc1760: e8bb 72fb + + 0x0000713e02fc1764: ; ImmutableOopMap {rsi=Oop rcx=Oop rdx=Oop rdi=Oop rbx=Oop [176]=Oop [184]=Oop [192]=Oop [240]=Oop [248]=Oop } + ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@71 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {metadata({method} {0x0000713db58af2b0} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/LambdaForm$MH+0x00000008002fe000')} + 0x0000713e02fc1764: 0649 bab0 | f28a b53d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e02fc177c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc177c: e8ff d4fb + + 0x0000713e02fc1780: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rax=Oop [176]=Oop [192]=Oop [240]=Oop [248]=Oop [256]=Oop } + ;*synchronization entry + ; - java.lang.invoke.LambdaForm$MH/0x00000008002fe000::invokeExact_MT@-1 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@72 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1780: 06e9 a3e7 + + 0x0000713e02fc1784: ; {metadata({method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc1784: ffff 49ba | 7821 38b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e02fc179c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc179c: ffe8 ded4 + + 0x0000713e02fc17a0: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rax=Oop r8=Oop [176]=Oop [192]=Oop [240]=Oop [248]=Oop [256]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers::checkExactType@-1 + ; - java.lang.invoke.LambdaForm$MH/0x00000008002fe000::invokeExact_MT@11 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@72 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc17a0: fb06 e94b + + 0x0000713e02fc17a4: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc17a4: e8ff ffe8 + + 0x0000713e02fc17a8: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rax=Oop r8=Oop [176]=Oop [192]=Oop [240]=Oop [248]=Oop [256]=Oop } + ;*invokevirtual type {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkExactType@1 + ; - java.lang.invoke.LambdaForm$MH/0x00000008002fe000::invokeExact_MT@11 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@72 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc17a8: 747b fb06 + + 0x0000713e02fc17ac: ; {metadata({method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc17ac: 49ba 9828 | 38b4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e02fc17c0: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc17c0: ffff ffe8 + + 0x0000713e02fc17c4: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rax=Oop [176]=Oop [192]=Oop [240]=Oop [248]=Oop [256]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers::checkCustomized@-1 + ; - java.lang.invoke.LambdaForm$MH/0x00000008002fe000::invokeExact_MT@15 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@72 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc17c4: b8d4 fb06 | e98c e9ff + + 0x0000713e02fc17cc: ; {metadata({method} {0x0000713db437a270} 'isCompileConstant' '(Ljava/lang/Object;)Z' in 'java/lang/invoke/MethodHandleImpl')} + 0x0000713e02fc17cc: ff49 ba70 | a237 b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e02fc17e4: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc17e4: e897 d4fb + + 0x0000713e02fc17e8: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rax=Oop [176]=Oop [192]=Oop [240]=Oop [248]=Oop [256]=Oop } + ;*synchronization entry + ; - java.lang.invoke.MethodHandleImpl::isCompileConstant@-1 + ; - java.lang.invoke.Invokers::checkCustomized@1 + ; - java.lang.invoke.LambdaForm$MH/0x00000008002fe000::invokeExact_MT@15 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@72 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc17e8: 06e9 a9e9 + + 0x0000713e02fc17ec: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc17ec: ffff e82d + + 0x0000713e02fc17f0: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rax=Oop [176]=Oop [192]=Oop [240]=Oop [248]=Oop [256]=Oop } + ;*getfield customized {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkCustomized@12 + ; - java.lang.invoke.LambdaForm$MH/0x00000008002fe000::invokeExact_MT@15 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@72 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {internal_word} + 0x0000713e02fc17f0: 7bfb 0649 | ba14 04fc | 023e 7100 | 004d 8997 | 6804 0000 + + 0x0000713e02fc1804: ; {runtime_call SafepointBlob} + 0x0000713e02fc1804: e9f7 3bef + + 0x0000713e02fc1808: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1808: 06e8 127b + + 0x0000713e02fc180c: ; ImmutableOopMap {rsi=Oop rcx=Oop rdx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [272]=Oop } + ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@54 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc180c: fb06 e80d + + 0x0000713e02fc1810: ; ImmutableOopMap {rsi=Oop rcx=Oop rdx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [272]=Oop } + ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@54 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1810: 7bfb 0648 | c704 2400 | 0000 0048 | 894c 2408 + + 0x0000713e02fc1820: ; {runtime_call throw_range_check_failed Runtime1 stub} + 0x0000713e02fc1820: e8fb 71fb + + 0x0000713e02fc1824: ; ImmutableOopMap {rsi=Oop rcx=Oop rdx=Oop rdi=Oop [176]=Oop [184]=Oop [192]=Oop [272]=Oop } + ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@54 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {metadata({method} {0x0000713db43a8878} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc1824: 0649 ba78 | 883a b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e02fc183c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc183c: e83f d4fb + + 0x0000713e02fc1840: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop [176]=Oop [192]=Oop [264]=Oop [272]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@-1 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@55 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1840: 06e9 7fed + + 0x0000713e02fc1844: ; {metadata({method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc1844: ffff 49ba | 7821 38b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e02fc185c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc185c: ffe8 1ed4 + + 0x0000713e02fc1860: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rcx=Oop [176]=Oop [192]=Oop [264]=Oop [272]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers::checkExactType@-1 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@55 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1860: fb06 e925 + + 0x0000713e02fc1864: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1864: eeff ffe8 + + 0x0000713e02fc1868: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop rcx=Oop [176]=Oop [192]=Oop [264]=Oop [272]=Oop } + ;*invokevirtual type {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkExactType@1 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@55 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1868: b47a fb06 + + 0x0000713e02fc186c: ; {metadata({method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc186c: 49ba 9828 | 38b4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e02fc1880: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc1880: ffff ffe8 + + 0x0000713e02fc1884: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop [176]=Oop [192]=Oop [264]=Oop [272]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers::checkCustomized@-1 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@55 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1884: f8d3 fb06 | e95f efff + + 0x0000713e02fc188c: ; {metadata({method} {0x0000713db437a270} 'isCompileConstant' '(Ljava/lang/Object;)Z' in 'java/lang/invoke/MethodHandleImpl')} + 0x0000713e02fc188c: ff49 ba70 | a237 b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e02fc18a4: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc18a4: e8d7 d3fb + + 0x0000713e02fc18a8: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop [176]=Oop [192]=Oop [264]=Oop [272]=Oop } + ;*synchronization entry + ; - java.lang.invoke.MethodHandleImpl::isCompileConstant@-1 + ; - java.lang.invoke.Invokers::checkCustomized@1 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@55 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc18a8: 06e9 77ef + + 0x0000713e02fc18ac: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc18ac: ffff e86d + + 0x0000713e02fc18b0: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rbx=Oop [176]=Oop [192]=Oop [264]=Oop [272]=Oop } + ;*getfield customized {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkCustomized@12 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@55 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {internal_word} + 0x0000713e02fc18b0: 7afb 0649 | ba8c 0afc | 023e 7100 | 004d 8997 | 6804 0000 + + 0x0000713e02fc18c4: ; {runtime_call SafepointBlob} + 0x0000713e02fc18c4: e937 3bef + + 0x0000713e02fc18c8: ; {metadata({method} {0x0000713db43a8500} 'invokeExact_MT' '(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'java/lang/invoke/Invokers$Holder')} + 0x0000713e02fc18c8: 0649 ba00 | 853a b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e02fc18e0: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc18e0: e89b d3fb + + 0x0000713e02fc18e4: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop [176]=Oop [192]=Oop [280]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@-1 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@41 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc18e4: 06e9 8af2 + + 0x0000713e02fc18e8: ; {metadata({method} {0x0000713db4382178} 'checkExactType' '(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc18e8: ffff 49ba | 7821 38b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e02fc1900: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc1900: ffe8 7ad3 + + 0x0000713e02fc1904: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rax=Oop [176]=Oop [192]=Oop [280]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers::checkExactType@-1 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@41 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1904: fb06 e9df + + 0x0000713e02fc1908: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1908: f2ff ffe8 + + 0x0000713e02fc190c: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop rax=Oop [176]=Oop [192]=Oop [280]=Oop } + ;*invokevirtual type {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.invoke.Invokers::checkExactType@1 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@41 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc190c: 107a fb06 + + 0x0000713e02fc1910: ; {metadata({method} {0x0000713db4382898} 'checkCustomized' '(Ljava/lang/invoke/MethodHandle;)V' in 'java/lang/invoke/Invokers')} + 0x0000713e02fc1910: 49ba 9828 | 38b4 3d71 | 0000 4c89 | 5424 0848 | c704 24ff + + 0x0000713e02fc1924: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc1924: ffff ffe8 + + 0x0000713e02fc1928: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop [176]=Oop [192]=Oop [280]=Oop } + ;*synchronization entry + ; - java.lang.invoke.Invokers::checkCustomized@-1 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@41 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1928: 54d3 fb06 | e9bd f3ff + + 0x0000713e02fc1930: ; {metadata({method} {0x0000713db437a270} 'isCompileConstant' '(Ljava/lang/Object;)Z' in 'java/lang/invoke/MethodHandleImpl')} + 0x0000713e02fc1930: ff49 ba70 | a237 b43d | 7100 004c | 8954 2408 | 48c7 0424 | ffff ffff + + 0x0000713e02fc1948: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc1948: e833 d3fb + + 0x0000713e02fc194c: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop [176]=Oop [192]=Oop [280]=Oop } + ;*synchronization entry + ; - java.lang.invoke.MethodHandleImpl::isCompileConstant@-1 + ; - java.lang.invoke.Invokers::checkCustomized@1 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@41 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc194c: 06e9 d4f3 + + 0x0000713e02fc1950: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1950: ffff e8c9 + + 0x0000713e02fc1954: ; ImmutableOopMap {rsi=Oop rdx=Oop rdi=Oop [176]=Oop [192]=Oop [280]=Oop } + ;*getfield customized {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkCustomized@12 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@41 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {internal_word} + 0x0000713e02fc1954: 79fb 0649 | ba73 0efc | 023e 7100 | 004d 8997 | 6804 0000 + + 0x0000713e02fc1968: ; {runtime_call SafepointBlob} + 0x0000713e02fc1968: e993 3aef + + 0x0000713e02fc196c: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc196c: 06e8 ae79 + + 0x0000713e02fc1970: ; ImmutableOopMap {rax=Oop [176]=Oop [192]=Oop [280]=Oop } + ;*athrow {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkExactType@15 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@41 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1970: fb06 e8a9 + + 0x0000713e02fc1974: ; ImmutableOopMap {rax=Oop [176]=Oop [192]=Oop [264]=Oop [272]=Oop } + ;*athrow {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkExactType@15 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@55 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1974: 79fb 06e8 + + 0x0000713e02fc1978: ; ImmutableOopMap {rax=Oop [176]=Oop [192]=Oop [240]=Oop [248]=Oop [256]=Oop } + ;*athrow {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkExactType@15 + ; - java.lang.invoke.LambdaForm$MH/0x00000008002fe000::invokeExact_MT@11 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@72 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + 0x0000713e02fc1978: a479 fb06 + + 0x0000713e02fc197c: ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc197c: e89f 79fb + + 0x0000713e02fc1980: ; ImmutableOopMap {rax=Oop [176]=Oop [192]=Oop [208]=Oop [216]=Oop [224]=Oop [232]=Oop } + ;*athrow {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkExactType@15 + ; - java.lang.invoke.LambdaForm$MH/0x000000080008cc00::invokeExact_MT@11 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@92 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {runtime_call throw_null_pointer_exception Runtime1 stub} + 0x0000713e02fc1980: 06e8 9a79 + + 0x0000713e02fc1984: ; ImmutableOopMap {rax=Oop [176]=Oop [184]=Oop [192]=Oop [200]=Oop } + ;*athrow {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.lang.invoke.Invokers::checkExactType@15 + ; - java.lang.invoke.Invokers$Holder::invokeExact_MT@10 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invokeImpl@104 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@23 + ; {metadata({method} {0x0000713db476f9e8} 'isIllegalArgument' '(Ljava/lang/RuntimeException;)Z' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc1984: fb06 49ba | e8f9 76b4 | 3d71 0000 | 4c89 5424 | 0848 c704 | 24ff ffff + + 0x0000713e02fc199c: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc199c: ffe8 ded2 + + 0x0000713e02fc19a0: ; ImmutableOopMap {rax=Oop } + ;*synchronization entry + ; - jdk.internal.reflect.DirectMethodHandleAccessor::isIllegalArgument@-1 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@58 + 0x0000713e02fc19a0: fb06 e97c + + 0x0000713e02fc19a4: ; {metadata({method} {0x0000713db476f9e8} 'isIllegalArgument' '(Ljava/lang/RuntimeException;)Z' in 'jdk/internal/reflect/DirectMethodHandleAccessor')} + 0x0000713e02fc19a4: f6ff ff49 | bae8 f976 | b43d 7100 | 004c 8954 | 2408 48c7 | 0424 ffff + + 0x0000713e02fc19bc: ; {runtime_call counter_overflow Runtime1 stub} + 0x0000713e02fc19bc: ffff e8bd + + 0x0000713e02fc19c0: ; ImmutableOopMap {rax=Oop } + ;*synchronization entry + ; - jdk.internal.reflect.DirectMethodHandleAccessor::isIllegalArgument@-1 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@30 + 0x0000713e02fc19c0: d2fb 06e9 | 16f7 ffff + + 0x0000713e02fc19c8: ; {metadata(nullptr)} + 0x0000713e02fc19c8: 48ba 0000 | 0000 0000 | 0000 b800 + + 0x0000713e02fc19d4: ; {runtime_call load_klass_patching Runtime1 stub} + 0x0000713e02fc19d4: 0f05 0ae8 + + 0x0000713e02fc19d8: ; ImmutableOopMap {} + ;*new {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) jdk.internal.reflect.DirectMethodHandleAccessor::invoke@36 + 0x0000713e02fc19d8: a4c0 fb06 | e957 f7ff | ff48 8bd2 + + 0x0000713e02fc19e4: ; {runtime_call fast_new_instance Runtime1 stub} + 0x0000713e02fc19e4: e817 83fb + + 0x0000713e02fc19e8: ; ImmutableOopMap {} + ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@36 + 0x0000713e02fc19e8: 06e9 a2f7 | ffff 488b + + 0x0000713e02fc19f0: ; {runtime_call fast_new_instance Runtime1 stub} + 0x0000713e02fc19f0: d2e8 0a83 + + 0x0000713e02fc19f4: ; ImmutableOopMap {rbx=Oop } + ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@46 + 0x0000713e02fc19f4: fb06 e93e + + 0x0000713e02fc19f8: ; {metadata(nullptr)} + 0x0000713e02fc19f8: f8ff ff48 | ba00 0000 | 0000 0000 | 00b8 000f + + 0x0000713e02fc1a08: ; {runtime_call load_klass_patching Runtime1 stub} + 0x0000713e02fc1a08: 050a e871 + + 0x0000713e02fc1a0c: ; ImmutableOopMap {[288]=Oop } + ;*new {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) jdk.internal.reflect.DirectMethodHandleAccessor::invoke@64 + 0x0000713e02fc1a0c: c0fb 06e9 | 6cf8 ffff + + 0x0000713e02fc1a14: ; {runtime_call fast_new_instance Runtime1 stub} + 0x0000713e02fc1a14: 488b d2e8 + + 0x0000713e02fc1a18: ; ImmutableOopMap {[288]=Oop } + ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@64 + 0x0000713e02fc1a18: e482 fb06 | e9b7 f8ff | ff48 8bd2 + + 0x0000713e02fc1a24: ; {runtime_call fast_new_instance Runtime1 stub} + 0x0000713e02fc1a24: e8d7 82fb + + 0x0000713e02fc1a28: ; ImmutableOopMap {rbx=Oop } + ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@73 + 0x0000713e02fc1a28: 06e9 53f9 + + 0x0000713e02fc1a2c: ; {metadata(nullptr)} + 0x0000713e02fc1a2c: ffff 48ba | 0000 0000 | 0000 0000 | b800 0f05 + + 0x0000713e02fc1a3c: ; {runtime_call load_klass_patching Runtime1 stub} + 0x0000713e02fc1a3c: 0ae8 3ec0 + + 0x0000713e02fc1a40: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop } + ;*new {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) jdk.internal.reflect.DirectMethodHandleAccessor::checkReceiver@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@9 + 0x0000713e02fc1a40: fb06 e981 | f9ff ff48 + + 0x0000713e02fc1a48: ; {runtime_call fast_new_instance Runtime1 stub} + 0x0000713e02fc1a48: 8bd2 e8b1 + + 0x0000713e02fc1a4c: ; ImmutableOopMap {[176]=Oop [184]=Oop [192]=Oop } + ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::checkReceiver@14 + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@9 + 0x0000713e02fc1a4c: 82fb 06e9 | ccf9 ffff + + 0x0000713e02fc1a54: ; {runtime_call fast_new_instance Runtime1 stub} + 0x0000713e02fc1a54: 488b d2e8 + + 0x0000713e02fc1a58: ; ImmutableOopMap {rbx=Oop } + ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - jdk.internal.reflect.DirectMethodHandleAccessor::invoke@83 + 0x0000713e02fc1a58: a482 fb06 | e97e faff | ff49 8b87 | 0005 0000 | 49c7 8700 | 0500 0000 | 0000 0049 | c787 0805 + 0x0000713e02fc1a78: 0000 0000 | 0000 4881 | c470 0100 + + 0x0000713e02fc1a84: ; {runtime_call unwind_exception Runtime1 stub} + 0x0000713e02fc1a84: 005d e975 | 69fb 06f4 | f4f4 f4f4 +[Stub Code] + 0x0000713e02fc1a90: ; {no_reloc} + 0x0000713e02fc1a90: 0f1f 4400 + + 0x0000713e02fc1a94: ; {static_stub} + 0x0000713e02fc1a94: 0048 bb00 | 0000 0000 + + 0x0000713e02fc1a9c: ; {runtime_call nmethod} + 0x0000713e02fc1a9c: 0000 00e9 | fbff ffff + + 0x0000713e02fc1aa4: ; {static_stub} + 0x0000713e02fc1aa4: 9048 bb00 | 0000 0000 + + 0x0000713e02fc1aac: ; {runtime_call nmethod} + 0x0000713e02fc1aac: 0000 00e9 | fbff ffff + + 0x0000713e02fc1ab4: ; {static_stub} + 0x0000713e02fc1ab4: 48bb 0000 | 0000 0000 + + 0x0000713e02fc1abc: ; {runtime_call nmethod} + 0x0000713e02fc1abc: 0000 e9fb + + 0x0000713e02fc1ac0: ; {static_stub} + 0x0000713e02fc1ac0: ffff ff48 | bb00 0000 | 0000 0000 + + 0x0000713e02fc1acc: ; {runtime_call nmethod} + 0x0000713e02fc1acc: 00e9 fbff + + 0x0000713e02fc1ad0: ; {static_stub} + 0x0000713e02fc1ad0: ffff 48bb | 0000 0000 | 0000 0000 + + 0x0000713e02fc1adc: ; {runtime_call nmethod} + 0x0000713e02fc1adc: e9fb ffff + + 0x0000713e02fc1ae0: ; {static_stub} + 0x0000713e02fc1ae0: ff48 bb00 | 0000 0000 + + 0x0000713e02fc1ae8: ; {runtime_call nmethod} + 0x0000713e02fc1ae8: 0000 00e9 | fbff ffff + + 0x0000713e02fc1af0: ; {static_stub} + 0x0000713e02fc1af0: 48bb 0000 | 0000 0000 + + 0x0000713e02fc1af8: ; {runtime_call nmethod} + 0x0000713e02fc1af8: 0000 e9fb + + 0x0000713e02fc1afc: ; {static_stub} + 0x0000713e02fc1afc: ffff ff48 | bb00 0000 | 0000 0000 + + 0x0000713e02fc1b08: ; {runtime_call nmethod} + 0x0000713e02fc1b08: 00e9 fbff + + 0x0000713e02fc1b0c: ; {static_stub} + 0x0000713e02fc1b0c: ffff 48bb | 0000 0000 | 0000 0000 + + 0x0000713e02fc1b18: ; {runtime_call nmethod} + 0x0000713e02fc1b18: e9fb ffff + + 0x0000713e02fc1b1c: ; {static_stub} + 0x0000713e02fc1b1c: ff48 bb00 | 0000 0000 + + 0x0000713e02fc1b24: ; {runtime_call nmethod} + 0x0000713e02fc1b24: 0000 00e9 | fbff ffff + + 0x0000713e02fc1b2c: ; {static_stub} + 0x0000713e02fc1b2c: 48bb 0000 | 0000 0000 + + 0x0000713e02fc1b34: ; {runtime_call nmethod} + 0x0000713e02fc1b34: 0000 e9fb + + 0x0000713e02fc1b38: ; {static_stub} + 0x0000713e02fc1b38: ffff ff48 | bb00 0000 | 0000 0000 + + 0x0000713e02fc1b44: ; {runtime_call nmethod} + 0x0000713e02fc1b44: 00e9 fbff + + 0x0000713e02fc1b48: ; {static_stub} + 0x0000713e02fc1b48: ffff 48bb | 0000 0000 | 0000 0000 + + 0x0000713e02fc1b54: ; {runtime_call nmethod} + 0x0000713e02fc1b54: e9fb ffff + + 0x0000713e02fc1b58: ; {runtime_call handle_exception_from_callee Runtime1 stub} + 0x0000713e02fc1b58: ffe8 a299 + + 0x0000713e02fc1b5c: ; {external_word} + 0x0000713e02fc1b5c: fb06 48bf | 217e 721b | 3e71 0000 | 4883 e4f0 + + 0x0000713e02fc1b6c: ; {runtime_call MacroAssembler::debug64(char*, long, long*)} + 0x0000713e02fc1b6c: e84f 3924 + + 0x0000713e02fc1b70: ; {section_word} + 0x0000713e02fc1b70: 18f4 49ba | 721b fc02 | 3e71 0000 + + 0x0000713e02fc1b7c: ; {runtime_call DeoptimizationBlob} + 0x0000713e02fc1b7c: 4152 e91d + + 0x0000713e02fc1b80: ; {section_word} + 0x0000713e02fc1b80: 4def 0649 | ba83 1bfc | 023e 7100 + + 0x0000713e02fc1b8c: ; {runtime_call DeoptimizationBlob} + 0x0000713e02fc1b8c: 0041 52e9 | 0c4d ef06 | f4f4 f4f4 +[/MachCode] + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x0000713c9c0115c0, length=58, elements={ +0x0000713e1402c000, 0x0000713e1420def0, 0x0000713e1420f480, 0x0000713e14210d70, +0x0000713e142122e0, 0x0000713e1422b860, 0x0000713e1422d3d0, 0x0000713e1422ea90, +0x0000713d8409cc50, 0x0000713e142897d0, 0x0000713e1428c0f0, 0x0000713d8c08faa0, +0x0000713d8c090d70, 0x0000713d800608e0, 0x0000713d80061d50, 0x0000713e147aff40, +0x0000713d54001270, 0x0000713d7400ede0, 0x0000713e14d1d280, 0x0000713e14f64020, +0x0000713e14f6a430, 0x0000713cb8030c50, 0x0000713cac0e9350, 0x0000713ca82fc3e0, +0x0000713ca82fcc60, 0x0000713ca87151e0, 0x0000713c7c0024e0, 0x0000713c7c003270, +0x0000713c3c0011d0, 0x0000713c64001160, 0x0000713c340017b0, 0x0000713c10001270, +0x0000713c9c001d70, 0x0000713c10001f90, 0x0000713c640022f0, 0x0000713c7c007ee0, +0x0000713c58001070, 0x0000713c54001110, 0x0000713c10002c80, 0x0000713c48001300, +0x0000713c48001b80, 0x0000713c3c006320, 0x0000713c9c0031c0, 0x0000713c30005c90, +0x0000713c24001220, 0x0000713c700013c0, 0x0000713c90001190, 0x0000713c8402eee0, +0x0000713c7c008be0, 0x0000713c94001680, 0x0000713d6029ed10, 0x0000713cb8032c10, +0x0000713d80372df0, 0x0000713c00205a50, 0x0000713d602a3be0, 0x0000713d843f01b0, +0x0000713d80376370, 0x0000713c9c010460 +} + +Java Threads: ( => current thread ) + 0x0000713e1402c000 JavaThread "main" [_thread_blocked, id=1031795, stack(0x0000713e1a500000,0x0000713e1a600000) (1024K)] + 0x0000713e1420def0 JavaThread "Reference Handler" daemon [_thread_blocked, id=1031803, stack(0x0000713dfed00000,0x0000713dfee00000) (1024K)] + 0x0000713e1420f480 JavaThread "Finalizer" daemon [_thread_blocked, id=1031804, stack(0x0000713ddc900000,0x0000713ddca00000) (1024K)] + 0x0000713e14210d70 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1031805, stack(0x0000713ddc800000,0x0000713ddc900000) (1024K)] + 0x0000713e142122e0 JavaThread "Service Thread" daemon [_thread_blocked, id=1031806, stack(0x0000713ddc700000,0x0000713ddc800000) (1024K)] + 0x0000713e1422b860 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=1031807, stack(0x0000713ddc600000,0x0000713ddc700000) (1024K)] + 0x0000713e1422d3d0 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=1031808, stack(0x0000713ddc500000,0x0000713ddc600000) (1024K)] + 0x0000713e1422ea90 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=1031809, stack(0x0000713ddc400000,0x0000713ddc500000) (1024K)] + 0x0000713d8409cc50 JavaThread "C1 CompilerThread1" daemon [_thread_blocked, id=1031810, stack(0x0000713ddc300000,0x0000713ddc400000) (1024K)] + 0x0000713e142897d0 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=1031811, stack(0x0000713ddc200000,0x0000713ddc300000) (1024K)] + 0x0000713e1428c0f0 JavaThread "Notification Thread" daemon [_thread_blocked, id=1031812, stack(0x0000713ddc100000,0x0000713ddc200000) (1024K)] + 0x0000713d8c08faa0 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=1031813, stack(0x0000713ddc000000,0x0000713ddc100000) (1024K)] + 0x0000713d8c090d70 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=1031814, stack(0x0000713dd5f00000,0x0000713dd6000000) (1024K)] + 0x0000713d800608e0 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=1031815, stack(0x0000713dd5e00000,0x0000713dd5f00000) (1024K)] + 0x0000713d80061d50 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=1031816, stack(0x0000713dd5d00000,0x0000713dd5e00000) (1024K)] + 0x0000713e147aff40 JavaThread "ForkJoinPool.commonPool-worker-1" daemon [_thread_blocked, id=1031818, stack(0x0000713dd5900000,0x0000713dd5a00000) (1024K)] + 0x0000713d54001270 JavaThread "ForkJoinPool.commonPool-worker-2" daemon [_thread_blocked, id=1031820, stack(0x0000713dd5800000,0x0000713dd5900000) (1024K)] + 0x0000713d7400ede0 JavaThread "memory-pressure-listener-0" [_thread_blocked, id=1031852, stack(0x0000713dd41eb000,0x0000713dd42eb000) (1024K)] + 0x0000713e14d1d280 JavaThread "pid-file-watcher" daemon [_thread_blocked, id=1031853, stack(0x0000713dd40eb000,0x0000713dd41eb000) (1024K)] + 0x0000713e14f64020 JavaThread "grpc-default-boss-ELG-1-1" daemon [_thread_in_native, id=1031855, stack(0x0000713dcbe00000,0x0000713dcbf00000) (1024K)] + 0x0000713e14f6a430 JavaThread "grpc-timeout-and-memory" daemon [_thread_blocked, id=1031856, stack(0x0000713dcbd00000,0x0000713dcbe00000) (1024K)] + 0x0000713cb8030c50 JavaThread "grpc-default-worker-ELG-3-1" daemon [_thread_in_native, id=1031860, stack(0x0000713dcb900000,0x0000713dcba00000) (1024K)] + 0x0000713cac0e9350 JavaThread "grpc-command-0" daemon [_thread_blocked, id=1031863, stack(0x0000713dcb500000,0x0000713dcb600000) (1024K)] + 0x0000713ca82fc3e0 JavaThread "profile-writer-thread" daemon [_thread_blocked, id=1031864, stack(0x0000713dcbf00000,0x0000713dcc000000) (1024K)] + 0x0000713ca82fcc60 JavaThread "collect-local-resources" daemon [_thread_blocked, id=1031865, stack(0x0000713dcb100000,0x0000713dcb200000) (1024K)] + 0x0000713ca87151e0 JavaThread "skyframe-evaluator-0" daemon [_thread_blocked, id=1031919, stack(0x0000713dc9900000,0x0000713dc9a00000) (1024K)] + 0x0000713c7c0024e0 JavaThread "skyframe-evaluator-1" daemon [_thread_blocked, id=1031920, stack(0x0000713dcad00000,0x0000713dcae00000) (1024K)] + 0x0000713c7c003270 JavaThread "skyframe-evaluator-2" daemon [_thread_blocked, id=1031921, stack(0x0000713dc9b00000,0x0000713dc9c00000) (1024K)] + 0x0000713c3c0011d0 JavaThread "skyframe-evaluator-3" daemon [_thread_blocked, id=1031922, stack(0x0000713dca700000,0x0000713dca800000) (1024K)] + 0x0000713c64001160 JavaThread "skyframe-evaluator-4" daemon [_thread_blocked, id=1031923, stack(0x0000713dca400000,0x0000713dca500000) (1024K)] + 0x0000713c340017b0 JavaThread "skyframe-evaluator-5" daemon [_thread_blocked, id=1031924, stack(0x0000713dc9f00000,0x0000713dca000000) (1024K)] + 0x0000713c10001270 JavaThread "skyframe-evaluator-6" daemon [_thread_blocked, id=1031925, stack(0x0000713dcab00000,0x0000713dcac00000) (1024K)] + 0x0000713c9c001d70 JavaThread "skyframe-evaluator-7" daemon [_thread_blocked, id=1031926, stack(0x0000713dcaf00000,0x0000713dcb000000) (1024K)] + 0x0000713c10001f90 JavaThread "skyframe-evaluator-9" daemon [_thread_blocked, id=1031927, stack(0x0000713dcaa00000,0x0000713dcab00000) (1024K)] + 0x0000713c640022f0 JavaThread "skyframe-evaluator-8" daemon [_thread_blocked, id=1031928, stack(0x0000713dca900000,0x0000713dcaa00000) (1024K)] + 0x0000713c7c007ee0 JavaThread "skyframe-evaluator-10" daemon [_thread_blocked, id=1031929, stack(0x0000713dc9c00000,0x0000713dc9d00000) (1024K)] + 0x0000713c58001070 JavaThread "skyframe-evaluator-11" daemon [_thread_blocked, id=1031930, stack(0x0000713dc9e00000,0x0000713dc9f00000) (1024K)] +=>0x0000713c54001110 JavaThread "skyframe-evaluator-12" daemon [_thread_in_Java, id=1031931, stack(0x0000713dca200000,0x0000713dca300000) (1024K)] + 0x0000713c10002c80 JavaThread "skyframe-evaluator-13" daemon [_thread_blocked, id=1031932, stack(0x0000713dca000000,0x0000713dca100000) (1024K)] + 0x0000713c48001300 JavaThread "skyframe-evaluator-19" daemon [_thread_blocked, id=1031933, stack(0x0000713dca100000,0x0000713dca200000) (1024K)] + 0x0000713c48001b80 JavaThread "skyframe-evaluator-20" daemon [_thread_blocked, id=1031934, stack(0x0000713dc9d00000,0x0000713dc9e00000) (1024K)] + 0x0000713c3c006320 JavaThread "skyframe-evaluator-14" daemon [_thread_blocked, id=1031935, stack(0x0000713dcae00000,0x0000713dcaf00000) (1024K)] + 0x0000713c9c0031c0 JavaThread "skyframe-evaluator-15" daemon [_thread_blocked, id=1031936, stack(0x0000713dca500000,0x0000713dca600000) (1024K)] + 0x0000713c30005c90 JavaThread "skyframe-evaluator-17" daemon [_thread_blocked, id=1031937, stack(0x0000713dcac00000,0x0000713dcad00000) (1024K)] + 0x0000713c24001220 JavaThread "skyframe-evaluator-18" daemon [_thread_blocked, id=1031938, stack(0x0000713dcb000000,0x0000713dcb100000) (1024K)] + 0x0000713c700013c0 JavaThread "skyframe-evaluator-16" daemon [_thread_blocked, id=1031939, stack(0x0000713dca600000,0x0000713dca700000) (1024K)] + 0x0000713c90001190 JavaThread "skyframe-evaluator-21" daemon [_thread_blocked, id=1031940, stack(0x0000713dca300000,0x0000713dca400000) (1024K)] + 0x0000713c8402eee0 JavaThread "cli-update-thread" daemon [_thread_blocked, id=1031941, stack(0x0000713dc9a00000,0x0000713dc9b00000) (1024K)] + 0x0000713c7c008be0 JavaThread "skyframe-evaluator-22" daemon [_thread_blocked, id=1031942, stack(0x0000713dca800000,0x0000713dca900000) (1024K)] + 0x0000713c94001680 JavaThread "skyframe-evaluator-23" daemon [_thread_blocked, id=1031943, stack(0x0000713dc9800000,0x0000713dc9900000) (1024K)] + 0x0000713d6029ed10 JavaThread "C2 CompilerThread3" daemon [_thread_blocked, id=1031944, stack(0x0000713dc9700000,0x0000713dc9800000) (1024K)] + 0x0000713cb8032c10 JavaThread "grpc-default-worker-ELG-3-2" daemon [_thread_in_native, id=1031948, stack(0x0000713dc9600000,0x0000713dc9700000) (1024K)] + 0x0000713d80372df0 JavaThread "C2 CompilerThread4" daemon [_thread_blocked, id=1031949, stack(0x0000713dc9500000,0x0000713dc9600000) (1024K)] + 0x0000713c00205a50 JavaThread "grpc-command-1" daemon [_thread_blocked, id=1031951, stack(0x0000713dc9400000,0x0000713dc9500000) (1024K)] + 0x0000713d602a3be0 JavaThread "C2 CompilerThread5" daemon [_thread_blocked, id=1031952, stack(0x0000713dc9300000,0x0000713dc9400000) (1024K)] + 0x0000713d843f01b0 JavaThread "C2 CompilerThread6" daemon [_thread_blocked, id=1031953, stack(0x0000713dc9200000,0x0000713dc9300000) (1024K)] + 0x0000713d80376370 JavaThread "C2 CompilerThread7" daemon [_thread_blocked, id=1031954, stack(0x0000713dc9100000,0x0000713dc9200000) (1024K)] + 0x0000713c9c010460 JavaThread "ForkJoinPool.commonPool-worker-3" daemon [_thread_blocked, id=1031955, stack(0x0000713dc9000000,0x0000713dc9100000) (1024K)] +Total: 58 + +Other Threads: + 0x0000713e141ced50 VMThread "VM Thread" [id=1031802, stack(0x0000713ddcff7000,0x0000713ddd0f7000) (1024K)] + 0x0000713e1413f950 WatcherThread "VM Periodic Task Thread" [id=1031801, stack(0x0000713ddd0f8000,0x0000713ddd1f8000) (1024K)] + 0x0000713e1405b7d0 WorkerThread "GC Thread#0" [id=1031796, stack(0x0000713e18e3f000,0x0000713e18f3f000) (1024K)] + 0x0000713db000a310 WorkerThread "GC Thread#1" [id=1031831, stack(0x0000713dd5700000,0x0000713dd5800000) (1024K)] + 0x0000713db000adb0 WorkerThread "GC Thread#2" [id=1031832, stack(0x0000713dd55ff000,0x0000713dd56ff000) (1024K)] + 0x0000713db000b8c0 WorkerThread "GC Thread#3" [id=1031833, stack(0x0000713dd54fe000,0x0000713dd55fe000) (1024K)] + 0x0000713db000c3d0 WorkerThread "GC Thread#4" [id=1031834, stack(0x0000713dd53fd000,0x0000713dd54fd000) (1024K)] + 0x0000713db000cee0 WorkerThread "GC Thread#5" [id=1031835, stack(0x0000713dd52fc000,0x0000713dd53fc000) (1024K)] + 0x0000713db000da20 WorkerThread "GC Thread#6" [id=1031836, stack(0x0000713dd51fb000,0x0000713dd52fb000) (1024K)] + 0x0000713db000e560 WorkerThread "GC Thread#7" [id=1031837, stack(0x0000713dd50fa000,0x0000713dd51fa000) (1024K)] + 0x0000713db000f0c0 WorkerThread "GC Thread#8" [id=1031838, stack(0x0000713dd4ff9000,0x0000713dd50f9000) (1024K)] + 0x0000713db000fc40 WorkerThread "GC Thread#9" [id=1031839, stack(0x0000713dd4ef8000,0x0000713dd4ff8000) (1024K)] + 0x0000713db00107c0 WorkerThread "GC Thread#10" [id=1031840, stack(0x0000713dd4df7000,0x0000713dd4ef7000) (1024K)] + 0x0000713db0011340 WorkerThread "GC Thread#11" [id=1031841, stack(0x0000713dd4cf6000,0x0000713dd4df6000) (1024K)] + 0x0000713db0011ec0 WorkerThread "GC Thread#12" [id=1031842, stack(0x0000713dd4bf5000,0x0000713dd4cf5000) (1024K)] + 0x0000713db0012a40 WorkerThread "GC Thread#13" [id=1031843, stack(0x0000713dd4af4000,0x0000713dd4bf4000) (1024K)] + 0x0000713db00135c0 WorkerThread "GC Thread#14" [id=1031844, stack(0x0000713dd49f3000,0x0000713dd4af3000) (1024K)] + 0x0000713db0014140 WorkerThread "GC Thread#15" [id=1031845, stack(0x0000713dd48f2000,0x0000713dd49f2000) (1024K)] + 0x0000713db0014cc0 WorkerThread "GC Thread#16" [id=1031846, stack(0x0000713dd47f1000,0x0000713dd48f1000) (1024K)] + 0x0000713db0015840 WorkerThread "GC Thread#17" [id=1031847, stack(0x0000713dd46f0000,0x0000713dd47f0000) (1024K)] + 0x0000713e1406ba40 ConcurrentGCThread "G1 Main Marker" [id=1031797, stack(0x0000713e18d3e000,0x0000713e18e3e000) (1024K)] + 0x0000713e1406ca10 WorkerThread "G1 Conc#0" [id=1031798, stack(0x0000713e18c3d000,0x0000713e18d3d000) (1024K)] + 0x0000713dd0000d90 WorkerThread "G1 Conc#1" [id=1031848, stack(0x0000713dd45ef000,0x0000713dd46ef000) (1024K)] + 0x0000713dd00018e0 WorkerThread "G1 Conc#2" [id=1031849, stack(0x0000713dd44ee000,0x0000713dd45ee000) (1024K)] + 0x0000713dd0002430 WorkerThread "G1 Conc#3" [id=1031850, stack(0x0000713dd43ed000,0x0000713dd44ed000) (1024K)] + 0x0000713dd0002fb0 WorkerThread "G1 Conc#4" [id=1031851, stack(0x0000713dd42ec000,0x0000713dd43ec000) (1024K)] + 0x0000713e1412e5b0 ConcurrentGCThread "G1 Refine#0" [id=1031799, stack(0x0000713ddd2fa000,0x0000713ddd3fa000) (1024K)] + 0x0000713e1412f570 ConcurrentGCThread "G1 Service" [id=1031800, stack(0x0000713ddd1f9000,0x0000713ddd2f9000) (1024K)] +Total: 28 + +Threads with active compile tasks: +Total: 0 + +VM state: not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: None + +Heap address: 0x00000000a0000000, size: 30208 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) not mapped +Compressed class space mapped at: 0x0000000800000000-0x0000000840000000, reserved size: 1073741824 +Narrow klass base: 0x0000000800000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 + +GC Precious Log: + CardTable entry size: 512 + Card Set container configuration: InlinePtr #cards 3 size 8 Array Of Cards #cards 128 size 272 Howl #buckets 8 coarsen threshold 29491 Howl Bitmap #cards 4096 size 528 coarsen threshold 3686 Card regions per heap region 1 cards per card region 32768 + CPUs: 24 total, 24 available + Memory: 250G + Large Page Support: Disabled + NUMA Support: Disabled + Compressed Oops: Enabled (Zero based) + Heap Region Size: 16M + Heap Min Capacity: 16M + Heap Initial Capacity: 2G + Heap Max Capacity: 30208M + Pre-touch: Disabled + Parallel Workers: 18 + Concurrent Workers: 5 + Concurrent Refinement Workers: 18 + Periodic GC: Disabled + +Heap: + garbage-first heap total 1097728K, used 70164K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 5 young (81920K), 1 survivors (16384K) + Metaspace used 51909K, committed 52608K, reserved 1114112K + class space used 5579K, committed 5888K, reserved 1048576K + +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom +| 0|0x00000000a0000000, 0x00000000a0d7e730, 0x00000000a1000000| 84%| O| |TAMS 0x00000000a0000000| PB 0x00000000a0000000| Untracked +| 1|0x00000000a1000000, 0x00000000a1000000, 0x00000000a2000000| 0%| F| |TAMS 0x00000000a1000000| PB 0x00000000a1000000| Untracked +| 2|0x00000000a2000000, 0x00000000a2706cb0, 0x00000000a3000000| 43%| S|CS|TAMS 0x00000000a2000000| PB 0x00000000a2000000| Complete +| 3|0x00000000a3000000, 0x00000000a3000000, 0x00000000a4000000| 0%| F| |TAMS 0x00000000a3000000| PB 0x00000000a3000000| Untracked +| 4|0x00000000a4000000, 0x00000000a4000000, 0x00000000a5000000| 0%| F| |TAMS 0x00000000a4000000| PB 0x00000000a4000000| Untracked +| 5|0x00000000a5000000, 0x00000000a5000000, 0x00000000a6000000| 0%| F| |TAMS 0x00000000a5000000| PB 0x00000000a5000000| Untracked +| 6|0x00000000a6000000, 0x00000000a6000000, 0x00000000a7000000| 0%| F| |TAMS 0x00000000a6000000| PB 0x00000000a6000000| Untracked +| 7|0x00000000a7000000, 0x00000000a7000000, 0x00000000a8000000| 0%| F| |TAMS 0x00000000a7000000| PB 0x00000000a7000000| Untracked +| 8|0x00000000a8000000, 0x00000000a8000000, 0x00000000a9000000| 0%| F| |TAMS 0x00000000a8000000| PB 0x00000000a8000000| Untracked +| 9|0x00000000a9000000, 0x00000000a9000000, 0x00000000aa000000| 0%| F| |TAMS 0x00000000a9000000| PB 0x00000000a9000000| Untracked +| 10|0x00000000aa000000, 0x00000000aa000000, 0x00000000ab000000| 0%| F| |TAMS 0x00000000aa000000| PB 0x00000000aa000000| Untracked +| 11|0x00000000ab000000, 0x00000000ab000000, 0x00000000ac000000| 0%| F| |TAMS 0x00000000ab000000| PB 0x00000000ab000000| Untracked +| 12|0x00000000ac000000, 0x00000000ac000000, 0x00000000ad000000| 0%| F| |TAMS 0x00000000ac000000| PB 0x00000000ac000000| Untracked +| 13|0x00000000ad000000, 0x00000000ad000000, 0x00000000ae000000| 0%| F| |TAMS 0x00000000ad000000| PB 0x00000000ad000000| Untracked +| 14|0x00000000ae000000, 0x00000000ae000000, 0x00000000af000000| 0%| F| |TAMS 0x00000000ae000000| PB 0x00000000ae000000| Untracked +| 15|0x00000000af000000, 0x00000000af000000, 0x00000000b0000000| 0%| F| |TAMS 0x00000000af000000| PB 0x00000000af000000| Untracked +| 16|0x00000000b0000000, 0x00000000b0000000, 0x00000000b1000000| 0%| F| |TAMS 0x00000000b0000000| PB 0x00000000b0000000| Untracked +| 17|0x00000000b1000000, 0x00000000b1000000, 0x00000000b2000000| 0%| F| |TAMS 0x00000000b1000000| PB 0x00000000b1000000| Untracked +| 18|0x00000000b2000000, 0x00000000b2000000, 0x00000000b3000000| 0%| F| |TAMS 0x00000000b2000000| PB 0x00000000b2000000| Untracked +| 19|0x00000000b3000000, 0x00000000b3000000, 0x00000000b4000000| 0%| F| |TAMS 0x00000000b3000000| PB 0x00000000b3000000| Untracked +| 20|0x00000000b4000000, 0x00000000b4000000, 0x00000000b5000000| 0%| F| |TAMS 0x00000000b4000000| PB 0x00000000b4000000| Untracked +| 21|0x00000000b5000000, 0x00000000b5000000, 0x00000000b6000000| 0%| F| |TAMS 0x00000000b5000000| PB 0x00000000b5000000| Untracked +| 22|0x00000000b6000000, 0x00000000b6000000, 0x00000000b7000000| 0%| F| |TAMS 0x00000000b6000000| PB 0x00000000b6000000| Untracked +| 23|0x00000000b7000000, 0x00000000b7000000, 0x00000000b8000000| 0%| F| |TAMS 0x00000000b7000000| PB 0x00000000b7000000| Untracked +| 24|0x00000000b8000000, 0x00000000b8000000, 0x00000000b9000000| 0%| F| |TAMS 0x00000000b8000000| PB 0x00000000b8000000| Untracked +| 25|0x00000000b9000000, 0x00000000b9000000, 0x00000000ba000000| 0%| F| |TAMS 0x00000000b9000000| PB 0x00000000b9000000| Untracked +| 26|0x00000000ba000000, 0x00000000ba000000, 0x00000000bb000000| 0%| F| |TAMS 0x00000000ba000000| PB 0x00000000ba000000| Untracked +| 27|0x00000000bb000000, 0x00000000bb000000, 0x00000000bc000000| 0%| F| |TAMS 0x00000000bb000000| PB 0x00000000bb000000| Untracked +| 28|0x00000000bc000000, 0x00000000bc000000, 0x00000000bd000000| 0%| F| |TAMS 0x00000000bc000000| PB 0x00000000bc000000| Untracked +| 29|0x00000000bd000000, 0x00000000bd000000, 0x00000000be000000| 0%| F| |TAMS 0x00000000bd000000| PB 0x00000000bd000000| Untracked +| 30|0x00000000be000000, 0x00000000be000000, 0x00000000bf000000| 0%| F| |TAMS 0x00000000be000000| PB 0x00000000be000000| Untracked +| 31|0x00000000bf000000, 0x00000000bf000000, 0x00000000c0000000| 0%| F| |TAMS 0x00000000bf000000| PB 0x00000000bf000000| Untracked +| 32|0x00000000c0000000, 0x00000000c0000000, 0x00000000c1000000| 0%| F| |TAMS 0x00000000c0000000| PB 0x00000000c0000000| Untracked +| 33|0x00000000c1000000, 0x00000000c1000000, 0x00000000c2000000| 0%| F| |TAMS 0x00000000c1000000| PB 0x00000000c1000000| Untracked +| 34|0x00000000c2000000, 0x00000000c2000000, 0x00000000c3000000| 0%| F| |TAMS 0x00000000c2000000| PB 0x00000000c2000000| Untracked +| 35|0x00000000c3000000, 0x00000000c3000000, 0x00000000c4000000| 0%| F| |TAMS 0x00000000c3000000| PB 0x00000000c3000000| Untracked +| 36|0x00000000c4000000, 0x00000000c4000000, 0x00000000c5000000| 0%| F| |TAMS 0x00000000c4000000| PB 0x00000000c4000000| Untracked +| 37|0x00000000c5000000, 0x00000000c5000000, 0x00000000c6000000| 0%| F| |TAMS 0x00000000c5000000| PB 0x00000000c5000000| Untracked +| 38|0x00000000c6000000, 0x00000000c6000000, 0x00000000c7000000| 0%| F| |TAMS 0x00000000c6000000| PB 0x00000000c6000000| Untracked +| 39|0x00000000c7000000, 0x00000000c7000000, 0x00000000c8000000| 0%| F| |TAMS 0x00000000c7000000| PB 0x00000000c7000000| Untracked +| 40|0x00000000c8000000, 0x00000000c8000000, 0x00000000c9000000| 0%| F| |TAMS 0x00000000c8000000| PB 0x00000000c8000000| Untracked +| 41|0x00000000c9000000, 0x00000000c9000000, 0x00000000ca000000| 0%| F| |TAMS 0x00000000c9000000| PB 0x00000000c9000000| Untracked +| 42|0x00000000ca000000, 0x00000000ca000000, 0x00000000cb000000| 0%| F| |TAMS 0x00000000ca000000| PB 0x00000000ca000000| Untracked +| 43|0x00000000cb000000, 0x00000000cb000000, 0x00000000cc000000| 0%| F| |TAMS 0x00000000cb000000| PB 0x00000000cb000000| Untracked +| 44|0x00000000cc000000, 0x00000000cc000000, 0x00000000cd000000| 0%| F| |TAMS 0x00000000cc000000| PB 0x00000000cc000000| Untracked +| 45|0x00000000cd000000, 0x00000000cd000000, 0x00000000ce000000| 0%| F| |TAMS 0x00000000cd000000| PB 0x00000000cd000000| Untracked +| 46|0x00000000ce000000, 0x00000000ce000000, 0x00000000cf000000| 0%| F| |TAMS 0x00000000ce000000| PB 0x00000000ce000000| Untracked +| 47|0x00000000cf000000, 0x00000000cf000000, 0x00000000d0000000| 0%| F| |TAMS 0x00000000cf000000| PB 0x00000000cf000000| Untracked +| 48|0x00000000d0000000, 0x00000000d0000000, 0x00000000d1000000| 0%| F| |TAMS 0x00000000d0000000| PB 0x00000000d0000000| Untracked +| 49|0x00000000d1000000, 0x00000000d1000000, 0x00000000d2000000| 0%| F| |TAMS 0x00000000d1000000| PB 0x00000000d1000000| Untracked +| 50|0x00000000d2000000, 0x00000000d2000000, 0x00000000d3000000| 0%| F| |TAMS 0x00000000d2000000| PB 0x00000000d2000000| Untracked +| 51|0x00000000d3000000, 0x00000000d3000000, 0x00000000d4000000| 0%| F| |TAMS 0x00000000d3000000| PB 0x00000000d3000000| Untracked +| 52|0x00000000d4000000, 0x00000000d4000000, 0x00000000d5000000| 0%| F| |TAMS 0x00000000d4000000| PB 0x00000000d4000000| Untracked +| 53|0x00000000d5000000, 0x00000000d5000000, 0x00000000d6000000| 0%| F| |TAMS 0x00000000d5000000| PB 0x00000000d5000000| Untracked +| 54|0x00000000d6000000, 0x00000000d6000000, 0x00000000d7000000| 0%| F| |TAMS 0x00000000d6000000| PB 0x00000000d6000000| Untracked +| 55|0x00000000d7000000, 0x00000000d7000000, 0x00000000d8000000| 0%| F| |TAMS 0x00000000d7000000| PB 0x00000000d7000000| Untracked +| 56|0x00000000d8000000, 0x00000000d8000000, 0x00000000d9000000| 0%| F| |TAMS 0x00000000d8000000| PB 0x00000000d8000000| Untracked +| 57|0x00000000d9000000, 0x00000000d9000000, 0x00000000da000000| 0%| F| |TAMS 0x00000000d9000000| PB 0x00000000d9000000| Untracked +| 58|0x00000000da000000, 0x00000000da000000, 0x00000000db000000| 0%| F| |TAMS 0x00000000da000000| PB 0x00000000da000000| Untracked +| 59|0x00000000db000000, 0x00000000db000000, 0x00000000dc000000| 0%| F| |TAMS 0x00000000db000000| PB 0x00000000db000000| Untracked +| 60|0x00000000dc000000, 0x00000000dc000000, 0x00000000dd000000| 0%| F| |TAMS 0x00000000dc000000| PB 0x00000000dc000000| Untracked +| 61|0x00000000dd000000, 0x00000000dd000000, 0x00000000de000000| 0%| F| |TAMS 0x00000000dd000000| PB 0x00000000dd000000| Untracked +| 62|0x00000000de000000, 0x00000000de000000, 0x00000000df000000| 0%| F| |TAMS 0x00000000de000000| PB 0x00000000de000000| Untracked +| 63|0x00000000df000000, 0x00000000df3f0510, 0x00000000e0000000| 24%| E| |TAMS 0x00000000df000000| PB 0x00000000df000000| Complete +| 64|0x00000000e0000000, 0x00000000e1000000, 0x00000000e1000000|100%| E|CS|TAMS 0x00000000e0000000| PB 0x00000000e0000000| Complete +| 123|0x000000011b000000, 0x000000011c000000, 0x000000011c000000|100%| E|CS|TAMS 0x000000011b000000| PB 0x000000011b000000| Complete +| 127|0x000000011f000000, 0x0000000120000000, 0x0000000120000000|100%| E|CS|TAMS 0x000000011f000000| PB 0x000000011f000000| Complete + +Card table byte_map: [0x0000713dfb200000,0x0000713dfed00000] _byte_map_base: 0x0000713dfad00000 + +Marking Bits: (CMBitMap*) 0x0000713e1405c300 + Bits: [0x0000713ddda00000, 0x0000713dfb200000) + +Polling page: 0x0000713e1bff7000 + +Metaspace: + +Usage: + Non-class: 45.24 MB used. + Class: 5.45 MB used. + Both: 50.69 MB used. + +Virtual space: + Non-class space: 64.00 MB reserved, 45.62 MB ( 71%) committed, 1 nodes. + Class space: 1.00 GB reserved, 5.75 MB ( <1%) committed, 1 nodes. + Both: 1.06 GB reserved, 51.38 MB ( 5%) committed. + +Chunk freelists: + Non-Class: 1.72 MB + Class: 10.06 MB + Both: 11.78 MB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 21.00 MB +Current GC threshold: 59.00 MB +CDS: off + - commit_granule_bytes: 65536. + - commit_granule_words: 8192. + - virtual_space_node_default_size: 8388608. + - enlarge_chunks_in_place: 1. + - use_allocation_guard: 0. + + +Internal statistics: + +num_allocs_failed_limit: 6. +num_arena_births: 1018. +num_arena_deaths: 0. +num_vsnodes_births: 2. +num_vsnodes_deaths: 0. +num_space_committed: 822. +num_space_uncommitted: 0. +num_chunks_returned_to_freelist: 6. +num_chunks_taken_from_freelist: 2665. +num_chunk_merges: 6. +num_chunk_splits: 1839. +num_chunks_enlarged: 1325. +num_inconsistent_stats: 0. + +CodeHeap 'non-profiled nmethods': size=119168Kb used=2567Kb max_used=2567Kb free=116600Kb + bounds [0x0000713e0a5a0000, 0x0000713e0a830000, 0x0000713e11a00000] +CodeHeap 'profiled nmethods': size=119164Kb used=11171Kb max_used=11171Kb free=107992Kb + bounds [0x0000713e02a00000, 0x0000713e034f0000, 0x0000713e09e5f000] +CodeHeap 'non-nmethods': size=7428Kb used=3566Kb max_used=3628Kb free=3861Kb + bounds [0x0000713e09e5f000, 0x0000713e0a1ff000, 0x0000713e0a5a0000] + total_blobs=6220 nmethods=5489 adapters=633 + compilation: enabled + stopped_count=0, restarted_count=0 + full_count=0 + +Compilation events (20 events): +Event: 0.960 Thread 0x0000713e1422ea90 5611 3 com.google.devtools.build.lib.skyframe.BzlCompileValue$Key::create (20 bytes) +Event: 0.960 Thread 0x0000713d800608e0 5612 1 com.google.devtools.build.lib.skyframe.BzlLoadValue$Key::isBuiltins (2 bytes) +Event: 0.960 Thread 0x0000713d800608e0 nmethod 5612 0x0000713e0a805390 code [0x0000713e0a805520, 0x0000713e0a8055e0] +Event: 0.960 Thread 0x0000713e1422ea90 nmethod 5611 0x0000713e034e4510 code [0x0000713e034e4700, 0x0000713e034e4c50] +Event: 0.960 Thread 0x0000713d8c090d70 nmethod 5600 0x0000713e0a805690 code [0x0000713e0a805840, 0x0000713e0a805bb0] +Event: 0.960 Thread 0x0000713d8c090d70 5613 4 com.google.common.collect.ImmutableMap::containsKey (14 bytes) +Event: 0.961 Thread 0x0000713d800608e0 5614 3 com.google.common.base.Predicates::compose (11 bytes) +Event: 0.961 Thread 0x0000713d8409cc50 5615 3 com.google.common.base.Predicates$CompositionPredicate:: (7 bytes) +Event: 0.961 Thread 0x0000713d80061d50 5616 3 com.google.common.base.Predicates$CompositionPredicate:: (27 bytes) +Event: 0.961 Thread 0x0000713d800608e0 nmethod 5614 0x0000713e034e4e10 code [0x0000713e034e5020, 0x0000713e034e5798] +Event: 0.961 Thread 0x0000713d80061d50 nmethod 5616 0x0000713e034e5a10 code [0x0000713e034e5c00, 0x0000713e034e6260] +Event: 0.961 Thread 0x0000713d8409cc50 nmethod 5615 0x0000713e034e6490 code [0x0000713e034e66a0, 0x0000713e034e6d60] +Event: 0.961 Thread 0x0000713d843f01b0 nmethod 5582 0x0000713e0a805e10 code [0x0000713e0a805fc0, 0x0000713e0a8064b0] +Event: 0.961 Thread 0x0000713d843f01b0 5617 4 java.lang.StringLatin1$LinesSpliterator::indexOfLineSeparator (44 bytes) +Event: 0.962 Thread 0x0000713d8c090d70 nmethod 5613 0x0000713e0a806690 code [0x0000713e0a806840, 0x0000713e0a806aa0] +Event: 0.963 Thread 0x0000713d843f01b0 nmethod 5617 0x0000713e0a806c90 code [0x0000713e0a806e20, 0x0000713e0a807030] +Event: 0.963 Thread 0x0000713e1422d3d0 nmethod 5361 0x0000713e0a807110 code [0x0000713e0a807560, 0x0000713e0a80a880] +Event: 0.965 Thread 0x0000713d80372df0 nmethod 5593 0x0000713e0a80bc10 code [0x0000713e0a80bdc0, 0x0000713e0a80c490] +Event: 0.965 Thread 0x0000713d602a3be0 nmethod 5579 0x0000713e0a80c690 code [0x0000713e0a80c8c0, 0x0000713e0a80d080] +Event: 0.965 Thread 0x0000713d8c08faa0 nmethod 5597 0x0000713e0a80d810 code [0x0000713e0a80da80, 0x0000713e0a80ea28] + +GC Heap History (12 events): +Event: 0.281 GC heap before +{Heap before GC invocations=0 (full 0): + garbage-first heap total 2097152K, used 32768K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 4 young (65536K), 0 survivors (0K) + Metaspace used 21272K, committed 21504K, reserved 1114112K + class space used 2144K, committed 2240K, reserved 1048576K +} +Event: 0.284 GC heap after +{Heap after GC invocations=1 (full 0): + garbage-first heap total 2097152K, used 7149K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 1 young (16384K), 1 survivors (16384K) + Metaspace used 21272K, committed 21504K, reserved 1114112K + class space used 2144K, committed 2240K, reserved 1048576K +} +Event: 0.543 GC heap before +{Heap before GC invocations=2 (full 0): + garbage-first heap total 65536K, used 39917K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 4 young (65536K), 1 survivors (16384K) + Metaspace used 34965K, committed 35264K, reserved 1114112K + class space used 3668K, committed 3776K, reserved 1048576K +} +Event: 0.548 GC heap after +{Heap after GC invocations=3 (full 0): + garbage-first heap total 81920K, used 14051K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 1 young (16384K), 1 survivors (16384K) + Metaspace used 34965K, committed 35264K, reserved 1114112K + class space used 3668K, committed 3776K, reserved 1048576K +} +Event: 0.581 GC heap before +{Heap before GC invocations=3 (full 0): + garbage-first heap total 81920K, used 14051K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 2 young (32768K), 1 survivors (16384K) + Metaspace used 35870K, committed 36160K, reserved 1114112K + class space used 3815K, committed 3968K, reserved 1048576K +} +Event: 0.585 GC heap after +{Heap after GC invocations=4 (full 0): + garbage-first heap total 81920K, used 16162K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 1 young (16384K), 1 survivors (16384K) + Metaspace used 35870K, committed 36160K, reserved 1114112K + class space used 3815K, committed 3968K, reserved 1048576K +} +Event: 0.666 GC heap before +{Heap before GC invocations=5 (full 0): + garbage-first heap total 81920K, used 32546K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 2 young (32768K), 1 survivors (16384K) + Metaspace used 42460K, committed 42752K, reserved 1114112K + class space used 4406K, committed 4544K, reserved 1048576K +} +Event: 0.668 GC heap after +{Heap after GC invocations=6 (full 0): + garbage-first heap total 81920K, used 18067K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 1 young (16384K), 1 survivors (16384K) + Metaspace used 42460K, committed 42752K, reserved 1114112K + class space used 4406K, committed 4544K, reserved 1048576K +} +Event: 0.748 GC heap before +{Heap before GC invocations=6 (full 0): + garbage-first heap total 81920K, used 34451K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 2 young (32768K), 1 survivors (16384K) + Metaspace used 46949K, committed 47296K, reserved 1114112K + class space used 4983K, committed 5120K, reserved 1048576K +} +Event: 0.750 GC heap after +{Heap after GC invocations=7 (full 0): + garbage-first heap total 81920K, used 19298K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 1 young (16384K), 1 survivors (16384K) + Metaspace used 46949K, committed 47296K, reserved 1114112K + class space used 4983K, committed 5120K, reserved 1048576K +} +Event: 0.816 GC heap before +{Heap before GC invocations=7 (full 0): + garbage-first heap total 81920K, used 19298K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 2 young (32768K), 1 survivors (16384K) + Metaspace used 48872K, committed 49408K, reserved 1114112K + class space used 5176K, committed 5440K, reserved 1048576K +} +Event: 0.819 GC heap after +{Heap after GC invocations=8 (full 0): + garbage-first heap total 1097728K, used 21012K [0x00000000a0000000, 0x0000000800000000) + region size 16384K, 1 young (16384K), 1 survivors (16384K) + Metaspace used 48872K, committed 49408K, reserved 1114112K + class space used 5176K, committed 5440K, reserved 1048576K +} + +Dll operation events (10 events): +Event: 0.001 Loaded shared library /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjava.so +Event: 0.034 Loaded shared library /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libnio.so +Event: 0.051 Loaded shared library /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libzip.so +Event: 0.059 Loaded shared library /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjimage.so +Event: 0.096 Loaded shared library /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libnet.so +Event: 0.124 Loaded shared library /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libmanagement.so +Event: 0.125 Loaded shared library /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libmanagement_ext.so +Event: 0.144 Loaded shared library /tmp/bazel-jni.6964268149134320779/libunix_jni.so +Event: 0.344 Loaded shared library /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/libcpu_profiler.so +Event: 0.415 Loaded shared library /tmp/libnetty_transport_native_epoll_x86_646359598312584981359.so + +Deoptimization events (20 events): +Event: 0.950 Thread 0x0000713c7c007ee0 Uncommon trap: trap_request=0xffffffde fr.pc=0x0000713e0a7ee8c0 relative=0x0000000000000400 +Event: 0.950 Thread 0x0000713c7c007ee0 Uncommon trap: reason=class_check action=maybe_recompile pc=0x0000713e0a7ee8c0 method=com.google.devtools.build.lib.skyframe.BzlLoadValue$Key.hashCode()I @ 14 c2 +Event: 0.950 Thread 0x0000713c7c007ee0 DEOPT PACKING pc=0x0000713e0a7ee8c0 sp=0x0000713dc9cfde90 +Event: 0.950 Thread 0x0000713c7c007ee0 DEOPT UNPACKING pc=0x0000713e09eb6619 sp=0x0000713dc9cfde48 mode 2 +Event: 0.950 Thread 0x0000713c7c007ee0 Uncommon trap: trap_request=0xffffffde fr.pc=0x0000713e0a7ee8c0 relative=0x0000000000000400 +Event: 0.950 Thread 0x0000713c7c007ee0 Uncommon trap: reason=class_check action=maybe_recompile pc=0x0000713e0a7ee8c0 method=com.google.devtools.build.lib.skyframe.BzlLoadValue$Key.hashCode()I @ 14 c2 +Event: 0.950 Thread 0x0000713c7c007ee0 DEOPT PACKING pc=0x0000713e0a7ee8c0 sp=0x0000713dc9cfe140 +Event: 0.950 Thread 0x0000713c7c007ee0 DEOPT UNPACKING pc=0x0000713e09eb6619 sp=0x0000713dc9cfe0f8 mode 2 +Event: 0.953 Thread 0x0000713c7c007ee0 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000713e0a676070 relative=0x00000000000003f0 +Event: 0.953 Thread 0x0000713c7c007ee0 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000713e0a676070 method=java.lang.StringConcatHelper.simpleConcat(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String; @ 14 c2 +Event: 0.953 Thread 0x0000713c7c007ee0 DEOPT PACKING pc=0x0000713e0a676070 sp=0x0000713dc9cfcb00 +Event: 0.953 Thread 0x0000713c7c007ee0 DEOPT UNPACKING pc=0x0000713e09eb6619 sp=0x0000713dc9cfcaa8 mode 2 +Event: 0.955 Thread 0x0000713c7c007ee0 Uncommon trap: trap_request=0xffffff76 fr.pc=0x0000713e0a7f739c relative=0x0000000000000c5c +Event: 0.955 Thread 0x0000713c7c007ee0 Uncommon trap: reason=predicate action=maybe_recompile pc=0x0000713e0a7f739c method=com.google.common.collect.RegularImmutableMap.fromEntryArrayCheckingBucketOverflow(I[Ljava/util/Map$Entry;Z)Lcom/google/common/collect/ImmutableMap; @ 50 c2 +Event: 0.955 Thread 0x0000713c7c007ee0 DEOPT PACKING pc=0x0000713e0a7f739c sp=0x0000713dc9cfdd50 +Event: 0.955 Thread 0x0000713c7c007ee0 DEOPT UNPACKING pc=0x0000713e09eb6619 sp=0x0000713dc9cfdcf8 mode 2 +Event: 0.957 Thread 0x0000713c7c007ee0 DEOPT PACKING pc=0x0000713e0333d748 sp=0x0000713dc9cfdf50 +Event: 0.957 Thread 0x0000713c7c007ee0 DEOPT UNPACKING pc=0x0000713e09eb714f sp=0x0000713dc9cfd458 mode 0 +Event: 0.957 Thread 0x0000713c54001110 DEOPT PACKING pc=0x0000713e0333d748 sp=0x0000713dca2fe010 +Event: 0.957 Thread 0x0000713c54001110 DEOPT UNPACKING pc=0x0000713e09eb714f sp=0x0000713dca2fd518 mode 0 + +Classes loaded (20 events): +Event: 0.807 Loading class java/security/PrivilegedActionException +Event: 0.807 Loading class java/security/PrivilegedActionException done +Event: 0.807 Loading class java/util/function/DoubleSupplier +Event: 0.807 Loading class java/util/function/DoubleSupplier done +Event: 0.845 Loading class java/util/stream/Streams$RangeIntSpliterator +Event: 0.845 Loading class java/util/stream/Streams$RangeIntSpliterator done +Event: 0.882 Loading class java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntrySetSpliterator +Event: 0.882 Loading class java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntrySetSpliterator done +Event: 0.930 Loading class java/lang/SafeVarargs +Event: 0.930 Loading class java/lang/SafeVarargs done +Event: 0.934 Loading class java/lang/invoke/BoundMethodHandle$Species_LLLLLLL +Event: 0.934 Loading class java/lang/invoke/BoundMethodHandle$Species_LLLLLLL done +Event: 0.936 Loading class java/util/AbstractList$RandomAccessSpliterator +Event: 0.936 Loading class java/util/AbstractList$RandomAccessSpliterator done +Event: 0.947 Loading class java/util/AbstractList$RandomAccessSubList +Event: 0.947 Loading class java/util/AbstractList$SubList +Event: 0.947 Loading class java/util/AbstractList$SubList done +Event: 0.947 Loading class java/util/AbstractList$RandomAccessSubList done +Event: 0.947 Loading class java/util/AbstractList$SubList$1 +Event: 0.947 Loading class java/util/AbstractList$SubList$1 done + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (20 events): +Event: 0.875 Thread 0x0000713c10001270 Exception (0x000000011b395980) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.893 Thread 0x0000713c24001220 Exception (0x000000011b7dbda0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.896 Thread 0x0000713c24001220 Implicit null exception at 0x0000713e0a78927b to 0x0000713e0a7894ec +Event: 0.900 Thread 0x0000713c7c007ee0 Exception (0x000000011bb43f28) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.909 Thread 0x0000713c3c0011d0 Exception (0x00000000e0183c00) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.909 Thread 0x0000713c340017b0 Exception (0x00000000e01cd320) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.910 Thread 0x0000713c94001680 Exception (0x00000000e0075e08) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.910 Thread 0x0000713c9c0031c0 Exception (0x00000000e0236ce0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.910 Thread 0x0000713c94001680 Exception (0x00000000e02bcc18) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.914 Thread 0x0000713c340017b0 Exception (0x00000000e0821218) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 840] +Event: 0.932 Thread 0x0000713c10001270 Exception (0x00000000e0acf6d8) +t +Event: 0.933 Thread 0x0000713c7c007ee0 Exception (0x00000000e01e99c0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.933 Thread 0x0000713c10001270 Exception (0x00000000e0ae8b28) +thrown [src/hotspo +Event: 0.933 Thread 0x0000713c30005c90 Exception (0x00000000e0acc948) +thrown [src/hotspo +Event: 0.940 Thread 0x0000713c30005c90 Exception (0x00000000df0da388) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.941 Thread 0x0000713c30005c90 Exception (0x00000000df114710) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.941 Thread 0x0000713c30005c90 Exception (0x00000000df139778) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.941 Thread 0x0000713c30005c90 Exception (0x00000000df140740) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] +Event: 0.953 Thread 0x0000713c7c007ee0 Exception (0x00000000df26a598) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 772] + +ZGC Phase Switch (0 events): +No events + +VM Operations (20 events): +Event: 0.880 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.880 Executing VM operation: HandshakeAllThreads (Deoptimize) done +Event: 0.888 Executing VM operation: ICBufferFull +Event: 0.888 Executing VM operation: ICBufferFull done +Event: 0.888 Executing VM operation: ICBufferFull +Event: 0.888 Executing VM operation: ICBufferFull done +Event: 0.888 Executing VM operation: ICBufferFull +Event: 0.888 Executing VM operation: ICBufferFull done +Event: 0.889 Executing VM operation: ICBufferFull +Event: 0.889 Executing VM operation: ICBufferFull done +Event: 0.889 Executing VM operation: ICBufferFull +Event: 0.889 Executing VM operation: ICBufferFull done +Event: 0.914 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.914 Executing VM operation: HandshakeAllThreads (Deoptimize) done +Event: 0.916 Executing VM operation: ICBufferFull +Event: 0.917 Executing VM operation: ICBufferFull done +Event: 0.944 Executing VM operation: ICBufferFull +Event: 0.944 Executing VM operation: ICBufferFull done +Event: 0.952 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.952 Executing VM operation: HandshakeAllThreads (Deoptimize) done + +Memory protections (20 events): +Event: 0.739 Protecting memory [0x0000713dca000000,0x0000713dca004000] with protection modes 0 +Event: 0.739 Protecting memory [0x0000713dca100000,0x0000713dca104000] with protection modes 0 +Event: 0.739 Protecting memory [0x0000713dc9d00000,0x0000713dc9d04000] with protection modes 0 +Event: 0.739 Protecting memory [0x0000713dcae00000,0x0000713dcae04000] with protection modes 0 +Event: 0.740 Protecting memory [0x0000713dca500000,0x0000713dca504000] with protection modes 0 +Event: 0.740 Protecting memory [0x0000713dcac00000,0x0000713dcac04000] with protection modes 0 +Event: 0.740 Protecting memory [0x0000713dcb000000,0x0000713dcb004000] with protection modes 0 +Event: 0.740 Protecting memory [0x0000713dca600000,0x0000713dca604000] with protection modes 0 +Event: 0.740 Protecting memory [0x0000713dca300000,0x0000713dca304000] with protection modes 0 +Event: 0.754 Protecting memory [0x0000713dc9a00000,0x0000713dc9a04000] with protection modes 0 +Event: 0.771 Protecting memory [0x0000713dca800000,0x0000713dca804000] with protection modes 0 +Event: 0.771 Protecting memory [0x0000713dc9800000,0x0000713dc9804000] with protection modes 0 +Event: 0.776 Protecting memory [0x0000713dc9700000,0x0000713dc9704000] with protection modes 0 +Event: 0.777 Protecting memory [0x0000713dc9600000,0x0000713dc9604000] with protection modes 0 +Event: 0.780 Protecting memory [0x0000713dc9500000,0x0000713dc9504000] with protection modes 0 +Event: 0.782 Protecting memory [0x0000713dc9400000,0x0000713dc9404000] with protection modes 0 +Event: 0.791 Protecting memory [0x0000713dc9200000,0x0000713dc9204000] with protection modes 0 +Event: 0.794 Protecting memory [0x0000713dc9100000,0x0000713dc9104000] with protection modes 0 +Event: 0.794 Protecting memory [0x0000713dc9300000,0x0000713dc9304000] with protection modes 0 +Event: 0.872 Protecting memory [0x0000713dc9000000,0x0000713dc9004000] with protection modes 0 + +Nmethod flushes (20 events): +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02a8fb10 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02a90490 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02a94910 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02a94f10 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e0a5c9890 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e0a5c9c90 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02a10790 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02a10e90 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02a11a90 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02a13590 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02a13b10 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02a13f10 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02a14d10 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02afb110 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02bdae90 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02bdbe10 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02bdc290 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02bdc590 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02bdcc10 +Event: 0.588 Thread 0x0000713e141ced50 flushing nmethod 0x0000713e02bdd390 + +Events (20 events): +Event: 0.739 Thread 0x0000713c340017b0 Thread added: 0x0000713c10002c80 +Event: 0.739 Thread 0x0000713c54001110 Thread added: 0x0000713c48001300 +Event: 0.739 Thread 0x0000713c54001110 Thread added: 0x0000713c48001b80 +Event: 0.739 Thread 0x0000713c7c003270 Thread added: 0x0000713c3c006320 +Event: 0.739 Thread 0x0000713c10001270 Thread added: 0x0000713c9c0031c0 +Event: 0.740 Thread 0x0000713c58001070 Thread added: 0x0000713c30005c90 +Event: 0.740 Thread 0x0000713c10001f90 Thread added: 0x0000713c24001220 +Event: 0.740 Thread 0x0000713c7c007ee0 Thread added: 0x0000713c700013c0 +Event: 0.740 Thread 0x0000713c48001300 Thread added: 0x0000713c90001190 +Event: 0.754 Thread 0x0000713c48001b80 Thread added: 0x0000713c8402eee0 +Event: 0.771 Thread 0x0000713ca87151e0 Thread added: 0x0000713c7c008be0 +Event: 0.771 Thread 0x0000713c7c008be0 Thread added: 0x0000713c94001680 +Event: 0.776 Thread 0x0000713d800608e0 Thread added: 0x0000713d6029ed10 +Event: 0.777 Thread 0x0000713e14f64020 Thread added: 0x0000713cb8032c10 +Event: 0.780 Thread 0x0000713d8409cc50 Thread added: 0x0000713d80372df0 +Event: 0.782 Thread 0x0000713cb8032c10 Thread added: 0x0000713c00205a50 +Event: 0.790 Thread 0x0000713d800608e0 Thread added: 0x0000713d602a3be0 +Event: 0.790 Thread 0x0000713e1422ea90 Thread added: 0x0000713d843f01b0 +Event: 0.794 Thread 0x0000713d8409cc50 Thread added: 0x0000713d80376370 +Event: 0.872 Thread 0x0000713c10001270 Thread added: 0x0000713c9c010460 + + +Dynamic libraries: +a0000000-e1000000 rw-p 00000000 00:00 0 +e1000000-11b000000 ---p 00000000 00:00 0 +11b000000-11c000000 rw-p 00000000 00:00 0 +11c000000-11f000000 ---p 00000000 00:00 0 +11f000000-120000000 rw-p 00000000 00:00 0 +120000000-800000000 ---p 00000000 00:00 0 +800000000-800010000 rw-p 00000000 00:00 0 +800010000-800030000 rw-p 00000000 00:00 0 +800030000-8000b0000 rw-p 00000000 00:00 0 +8000b0000-800130000 rw-p 00000000 00:00 0 +800130000-8001b0000 rw-p 00000000 00:00 0 +8001b0000-8001f0000 rw-p 00000000 00:00 0 +8001f0000-800530000 rw-p 00000000 00:00 0 +800530000-800550000 rw-p 00000000 00:00 0 +800550000-800580000 ---p 00000000 00:00 0 +800580000-8005f0000 rw-p 00000000 00:00 0 +8005f0000-840000000 ---p 00000000 00:00 0 +56a99f84a000-56a99f84b000 r-xp 00000000 08:02 33983821 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/bin/java +56a99f84c000-56a99f84d000 r--p 00001000 08:02 33983821 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/bin/java +56a99f84d000-56a99f84e000 rw-p 00002000 08:02 33983821 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/bin/java +56a9b5bd9000-56a9b5c20000 rw-p 00000000 00:00 0 [heap] +713bdc000000-713bdc021000 rw-p 00000000 00:00 0 +713bdc021000-713be0000000 ---p 00000000 00:00 0 +713be0000000-713be0b01000 rw-p 00000000 00:00 0 +713be0b01000-713be4000000 ---p 00000000 00:00 0 +713be8000000-713be825b000 rw-p 00000000 00:00 0 +713be825b000-713bec000000 ---p 00000000 00:00 0 +713bec000000-713bec254000 rw-p 00000000 00:00 0 +713bec254000-713bf0000000 ---p 00000000 00:00 0 +713bf4000000-713bf4203000 rw-p 00000000 00:00 0 +713bf4203000-713bf8000000 ---p 00000000 00:00 0 +713bf8000000-713bf83e5000 rw-p 00000000 00:00 0 +713bf83e5000-713bfc000000 ---p 00000000 00:00 0 +713c00000000-713c00209000 rw-p 00000000 00:00 0 +713c00209000-713c04000000 ---p 00000000 00:00 0 +713c04000000-713c04302000 rw-p 00000000 00:00 0 +713c04302000-713c08000000 ---p 00000000 00:00 0 +713c0c000000-713c0c021000 rw-p 00000000 00:00 0 +713c0c021000-713c10000000 ---p 00000000 00:00 0 +713c10000000-713c10023000 rw-p 00000000 00:00 0 +713c10023000-713c14000000 ---p 00000000 00:00 0 +713c18000000-713c18021000 rw-p 00000000 00:00 0 +713c18021000-713c1c000000 ---p 00000000 00:00 0 +713c1c000000-713c1c056000 rw-p 00000000 00:00 0 +713c1c056000-713c20000000 ---p 00000000 00:00 0 +713c24000000-713c24021000 rw-p 00000000 00:00 0 +713c24021000-713c28000000 ---p 00000000 00:00 0 +713c28000000-713c28021000 rw-p 00000000 00:00 0 +713c28021000-713c2c000000 ---p 00000000 00:00 0 +713c30000000-713c3023f000 rw-p 00000000 00:00 0 +713c3023f000-713c34000000 ---p 00000000 00:00 0 +713c34000000-713c34021000 rw-p 00000000 00:00 0 +713c34021000-713c38000000 ---p 00000000 00:00 0 +713c3c000000-713c3c021000 rw-p 00000000 00:00 0 +713c3c021000-713c40000000 ---p 00000000 00:00 0 +713c40000000-713c40021000 rw-p 00000000 00:00 0 +713c40021000-713c44000000 ---p 00000000 00:00 0 +713c48000000-713c481ff000 rw-p 00000000 00:00 0 +713c481ff000-713c4c000000 ---p 00000000 00:00 0 +713c4c000000-713c4c06a000 rw-p 00000000 00:00 0 +713c4c06a000-713c50000000 ---p 00000000 00:00 0 +713c54000000-713c54021000 rw-p 00000000 00:00 0 +713c54021000-713c58000000 ---p 00000000 00:00 0 +713c58000000-713c58021000 rw-p 00000000 00:00 0 +713c58021000-713c5c000000 ---p 00000000 00:00 0 +713c60000000-713c60021000 rw-p 00000000 00:00 0 +713c60021000-713c64000000 ---p 00000000 00:00 0 +713c64000000-713c64021000 rw-p 00000000 00:00 0 +713c64021000-713c68000000 ---p 00000000 00:00 0 +713c6c000000-713c6c021000 rw-p 00000000 00:00 0 +713c6c021000-713c70000000 ---p 00000000 00:00 0 +713c70000000-713c7023e000 rw-p 00000000 00:00 0 +713c7023e000-713c74000000 ---p 00000000 00:00 0 +713c78000000-713c78021000 rw-p 00000000 00:00 0 +713c78021000-713c7c000000 ---p 00000000 00:00 0 +713c7c000000-713c7c021000 rw-p 00000000 00:00 0 +713c7c021000-713c80000000 ---p 00000000 00:00 0 +713c84000000-713c8405c000 rw-p 00000000 00:00 0 +713c8405c000-713c88000000 ---p 00000000 00:00 0 +713c88000000-713c88021000 rw-p 00000000 00:00 0 +713c88021000-713c8c000000 ---p 00000000 00:00 0 +713c90000000-713c90021000 rw-p 00000000 00:00 0 +713c90021000-713c94000000 ---p 00000000 00:00 0 +713c94000000-713c94026000 rw-p 00000000 00:00 0 +713c94026000-713c98000000 ---p 00000000 00:00 0 +713c9c000000-713c9c02f000 rw-p 00000000 00:00 0 +713c9c02f000-713ca0000000 ---p 00000000 00:00 0 +713ca0000000-713ca0021000 rw-p 00000000 00:00 0 +713ca0021000-713ca4000000 ---p 00000000 00:00 0 +713ca8000000-713ca871f000 rw-p 00000000 00:00 0 +713ca871f000-713cac000000 ---p 00000000 00:00 0 +713cac000000-713cac0fb000 rw-p 00000000 00:00 0 +713cac0fb000-713cb0000000 ---p 00000000 00:00 0 +713cb4000000-713cb4021000 rw-p 00000000 00:00 0 +713cb4021000-713cb8000000 ---p 00000000 00:00 0 +713cb8000000-713cb8039000 rw-p 00000000 00:00 0 +713cb8039000-713cbc000000 ---p 00000000 00:00 0 +713cc0000000-713cc0021000 rw-p 00000000 00:00 0 +713cc0021000-713cc4000000 ---p 00000000 00:00 0 +713cc4000000-713cc4021000 rw-p 00000000 00:00 0 +713cc4021000-713cc8000000 ---p 00000000 00:00 0 +713ccc000000-713ccc021000 rw-p 00000000 00:00 0 +713ccc021000-713cd0000000 ---p 00000000 00:00 0 +713cd0000000-713cd0021000 rw-p 00000000 00:00 0 +713cd0021000-713cd4000000 ---p 00000000 00:00 0 +713cd8000000-713cd8021000 rw-p 00000000 00:00 0 +713cd8021000-713cdc000000 ---p 00000000 00:00 0 +713cdc000000-713cdc021000 rw-p 00000000 00:00 0 +713cdc021000-713ce0000000 ---p 00000000 00:00 0 +713ce4000000-713ce4021000 rw-p 00000000 00:00 0 +713ce4021000-713ce8000000 ---p 00000000 00:00 0 +713ce8000000-713ce8021000 rw-p 00000000 00:00 0 +713ce8021000-713cec000000 ---p 00000000 00:00 0 +713cf0000000-713cf0021000 rw-p 00000000 00:00 0 +713cf0021000-713cf4000000 ---p 00000000 00:00 0 +713cf4000000-713cf4021000 rw-p 00000000 00:00 0 +713cf4021000-713cf8000000 ---p 00000000 00:00 0 +713cfc000000-713cfc021000 rw-p 00000000 00:00 0 +713cfc021000-713d00000000 ---p 00000000 00:00 0 +713d00000000-713d00021000 rw-p 00000000 00:00 0 +713d00021000-713d04000000 ---p 00000000 00:00 0 +713d08000000-713d08021000 rw-p 00000000 00:00 0 +713d08021000-713d0c000000 ---p 00000000 00:00 0 +713d0c000000-713d0c021000 rw-p 00000000 00:00 0 +713d0c021000-713d10000000 ---p 00000000 00:00 0 +713d14000000-713d14021000 rw-p 00000000 00:00 0 +713d14021000-713d18000000 ---p 00000000 00:00 0 +713d18000000-713d18021000 rw-p 00000000 00:00 0 +713d18021000-713d1c000000 ---p 00000000 00:00 0 +713d20000000-713d20021000 rw-p 00000000 00:00 0 +713d20021000-713d24000000 ---p 00000000 00:00 0 +713d24000000-713d24021000 rw-p 00000000 00:00 0 +713d24021000-713d28000000 ---p 00000000 00:00 0 +713d2c000000-713d2c021000 rw-p 00000000 00:00 0 +713d2c021000-713d30000000 ---p 00000000 00:00 0 +713d30000000-713d30021000 rw-p 00000000 00:00 0 +713d30021000-713d34000000 ---p 00000000 00:00 0 +713d38000000-713d38021000 rw-p 00000000 00:00 0 +713d38021000-713d3c000000 ---p 00000000 00:00 0 +713d3c000000-713d3c021000 rw-p 00000000 00:00 0 +713d3c021000-713d40000000 ---p 00000000 00:00 0 +713d44000000-713d44021000 rw-p 00000000 00:00 0 +713d44021000-713d48000000 ---p 00000000 00:00 0 +713d48000000-713d48021000 rw-p 00000000 00:00 0 +713d48021000-713d4c000000 ---p 00000000 00:00 0 +713d50000000-713d50021000 rw-p 00000000 00:00 0 +713d50021000-713d54000000 ---p 00000000 00:00 0 +713d54000000-713d54021000 rw-p 00000000 00:00 0 +713d54021000-713d58000000 ---p 00000000 00:00 0 +713d5c000000-713d5c453000 rw-p 00000000 00:00 0 +713d5c453000-713d60000000 ---p 00000000 00:00 0 +713d60000000-713d602cd000 rw-p 00000000 00:00 0 +713d602cd000-713d64000000 ---p 00000000 00:00 0 +713d68000000-713d6925b000 rw-p 00000000 00:00 0 +713d6925b000-713d6c000000 ---p 00000000 00:00 0 +713d6c000000-713d6ca37000 rw-p 00000000 00:00 0 +713d6ca37000-713d70000000 ---p 00000000 00:00 0 +713d74000000-713d7404c000 rw-p 00000000 00:00 0 +713d7404c000-713d78000000 ---p 00000000 00:00 0 +713d78000000-713d78021000 rw-p 00000000 00:00 0 +713d78021000-713d7c000000 ---p 00000000 00:00 0 +713d80000000-713d803c7000 rw-p 00000000 00:00 0 +713d803c7000-713d84000000 ---p 00000000 00:00 0 +713d84000000-713d84449000 rw-p 00000000 00:00 0 +713d84449000-713d88000000 ---p 00000000 00:00 0 +713d8c000000-713d8d122000 rw-p 00000000 00:00 0 +713d8d122000-713d90000000 ---p 00000000 00:00 0 +713d90000000-713d90021000 rw-p 00000000 00:00 0 +713d90021000-713d94000000 ---p 00000000 00:00 0 +713d98000000-713d98021000 rw-p 00000000 00:00 0 +713d98021000-713d9c000000 ---p 00000000 00:00 0 +713d9c000000-713d9c021000 rw-p 00000000 00:00 0 +713d9c021000-713da0000000 ---p 00000000 00:00 0 +713da4000000-713da4021000 rw-p 00000000 00:00 0 +713da4021000-713da8000000 ---p 00000000 00:00 0 +713da8000000-713da8021000 rw-p 00000000 00:00 0 +713da8021000-713dac000000 ---p 00000000 00:00 0 +713db0000000-713db0025000 rw-p 00000000 00:00 0 +713db0025000-713db4000000 ---p 00000000 00:00 0 +713db4000000-713db44f0000 rw-p 00000000 00:00 0 +713db44f0000-713db4570000 rw-p 00000000 00:00 0 +713db4570000-713db4670000 rw-p 00000000 00:00 0 +713db4670000-713db46f0000 rw-p 00000000 00:00 0 +713db46f0000-713db48f0000 rw-p 00000000 00:00 0 +713db48f0000-713db4970000 rw-p 00000000 00:00 0 +713db4970000-713db4af0000 rw-p 00000000 00:00 0 +713db4af0000-713db4bf0000 rw-p 00000000 00:00 0 +713db4bf0000-713db4cf0000 rw-p 00000000 00:00 0 +713db4cf0000-713db4df0000 rw-p 00000000 00:00 0 +713db4df0000-713db51f0000 rw-p 00000000 00:00 0 +713db51f0000-713db52f0000 rw-p 00000000 00:00 0 +713db52f0000-713db53f0000 rw-p 00000000 00:00 0 +713db53f0000-713db58f0000 rw-p 00000000 00:00 0 +713db58f0000-713db59f0000 rw-p 00000000 00:00 0 +713db59f0000-713db6770000 rw-p 00000000 00:00 0 +713db6770000-713db67f0000 rw-p 00000000 00:00 0 +713db67f0000-713db6af0000 rw-p 00000000 00:00 0 +713db6af0000-713db6b50000 rw-p 00000000 00:00 0 +713db6b50000-713db6c00000 ---p 00000000 00:00 0 +713db6c00000-713db6e50000 rw-p 00000000 00:00 0 +713db6e50000-713db8000000 ---p 00000000 00:00 0 +713db8000000-713db8021000 rw-p 00000000 00:00 0 +713db8021000-713dbc000000 ---p 00000000 00:00 0 +713dc0000000-713dc0021000 rw-p 00000000 00:00 0 +713dc0021000-713dc4000000 ---p 00000000 00:00 0 +713dc4000000-713dc4021000 rw-p 00000000 00:00 0 +713dc4021000-713dc8000000 ---p 00000000 00:00 0 +713dc8c00000-713dc8ee1000 rw-p 00000000 00:00 0 +713dc9000000-713dc9004000 ---p 00000000 00:00 0 +713dc9004000-713dc9100000 rw-p 00000000 00:00 0 +713dc9100000-713dc9104000 ---p 00000000 00:00 0 +713dc9104000-713dc9200000 rw-p 00000000 00:00 0 +713dc9200000-713dc9204000 ---p 00000000 00:00 0 +713dc9204000-713dc9300000 rw-p 00000000 00:00 0 +713dc9300000-713dc9304000 ---p 00000000 00:00 0 +713dc9304000-713dc9400000 rw-p 00000000 00:00 0 +713dc9400000-713dc9404000 ---p 00000000 00:00 0 +713dc9404000-713dc9500000 rw-p 00000000 00:00 0 +713dc9500000-713dc9504000 ---p 00000000 00:00 0 +713dc9504000-713dc9600000 rw-p 00000000 00:00 0 +713dc9600000-713dc9604000 ---p 00000000 00:00 0 +713dc9604000-713dc9700000 rw-p 00000000 00:00 0 +713dc9700000-713dc9704000 ---p 00000000 00:00 0 +713dc9704000-713dc9800000 rw-p 00000000 00:00 0 +713dc9800000-713dc9804000 ---p 00000000 00:00 0 +713dc9804000-713dc9900000 rw-p 00000000 00:00 0 +713dc9900000-713dc9904000 ---p 00000000 00:00 0 +713dc9904000-713dc9a00000 rw-p 00000000 00:00 0 +713dc9a00000-713dc9a04000 ---p 00000000 00:00 0 +713dc9a04000-713dc9b00000 rw-p 00000000 00:00 0 +713dc9b00000-713dc9b04000 ---p 00000000 00:00 0 +713dc9b04000-713dc9c00000 rw-p 00000000 00:00 0 +713dc9c00000-713dc9c04000 ---p 00000000 00:00 0 +713dc9c04000-713dc9d00000 rw-p 00000000 00:00 0 +713dc9d00000-713dc9d04000 ---p 00000000 00:00 0 +713dc9d04000-713dc9e00000 rw-p 00000000 00:00 0 +713dc9e00000-713dc9e04000 ---p 00000000 00:00 0 +713dc9e04000-713dc9f00000 rw-p 00000000 00:00 0 +713dc9f00000-713dc9f04000 ---p 00000000 00:00 0 +713dc9f04000-713dca000000 rw-p 00000000 00:00 0 +713dca000000-713dca004000 ---p 00000000 00:00 0 +713dca004000-713dca100000 rw-p 00000000 00:00 0 +713dca100000-713dca104000 ---p 00000000 00:00 0 +713dca104000-713dca200000 rw-p 00000000 00:00 0 +713dca200000-713dca204000 ---p 00000000 00:00 0 +713dca204000-713dca300000 rw-p 00000000 00:00 0 +713dca300000-713dca304000 ---p 00000000 00:00 0 +713dca304000-713dca400000 rw-p 00000000 00:00 0 +713dca400000-713dca404000 ---p 00000000 00:00 0 +713dca404000-713dca500000 rw-p 00000000 00:00 0 +713dca500000-713dca504000 ---p 00000000 00:00 0 +713dca504000-713dca600000 rw-p 00000000 00:00 0 +713dca600000-713dca604000 ---p 00000000 00:00 0 +713dca604000-713dca700000 rw-p 00000000 00:00 0 +713dca700000-713dca704000 ---p 00000000 00:00 0 +713dca704000-713dca800000 rw-p 00000000 00:00 0 +713dca800000-713dca804000 ---p 00000000 00:00 0 +713dca804000-713dca900000 rw-p 00000000 00:00 0 +713dca900000-713dca904000 ---p 00000000 00:00 0 +713dca904000-713dcaa00000 rw-p 00000000 00:00 0 +713dcaa00000-713dcaa04000 ---p 00000000 00:00 0 +713dcaa04000-713dcab00000 rw-p 00000000 00:00 0 +713dcab00000-713dcab04000 ---p 00000000 00:00 0 +713dcab04000-713dcac00000 rw-p 00000000 00:00 0 +713dcac00000-713dcac04000 ---p 00000000 00:00 0 +713dcac04000-713dcad00000 rw-p 00000000 00:00 0 +713dcad00000-713dcad04000 ---p 00000000 00:00 0 +713dcad04000-713dcae00000 rw-p 00000000 00:00 0 +713dcae00000-713dcae04000 ---p 00000000 00:00 0 +713dcae04000-713dcaf00000 rw-p 00000000 00:00 0 +713dcaf00000-713dcaf04000 ---p 00000000 00:00 0 +713dcaf04000-713dcb000000 rw-p 00000000 00:00 0 +713dcb000000-713dcb004000 ---p 00000000 00:00 0 +713dcb004000-713dcb100000 rw-p 00000000 00:00 0 +713dcb100000-713dcb104000 ---p 00000000 00:00 0 +713dcb104000-713dcb200000 rw-p 00000000 00:00 0 +713dcb200000-713dcb401000 rw-p 00000000 00:00 0 +713dcb500000-713dcb504000 ---p 00000000 00:00 0 +713dcb504000-713dcb600000 rw-p 00000000 00:00 0 +713dcb600000-713dcb801000 rw-p 00000000 00:00 0 +713dcb900000-713dcb904000 ---p 00000000 00:00 0 +713dcb904000-713dcba00000 rw-p 00000000 00:00 0 +713dcba00000-713dcba11000 r-xp 00000000 08:02 7340126 /tmp/libnetty_transport_native_epoll_x86_646359598312584981359.so (deleted) +713dcba11000-713dcbc10000 ---p 00011000 08:02 7340126 /tmp/libnetty_transport_native_epoll_x86_646359598312584981359.so (deleted) +713dcbc10000-713dcbc12000 r--p 00010000 08:02 7340126 /tmp/libnetty_transport_native_epoll_x86_646359598312584981359.so (deleted) +713dcbc12000-713dcbc13000 rw-p 00000000 00:00 0 +713dcbd00000-713dcbd04000 ---p 00000000 00:00 0 +713dcbd04000-713dcbe00000 rw-p 00000000 00:00 0 +713dcbe00000-713dcbe04000 ---p 00000000 00:00 0 +713dcbe04000-713dcbf00000 rw-p 00000000 00:00 0 +713dcbf00000-713dcbf04000 ---p 00000000 00:00 0 +713dcbf04000-713dcc000000 rw-p 00000000 00:00 0 +713dcc000000-713dcc021000 rw-p 00000000 00:00 0 +713dcc021000-713dd0000000 ---p 00000000 00:00 0 +713dd0000000-713dd0021000 rw-p 00000000 00:00 0 +713dd0021000-713dd4000000 ---p 00000000 00:00 0 +713dd40eb000-713dd40ef000 ---p 00000000 00:00 0 +713dd40ef000-713dd41eb000 rw-p 00000000 00:00 0 +713dd41eb000-713dd41ef000 ---p 00000000 00:00 0 +713dd41ef000-713dd42eb000 rw-p 00000000 00:00 0 +713dd42eb000-713dd42ec000 ---p 00000000 00:00 0 +713dd42ec000-713dd43ec000 rw-p 00000000 00:00 0 +713dd43ec000-713dd43ed000 ---p 00000000 00:00 0 +713dd43ed000-713dd44ed000 rw-p 00000000 00:00 0 +713dd44ed000-713dd44ee000 ---p 00000000 00:00 0 +713dd44ee000-713dd45ee000 rw-p 00000000 00:00 0 +713dd45ee000-713dd45ef000 ---p 00000000 00:00 0 +713dd45ef000-713dd46ef000 rw-p 00000000 00:00 0 +713dd46ef000-713dd46f0000 ---p 00000000 00:00 0 +713dd46f0000-713dd47f0000 rw-p 00000000 00:00 0 +713dd47f0000-713dd47f1000 ---p 00000000 00:00 0 +713dd47f1000-713dd48f1000 rw-p 00000000 00:00 0 +713dd48f1000-713dd48f2000 ---p 00000000 00:00 0 +713dd48f2000-713dd49f2000 rw-p 00000000 00:00 0 +713dd49f2000-713dd49f3000 ---p 00000000 00:00 0 +713dd49f3000-713dd4af3000 rw-p 00000000 00:00 0 +713dd4af3000-713dd4af4000 ---p 00000000 00:00 0 +713dd4af4000-713dd4bf4000 rw-p 00000000 00:00 0 +713dd4bf4000-713dd4bf5000 ---p 00000000 00:00 0 +713dd4bf5000-713dd4cf5000 rw-p 00000000 00:00 0 +713dd4cf5000-713dd4cf6000 ---p 00000000 00:00 0 +713dd4cf6000-713dd4df6000 rw-p 00000000 00:00 0 +713dd4df6000-713dd4df7000 ---p 00000000 00:00 0 +713dd4df7000-713dd4ef7000 rw-p 00000000 00:00 0 +713dd4ef7000-713dd4ef8000 ---p 00000000 00:00 0 +713dd4ef8000-713dd4ff8000 rw-p 00000000 00:00 0 +713dd4ff8000-713dd4ff9000 ---p 00000000 00:00 0 +713dd4ff9000-713dd50f9000 rw-p 00000000 00:00 0 +713dd50f9000-713dd50fa000 ---p 00000000 00:00 0 +713dd50fa000-713dd51fa000 rw-p 00000000 00:00 0 +713dd51fa000-713dd51fb000 ---p 00000000 00:00 0 +713dd51fb000-713dd52fb000 rw-p 00000000 00:00 0 +713dd52fb000-713dd52fc000 ---p 00000000 00:00 0 +713dd52fc000-713dd53fc000 rw-p 00000000 00:00 0 +713dd53fc000-713dd53fd000 ---p 00000000 00:00 0 +713dd53fd000-713dd54fd000 rw-p 00000000 00:00 0 +713dd54fd000-713dd54fe000 ---p 00000000 00:00 0 +713dd54fe000-713dd55fe000 rw-p 00000000 00:00 0 +713dd55fe000-713dd55ff000 ---p 00000000 00:00 0 +713dd55ff000-713dd56ff000 rw-p 00000000 00:00 0 +713dd56ff000-713dd5700000 ---p 00000000 00:00 0 +713dd5700000-713dd5800000 rw-p 00000000 00:00 0 +713dd5800000-713dd5804000 ---p 00000000 00:00 0 +713dd5804000-713dd5900000 rw-p 00000000 00:00 0 +713dd5900000-713dd5904000 ---p 00000000 00:00 0 +713dd5904000-713dd5a00000 rw-p 00000000 00:00 0 +713dd5a00000-713dd5a9d000 r--p 00000000 08:02 3935604 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.33 +713dd5a9d000-713dd5be5000 r-xp 0009d000 08:02 3935604 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.33 +713dd5be5000-713dd5c6c000 r--p 001e5000 08:02 3935604 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.33 +713dd5c6c000-713dd5c77000 r--p 0026b000 08:02 3935604 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.33 +713dd5c77000-713dd5c7a000 rw-p 00276000 08:02 3935604 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.33 +713dd5c7a000-713dd5c7e000 rw-p 00000000 00:00 0 +713dd5d00000-713dd5d04000 ---p 00000000 00:00 0 +713dd5d04000-713dd5e00000 rw-p 00000000 00:00 0 +713dd5e00000-713dd5e04000 ---p 00000000 00:00 0 +713dd5e04000-713dd5f00000 rw-p 00000000 00:00 0 +713dd5f00000-713dd5f04000 ---p 00000000 00:00 0 +713dd5f04000-713dd6000000 rw-p 00000000 00:00 0 +713dd6000000-713dd8021000 rw-p 00000000 00:00 0 +713dd8021000-713ddc004000 ---p 00000000 00:00 0 +713ddc004000-713ddc100000 rw-p 00000000 00:00 0 +713ddc100000-713ddc104000 ---p 00000000 00:00 0 +713ddc104000-713ddc200000 rw-p 00000000 00:00 0 +713ddc200000-713ddc204000 ---p 00000000 00:00 0 +713ddc204000-713ddc300000 rw-p 00000000 00:00 0 +713ddc300000-713ddc304000 ---p 00000000 00:00 0 +713ddc304000-713ddc400000 rw-p 00000000 00:00 0 +713ddc400000-713ddc404000 ---p 00000000 00:00 0 +713ddc404000-713ddc500000 rw-p 00000000 00:00 0 +713ddc500000-713ddc504000 ---p 00000000 00:00 0 +713ddc504000-713ddc600000 rw-p 00000000 00:00 0 +713ddc600000-713ddc604000 ---p 00000000 00:00 0 +713ddc604000-713ddc700000 rw-p 00000000 00:00 0 +713ddc700000-713ddc704000 ---p 00000000 00:00 0 +713ddc704000-713ddc800000 rw-p 00000000 00:00 0 +713ddc800000-713ddc804000 ---p 00000000 00:00 0 +713ddc804000-713ddc900000 rw-p 00000000 00:00 0 +713ddc900000-713ddc904000 ---p 00000000 00:00 0 +713ddc904000-713ddca00000 rw-p 00000000 00:00 0 +713ddca00000-713ddcf75000 r--p 00000000 08:02 3934844 /usr/lib/locale/locale-archive +713ddcff6000-713ddcff7000 ---p 00000000 00:00 0 +713ddcff7000-713ddd0f7000 rw-p 00000000 00:00 0 +713ddd0f7000-713ddd0f8000 ---p 00000000 00:00 0 +713ddd0f8000-713ddd1f8000 rw-p 00000000 00:00 0 +713ddd1f8000-713ddd1f9000 ---p 00000000 00:00 0 +713ddd1f9000-713ddd2f9000 rw-p 00000000 00:00 0 +713ddd2f9000-713ddd2fa000 ---p 00000000 00:00 0 +713ddd2fa000-713ddd3fa000 rw-p 00000000 00:00 0 +713ddd3fa000-713ddea40000 rw-p 00000000 00:00 0 +713ddea40000-713ddf8c0000 ---p 00000000 00:00 0 +713ddf8c0000-713ddf900000 rw-p 00000000 00:00 0 +713ddf900000-713ddf9c0000 ---p 00000000 00:00 0 +713ddf9c0000-713ddfa00000 rw-p 00000000 00:00 0 +713ddfa00000-713dfb200000 ---p 00000000 00:00 0 +713dfb200000-713dfb408000 rw-p 00000000 00:00 0 +713dfb408000-713dfb5d8000 ---p 00000000 00:00 0 +713dfb5d8000-713dfb5e0000 rw-p 00000000 00:00 0 +713dfb5e0000-713dfb5f8000 ---p 00000000 00:00 0 +713dfb5f8000-713dfb600000 rw-p 00000000 00:00 0 +713dfb600000-713dfed00000 ---p 00000000 00:00 0 +713dfed00000-713dfed04000 ---p 00000000 00:00 0 +713dfed04000-713dfee00000 rw-p 00000000 00:00 0 +713dfee00000-713dff008000 rw-p 00000000 00:00 0 +713dff008000-713dff1d8000 ---p 00000000 00:00 0 +713dff1d8000-713dff1e0000 rw-p 00000000 00:00 0 +713dff1e0000-713dff1f8000 ---p 00000000 00:00 0 +713dff1f8000-713dff200000 rw-p 00000000 00:00 0 +713dff200000-713e02900000 ---p 00000000 00:00 0 +713e02917000-713e0291b000 r--p 00000000 08:02 3935581 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 +713e0291b000-713e0293f000 r-xp 00004000 08:02 3935581 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 +713e0293f000-713e02943000 r--p 00028000 08:02 3935581 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 +713e02943000-713e02944000 r--p 0002b000 08:02 3935581 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 +713e02944000-713e02945000 rw-p 0002c000 08:02 3935581 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 +713e02957000-713e0297c000 r-xp 00000000 08:02 14313305 /tmp/bazel-jni.6964268149134320779/libunix_jni.so (deleted) +713e0297c000-713e0297d000 ---p 00025000 08:02 14313305 /tmp/bazel-jni.6964268149134320779/libunix_jni.so (deleted) +713e0297d000-713e0297e000 r--p 00025000 08:02 14313305 /tmp/bazel-jni.6964268149134320779/libunix_jni.so (deleted) +713e0297e000-713e0297f000 rw-p 00026000 08:02 14313305 /tmp/bazel-jni.6964268149134320779/libunix_jni.so (deleted) +713e0297f000-713e02a00000 rw-p 00000000 00:00 0 +713e02a00000-713e034f0000 rwxp 00000000 00:00 0 +713e034f0000-713e09e5f000 ---p 00000000 00:00 0 +713e09e5f000-713e0a1ff000 rwxp 00000000 00:00 0 +713e0a1ff000-713e0a5a0000 ---p 00000000 00:00 0 +713e0a5a0000-713e0a830000 rwxp 00000000 00:00 0 +713e0a830000-713e11a00000 ---p 00000000 00:00 0 +713e11a00000-713e13f9e000 r--s 00000000 08:02 37498452 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/modules +713e13fa5000-713e14f97000 rw-p 00000000 00:00 0 +713e14f97000-713e18000000 ---p 00000000 00:00 0 +713e18000000-713e18007000 r--s 00000000 08:02 3962070 /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache +713e18007000-713e18008000 r--p 00000000 08:02 3943932 /usr/lib/x86_64-linux-gnu/libnss_mdns4_minimal.so.2 +713e18008000-713e1800a000 r-xp 00001000 08:02 3943932 /usr/lib/x86_64-linux-gnu/libnss_mdns4_minimal.so.2 +713e1800a000-713e1800b000 r--p 00003000 08:02 3943932 /usr/lib/x86_64-linux-gnu/libnss_mdns4_minimal.so.2 +713e1800b000-713e1800c000 r--p 00003000 08:02 3943932 /usr/lib/x86_64-linux-gnu/libnss_mdns4_minimal.so.2 +713e1800c000-713e1800d000 rw-p 00004000 08:02 3943932 /usr/lib/x86_64-linux-gnu/libnss_mdns4_minimal.so.2 +713e1800d000-713e1800f000 r-xp 00000000 08:02 33984389 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/libcpu_profiler.so +713e1800f000-713e18010000 r--p 00001000 08:02 33984389 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/libcpu_profiler.so +713e18010000-713e18011000 rw-p 00000000 00:00 0 +713e18011000-713e18016000 r-xp 00000000 08:02 37498446 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libmanagement_ext.so +713e18016000-713e18017000 r--p 00005000 08:02 37498446 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libmanagement_ext.so +713e18017000-713e18018000 rw-p 00006000 08:02 37498446 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libmanagement_ext.so +713e18018000-713e1801f000 r-xp 00000000 08:02 37498451 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libzip.so +713e1801f000-713e18020000 ---p 00007000 08:02 37498451 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libzip.so +713e18020000-713e18021000 r--p 00007000 08:02 37498451 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libzip.so +713e18021000-713e18022000 rw-p 00008000 08:02 37498451 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libzip.so +713e18022000-713e1802e000 r-xp 00000000 08:02 37498447 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libnet.so +713e1802e000-713e1802f000 r--p 0000b000 08:02 37498447 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libnet.so +713e1802f000-713e18030000 rw-p 0000c000 08:02 37498447 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libnet.so +713e18030000-713e18c3c000 rw-p 00000000 00:00 0 +713e18c3c000-713e18c3d000 ---p 00000000 00:00 0 +713e18c3d000-713e18d3d000 rw-p 00000000 00:00 0 +713e18d3d000-713e18d3e000 ---p 00000000 00:00 0 +713e18d3e000-713e18e3e000 rw-p 00000000 00:00 0 +713e18e3e000-713e18e3f000 ---p 00000000 00:00 0 +713e18e3f000-713e18f3f000 rw-p 00000000 00:00 0 +713e18f3f000-713e1a334000 rw-p 00000000 00:00 0 +713e1a334000-713e1a417000 ---p 00000000 00:00 0 +713e1a417000-713e1a42d000 rw-p 00000000 00:00 0 +713e1a42d000-713e1a500000 ---p 00000000 00:00 0 +713e1a500000-713e1a504000 ---p 00000000 00:00 0 +713e1a504000-713e1a600000 rw-p 00000000 00:00 0 +713e1a600000-713e1ba1e000 r-xp 00000000 08:02 37498460 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/server/libjvm.so +713e1ba1e000-713e1ba1f000 ---p 0141e000 08:02 37498460 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/server/libjvm.so +713e1ba1f000-713e1baf3000 r--p 0141e000 08:02 37498460 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/server/libjvm.so +713e1baf3000-713e1bb23000 rw-p 014f2000 08:02 37498460 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/server/libjvm.so +713e1bb23000-713e1bc00000 rw-p 00000000 00:00 0 +713e1bc00000-713e1bc28000 r--p 00000000 08:02 3962082 /usr/lib/x86_64-linux-gnu/libc.so.6 +713e1bc28000-713e1bdb0000 r-xp 00028000 08:02 3962082 /usr/lib/x86_64-linux-gnu/libc.so.6 +713e1bdb0000-713e1bdff000 r--p 001b0000 08:02 3962082 /usr/lib/x86_64-linux-gnu/libc.so.6 +713e1bdff000-713e1be03000 r--p 001fe000 08:02 3962082 /usr/lib/x86_64-linux-gnu/libc.so.6 +713e1be03000-713e1be05000 rw-p 00202000 08:02 3962082 /usr/lib/x86_64-linux-gnu/libc.so.6 +713e1be05000-713e1be12000 rw-p 00000000 00:00 0 +713e1be15000-713e1be29000 r-xp 00000000 08:02 37498448 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libnio.so +713e1be29000-713e1be2a000 r--p 00013000 08:02 37498448 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libnio.so +713e1be2a000-713e1be2b000 rw-p 00014000 08:02 37498448 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libnio.so +713e1be2b000-713e1be74000 rw-p 00000000 00:00 0 +713e1be74000-713e1be7b000 ---p 00000000 00:00 0 +713e1be7b000-713e1be9b000 r-xp 00000000 08:02 37498440 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjava.so +713e1be9b000-713e1be9c000 ---p 00020000 08:02 37498440 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjava.so +713e1be9c000-713e1be9d000 r--p 00020000 08:02 37498440 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjava.so +713e1be9d000-713e1be9e000 rw-p 00021000 08:02 37498440 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjava.so +713e1be9e000-713e1be9f000 rw-p 00000000 00:00 0 +713e1be9f000-713e1beba000 r-xp 00000000 08:02 37498442 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjimage.so +713e1beba000-713e1bebb000 ---p 0001b000 08:02 37498442 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjimage.so +713e1bebb000-713e1bebd000 r--p 0001b000 08:02 37498442 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjimage.so +713e1bebd000-713e1bebe000 rw-p 0001d000 08:02 37498442 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjimage.so +713e1bebe000-713e1bece000 r--p 00000000 08:02 3962085 /usr/lib/x86_64-linux-gnu/libm.so.6 +713e1bece000-713e1bf4d000 r-xp 00010000 08:02 3962085 /usr/lib/x86_64-linux-gnu/libm.so.6 +713e1bf4d000-713e1bfa5000 r--p 0008f000 08:02 3962085 /usr/lib/x86_64-linux-gnu/libm.so.6 +713e1bfa5000-713e1bfa6000 r--p 000e7000 08:02 3962085 /usr/lib/x86_64-linux-gnu/libm.so.6 +713e1bfa6000-713e1bfa7000 rw-p 000e8000 08:02 3962085 /usr/lib/x86_64-linux-gnu/libm.so.6 +713e1bfa7000-713e1bfa8000 r--p 00000000 08:02 3962096 /usr/lib/x86_64-linux-gnu/librt.so.1 +713e1bfa8000-713e1bfa9000 r-xp 00001000 08:02 3962096 /usr/lib/x86_64-linux-gnu/librt.so.1 +713e1bfa9000-713e1bfaa000 r--p 00002000 08:02 3962096 /usr/lib/x86_64-linux-gnu/librt.so.1 +713e1bfaa000-713e1bfab000 r--p 00002000 08:02 3962096 /usr/lib/x86_64-linux-gnu/librt.so.1 +713e1bfab000-713e1bfac000 rw-p 00003000 08:02 3962096 /usr/lib/x86_64-linux-gnu/librt.so.1 +713e1bfac000-713e1bfb1000 rw-p 00000000 00:00 0 +713e1bfb1000-713e1bfb2000 r--p 00000000 08:02 3962084 /usr/lib/x86_64-linux-gnu/libdl.so.2 +713e1bfb2000-713e1bfb3000 r-xp 00001000 08:02 3962084 /usr/lib/x86_64-linux-gnu/libdl.so.2 +713e1bfb3000-713e1bfb4000 r--p 00002000 08:02 3962084 /usr/lib/x86_64-linux-gnu/libdl.so.2 +713e1bfb4000-713e1bfb5000 r--p 00002000 08:02 3962084 /usr/lib/x86_64-linux-gnu/libdl.so.2 +713e1bfb5000-713e1bfb6000 rw-p 00003000 08:02 3962084 /usr/lib/x86_64-linux-gnu/libdl.so.2 +713e1bfb6000-713e1bfb7000 r--p 00000000 08:02 3962094 /usr/lib/x86_64-linux-gnu/libpthread.so.0 +713e1bfb7000-713e1bfb8000 r-xp 00001000 08:02 3962094 /usr/lib/x86_64-linux-gnu/libpthread.so.0 +713e1bfb8000-713e1bfb9000 r--p 00002000 08:02 3962094 /usr/lib/x86_64-linux-gnu/libpthread.so.0 +713e1bfb9000-713e1bfba000 r--p 00002000 08:02 3962094 /usr/lib/x86_64-linux-gnu/libpthread.so.0 +713e1bfba000-713e1bfbb000 rw-p 00003000 08:02 3962094 /usr/lib/x86_64-linux-gnu/libpthread.so.0 +713e1bfbb000-713e1bfca000 r-xp 00000000 08:02 37498443 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjli.so +713e1bfca000-713e1bfcb000 r--p 0000e000 08:02 37498443 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjli.so +713e1bfcb000-713e1bfcc000 rw-p 0000f000 08:02 37498443 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libjli.so +713e1bfcc000-713e1bfce000 r--p 00000000 08:02 3944212 /usr/lib/x86_64-linux-gnu/libz.so.1.3 +713e1bfce000-713e1bfe0000 r-xp 00002000 08:02 3944212 /usr/lib/x86_64-linux-gnu/libz.so.1.3 +713e1bfe0000-713e1bfe6000 r--p 00014000 08:02 3944212 /usr/lib/x86_64-linux-gnu/libz.so.1.3 +713e1bfe6000-713e1bfe7000 r--p 0001a000 08:02 3944212 /usr/lib/x86_64-linux-gnu/libz.so.1.3 +713e1bfe7000-713e1bfe8000 rw-p 0001b000 08:02 3944212 /usr/lib/x86_64-linux-gnu/libz.so.1.3 +713e1bfe9000-713e1bfed000 r-xp 00000000 08:02 37498445 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libmanagement.so +713e1bfed000-713e1bfee000 r--p 00003000 08:02 37498445 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libmanagement.so +713e1bfee000-713e1bfef000 rw-p 00004000 08:02 37498445 /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/libmanagement.so +713e1bfef000-713e1bff7000 rw-s 00000000 08:02 14194022 /tmp/hsperfdata_dase212/1031794 +713e1bff7000-713e1bff8000 ---p 00000000 00:00 0 +713e1bff8000-713e1bff9000 r--p 00000000 00:00 0 +713e1bff9000-713e1bffa000 ---p 00000000 00:00 0 +713e1bffa000-713e1bffc000 rw-p 00000000 00:00 0 +713e1bffc000-713e1bffd000 r--p 00000000 08:02 3962078 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 +713e1bffd000-713e1c028000 r-xp 00001000 08:02 3962078 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 +713e1c028000-713e1c032000 r--p 0002c000 08:02 3962078 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 +713e1c032000-713e1c034000 r--p 00036000 08:02 3962078 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 +713e1c034000-713e1c036000 rw-p 00038000 08:02 3962078 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 +7ffe0c53b000-7ffe0c55d000 rw-p 00000000 00:00 0 [stack] +7ffe0c584000-7ffe0c588000 r--p 00000000 00:00 0 [vvar] +7ffe0c588000-7ffe0c58a000 r-xp 00000000 00:00 0 [vdso] +ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall] +Total number of mappings: 530 + + +VM Arguments: +jvm_args: --add-opens=java.base/java.lang=ALL-UNNAMED -Xverify:none -Djava.util.logging.config.file=/home/dase212/.cache/bazel/_bazel_dase212/b3aa481a2afc88cf641c64afb43eb882/javalog.properties -Dcom.google.devtools.build.lib.util.LogHandlerQuerier.class=com.google.devtools.build.lib.util.SimpleLogHandler$HandlerQuerier -XX:-MaxFDLimit -Djava.library.path=/home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib:/home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/embedded_tools/jdk/lib/server:/home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/ -Dfile.encoding=ISO-8859-1 -Duser.country= -Duser.language= -Duser.variant= +java_command: /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/A-server.jar --max_idle_secs=10800 --noshutdown_on_low_sys_mem --connect_timeout_secs=30 --output_user_root=/home/dase212/.cache/bazel/_bazel_dase212 --install_base=/home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459 --install_md5=bd3f2062f72dd67fde166eda94178459 --output_base=/home/dase212/.cache/bazel/_bazel_dase212/b3aa481a2afc88cf641c64afb43eb882 --workspace_directory=/home/dase212/lxy/yacl --default_system_javabase= --failure_detail_out=/home/dase212/.cache/bazel/_bazel_dase212/b3aa481a2afc88cf641c64afb43eb882/failure_detail.rawproto --expand_configs_in_place --idle_server_tasks --write_command_log --nowatchfs --nofatal_event_bus_exceptions --nowindows_enable_symlinks --client_debug=false --product_name=Bazel --option_sources= +java_class_path (initial): /home/dase212/.cache/bazel/_bazel_dase212/install/bd3f2062f72dd67fde166eda94178459/A-server.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 12 {product} {ergonomic} + uint ConcGCThreads = 5 {product} {ergonomic} + uint G1ConcRefinementThreads = 18 {product} {ergonomic} + size_t G1HeapRegionSize = 16777216 {product} {ergonomic} + uintx GCDrainStackTargetSize = 64 {product} {ergonomic} + size_t InitialHeapSize = 2147483648 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + bool MaxFDLimit = false {product} {command line} + size_t MaxHeapSize = 31675383808 {product} {ergonomic} + size_t MaxNewSize = 18991808512 {product} {ergonomic} + size_t MinHeapDeltaBytes = 16777216 {product} {ergonomic} + size_t MinHeapSize = 16777216 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 7602480 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 31675383808 {manageable} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Environment Variables: +PATH=/home/dase212/.vscode-server/cli/servers/Stable-ddc367ed5c8936efe395cffeec279b04ffd7db78/server/bin/remote-cli:/home/dase212/bin:/home/dase212/anaconda3/bin:/home/dase212/anaconda3/bin:/home/dase212/anaconda3/condabin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/dase212/bin +SHELL=/bin/bash +LANG=en_US.UTF-8 + +Active Locale: +LC_ALL=en_US.UTF-8 +LC_COLLATE=en_US.UTF-8 +LC_CTYPE=en_US.UTF-8 +LC_MESSAGES=en_US.UTF-8 +LC_MONETARY=en_US.UTF-8 +LC_NUMERIC=en_US.UTF-8 +LC_TIME=en_US.UTF-8 + +Signal Handlers: + SIGSEGV: crash_handler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGBUS: crash_handler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGFPE: crash_handler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGPIPE: javaSignalHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked + SIGXFSZ: javaSignalHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked + SIGILL: crash_handler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGUSR2: SR_handler in libjvm.so, mask=00000000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked + SIGHUP: SIG_IGN, mask=00000000000000000000000000000000, flags=none, blocked + SIGINT: UserHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTERM: UserHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked + SIGQUIT: UserHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTRAP: crash_handler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked + + +Periodic native trim disabled + +--------------- S Y S T E M --------------- + +OS: +DISTRIB_ID=Ubuntu +DISTRIB_RELEASE=24.04 +DISTRIB_CODENAME=noble +DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS" +uname: Linux 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 5 13:09:44 UTC 2024 x86_64 +OS uptime: 42 days 22:41 hours +libc: glibc 2.39 NPTL 2.39 +rlimit (soft/hard): STACK 8192k/infinity , CORE 0k/infinity , NPROC 1027259/1027259 , NOFILE 1048576/1048576 , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK 32881196k/32881196k +load average: 0.49 0.30 0.22 + +/proc/meminfo: +MemTotal: 263049576 kB +MemFree: 157897640 kB +MemAvailable: 249004752 kB +Buffers: 2013864 kB +Cached: 85288296 kB +SwapCached: 0 kB +Active: 14045184 kB +Inactive: 83099256 kB +Active(anon): 10009344 kB +Inactive(anon): 0 kB +Active(file): 4035840 kB +Inactive(file): 83099256 kB +Unevictable: 8188 kB +Mlocked: 88 kB +SwapTotal: 8388604 kB +SwapFree: 8388604 kB +Zswap: 0 kB +Zswapped: 0 kB +Dirty: 1276 kB +Writeback: 4 kB +AnonPages: 9835080 kB +Mapped: 1287048 kB +Shmem: 167136 kB +KReclaimable: 6265096 kB +Slab: 7191828 kB +SReclaimable: 6265096 kB +SUnreclaim: 926732 kB +KernelStack: 36976 kB +PageTables: 111768 kB +SecPageTables: 0 kB +NFS_Unstable: 0 kB +Bounce: 0 kB +WritebackTmp: 0 kB +CommitLimit: 139913392 kB +Committed_AS: 20589880 kB +VmallocTotal: 13743895347199 kB +VmallocUsed: 253452 kB +VmallocChunk: 0 kB +Percpu: 119136 kB +HardwareCorrupted: 20 kB +AnonHugePages: 10240 kB +ShmemHugePages: 0 kB +ShmemPmdMapped: 0 kB +FileHugePages: 0 kB +FilePmdMapped: 0 kB +Unaccepted: 0 kB +HugePages_Total: 0 +HugePages_Free: 0 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +Hugepagesize: 2048 kB +Hugetlb: 0 kB +DirectMap4k: 3808984 kB +DirectMap2M: 54028288 kB +DirectMap1G: 209715200 kB + +/sys/kernel/mm/transparent_hugepage/enabled: always [madvise] never +/sys/kernel/mm/transparent_hugepage/hpage_pmd_size: 2097152 +/sys/kernel/mm/transparent_hugepage/defrag (defrag/compaction efforts parameter): always defer defer+madvise [madvise] never + +Process Memory: +Virtual Size: 38779376K (peak: 38779448K) +Resident Set Size: 323704K (peak: 330028K) (anon: 302008K, file: 21696K, shmem: 0K) +Swapped out: 0K +C-Heap outstanding allocations: 122213K, retained: 48034K +glibc malloc tunables: (default) + +/proc/sys/kernel/threads-max (system-wide limit on the number of threads): 2054518 +/proc/sys/vm/max_map_count (maximum number of memory map areas a process may have): 1048576 +/proc/sys/vm/swappiness (control to define how aggressively the kernel swaps out anonymous memory): 60 +/proc/sys/kernel/pid_max (system-wide limit on number of process identifiers): 4194304 + +container (cgroup) information: +container_type: cgroupv2 +cpu_cpuset_cpus: not supported +cpu_memory_nodes: not supported +active_processor_count: 24 +cpu_quota: no quota +cpu_period: 100000 +cpu_shares: no shares +memory_limit_in_bytes: unlimited +memory_and_swap_limit_in_bytes: unlimited +memory_soft_limit_in_bytes: unlimited +memory_usage_in_bytes: 10836160 k +memory_max_usage_in_bytes: not supported +memory_swap_current_in_bytes: unlimited +memory_swap_max_limit_in_bytes: unlimited +maximum number of tasks: unlimited +current number of tasks: 352 + +Steal ticks since vm start: 0 +Steal ticks percentage since vm start: 0.000 + +CPU: total 24 (initial active 24) (24 cores per cpu, 2 threads per core) family 25 model 24 stepping 1 microcode 0xa108105, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, avx512f, avx512dq, avx512cd, avx512bw, avx512vl, sha, fma, vzeroupper, avx512_vpopcntdq, avx512_vpclmulqdq, avx512_vaes, avx512_vnni, clflush, clflushopt, avx512_vbmi2, avx512_vbmi, rdtscp, rdpid, fsrm, gfni, avx512_bitalg, f16c, pku, ospke, cet_ss, avx512_ifma +CPU Model and flags from /proc/cpuinfo: +model name : AMD Ryzen Threadripper PRO 7945WX 12-Cores +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good amd_lbr_v2 nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp ibrs_enhanced vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local user_shstk avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif x2avic v_spec_ctrl vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq la57 rdpid overflow_recov succor smca fsrm flush_l1d debug_swap + +Online cpus: 0-23 +Offline cpus: +BIOS frequency limitation: +Frequency switch latency (ns): 0 +Available cpu frequencies: +Current governor: powersave +Core performance/turbo boost: + +Memory: 4k page, physical 263049576k(249003760k free), swap 8388604k(8388604k free) +Page Sizes: 4k + +vm_info: OpenJDK 64-Bit Server VM (21.0.5+11-LTS) for linux-amd64 JRE (21.0.5+11-LTS) (Zulu21.38+21-CA), built on 2024-10-11T20:45:05Z by "zulu_re" with gcc 11.2.0 + +END. From 6383eb92dddaef9724abe41fe731aa9d2f2d763d Mon Sep 17 00:00:00 2001 From: gitCoder1024 <201810111240@stu.shmtu.edu.cn> Date: Mon, 31 Mar 2025 16:44:05 +0800 Subject: [PATCH 24/27] clean code --- examples/gc/BUILD.bazel | 14 +++++++++ examples/gc/aes_128_evaluator.h | 42 ++++++++++++-------------- examples/gc/aes_128_garbler.h | 52 ++++++++++++++------------------- examples/gc/gc_test.cc | 36 +++++++++++------------ examples/gc/mitccrh.h | 19 ++++++++++-- examples/gc/sha256_evaluator.h | 22 ++++++++++---- examples/gc/sha256_garbler.h | 47 +++++++++++++---------------- examples/gc/utils.h | 14 +++++++++ 8 files changed, 139 insertions(+), 107 deletions(-) diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel index 6823ab0b..2ce288ff 100644 --- a/examples/gc/BUILD.bazel +++ b/examples/gc/BUILD.bazel @@ -1,3 +1,17 @@ +# Copyright 2024 Ant Group Co., Ltd. +# +# 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. + load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") package(default_visibility = ["//visibility:public"]) diff --git a/examples/gc/aes_128_evaluator.h b/examples/gc/aes_128_evaluator.h index 1b08c513..156a6dc9 100644 --- a/examples/gc/aes_128_evaluator.h +++ b/examples/gc/aes_128_evaluator.h @@ -1,3 +1,17 @@ +// Copyright 2024 Ant Group Co., Ltd. +// +// 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. + #pragma once #include @@ -38,7 +52,6 @@ class EvaluatorAES { yacl::io::BFCircuit circ_; std::shared_ptr lctx; - // 根据电路改 uint128_t table[36663][2]; uint128_t input; int num_ot = 128; @@ -49,7 +62,6 @@ class EvaluatorAES { OtRecvStore(num_ot, yacl::crypto::OtStoreType::Normal); void setup() { - // 通信环境初始化 size_t world_size = 2; yacl::link::ContextDesc ctx_desc; @@ -69,8 +81,9 @@ class EvaluatorAES { kernel1.init(lctx); kernel1.eval_rot(lctx, num_ot, &ot_recv); + // delta, inv_constant, start_point uint128_t tmp[3]; - // delta, inv_constant, start_point 接收 + yacl::Buffer r = lctx->Recv(0, "tmp"); const uint128_t* buffer_data = r.data(); memcpy(tmp, buffer_data, sizeof(uint128_t) * 3); @@ -80,7 +93,6 @@ class EvaluatorAES { inv_constant = tmp[1]; start_point = tmp[2]; - // 秘钥生成 mitccrh.setS(start_point); } @@ -89,14 +101,12 @@ class EvaluatorAES { gb_value.resize(circ_.nw); wires_.resize(circ_.nw); - // 输入位数有关 yacl::dynamic_bitset bi_val; - // 输入位数有关 input = yacl::crypto::FastRandU128(); std::cout << "input of evaluator:" << input << std::endl; - bi_val.append(input); // 直接转换为二进制 输入线路在前64位 - // 接收garbler混淆值 + bi_val.append(input); + yacl::Buffer r = lctx->Recv(0, "garbleInput1"); const uint128_t* buffer_data = r.data(); @@ -105,19 +115,6 @@ class EvaluatorAES { std::cout << "recvInput1" << std::endl; - // 对evaluator自己的输入值进行混淆 - // r = lctx->Recv(0, "garbleInput2"); - // buffer_data = r.data(); - // for (int i = 0; i < circ_.niw[1]; i++) { - // wires_[i + circ_.niw[0]] = - // buffer_data[i] ^ (select_mask[bi_val[i]] & delta); - - // } - // std::cout << "recvInput2" << std::endl; - - // onLineOT(); - - // 输入位数有关 lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint128_t)), "Input1"); return input; @@ -136,7 +133,6 @@ class EvaluatorAES { std::cout << "recvTable" << std::endl; } - // 未检查 uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { uint128_t HA, HB, W; @@ -164,7 +160,7 @@ class EvaluatorAES { auto gate = circ_.gates[i]; switch (gate.op) { case yacl::io::BFCircuit::Op::XOR: { - const auto& iw0 = wires_.operator[](gate.iw[0]); // 取到具体值 + const auto& iw0 = wires_.operator[](gate.iw[0]); const auto& iw1 = wires_.operator[](gate.iw[1]); wires_[gate.ow[0]] = iw0 ^ iw1; break; diff --git a/examples/gc/aes_128_garbler.h b/examples/gc/aes_128_garbler.h index 3d73531a..67efd3ea 100644 --- a/examples/gc/aes_128_garbler.h +++ b/examples/gc/aes_128_garbler.h @@ -1,3 +1,17 @@ +// Copyright 2024 Ant Group Co., Ltd. +// +// 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. + #pragma once #include @@ -21,8 +35,6 @@ using namespace std; using namespace yacl; - - inline uint128_t Aes128(uint128_t k, uint128_t m) { crypto::SymmetricCrypto enc(crypto::SymmetricCrypto::CryptoType::AES128_ECB, k); @@ -50,14 +62,12 @@ class GarblerAES { std::vector wires_; std::vector gb_value; yacl::io::BFCircuit circ_; - // 根据电路改 + uint128_t table[36663][2]; - // 输入数据类型需要修改 uint128_t input; uint128_t input_EV; - // num_ot根据输入改 int num_ot = 128; uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); uint128_t select_mask_[2] = {0, all_one_uint128_t_}; @@ -65,7 +75,6 @@ class GarblerAES { OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); void setup() { - // 通信环境初始化 size_t world_size = 2; yacl::link::ContextDesc ctx_desc; @@ -85,11 +94,10 @@ class GarblerAES { kernel0.init(lctx); kernel0.eval_rot(lctx, num_ot, &ot_send); - // delta, inv_constant, start_point 初始化并发送给evaluator + // delta, inv_constant, start_point uint128_t tmp[3]; - // random_uint128_t(tmp, 3); - for(int i = 0; i < 3; i++){ + for (int i = 0; i < 3; i++) { std::random_device rd; std::mt19937_64 eng(rd()); std::uniform_int_distribution distr; @@ -107,32 +115,26 @@ class GarblerAES { inv_constant = tmp[1] ^ delta; start_point = tmp[2]; - // 秘钥生成 mitccrh.setS(start_point); } - // 包扩 输入值生成和混淆,garbler混淆值的发送 uint128_t inputProcess(yacl::io::BFCircuit param_circ_) { circ_ = param_circ_; gb_value.resize(circ_.nw); wires_.resize(circ_.nw); - // 输入位数有关 input = yacl::crypto::FastRandU128(); std::cout << "input of garbler:" << input << std::endl; - // 输入位数有关 yacl::dynamic_bitset bi_val; - bi_val.append(input); // 直接转换为二进制 输入线路在前64位 + bi_val.append(input); - // 混淆过程 int num_of_input_wires = 0; for (size_t i = 0; i < circ_.niv; ++i) { num_of_input_wires += circ_.niw[i]; } - // random_uint128_t(gb_value.data(), num_of_input_wires); - for(int i = 0; i < num_of_input_wires; i++){ + for (int i = 0; i < num_of_input_wires; i++) { std::random_device rd; std::mt19937_64 eng(rd()); std::uniform_int_distribution distr; @@ -143,7 +145,6 @@ class GarblerAES { gb_value[i] = MakeUint128(high, low); } - // 前64位 直接置换 garbler for (size_t i = 0; i < circ_.niw[0]; i++) { wires_[i] = gb_value[i] ^ (select_mask_[bi_val[i]] & delta); } @@ -158,7 +159,6 @@ class GarblerAES { yacl::Buffer r = lctx->Recv(1, "Input1"); - // 输入位数有关 const uint128_t* buffer_data = r.data(); input_EV = *buffer_data; @@ -204,7 +204,7 @@ class GarblerAES { auto gate = circ_.gates[i]; switch (gate.op) { case yacl::io::BFCircuit::Op::XOR: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 + const auto& iw0 = gb_value.operator[](gate.iw[0]); const auto& iw1 = gb_value.operator[](gate.iw[1]); gb_value[gate.ow[0]] = iw0 ^ iw1; break; @@ -247,7 +247,6 @@ class GarblerAES { std::cout << "sendTable" << std::endl; } uint128_t decode() { - // 现接收计算结果 size_t index = wires_.size(); int start = index - circ_.now[0]; @@ -258,31 +257,24 @@ class GarblerAES { std::cout << "recvOutput" << std::endl; // decode - - // 线路有关 输出位数 std::vector result(1); finalize(absl::MakeSpan(result)); std::cout << "MPC结果:" << ReverseBytes(result[0]) << std::endl; std::cout << "明文结果:" << Aes128(ReverseBytes(input), ReverseBytes(input_EV)) - << std::endl; // 待修改 + << std::endl; return result[0]; } template void finalize(absl::Span outputs) { - // YACL_ENFORCE(outputs.size() >= circ_->nov); - size_t index = wires_.size(); for (size_t i = 0; i < circ_.nov; ++i) { yacl::dynamic_bitset result(circ_.now[i]); for (size_t j = 0; j < circ_.now[i]; ++j) { int wire_index = index - circ_.now[i] + j; - result[j] = getLSB(wires_[wire_index]) ^ - getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 - // 对应的混淆电路计算为LSB ^ - // d 输出线路在后xx位 + result[j] = getLSB(wires_[wire_index]) ^ getLSB(gb_value[wire_index]); } outputs[circ_.nov - i - 1] = *(T*)result.data(); diff --git a/examples/gc/gc_test.cc b/examples/gc/gc_test.cc index 041ea243..ea8a1153 100644 --- a/examples/gc/gc_test.cc +++ b/examples/gc/gc_test.cc @@ -1,4 +1,16 @@ - +// Copyright 2024 Ant Group Co., Ltd. +// +// 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 @@ -32,7 +44,7 @@ uint128_t ReverseBytes(uint128_t x) { TEST(GCTest, SHA256Test) { std::shared_ptr circ_; - // 初始化 + GarblerSHA256* garbler = new GarblerSHA256(); EvaluatorSHA256* evaluator = new EvaluatorSHA256(); @@ -41,17 +53,13 @@ TEST(GCTest, SHA256Test) { thread1.get(); thread2.get(); - // 电路读取 std::string pth = fmt::format("{0}/yacl/io/circuit/data/{1}.txt", std::filesystem::current_path().string(), "sha256"); yacl::io::CircuitReader reader(pth); reader.ReadMeta(); reader.ReadAllGates(); - circ_ = reader.StealCirc(); // 指针 - - // 输入处理 - // garbler->inputProcess(*circ_); + circ_ = reader.StealCirc(); vector sha256_result; thread1 = std::async([&] { sha256_result = garbler->inputProcess(*circ_); }); @@ -59,16 +67,13 @@ TEST(GCTest, SHA256Test) { thread1.get(); thread2.get(); - // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator garbler->GB(); garbler->sendTable(); evaluator->recvTable(); - // // 计算方进行计算 按拓扑顺序进行计算 evaluator->EV(); - // // // evaluator发送计算结果 garbler进行DE操作 evaluator->sendOutput(); vector gc_result = garbler->decode(); @@ -80,7 +85,7 @@ TEST(GCTest, SHA256Test) { TEST(GCTest, AESTest) { std::shared_ptr circ_; - // 初始化 + GarblerAES* garbler = new GarblerAES(); EvaluatorAES* evaluator = new EvaluatorAES(); @@ -89,17 +94,13 @@ TEST(GCTest, AESTest) { thread1.get(); thread2.get(); - // 电路读取 std::string pth = fmt::format("{0}/yacl/io/circuit/data/{1}.txt", std::filesystem::current_path().string(), "aes_128"); yacl::io::CircuitReader reader(pth); reader.ReadMeta(); reader.ReadAllGates(); - circ_ = reader.StealCirc(); // 指针 - - // 输入处理 - // garbler->inputProcess(*circ_); + circ_ = reader.StealCirc(); uint128_t key; uint128_t message; @@ -114,16 +115,13 @@ TEST(GCTest, AESTest) { thread1.get(); thread2.get(); - // 混淆方对整个电路进行混淆, 并将混淆表发送给evaluator garbler->GB(); garbler->sendTable(); evaluator->recvTable(); - // // 计算方进行计算 按拓扑顺序进行计算 evaluator->EV(); - // // // evaluator发送计算结果 garbler进行DE操作 evaluator->sendOutput(); uint128_t gc_result = garbler->decode(); diff --git a/examples/gc/mitccrh.h b/examples/gc/mitccrh.h index eebf73b1..64327828 100644 --- a/examples/gc/mitccrh.h +++ b/examples/gc/mitccrh.h @@ -1,7 +1,23 @@ +// Copyright 2024 Ant Group Co., Ltd. +// +// 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. + #pragma once + #include #include "utils.h" + #include "yacl/base/int128.h" #include "yacl/crypto/aes/aes_opt.h" #include "yacl/crypto/tools/crhash.h" @@ -12,7 +28,6 @@ using block = __uint128_t; - inline uint128_t Sigma(uint128_t x) { auto _x = _mm_loadu_si128(reinterpret_cast<__m128i*>(&x)); auto exchange = _mm_shuffle_epi32(_x, 0b01001110); @@ -45,8 +60,6 @@ class MITCCRH { template void hash_cir(block* blks) { - /********因为Sigma函数这里在编译指令里加了--copt=-fpermissive************** - */ for (int i = 0; i < K * H; ++i) blks[i] = Sigma(blks[i]); hash(blks); } diff --git a/examples/gc/sha256_evaluator.h b/examples/gc/sha256_evaluator.h index 3a671301..38b4089c 100644 --- a/examples/gc/sha256_evaluator.h +++ b/examples/gc/sha256_evaluator.h @@ -1,3 +1,17 @@ +// Copyright 2024 Ant Group Co., Ltd. +// +// 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. + #pragma once #include @@ -29,7 +43,6 @@ class EvaluatorSHA256 { yacl::io::BFCircuit circ_; std::shared_ptr lctx; - // 根据电路改 uint128_t table[135073][2]; uint128_t input; int num_ot = 768; @@ -37,7 +50,6 @@ class EvaluatorSHA256 { uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); uint128_t select_mask[2] = {0, all_one_uint128_t}; void setup() { - // 通信环境初始化 size_t world_size = 2; yacl::link::ContextDesc ctx_desc; @@ -50,8 +62,8 @@ class EvaluatorSHA256 { lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, 1); lctx->ConnectToMesh(); + // delta, inv_constant, start_point uint128_t tmp[3]; - // delta, inv_constant, start_point 接收 yacl::Buffer r = lctx->Recv(0, "tmp"); const uint128_t* buffer_data = r.data(); memcpy(tmp, buffer_data, sizeof(uint128_t) * 3); @@ -61,7 +73,6 @@ class EvaluatorSHA256 { inv_constant = tmp[1]; start_point = tmp[2]; - // 秘钥生成 mitccrh.setS(start_point); } @@ -92,7 +103,6 @@ class EvaluatorSHA256 { std::cout << "recvTable" << std::endl; } - // 未检查 uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, MITCCRH<8>* mitccrh_pointer) { uint128_t HA, HB, W; @@ -120,7 +130,7 @@ class EvaluatorSHA256 { auto gate = circ_.gates[i]; switch (gate.op) { case yacl::io::BFCircuit::Op::XOR: { - const auto& iw0 = wires_.operator[](gate.iw[0]); // 取到具体值 + const auto& iw0 = wires_.operator[](gate.iw[0]); const auto& iw1 = wires_.operator[](gate.iw[1]); wires_[gate.ow[0]] = iw0 ^ iw1; break; diff --git a/examples/gc/sha256_garbler.h b/examples/gc/sha256_garbler.h index 8a9c8da2..944fe2ec 100644 --- a/examples/gc/sha256_garbler.h +++ b/examples/gc/sha256_garbler.h @@ -1,3 +1,17 @@ +// Copyright 2024 Ant Group Co., Ltd. +// +// 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. + #pragma once #include @@ -18,10 +32,6 @@ using namespace std; using namespace yacl; -// bazel test //examples/gc:gc_test - - - class GarblerSHA256 { public: @@ -34,14 +44,13 @@ class GarblerSHA256 { std::vector wires_; std::vector gb_value; yacl::io::BFCircuit circ_; - // 根据电路改 + uint128_t table[135073][2]; - // 输入数据类型需要修改 uint128_t input; uint128_t input_EV; vector message; - // num_ot根据输入改 + int num_ot = 768; uint128_t all_one_uint128_t_ = ~static_cast<__uint128_t>(0); uint128_t select_mask_[2] = {0, all_one_uint128_t_}; @@ -50,7 +59,6 @@ class GarblerSHA256 { yacl::crypto::OtSendStore(num_ot, yacl::crypto::OtStoreType::Normal); void setup() { - // 通信环境初始化 size_t world_size = 2; yacl::link::ContextDesc ctx_desc; @@ -63,11 +71,10 @@ class GarblerSHA256 { lctx = yacl::link::FactoryBrpc().CreateContext(ctx_desc, 0); lctx->ConnectToMesh(); - // delta, inv_constant, start_point 初始化并发送给evaluator + // delta, inv_constant, start_point uint128_t tmp[3]; - // random_uint128_t(tmp, 3); - for(int i = 0; i < 3; i++){ + for (int i = 0; i < 3; i++) { std::random_device rd; std::mt19937_64 eng(rd()); std::uniform_int_distribution distr; @@ -85,17 +92,14 @@ class GarblerSHA256 { inv_constant = tmp[1] ^ delta; start_point = tmp[2]; - // 秘钥生成 mitccrh.setS(start_point); } - // 包扩 输入值生成和混淆,garbler混淆值的发送 vector inputProcess(yacl::io::BFCircuit param_circ_) { circ_ = param_circ_; gb_value.resize(circ_.nw); wires_.resize(circ_.nw); - // 输入位数有关 message = crypto::FastRandBytes(crypto::RandLtN(32)); auto in_buf = io::BuiltinBFCircuit::PrepareSha256Input(message); auto sha256_result = crypto::Sha256Hash().Update(message).CumulativeHash(); @@ -108,14 +112,12 @@ class GarblerSHA256 { bi_val.resize(circ_.nw); std::memcpy(bi_val.data(), in_buf.data(), in_buf.size()); - // 混淆过程 int num_of_input_wires = 0; for (size_t i = 0; i < circ_.niv; ++i) { num_of_input_wires += circ_.niw[i]; } - // random_uint128_t(gb_value.data(), num_of_input_wires); - for(int i = 0; i < num_of_input_wires; i++){ + for (int i = 0; i < num_of_input_wires; i++) { std::random_device rd; std::mt19937_64 eng(rd()); std::uniform_int_distribution distr; @@ -178,7 +180,7 @@ class GarblerSHA256 { auto gate = circ_.gates[i]; switch (gate.op) { case yacl::io::BFCircuit::Op::XOR: { - const auto& iw0 = gb_value.operator[](gate.iw[0]); // 取到具体值 + const auto& iw0 = gb_value.operator[](gate.iw[0]); const auto& iw1 = gb_value.operator[](gate.iw[1]); gb_value[gate.ow[0]] = iw0 ^ iw1; break; @@ -221,12 +223,10 @@ class GarblerSHA256 { std::cout << "sendTable" << std::endl; } vector decode() { - // 现接收计算结果 size_t index = wires_.size(); int start = index - circ_.now[0]; yacl::Buffer r = lctx->Recv(1, "output"); - // vector out(96); memcpy(wires_.data() + start, r.data(), sizeof(uint128_t) * 256); std::cout << "recvOutput" << std::endl; @@ -256,18 +256,13 @@ class GarblerSHA256 { template void finalize(absl::Span outputs) { - // YACL_ENFORCE(outputs.size() >= circ_->nov); - size_t index = wires_.size(); for (size_t i = 0; i < circ_.nov; ++i) { yacl::dynamic_bitset result(circ_.now[i]); for (size_t j = 0; j < circ_.now[i]; ++j) { int wire_index = index - circ_.now[i] + j; - result[j] = getLSB(wires_[wire_index]) ^ - getLSB(gb_value[wire_index]); // 得到的是逆序的二进制值 - // 对应的混淆电路计算为LSB ^ - // d 输出线路在后xx位 + result[j] = getLSB(wires_[wire_index]) ^ getLSB(gb_value[wire_index]); } outputs[circ_.nov - i - 1] = *(T*)result.data(); diff --git a/examples/gc/utils.h b/examples/gc/utils.h index 3e38de14..ca084c71 100644 --- a/examples/gc/utils.h +++ b/examples/gc/utils.h @@ -1,3 +1,17 @@ +// Copyright 2024 Ant Group Co., Ltd. +// +// 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 #include #include From db052aeb4cd0687a90ea285c73118d015bce5f77 Mon Sep 17 00:00:00 2001 From: gitCoder1024 <201810111240@stu.shmtu.edu.cn> Date: Fri, 11 Apr 2025 15:48:33 +0800 Subject: [PATCH 25/27] apply patch --- clean.patch | 555 ++++++++++++++++++++++++++++++++ examples/MODULE.bazel.lock | 2 +- examples/gc/BUILD.bazel | 60 +--- examples/gc/aes_128_evaluator.h | 18 +- examples/gc/aes_128_garbler.h | 31 +- examples/gc/gc_test.cc | 13 +- examples/gc/mitccrh.h | 5 +- examples/gc/sha256_evaluator.h | 13 +- examples/gc/sha256_garbler.h | 21 +- examples/gc/utils.h | 26 +- 10 files changed, 615 insertions(+), 129 deletions(-) create mode 100644 clean.patch diff --git a/clean.patch b/clean.patch new file mode 100644 index 00000000..0e3ae511 --- /dev/null +++ b/clean.patch @@ -0,0 +1,555 @@ +diff --git a/examples/MODULE.bazel.lock b/examples/MODULE.bazel.lock +index 2f4b509..b9b80d4 100644 +--- a/examples/MODULE.bazel.lock ++++ b/examples/MODULE.bazel.lock +@@ -1,5 +1,5 @@ + { +- "lockFileVersion": 13, ++ "lockFileVersion": 11, + "registryFileHashes": { + "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", + "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", +diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel +index 2ce288f..3bf1cd1 100644 +--- a/examples/gc/BUILD.bazel ++++ b/examples/gc/BUILD.bazel +@@ -12,7 +12,7 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") ++load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") + + package(default_visibility = ["//visibility:public"]) + +@@ -21,23 +21,19 @@ yacl_cc_library( + hdrs = [ + "mitccrh.h", + ], +- copts = [ +- "-mavx", +- "-maes", +- "-mpclmul", +- ], + deps = [ + ":utils", +- "//yacl/base:int128", + "//yacl/crypto/aes:aes_opt", +- "//yacl/crypto/tools:crhash", + ], + ) + + yacl_cc_library( + name = "utils", + hdrs = ["utils.h"], +- deps = ["//yacl/math/mpint:mpint",], ++ deps = [ ++ "//yacl/base:byte_container_view", ++ "//yacl/base:int128", ++ ], + ) + + yacl_cc_library( +@@ -45,22 +41,11 @@ yacl_cc_library( + hdrs = [ + "aes_128_garbler.h", + ], +- copts = [ +- "-mavx", +- "-maes", +- "-mpclmul", +- ], + deps = [ + ":mitccrh", + "//yacl/base:byte_container_view", +- "//yacl/base:dynamic_bitset", +- "//yacl/base:int128", +- "//yacl/crypto/rand", + "//yacl/io/circuit:bristol_fashion", +- "//yacl/kernel/algorithms:base_ot", +- "//yacl/kernel/algorithms:iknp_ote", + "//yacl/kernel:ot_kernel", +- "//yacl/kernel/type:ot_store_utils", + ], + ) + +@@ -69,18 +54,9 @@ yacl_cc_library( + hdrs = [ + "sha256_garbler.h", + ], +- copts = [ +- "-mavx", +- "-maes", +- "-mpclmul", +- ], + deps = [ + ":mitccrh", +- "//yacl/base:int128", +- "//yacl/crypto/block_cipher:symmetric_crypto", + "//yacl/base:byte_container_view", +- "//yacl/base:dynamic_bitset", +- "//yacl/crypto/rand", + "//yacl/io/circuit:bristol_fashion", + ], + ) +@@ -90,17 +66,9 @@ yacl_cc_library( + hdrs = [ + "sha256_evaluator.h", + ], +- copts = [ +- "-mavx", +- "-maes", +- "-mpclmul", +- ], + deps = [ + ":mitccrh", +- "//yacl/base:int128", + "//yacl/base:byte_container_view", +- "//yacl/base:dynamic_bitset", +- "//yacl/crypto/rand", + "//yacl/io/circuit:bristol_fashion", + ], + ) +@@ -110,22 +78,11 @@ yacl_cc_library( + hdrs = [ + "aes_128_evaluator.h", + ], +- copts = [ +- "-mavx", +- "-maes", +- "-mpclmul", +- ], + deps = [ + ":mitccrh", +- "//yacl/base:int128", + "//yacl/base:byte_container_view", +- "//yacl/base:dynamic_bitset", +- "//yacl/crypto/rand", + "//yacl/io/circuit:bristol_fashion", +- "//yacl/kernel/algorithms:base_ot", +- "//yacl/kernel/algorithms:iknp_ote", + "//yacl/kernel:ot_kernel", +- "//yacl/kernel/type:ot_store_utils", + ], + ) + +@@ -139,10 +96,9 @@ yacl_cc_test( + ], + data = ["//yacl/io/circuit:circuit_data"], + deps = [ +- ":sha256_garbler", +- ":sha256_evaluator", + ":aes_128_evaluator", + ":aes_128_garbler", +- "//yacl/crypto/block_cipher:symmetric_crypto", ++ ":sha256_evaluator", ++ ":sha256_garbler", + ], +-) +\ No newline at end of file ++) +diff --git a/examples/gc/aes_128_evaluator.h b/examples/gc/aes_128_evaluator.h +index 156a6dc..3b9c968 100644 +--- a/examples/gc/aes_128_evaluator.h ++++ b/examples/gc/aes_128_evaluator.h +@@ -17,21 +17,21 @@ + + #include "examples/gc/mitccrh.h" + #include "fmt/format.h" ++#include "spdlog/spdlog.h" + + #include "yacl/base/byte_container_view.h" + #include "yacl/base/dynamic_bitset.h" + #include "yacl/base/int128.h" + #include "yacl/crypto/rand/rand.h" + #include "yacl/io/circuit/bristol_fashion.h" +-#include "yacl/kernel/algorithms/base_ot.h" +-#include "yacl/kernel/algorithms/iknp_ote.h" + #include "yacl/kernel/ot_kernel.h" +-#include "yacl/kernel/type/ot_store_utils.h" + #include "yacl/link/context.h" + #include "yacl/link/factory.h" ++ + using namespace std; + using namespace yacl; + using namespace yacl::crypto; ++ + namespace { + + using OtMsg = uint128_t; +@@ -55,7 +55,7 @@ class EvaluatorAES { + uint128_t table[36663][2]; + uint128_t input; + int num_ot = 128; +- uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); ++ uint128_t all_one_uint128_t = ~static_cast(0); + uint128_t select_mask[2] = {0, all_one_uint128_t}; + + yacl::crypto::OtRecvStore ot_recv = +@@ -87,7 +87,7 @@ class EvaluatorAES { + yacl::Buffer r = lctx->Recv(0, "tmp"); + const uint128_t* buffer_data = r.data(); + memcpy(tmp, buffer_data, sizeof(uint128_t) * 3); +- std::cout << "tmpRecv" << std::endl; ++ SPDLOG_INFO("tmpRecv"); + + delta = tmp[0]; + inv_constant = tmp[1]; +@@ -104,7 +104,7 @@ class EvaluatorAES { + yacl::dynamic_bitset bi_val; + + input = yacl::crypto::FastRandU128(); +- std::cout << "input of evaluator:" << input << std::endl; ++ SPDLOG_INFO("input of evaluator: {}", input); + bi_val.append(input); + + yacl::Buffer r = lctx->Recv(0, "garbleInput1"); +@@ -113,7 +113,7 @@ class EvaluatorAES { + + memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * num_ot); + +- std::cout << "recvInput1" << std::endl; ++ SPDLOG_INFO("recvInput1"); + + lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint128_t)), "Input1"); + +@@ -130,7 +130,7 @@ class EvaluatorAES { + } + } + +- std::cout << "recvTable" << std::endl; ++ SPDLOG_INFO("recvTable"); + } + + uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, +@@ -201,7 +201,7 @@ class EvaluatorAES { + yacl::ByteContainerView(wires_.data() + start, + sizeof(uint128_t) * num_ot), + "output"); +- std::cout << "sendOutput" << std::endl; ++ SPDLOG_INFO("sendOutput"); + } + void onLineOT() { + yacl::dynamic_bitset choices; +diff --git a/examples/gc/aes_128_garbler.h b/examples/gc/aes_128_garbler.h +index 67efd3e..5e04792 100644 +--- a/examples/gc/aes_128_garbler.h ++++ b/examples/gc/aes_128_garbler.h +@@ -19,16 +19,14 @@ + #include "absl/types/span.h" + #include "examples/gc/mitccrh.h" + #include "fmt/format.h" ++#include "spdlog/spdlog.h" + + #include "yacl/base/byte_container_view.h" + #include "yacl/base/dynamic_bitset.h" + #include "yacl/base/int128.h" + #include "yacl/crypto/rand/rand.h" + #include "yacl/io/circuit/bristol_fashion.h" +-#include "yacl/kernel/algorithms/base_ot.h" +-#include "yacl/kernel/algorithms/iknp_ote.h" + #include "yacl/kernel/ot_kernel.h" +-#include "yacl/kernel/type/ot_store_utils.h" + #include "yacl/link/context.h" + #include "yacl/link/factory.h" + +@@ -41,16 +39,6 @@ inline uint128_t Aes128(uint128_t k, uint128_t m) { + return enc.Encrypt(m); + } + +-uint128_t ReverseBytes(uint128_t x) { +- auto byte_view = ByteContainerView(&x, sizeof(x)); +- uint128_t ret = 0; +- auto buf = std::vector(sizeof(ret)); +- for (size_t i = 0; i < byte_view.size(); ++i) { +- buf[byte_view.size() - i - 1] = byte_view[i]; +- } +- std::memcpy(&ret, buf.data(), buf.size()); +- return ret; +-} + class GarblerAES { + public: + std::shared_ptr lctx; +@@ -109,7 +97,7 @@ class GarblerAES { + } + tmp[0] = tmp[0] | 1; + lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 3), "tmp"); +- std::cout << "tmpSend" << std::endl; ++ SPDLOG_INFO("tmpSend"); + + delta = tmp[0]; + inv_constant = tmp[1] ^ delta; +@@ -124,7 +112,7 @@ class GarblerAES { + wires_.resize(circ_.nw); + + input = yacl::crypto::FastRandU128(); +- std::cout << "input of garbler:" << input << std::endl; ++ SPDLOG_INFO("input of garbler: {}", input); + + yacl::dynamic_bitset bi_val; + bi_val.append(input); +@@ -153,7 +141,7 @@ class GarblerAES { + 1, yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), + "garbleInput1"); + +- std::cout << "sendInput1" << std::endl; ++ SPDLOG_INFO("sendInput1"); + + // onlineOT(); + +@@ -244,7 +232,7 @@ class GarblerAES { + lctx->Send(1, + yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_.ng), + "table"); +- std::cout << "sendTable" << std::endl; ++ SPDLOG_INFO("sendTable"); + } + uint128_t decode() { + size_t index = wires_.size(); +@@ -254,15 +242,14 @@ class GarblerAES { + const uint128_t* buffer_data = r.data(); + + memcpy(wires_.data() + start, buffer_data, sizeof(uint128_t) * num_ot); +- std::cout << "recvOutput" << std::endl; ++ SPDLOG_INFO("recvOutput"); + + // decode + std::vector result(1); + finalize(absl::MakeSpan(result)); +- std::cout << "MPC结果:" << ReverseBytes(result[0]) << std::endl; +- std::cout << "明文结果:" +- << Aes128(ReverseBytes(input), ReverseBytes(input_EV)) +- << std::endl; ++ SPDLOG_INFO("MPC结果:{}", ReverseBytes(result[0])); ++ SPDLOG_INFO("明文结果:{}", ++ Aes128(ReverseBytes(input), ReverseBytes(input_EV))); + return result[0]; + } + +diff --git a/examples/gc/gc_test.cc b/examples/gc/gc_test.cc +index ea8a115..2e2b307 100644 +--- a/examples/gc/gc_test.cc ++++ b/examples/gc/gc_test.cc +@@ -12,6 +12,8 @@ + // See the License for the specific language governing permissions and + // limitations under the License. + ++#include ++#include + #include + + #include "examples/gc/aes_128_evaluator.h" +@@ -31,17 +33,6 @@ inline uint128_t Aes128(uint128_t k, uint128_t m) { + return enc.Encrypt(m); + } + +-uint128_t ReverseBytes(uint128_t x) { +- auto byte_view = ByteContainerView(&x, sizeof(x)); +- uint128_t ret = 0; +- auto buf = std::vector(sizeof(ret)); +- for (size_t i = 0; i < byte_view.size(); ++i) { +- buf[byte_view.size() - i - 1] = byte_view[i]; +- } +- std::memcpy(&ret, buf.data(), buf.size()); +- return ret; +-} +- + TEST(GCTest, SHA256Test) { + std::shared_ptr circ_; + +diff --git a/examples/gc/mitccrh.h b/examples/gc/mitccrh.h +index 6432782..28f591a 100644 +--- a/examples/gc/mitccrh.h ++++ b/examples/gc/mitccrh.h +@@ -14,13 +14,10 @@ + + #pragma once + +-#include +- + #include "utils.h" + +-#include "yacl/base/int128.h" + #include "yacl/crypto/aes/aes_opt.h" +-#include "yacl/crypto/tools/crhash.h" ++ + /* + * [REF] Implementation of "Better Concrete Security for Half-Gates Garbling (in + * the Multi-Instance Setting)" https://eprint.iacr.org/2019/1168.pdf +diff --git a/examples/gc/sha256_evaluator.h b/examples/gc/sha256_evaluator.h +index 38b4089..84912c5 100644 +--- a/examples/gc/sha256_evaluator.h ++++ b/examples/gc/sha256_evaluator.h +@@ -18,15 +18,14 @@ + + #include "examples/gc/mitccrh.h" + #include "fmt/format.h" ++#include "spdlog/spdlog.h" + + #include "yacl/base/byte_container_view.h" +-#include "yacl/base/dynamic_bitset.h" + #include "yacl/base/int128.h" +-#include "yacl/crypto/rand/rand.h" + #include "yacl/io/circuit/bristol_fashion.h" + #include "yacl/link/context.h" + #include "yacl/link/factory.h" +-#include "yacl/link/test_util.h" ++ + using namespace std; + using namespace yacl; + using namespace yacl::crypto; +@@ -67,7 +66,7 @@ class EvaluatorSHA256 { + yacl::Buffer r = lctx->Recv(0, "tmp"); + const uint128_t* buffer_data = r.data(); + memcpy(tmp, buffer_data, sizeof(uint128_t) * 3); +- std::cout << "tmpRecv" << std::endl; ++ SPDLOG_INFO("tmpRecv"); + + delta = tmp[0]; + inv_constant = tmp[1]; +@@ -87,7 +86,7 @@ class EvaluatorSHA256 { + + memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * num_ot); + +- std::cout << "recvInput1" << std::endl; ++ SPDLOG_INFO("recvInput1"); + } + void recvTable() { + yacl::Buffer r = lctx->Recv(0, "table"); +@@ -100,7 +99,7 @@ class EvaluatorSHA256 { + } + } + +- std::cout << "recvTable" << std::endl; ++ SPDLOG_INFO("recvTable"); + } + + uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, +@@ -171,6 +170,6 @@ class EvaluatorSHA256 { + 0, + yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * 256), + "output"); +- std::cout << "sendOutput" << std::endl; ++ SPDLOG_INFO("sendOutput"); + } + }; +\ No newline at end of file +diff --git a/examples/gc/sha256_garbler.h b/examples/gc/sha256_garbler.h +index 944fe2e..c141603 100644 +--- a/examples/gc/sha256_garbler.h ++++ b/examples/gc/sha256_garbler.h +@@ -19,11 +19,11 @@ + #include "absl/types/span.h" + #include "examples/gc/mitccrh.h" + #include "fmt/format.h" ++#include "spdlog/spdlog.h" + + #include "yacl/base/byte_container_view.h" + #include "yacl/base/dynamic_bitset.h" + #include "yacl/base/int128.h" +-#include "yacl/crypto/block_cipher/symmetric_crypto.h" + #include "yacl/crypto/hash/ssl_hash.h" + #include "yacl/crypto/rand/rand.h" + #include "yacl/io/circuit/bristol_fashion.h" +@@ -86,7 +86,7 @@ class GarblerSHA256 { + } + tmp[0] = tmp[0] | 1; + lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 3), "tmp"); +- std::cout << "tmpSend" << std::endl; ++ SPDLOG_INFO("tmpSend"); + + delta = tmp[0]; + inv_constant = tmp[1] ^ delta; +@@ -103,10 +103,11 @@ class GarblerSHA256 { + message = crypto::FastRandBytes(crypto::RandLtN(32)); + auto in_buf = io::BuiltinBFCircuit::PrepareSha256Input(message); + auto sha256_result = crypto::Sha256Hash().Update(message).CumulativeHash(); ++ ++ SPDLOG_DEBUG("inputProcess"); + for (int i = 0; i < 32; i++) { +- cout << int(sha256_result[i]) << " "; ++ SPDLOG_DEBUG("{}", int(sha256_result[i])); + } +- cout << endl; + + dynamic_bitset bi_val; + bi_val.resize(circ_.nw); +@@ -136,7 +137,7 @@ class GarblerSHA256 { + 1, yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), + "garbleInput1"); + +- std::cout << "sendInput1" << std::endl; ++ SPDLOG_INFO("sendInput1"); + + return sha256_result; + } +@@ -220,8 +221,9 @@ class GarblerSHA256 { + lctx->Send(1, + yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_.ng), + "table"); +- std::cout << "sendTable" << std::endl; ++ SPDLOG_INFO("sendTable"); + } ++ + vector decode() { + size_t index = wires_.size(); + int start = index - circ_.now[0]; +@@ -229,7 +231,7 @@ class GarblerSHA256 { + yacl::Buffer r = lctx->Recv(1, "output"); + + memcpy(wires_.data() + start, r.data(), sizeof(uint128_t) * 256); +- std::cout << "recvOutput" << std::endl; ++ SPDLOG_INFO("recvOutput"); + + const auto out_size = 32; + std::vector out(out_size); +@@ -247,9 +249,8 @@ class GarblerSHA256 { + + auto sha256_result = crypto::Sha256Hash().Update(message).CumulativeHash(); + +- if (sha256_result.size() == out.size() && +- std::equal(out.begin(), out.end(), sha256_result.begin())) +- cout << "YES!!!" << endl; ++ YACL_ENFORCE(sha256_result.size() == out.size() && ++ std::equal(out.begin(), out.end(), sha256_result.begin())); + + return out; + } +diff --git a/examples/gc/utils.h b/examples/gc/utils.h +index ca084c7..b3ba005 100644 +--- a/examples/gc/utils.h ++++ b/examples/gc/utils.h +@@ -12,19 +12,19 @@ + // See the License for the specific language governing permissions and + // limitations under the License. + +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include +- +-#include "yacl/math/mpint/mp_int.h" +- +-using uint128_t = __uint128_t; ++#include "yacl/base/byte_container_view.h" ++#include "yacl/base/int128.h" + + // get the Least Significant Bit of uint128_t + inline bool getLSB(const uint128_t& x) { return (x & 1) == 1; } ++ ++uint128_t ReverseBytes(uint128_t x) { ++ auto byte_view = yacl::ByteContainerView(&x, sizeof(x)); ++ uint128_t ret = 0; ++ auto buf = std::vector(sizeof(ret)); ++ for (size_t i = 0; i < byte_view.size(); ++i) { ++ buf[byte_view.size() - i - 1] = byte_view[i]; ++ } ++ std::memcpy(&ret, buf.data(), buf.size()); ++ return ret; ++} +\ No newline at end of file diff --git a/examples/MODULE.bazel.lock b/examples/MODULE.bazel.lock index 2f4b509c..b9b80d4d 100644 --- a/examples/MODULE.bazel.lock +++ b/examples/MODULE.bazel.lock @@ -1,5 +1,5 @@ { - "lockFileVersion": 13, + "lockFileVersion": 11, "registryFileHashes": { "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", diff --git a/examples/gc/BUILD.bazel b/examples/gc/BUILD.bazel index 2ce288ff..3bf1cd1f 100644 --- a/examples/gc/BUILD.bazel +++ b/examples/gc/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") +load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") package(default_visibility = ["//visibility:public"]) @@ -21,23 +21,19 @@ yacl_cc_library( hdrs = [ "mitccrh.h", ], - copts = [ - "-mavx", - "-maes", - "-mpclmul", - ], deps = [ ":utils", - "//yacl/base:int128", "//yacl/crypto/aes:aes_opt", - "//yacl/crypto/tools:crhash", ], ) yacl_cc_library( name = "utils", hdrs = ["utils.h"], - deps = ["//yacl/math/mpint:mpint",], + deps = [ + "//yacl/base:byte_container_view", + "//yacl/base:int128", + ], ) yacl_cc_library( @@ -45,22 +41,11 @@ yacl_cc_library( hdrs = [ "aes_128_garbler.h", ], - copts = [ - "-mavx", - "-maes", - "-mpclmul", - ], deps = [ ":mitccrh", "//yacl/base:byte_container_view", - "//yacl/base:dynamic_bitset", - "//yacl/base:int128", - "//yacl/crypto/rand", "//yacl/io/circuit:bristol_fashion", - "//yacl/kernel/algorithms:base_ot", - "//yacl/kernel/algorithms:iknp_ote", "//yacl/kernel:ot_kernel", - "//yacl/kernel/type:ot_store_utils", ], ) @@ -69,18 +54,9 @@ yacl_cc_library( hdrs = [ "sha256_garbler.h", ], - copts = [ - "-mavx", - "-maes", - "-mpclmul", - ], deps = [ ":mitccrh", - "//yacl/base:int128", - "//yacl/crypto/block_cipher:symmetric_crypto", "//yacl/base:byte_container_view", - "//yacl/base:dynamic_bitset", - "//yacl/crypto/rand", "//yacl/io/circuit:bristol_fashion", ], ) @@ -90,17 +66,9 @@ yacl_cc_library( hdrs = [ "sha256_evaluator.h", ], - copts = [ - "-mavx", - "-maes", - "-mpclmul", - ], deps = [ ":mitccrh", - "//yacl/base:int128", "//yacl/base:byte_container_view", - "//yacl/base:dynamic_bitset", - "//yacl/crypto/rand", "//yacl/io/circuit:bristol_fashion", ], ) @@ -110,22 +78,11 @@ yacl_cc_library( hdrs = [ "aes_128_evaluator.h", ], - copts = [ - "-mavx", - "-maes", - "-mpclmul", - ], deps = [ ":mitccrh", - "//yacl/base:int128", "//yacl/base:byte_container_view", - "//yacl/base:dynamic_bitset", - "//yacl/crypto/rand", "//yacl/io/circuit:bristol_fashion", - "//yacl/kernel/algorithms:base_ot", - "//yacl/kernel/algorithms:iknp_ote", "//yacl/kernel:ot_kernel", - "//yacl/kernel/type:ot_store_utils", ], ) @@ -139,10 +96,9 @@ yacl_cc_test( ], data = ["//yacl/io/circuit:circuit_data"], deps = [ - ":sha256_garbler", - ":sha256_evaluator", ":aes_128_evaluator", ":aes_128_garbler", - "//yacl/crypto/block_cipher:symmetric_crypto", + ":sha256_evaluator", + ":sha256_garbler", ], -) \ No newline at end of file +) diff --git a/examples/gc/aes_128_evaluator.h b/examples/gc/aes_128_evaluator.h index 156a6dc9..3b9c968d 100644 --- a/examples/gc/aes_128_evaluator.h +++ b/examples/gc/aes_128_evaluator.h @@ -17,21 +17,21 @@ #include "examples/gc/mitccrh.h" #include "fmt/format.h" +#include "spdlog/spdlog.h" #include "yacl/base/byte_container_view.h" #include "yacl/base/dynamic_bitset.h" #include "yacl/base/int128.h" #include "yacl/crypto/rand/rand.h" #include "yacl/io/circuit/bristol_fashion.h" -#include "yacl/kernel/algorithms/base_ot.h" -#include "yacl/kernel/algorithms/iknp_ote.h" #include "yacl/kernel/ot_kernel.h" -#include "yacl/kernel/type/ot_store_utils.h" #include "yacl/link/context.h" #include "yacl/link/factory.h" + using namespace std; using namespace yacl; using namespace yacl::crypto; + namespace { using OtMsg = uint128_t; @@ -55,7 +55,7 @@ class EvaluatorAES { uint128_t table[36663][2]; uint128_t input; int num_ot = 128; - uint128_t all_one_uint128_t = ~static_cast<__uint128_t>(0); + uint128_t all_one_uint128_t = ~static_cast(0); uint128_t select_mask[2] = {0, all_one_uint128_t}; yacl::crypto::OtRecvStore ot_recv = @@ -87,7 +87,7 @@ class EvaluatorAES { yacl::Buffer r = lctx->Recv(0, "tmp"); const uint128_t* buffer_data = r.data(); memcpy(tmp, buffer_data, sizeof(uint128_t) * 3); - std::cout << "tmpRecv" << std::endl; + SPDLOG_INFO("tmpRecv"); delta = tmp[0]; inv_constant = tmp[1]; @@ -104,7 +104,7 @@ class EvaluatorAES { yacl::dynamic_bitset bi_val; input = yacl::crypto::FastRandU128(); - std::cout << "input of evaluator:" << input << std::endl; + SPDLOG_INFO("input of evaluator: {}", input); bi_val.append(input); yacl::Buffer r = lctx->Recv(0, "garbleInput1"); @@ -113,7 +113,7 @@ class EvaluatorAES { memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * num_ot); - std::cout << "recvInput1" << std::endl; + SPDLOG_INFO("recvInput1"); lctx->Send(0, yacl::ByteContainerView(&input, sizeof(uint128_t)), "Input1"); @@ -130,7 +130,7 @@ class EvaluatorAES { } } - std::cout << "recvTable" << std::endl; + SPDLOG_INFO("recvTable"); } uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, @@ -201,7 +201,7 @@ class EvaluatorAES { yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * num_ot), "output"); - std::cout << "sendOutput" << std::endl; + SPDLOG_INFO("sendOutput"); } void onLineOT() { yacl::dynamic_bitset choices; diff --git a/examples/gc/aes_128_garbler.h b/examples/gc/aes_128_garbler.h index 67efd3ea..5e047924 100644 --- a/examples/gc/aes_128_garbler.h +++ b/examples/gc/aes_128_garbler.h @@ -19,16 +19,14 @@ #include "absl/types/span.h" #include "examples/gc/mitccrh.h" #include "fmt/format.h" +#include "spdlog/spdlog.h" #include "yacl/base/byte_container_view.h" #include "yacl/base/dynamic_bitset.h" #include "yacl/base/int128.h" #include "yacl/crypto/rand/rand.h" #include "yacl/io/circuit/bristol_fashion.h" -#include "yacl/kernel/algorithms/base_ot.h" -#include "yacl/kernel/algorithms/iknp_ote.h" #include "yacl/kernel/ot_kernel.h" -#include "yacl/kernel/type/ot_store_utils.h" #include "yacl/link/context.h" #include "yacl/link/factory.h" @@ -41,16 +39,6 @@ inline uint128_t Aes128(uint128_t k, uint128_t m) { return enc.Encrypt(m); } -uint128_t ReverseBytes(uint128_t x) { - auto byte_view = ByteContainerView(&x, sizeof(x)); - uint128_t ret = 0; - auto buf = std::vector(sizeof(ret)); - for (size_t i = 0; i < byte_view.size(); ++i) { - buf[byte_view.size() - i - 1] = byte_view[i]; - } - std::memcpy(&ret, buf.data(), buf.size()); - return ret; -} class GarblerAES { public: std::shared_ptr lctx; @@ -109,7 +97,7 @@ class GarblerAES { } tmp[0] = tmp[0] | 1; lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 3), "tmp"); - std::cout << "tmpSend" << std::endl; + SPDLOG_INFO("tmpSend"); delta = tmp[0]; inv_constant = tmp[1] ^ delta; @@ -124,7 +112,7 @@ class GarblerAES { wires_.resize(circ_.nw); input = yacl::crypto::FastRandU128(); - std::cout << "input of garbler:" << input << std::endl; + SPDLOG_INFO("input of garbler: {}", input); yacl::dynamic_bitset bi_val; bi_val.append(input); @@ -153,7 +141,7 @@ class GarblerAES { 1, yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), "garbleInput1"); - std::cout << "sendInput1" << std::endl; + SPDLOG_INFO("sendInput1"); // onlineOT(); @@ -244,7 +232,7 @@ class GarblerAES { lctx->Send(1, yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_.ng), "table"); - std::cout << "sendTable" << std::endl; + SPDLOG_INFO("sendTable"); } uint128_t decode() { size_t index = wires_.size(); @@ -254,15 +242,14 @@ class GarblerAES { const uint128_t* buffer_data = r.data(); memcpy(wires_.data() + start, buffer_data, sizeof(uint128_t) * num_ot); - std::cout << "recvOutput" << std::endl; + SPDLOG_INFO("recvOutput"); // decode std::vector result(1); finalize(absl::MakeSpan(result)); - std::cout << "MPC结果:" << ReverseBytes(result[0]) << std::endl; - std::cout << "明文结果:" - << Aes128(ReverseBytes(input), ReverseBytes(input_EV)) - << std::endl; + SPDLOG_INFO("MPC结果:{}", ReverseBytes(result[0])); + SPDLOG_INFO("明文结果:{}", + Aes128(ReverseBytes(input), ReverseBytes(input_EV))); return result[0]; } diff --git a/examples/gc/gc_test.cc b/examples/gc/gc_test.cc index ea8a1153..2e2b307c 100644 --- a/examples/gc/gc_test.cc +++ b/examples/gc/gc_test.cc @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include #include #include "examples/gc/aes_128_evaluator.h" @@ -31,17 +33,6 @@ inline uint128_t Aes128(uint128_t k, uint128_t m) { return enc.Encrypt(m); } -uint128_t ReverseBytes(uint128_t x) { - auto byte_view = ByteContainerView(&x, sizeof(x)); - uint128_t ret = 0; - auto buf = std::vector(sizeof(ret)); - for (size_t i = 0; i < byte_view.size(); ++i) { - buf[byte_view.size() - i - 1] = byte_view[i]; - } - std::memcpy(&ret, buf.data(), buf.size()); - return ret; -} - TEST(GCTest, SHA256Test) { std::shared_ptr circ_; diff --git a/examples/gc/mitccrh.h b/examples/gc/mitccrh.h index 64327828..28f591a0 100644 --- a/examples/gc/mitccrh.h +++ b/examples/gc/mitccrh.h @@ -14,13 +14,10 @@ #pragma once -#include - #include "utils.h" -#include "yacl/base/int128.h" #include "yacl/crypto/aes/aes_opt.h" -#include "yacl/crypto/tools/crhash.h" + /* * [REF] Implementation of "Better Concrete Security for Half-Gates Garbling (in * the Multi-Instance Setting)" https://eprint.iacr.org/2019/1168.pdf diff --git a/examples/gc/sha256_evaluator.h b/examples/gc/sha256_evaluator.h index 38b4089c..84912c5b 100644 --- a/examples/gc/sha256_evaluator.h +++ b/examples/gc/sha256_evaluator.h @@ -18,15 +18,14 @@ #include "examples/gc/mitccrh.h" #include "fmt/format.h" +#include "spdlog/spdlog.h" #include "yacl/base/byte_container_view.h" -#include "yacl/base/dynamic_bitset.h" #include "yacl/base/int128.h" -#include "yacl/crypto/rand/rand.h" #include "yacl/io/circuit/bristol_fashion.h" #include "yacl/link/context.h" #include "yacl/link/factory.h" -#include "yacl/link/test_util.h" + using namespace std; using namespace yacl; using namespace yacl::crypto; @@ -67,7 +66,7 @@ class EvaluatorSHA256 { yacl::Buffer r = lctx->Recv(0, "tmp"); const uint128_t* buffer_data = r.data(); memcpy(tmp, buffer_data, sizeof(uint128_t) * 3); - std::cout << "tmpRecv" << std::endl; + SPDLOG_INFO("tmpRecv"); delta = tmp[0]; inv_constant = tmp[1]; @@ -87,7 +86,7 @@ class EvaluatorSHA256 { memcpy(wires_.data(), buffer_data, sizeof(uint128_t) * num_ot); - std::cout << "recvInput1" << std::endl; + SPDLOG_INFO("recvInput1"); } void recvTable() { yacl::Buffer r = lctx->Recv(0, "table"); @@ -100,7 +99,7 @@ class EvaluatorSHA256 { } } - std::cout << "recvTable" << std::endl; + SPDLOG_INFO("recvTable"); } uint128_t EVAND(uint128_t A, uint128_t B, const uint128_t* table_item, @@ -171,6 +170,6 @@ class EvaluatorSHA256 { 0, yacl::ByteContainerView(wires_.data() + start, sizeof(uint128_t) * 256), "output"); - std::cout << "sendOutput" << std::endl; + SPDLOG_INFO("sendOutput"); } }; \ No newline at end of file diff --git a/examples/gc/sha256_garbler.h b/examples/gc/sha256_garbler.h index 944fe2ec..c141603a 100644 --- a/examples/gc/sha256_garbler.h +++ b/examples/gc/sha256_garbler.h @@ -19,11 +19,11 @@ #include "absl/types/span.h" #include "examples/gc/mitccrh.h" #include "fmt/format.h" +#include "spdlog/spdlog.h" #include "yacl/base/byte_container_view.h" #include "yacl/base/dynamic_bitset.h" #include "yacl/base/int128.h" -#include "yacl/crypto/block_cipher/symmetric_crypto.h" #include "yacl/crypto/hash/ssl_hash.h" #include "yacl/crypto/rand/rand.h" #include "yacl/io/circuit/bristol_fashion.h" @@ -86,7 +86,7 @@ class GarblerSHA256 { } tmp[0] = tmp[0] | 1; lctx->Send(1, yacl::ByteContainerView(tmp, sizeof(uint128_t) * 3), "tmp"); - std::cout << "tmpSend" << std::endl; + SPDLOG_INFO("tmpSend"); delta = tmp[0]; inv_constant = tmp[1] ^ delta; @@ -103,10 +103,11 @@ class GarblerSHA256 { message = crypto::FastRandBytes(crypto::RandLtN(32)); auto in_buf = io::BuiltinBFCircuit::PrepareSha256Input(message); auto sha256_result = crypto::Sha256Hash().Update(message).CumulativeHash(); + + SPDLOG_DEBUG("inputProcess"); for (int i = 0; i < 32; i++) { - cout << int(sha256_result[i]) << " "; + SPDLOG_DEBUG("{}", int(sha256_result[i])); } - cout << endl; dynamic_bitset bi_val; bi_val.resize(circ_.nw); @@ -136,7 +137,7 @@ class GarblerSHA256 { 1, yacl::ByteContainerView(wires_.data(), sizeof(uint128_t) * num_ot), "garbleInput1"); - std::cout << "sendInput1" << std::endl; + SPDLOG_INFO("sendInput1"); return sha256_result; } @@ -220,8 +221,9 @@ class GarblerSHA256 { lctx->Send(1, yacl::ByteContainerView(table, sizeof(uint128_t) * 2 * circ_.ng), "table"); - std::cout << "sendTable" << std::endl; + SPDLOG_INFO("sendTable"); } + vector decode() { size_t index = wires_.size(); int start = index - circ_.now[0]; @@ -229,7 +231,7 @@ class GarblerSHA256 { yacl::Buffer r = lctx->Recv(1, "output"); memcpy(wires_.data() + start, r.data(), sizeof(uint128_t) * 256); - std::cout << "recvOutput" << std::endl; + SPDLOG_INFO("recvOutput"); const auto out_size = 32; std::vector out(out_size); @@ -247,9 +249,8 @@ class GarblerSHA256 { auto sha256_result = crypto::Sha256Hash().Update(message).CumulativeHash(); - if (sha256_result.size() == out.size() && - std::equal(out.begin(), out.end(), sha256_result.begin())) - cout << "YES!!!" << endl; + YACL_ENFORCE(sha256_result.size() == out.size() && + std::equal(out.begin(), out.end(), sha256_result.begin())); return out; } diff --git a/examples/gc/utils.h b/examples/gc/utils.h index ca084c71..b3ba0056 100644 --- a/examples/gc/utils.h +++ b/examples/gc/utils.h @@ -12,19 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "yacl/math/mpint/mp_int.h" - -using uint128_t = __uint128_t; +#include "yacl/base/byte_container_view.h" +#include "yacl/base/int128.h" // get the Least Significant Bit of uint128_t inline bool getLSB(const uint128_t& x) { return (x & 1) == 1; } + +uint128_t ReverseBytes(uint128_t x) { + auto byte_view = yacl::ByteContainerView(&x, sizeof(x)); + uint128_t ret = 0; + auto buf = std::vector(sizeof(ret)); + for (size_t i = 0; i < byte_view.size(); ++i) { + buf[byte_view.size() - i - 1] = byte_view[i]; + } + std::memcpy(&ret, buf.data(), buf.size()); + return ret; +} \ No newline at end of file From 125d21d0fb89cace317633bf559ddaf01268e6b5 Mon Sep 17 00:00:00 2001 From: gitCoder1024 <201810111240@stu.shmtu.edu.cn> Date: Fri, 11 Apr 2025 15:51:41 +0800 Subject: [PATCH 26/27] emp-benchmark --- .../communication_cost_sh2pc.patch | 472 ++++++++++++++++++ .../communication_cost_tool.patch | 33 ++ .../emp_benchmark/emp-readme-install.patch | 77 +++ examples/emp_benchmark/run.sh | 68 +++ 4 files changed, 650 insertions(+) create mode 100644 examples/emp_benchmark/communication_cost_sh2pc.patch create mode 100644 examples/emp_benchmark/communication_cost_tool.patch create mode 100644 examples/emp_benchmark/emp-readme-install.patch create mode 100644 examples/emp_benchmark/run.sh diff --git a/examples/emp_benchmark/communication_cost_sh2pc.patch b/examples/emp_benchmark/communication_cost_sh2pc.patch new file mode 100644 index 00000000..860e377a --- /dev/null +++ b/examples/emp_benchmark/communication_cost_sh2pc.patch @@ -0,0 +1,472 @@ +diff --git a/aes_run.sh b/aes_run.sh +new file mode 100644 +index 0000000..20df3b7 +--- /dev/null ++++ b/aes_run.sh +@@ -0,0 +1,126 @@ ++#!/bin/bash ++cd build ++ ++# 初始化变量 ++total_send_rounds_1=0 ++total_recv_rounds_1=0 ++total_send_bytes_1=0 ++total_recv_bytes_1=0 ++total_send_rounds_2=0 ++total_recv_rounds_2=0 ++total_send_bytes_2=0 ++total_recv_bytes_2=0 ++total_computation_time_1=0 ++total_reading_time_1=0 ++total_computation_time_2=0 ++total_reading_time_2=0 ++ ++ ++# 运行 100 次循环 ++total=100 ++PROGRESS_WIDTH=20 ++echo "==================================AES BEGIN=========================================" ++echo "Total Iteration: $total, Batch Size 1" ++for ((i=1; i<=total; i++)); do ++ # 计算进度条 ++ percent=$((i * 100 / total)) ++ progress=$(( (i * PROGRESS_WIDTH) / total )) ++ remaining=$((PROGRESS_WIDTH - progress)) ++ bar=$(printf "%-${PROGRESS_WIDTH}s" "$(printf '█%.0s' $(seq 1 $progress))") ++ echo -ne "\r[ ${bar// / } ] $percent% ($i/$total) Running iteration $i... " ++ ++ # 启动进程 ++ port=$((1234 + i)) ++ # echo -ne "\r[$bar] $percent% ($i/$total) Running iteration $i..." ++ ./bin/test_circuit_file_aes 1 1234 > output1.log& ++ ./bin/test_circuit_file_aes 2 1234 > output2.log 2>&1 ++ wait ++ ++ # 解析 party 1 数据(清理分号) ++ computation_time_1=$(grep "Time for Computation:" output1.log | awk '{print $4}' | tr -d ';') ++ reading_time_1=$(grep "Time for Reading File and Creating Circuits:" output1.log | awk '{print $8}' | tr -d ';') ++ send_rounds_1=$(grep "party 1: send rounds:" output1.log | awk '{print $5}' | tr -d ';') ++ recv_rounds_1=$(grep "recv rounds:" output1.log | awk '{print $8}' | tr -d ';') ++ send_bytes_1=$(grep "party 1: send bytes:" output1.log | awk '{print $5}' | tr -d ';') ++ recv_bytes_1=$(grep "recv bytes:" output1.log | awk '{print $5}' | tr -d ';') ++ ++ # 解析 party 2 数据(清理分号) ++ send_rounds_2=$(grep "party 2: send rounds:" output2.log | awk '{print $5}' | tr -d ';') ++ recv_rounds_2=$(grep "recv rounds:" output2.log | awk '{print $8}' | tr -d ';') ++ send_bytes_2=$(grep "party 2: send bytes:" output2.log | awk '{print $5}' | tr -d ';') ++ recv_bytes_2=$(grep "recv bytes:" output2.log | awk '{print $5}' | tr -d ';') ++ computation_time_2=$(grep "Time for Computation:" output2.log | awk '{print $4}' | tr -d ';') ++ reading_time_2=$(grep "Time for Reading File and Creating Circuits:" output2.log | awk '{print $8}' | tr -d ';') ++ ++ # 累加数据 ++ total_send_rounds_1=$((total_send_rounds_1 + send_rounds_1)) ++ total_recv_rounds_1=$((total_recv_rounds_1 + recv_rounds_1)) ++ total_send_bytes_1=$((total_send_bytes_1 + send_bytes_1)) ++ total_recv_bytes_1=$((total_recv_bytes_1 + recv_bytes_1)) ++ total_computation_time_1=$((total_computation_time_1 + computation_time_1)) ++ total_reading_time_1=$((total_reading_time_1 + reading_time_1)) ++ ++ total_send_rounds_2=$((total_send_rounds_2 + send_rounds_2)) ++ total_recv_rounds_2=$((total_recv_rounds_2 + recv_rounds_2)) ++ total_send_bytes_2=$((total_send_bytes_2 + send_bytes_2)) ++ total_recv_bytes_2=$((total_recv_bytes_2 + recv_bytes_2)) ++ total_computation_time_2=$((total_computation_time_2 + computation_time_2)) ++ total_reading_time_2=$((total_reading_time_2 + reading_time_2)) ++done ++ ++convert_to_kb() { ++ local bytes=$1 ++ if [ "$bytes" -gt 1024 ]; then ++ echo "$((bytes / 1024)) KB" ++ else ++ echo "$bytes B" ++ fi ++} ++ ++convert_to_ms() { ++ local times=$1 ++ if [ "$times" -gt 100000000 ]; then ++ echo "$((times / 1000000)) ms" ++ else ++ echo "$times ns" ++ fi ++} ++ ++ ++echo "Emp-tool AES Total Results after 100 Iterations:" ++echo "Party 1:" ++echo " Send Rounds: $total_send_rounds_1" ++echo " Recv Rounds: $total_recv_rounds_1" ++echo " Send Bytes: $(convert_to_kb $total_send_bytes_1)" ++echo " Recv Bytes: $(convert_to_kb $total_recv_bytes_1)" ++echo " Time for Reading File and Creating Circuits: $(convert_to_ms $total_reading_time_1)" ++echo " Time for Computation: $(convert_to_ms $total_computation_time_1)" ++echo "Party 2:" ++echo " Send Rounds: $total_send_rounds_2" ++echo " Recv Rounds: $total_recv_rounds_2" ++echo " Send Bytes: $(convert_to_kb $total_send_bytes_2)" ++echo " Recv Bytes: $(convert_to_kb $total_recv_bytes_2)" ++echo " Time for Reading File and Creating Circuits: $(convert_to_ms $total_reading_time_2)" ++echo " Time for Computation: $(convert_to_ms $total_computation_time_2)" ++ ++{ ++ echo "Emp-tool AES Total Results after 100 Iterations:" ++ echo "Party 1:" ++ echo " Send Rounds: $total_send_rounds_1" ++ echo " Recv Rounds: $total_recv_rounds_1" ++ echo " Send Bytes: $(convert_to_kb $total_send_bytes_1)" ++ echo " Recv Bytes: $(convert_to_kb $total_recv_bytes_1)" ++ echo " Time for Reading File and Creating Circuits: $(convert_to_ms $total_reading_time_1)" ++ echo " Time for Computation: $(convert_to_ms $total_computation_time_1)" ++ echo "Party 2:" ++ echo " Send Rounds: $total_send_rounds_2" ++ echo " Recv Rounds: $total_recv_rounds_2" ++ echo " Send Bytes: $(convert_to_kb $total_send_bytes_2)" ++ echo " Recv Bytes: $(convert_to_kb $total_recv_bytes_2)" ++ echo " Time for Reading File and Creating Circuits: $(convert_to_ms $total_reading_time_2)" ++ echo " Time for Computation: $(convert_to_ms $total_computation_time_2)" ++} > aes_result.log ++ ++rm output1.log ++rm output2.log ++echo "Results saved to ./build/aes_result.log" +\ No newline at end of file +diff --git a/sha256_run.sh b/sha256_run.sh +new file mode 100644 +index 0000000..d49c3c6 +--- /dev/null ++++ b/sha256_run.sh +@@ -0,0 +1,127 @@ ++#!/bin/bash ++cd build ++ ++# 初始化变量 ++total_send_rounds_1=0 ++total_recv_rounds_1=0 ++total_send_bytes_1=0 ++total_recv_bytes_1=0 ++total_send_rounds_2=0 ++total_recv_rounds_2=0 ++total_send_bytes_2=0 ++total_recv_bytes_2=0 ++total_computation_time_1=0 ++total_reading_time_1=0 ++total_computation_time_2=0 ++total_reading_time_2=0 ++ ++ ++# 运行 100 次循环 ++total=100 ++PROGRESS_WIDTH=20 ++echo "==================================SHA256 BEGIN=========================================" ++echo "Total Iteration: $total, Batch Size 1" ++for ((i=1; i<=total; i++)); do ++ # 计算进度条 ++ percent=$((i * 100 / total)) ++ progress=$(( (i * PROGRESS_WIDTH) / total )) ++ remaining=$((PROGRESS_WIDTH - progress)) ++ bar=$(printf "%-${PROGRESS_WIDTH}s" "$(printf '█%.0s' $(seq 1 $progress))") ++ echo -ne "\r[ ${bar// / } ] $percent% ($i/$total) Running iteration $i... " ++ ++ # 启动进程 ++ port=$((1234 + i)) ++ # echo -ne "\r[$bar] $percent% ($i/$total) Running iteration $i..." ++ ./bin/test_circuit_file_sha256 1 1234 > output1.log& ++ ./bin/test_circuit_file_sha256 2 1234 > output2.log 2>&1 ++ wait ++ ++ # 解析 party 1 数据(清理分号) ++ computation_time_1=$(grep "Time for Computation:" output1.log | awk '{print $4}' | tr -d ';') ++ reading_time_1=$(grep "Time for Reading File and Creating Circuits:" output1.log | awk '{print $8}' | tr -d ';') ++ send_rounds_1=$(grep "party 1: send rounds:" output1.log | awk '{print $5}' | tr -d ';') ++ recv_rounds_1=$(grep "recv rounds:" output1.log | awk '{print $8}' | tr -d ';') ++ send_bytes_1=$(grep "party 1: send bytes:" output1.log | awk '{print $5}' | tr -d ';') ++ recv_bytes_1=$(grep "recv bytes:" output1.log | awk '{print $5}' | tr -d ';') ++ ++ # 解析 party 2 数据(清理分号) ++ send_rounds_2=$(grep "party 2: send rounds:" output2.log | awk '{print $5}' | tr -d ';') ++ recv_rounds_2=$(grep "recv rounds:" output2.log | awk '{print $8}' | tr -d ';') ++ send_bytes_2=$(grep "party 2: send bytes:" output2.log | awk '{print $5}' | tr -d ';') ++ recv_bytes_2=$(grep "recv bytes:" output2.log | awk '{print $5}' | tr -d ';') ++ computation_time_2=$(grep "Time for Computation:" output2.log | awk '{print $4}' | tr -d ';') ++ reading_time_2=$(grep "Time for Reading File and Creating Circuits:" output2.log | awk '{print $8}' | tr -d ';') ++ ++ # 累加数据 ++ total_send_rounds_1=$((total_send_rounds_1 + send_rounds_1)) ++ total_recv_rounds_1=$((total_recv_rounds_1 + recv_rounds_1)) ++ total_send_bytes_1=$((total_send_bytes_1 + send_bytes_1)) ++ total_recv_bytes_1=$((total_recv_bytes_1 + recv_bytes_1)) ++ total_computation_time_1=$((total_computation_time_1 + computation_time_1)) ++ total_reading_time_1=$((total_reading_time_1 + reading_time_1)) ++ ++ total_send_rounds_2=$((total_send_rounds_2 + send_rounds_2)) ++ total_recv_rounds_2=$((total_recv_rounds_2 + recv_rounds_2)) ++ total_send_bytes_2=$((total_send_bytes_2 + send_bytes_2)) ++ total_recv_bytes_2=$((total_recv_bytes_2 + recv_bytes_2)) ++ total_computation_time_2=$((total_computation_time_2 + computation_time_2)) ++ total_reading_time_2=$((total_reading_time_2 + reading_time_2)) ++done ++ ++# 转换 bytes 为 KB(如果超过 1024) ++convert_to_kb() { ++ local bytes=$1 ++ if [ "$bytes" -gt 1024 ]; then ++ echo "$((bytes / 1024)) KB" ++ else ++ echo "$bytes B" ++ fi ++} ++ ++convert_to_ms() { ++ local times=$1 ++ if [ "$times" -gt 100000000 ]; then ++ echo "$((times / 1000000)) ms" ++ else ++ echo "$times ns" ++ fi ++} ++ ++ ++echo "Emp-tool AES Total Results after 100 Iterations:" ++echo "Party 1:" ++echo " Send Rounds: $total_send_rounds_1" ++echo " Recv Rounds: $total_recv_rounds_1" ++echo " Send Bytes: $(convert_to_kb $total_send_bytes_1)" ++echo " Recv Bytes: $(convert_to_kb $total_recv_bytes_1)" ++echo " Time for Reading File and Creating Circuits: $(convert_to_ms $total_reading_time_1)" ++echo " Time for Computation: $(convert_to_ms $total_computation_time_1)" ++echo "Party 2:" ++echo " Send Rounds: $total_send_rounds_2" ++echo " Recv Rounds: $total_recv_rounds_2" ++echo " Send Bytes: $(convert_to_kb $total_send_bytes_2)" ++echo " Recv Bytes: $(convert_to_kb $total_recv_bytes_2)" ++echo " Time for Reading File and Creating Circuits: $(convert_to_ms $total_reading_time_2)" ++echo " Time for Computation: $(convert_to_ms $total_computation_time_2)" ++ ++{ ++ echo "Emp-tool AES Total Results after 100 Iterations:" ++ echo "Party 1:" ++ echo " Send Rounds: $total_send_rounds_1" ++ echo " Recv Rounds: $total_recv_rounds_1" ++ echo " Send Bytes: $(convert_to_kb $total_send_bytes_1)" ++ echo " Recv Bytes: $(convert_to_kb $total_recv_bytes_1)" ++ echo " Time for Reading File and Creating Circuits: $(convert_to_ms $total_reading_time_1)" ++ echo " Time for Computation: $(convert_to_ms $total_computation_time_1)" ++ echo "Party 2:" ++ echo " Send Rounds: $total_send_rounds_2" ++ echo " Recv Rounds: $total_recv_rounds_2" ++ echo " Send Bytes: $(convert_to_kb $total_send_bytes_2)" ++ echo " Recv Bytes: $(convert_to_kb $total_recv_bytes_2)" ++ echo " Time for Reading File and Creating Circuits: $(convert_to_ms $total_reading_time_2)" ++ echo " Time for Computation: $(convert_to_ms $total_computation_time_2)" ++} > sha256_result.log ++ ++rm output1.log ++rm output2.log ++echo "Results saved to ./build/sha256_result.log" +\ No newline at end of file +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index d4d81ac..213a101 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -22,5 +22,7 @@ IF(${ENABLE_FLOAT}) + add_test_case_with_run(float) + ENDIF(${ENABLE_FLOAT}) + add_test_case_with_run(circuit_file) ++add_test_case_with_run(circuit_file_aes) ++add_test_case_with_run(circuit_file_sha256) + add_test_case_with_run(example) + add_test_case_with_run(repeat) +diff --git a/test/circuit_file_aes.cpp b/test/circuit_file_aes.cpp +new file mode 100644 +index 0000000..7c44ad3 +--- /dev/null ++++ b/test/circuit_file_aes.cpp +@@ -0,0 +1,74 @@ ++#include "emp-sh2pc/emp-sh2pc.h" ++using namespace emp; ++using namespace std; ++const string circuit_file_location = macro_xstr(EMP_CIRCUIT_PATH); ++ ++int port, party; ++string file = circuit_file_location + "/bristol_fashion/aes_128.txt"; ++ ++vector cat_vector(vector key, vector plaintext) ++{ ++ vector result = key; ++ result.insert(result.end(), plaintext.begin(), plaintext.end()); ++ return result; ++} ++ ++string bits2string(vector bits) ++{ ++ string result; ++ for (const Bit &b : bits) ++ { ++ result += b.reveal() ? '1' : '0'; ++ } ++ return result; ++} ++ ++string reverse_string(string str) ++{ ++ reverse(str.begin(), str.end()); ++ return str; ++} ++ ++void test() ++{ ++ std::srand(static_cast( ++ std::chrono::system_clock::now().time_since_epoch().count())); ++ auto start1 = clock_start(); ++ BristolFashion cf(file.c_str()); ++ cout << "Time for Reading File and Creating Circuits: " << time_from(start1) << endl; ++ ++ vector key(128); ++ for (auto &bit : key) ++ { ++ bit = (rand() % 2) == 1; ++ } ++ ++ vector plaintext(128); ++ for (auto &bit : plaintext) ++ { ++ bit = (rand() % 2) == 1; ++ } ++ cout << "key : " << bits2string(key) << endl; ++ cout << "plaintext: " << bits2string(plaintext) << endl; ++ ++ vector bit_vec = cat_vector(key, plaintext); ++ Integer a(bit_vec); ++ ++ Integer c(128, 1, PUBLIC); ++ auto start2 = clock_start(); ++ cf.compute((block *)c.bits.data(), (block *)a.bits.data()); ++ cout << "ciphertext: " << reverse_string(c.reveal()) << endl; ++ cout << "Time for Computation: " << time_from(start2) << endl; ++} ++int main(int argc, char **argv) ++{ ++ parse_party_and_port(argv, &party, &port); ++ NetIO *io = new NetIO(party == ALICE ? nullptr : "127.0.0.1", port); ++ ++ setup_semi_honest(io, party); ++ test(); ++ cout << "party " << party << ": send rounds: " << io->send_rounds << "; recv rounds: " << io->recv_rounds << endl; ++ cout << "party " << party << ": send bytes: " << io->send_bytes << "; recv bytes: " << io->recv_bytes << endl; ++ finalize_semi_honest(); ++ delete io; ++} +diff --git a/test/circuit_file_sha256.cpp b/test/circuit_file_sha256.cpp +new file mode 100644 +index 0000000..7925096 +--- /dev/null ++++ b/test/circuit_file_sha256.cpp +@@ -0,0 +1,107 @@ ++#include ++#include ++#include "emp-sh2pc/emp-sh2pc.h" ++using namespace emp; ++using namespace std; ++const string circuit_file_location = macro_xstr(EMP_CIRCUIT_PATH); ++ ++int port, party; ++string file = circuit_file_location + "/bristol_fashion/sha256.txt"; ++ ++vector cat_vector(vector key, vector plaintext) ++{ ++ vector result = key; ++ result.insert(result.end(), plaintext.begin(), plaintext.end()); ++ return result; ++} ++ ++string bits2string(vector bits) ++{ ++ string result; ++ for (const Bit &b : bits) ++ { ++ result += b.reveal() ? '1' : '0'; ++ } ++ return result; ++} ++ ++string reverse_string(string str) ++{ ++ reverse(str.begin(), str.end()); ++ return str; ++} ++ ++string bits2hexString(vector bits) ++{ ++ stringstream ss; ++ for (size_t i = 0; i < bits.size(); i += 4) ++ { ++ int hex_value = 0; ++ for (size_t j = 0; j < 4 && i + j < bits.size(); ++j) ++ { ++ hex_value = (hex_value << 1) | bits[i + j].reveal(); ++ } ++ ss << hex << hex_value; ++ } ++ return ss.str(); ++} ++ ++string biString2hexString(string str) ++{ ++ stringstream ss; ++ int len = str.length(); ++ while (len % 4 != 0) ++ { ++ str = '0' + str; ++ len++; ++ } ++ for (int i = 0; i < len; i += 4) ++ { ++ string byte_str = str.substr(i, 4); ++ int byte_val = stoi(byte_str, nullptr, 2); ++ ss << hex << setw(1) << setfill('0') << byte_val; ++ } ++ ++ return ss.str(); ++} ++ ++void test() ++{ ++ std::srand(static_cast( ++ std::chrono::system_clock::now().time_since_epoch().count())); ++ auto start1 = clock_start(); ++ BristolFashion cf(file.c_str()); ++ cout << "Time for Reading File and Creating Circuits: " << time_from(start1) << endl; ++ vector message_block(512); ++ vector hash_state(256); ++ for (auto &bit : message_block) ++ { ++ bit = (rand() % 2) == 1; ++ } ++ for (auto &bit : hash_state) ++ { ++ bit = (rand() % 2) == 1; ++ } ++ ++ cout << "message block: 0x" << bits2hexString(message_block) << endl; ++ cout << "hash state : 0x" << bits2hexString(hash_state) << endl; ++ Integer a(cat_vector(message_block, hash_state)); ++ ++ Integer c(256, 0, PUBLIC); ++ auto start2 = clock_start(); ++ cf.compute((block *)c.bits.data(), (block *)a.bits.data()); ++ cout << "ciphertext : 0x" << biString2hexString(c.reveal()) << endl; ++ cout << "Time for Computation: " << time_from(start2) << endl; ++} ++int main(int argc, char **argv) ++{ ++ parse_party_and_port(argv, &party, &port); ++ NetIO *io = new NetIO(party == ALICE ? nullptr : "127.0.0.1", port); ++ ++ setup_semi_honest(io, party); ++ test(); ++ cout << "party " << party << ": send rounds: " << io->send_rounds << "; recv rounds: " << io->recv_rounds << endl; ++ cout << "party " << party << ": send bytes: " << io->send_bytes << "; recv bytes: " << io->recv_bytes << endl; ++ finalize_semi_honest(); ++ delete io; ++} diff --git a/examples/emp_benchmark/communication_cost_tool.patch b/examples/emp_benchmark/communication_cost_tool.patch new file mode 100644 index 00000000..252707c2 --- /dev/null +++ b/examples/emp_benchmark/communication_cost_tool.patch @@ -0,0 +1,33 @@ +diff --git a/emp-tool/io/net_io_channel.h b/emp-tool/io/net_io_channel.h +index 6566564..c049d16 100644 +--- a/emp-tool/io/net_io_channel.h ++++ b/emp-tool/io/net_io_channel.h +@@ -28,6 +28,10 @@ class NetIO: public IOChannel { public: + bool has_sent = false; + string addr; + int port; ++ int send_rounds = 0; ++ int recv_rounds = 0; ++ int send_bytes = 0; ++ int recv_bytes = 0; + NetIO(const char * address, int port, bool quiet = false) { + if (port <0 || port > 65535) { + throw std::runtime_error("Invalid port number!"); +@@ -128,6 +132,8 @@ class NetIO: public IOChannel { public: + error("net_send_data\n"); + } + has_sent = true; ++ send_rounds += 1; ++ send_bytes += len; + } + + void recv_data_internal(void * data, size_t len) { +@@ -142,6 +148,8 @@ class NetIO: public IOChannel { public: + else + error("net_recv_data\n"); + } ++ recv_rounds += 1; ++ recv_bytes += len; + } + }; + diff --git a/examples/emp_benchmark/emp-readme-install.patch b/examples/emp_benchmark/emp-readme-install.patch new file mode 100644 index 00000000..69f1dd92 --- /dev/null +++ b/examples/emp_benchmark/emp-readme-install.patch @@ -0,0 +1,77 @@ +diff --git a/scripts/install.py b/scripts/install.py +index bca7d4d..901a34a 100644 +--- a/scripts/install.py ++++ b/scripts/install.py +@@ -1,6 +1,7 @@ + #!/usr/python + import subprocess +-install_packages = ''' ++ ++install_packages = """ + if [ "$(uname)" == "Darwin" ]; then + brew list openssl || brew install openssl + brew list pkg-config || brew install pkg-config +@@ -16,34 +17,44 @@ else + echo "System not supported yet!" + fi + fi +-''' ++""" + +-install_template = ''' +-git clone https://github.com/emp-toolkit/X.git --branch Y ++install_template = """ ++git clone https://github.com/emp-toolkit/X.git + cd X ++git checkout Y + cmake . + make -j4 + sudo make install + cd .. +-''' ++""" + + import argparse ++ + parser = argparse.ArgumentParser() +-parser.add_argument('-install', '--install', action='store_true') +-parser.add_argument('-deps', '--deps', action='store_true') +-parser.add_argument('--tool', nargs='?', const='master') +-parser.add_argument('--ot', nargs='?', const='master') +-parser.add_argument('--sh2pc', nargs='?', const='master') +-parser.add_argument('--ag2pc', nargs='?', const='master') +-parser.add_argument('--agmpc', nargs='?', const='master') +-parser.add_argument('--zk', nargs='?', const='master') ++parser.add_argument("-install", "--install", action="store_true") ++parser.add_argument("-deps", "--deps", action="store_true") ++parser.add_argument( ++ "--tool", nargs="?", const="8052d95ddf56b519a671b774865bb13157b3b4e0" ++) ++parser.add_argument("--ot", nargs="?", const="0342af547fa80477e866c56b5e2632315ae51721") ++parser.add_argument( ++ "--sh2pc", nargs="?", const="61589f52111a26015b2bb8ab359dc457f8a246eb" ++) ++parser.add_argument( ++ "--ag2pc", nargs="?", const="61589f52111a26015b2bb8ab359dc457f8a246eb" ++) ++parser.add_argument( ++ "--agmpc", nargs="?", const="0add81ed517ac5b83d3a6576572b8daa0d236303" ++) ++parser.add_argument("--zk", nargs="?", const="4a0d717f5e3d18b408db422b845ccb18e24a853b") + args = parser.parse_args() + +-if vars(args)['install'] or vars(args)['deps']: +- subprocess.call(["bash", "-c", install_packages]) ++print(vars(args)) ++ + +-for k in ['tool', 'ot', 'zk', 'sh2pc', 'ag2pc', 'agmpc']: +- if vars(args)[k]: +- template = install_template.replace("X", "emp-"+k).replace("Y", vars(args)[k]) +- print(template) +- subprocess.call(["bash", "-c", template]) ++for k in ["tool", "ot", "zk", "sh2pc", "ag2pc", "agmpc"]: ++ if vars(args)[k]: ++ template = install_template.replace("X", "emp-" + k).replace("Y", vars(args)[k]) ++ print(template) ++ subprocess.call(["bash", "-c", template]) diff --git a/examples/emp_benchmark/run.sh b/examples/emp_benchmark/run.sh new file mode 100644 index 00000000..afd61ff1 --- /dev/null +++ b/examples/emp_benchmark/run.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +OS_TYPE="$(uname)" + +if [ "$OS_TYPE" == "Darwin" ]; then + # macOS 系统 + brew list openssl || brew install openssl + brew list pkg-config || brew install pkg-config + brew list cmake || brew install cmake +elif [ "$OS_TYPE" == "Linux" ]; then + if command -v apt-get >/dev/null; then + # Ubuntu/Debian 系统 + sudo apt-get update + sudo apt-get install -y software-properties-common + sudo apt-get install -y cmake git build-essential libssl-dev pkg-config + elif command -v yum >/dev/null; then + # RHEL / CentOS / Fedora + sudo yum install -y python3 gcc make git cmake gcc-c++ openssl-devel + else + echo "当前 Linux 发行版不受支持,请手动安装 cmake、git 和 libssl-dev" + exit 1 + fi +else + echo "当前系统 ($OS_TYPE) 不支持!" + exit 1 +fi + +mkdir emp_toolkit +cd emp_toolkit +git clone https://github.com/emp-toolkit/emp-tool.git +cp ../communication_cost_tool.patch emp-tool/ +cd emp-tool/ +git checkout 8052d95ddf56b519a671b774865bb13157b3b4e0 +git apply communication_cost_tool.patch +cmake . +make -j4 +sudo make install +cd .. + +git clone https://github.com/emp-toolkit/emp-readme.git +cp ../emp-readme-install.patch emp-readme/ +cd emp-readme/ +git checkout 28ed3ab07be2edda6d7841692be2c552d22d7cf5 +git apply emp-readme-install.patch +cp scripts/install.py ../ +cd .. + +python install.py --ot --sh2pc +cd .. + +git clone https://github.com/emp-toolkit/emp-sh2pc.git +cp ./communication_cost_sh2pc.patch emp-sh2pc +cd emp-sh2pc +git checkout 61589f52111a26015b2bb8ab359dc457f8a246eb +git apply --reject --whitespace=fix communication_cost_sh2pc.patch + +mkdir build +cd build +cmake .. +make -j4 +cd .. + +bash aes_run.sh +bash sha256_run.sh + + + + From 1bcb8a40a706d53c431bc4d8ec2d9c4a10610034 Mon Sep 17 00:00:00 2001 From: gitCoder1024 <201810111240@stu.shmtu.edu.cn> Date: Fri, 11 Apr 2025 16:10:40 +0800 Subject: [PATCH 27/27] epm_bench_file --- examples/{ => gc}/emp_benchmark/communication_cost_sh2pc.patch | 0 examples/{ => gc}/emp_benchmark/communication_cost_tool.patch | 0 examples/{ => gc}/emp_benchmark/emp-readme-install.patch | 0 examples/{ => gc}/emp_benchmark/run.sh | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename examples/{ => gc}/emp_benchmark/communication_cost_sh2pc.patch (100%) rename examples/{ => gc}/emp_benchmark/communication_cost_tool.patch (100%) rename examples/{ => gc}/emp_benchmark/emp-readme-install.patch (100%) rename examples/{ => gc}/emp_benchmark/run.sh (100%) diff --git a/examples/emp_benchmark/communication_cost_sh2pc.patch b/examples/gc/emp_benchmark/communication_cost_sh2pc.patch similarity index 100% rename from examples/emp_benchmark/communication_cost_sh2pc.patch rename to examples/gc/emp_benchmark/communication_cost_sh2pc.patch diff --git a/examples/emp_benchmark/communication_cost_tool.patch b/examples/gc/emp_benchmark/communication_cost_tool.patch similarity index 100% rename from examples/emp_benchmark/communication_cost_tool.patch rename to examples/gc/emp_benchmark/communication_cost_tool.patch diff --git a/examples/emp_benchmark/emp-readme-install.patch b/examples/gc/emp_benchmark/emp-readme-install.patch similarity index 100% rename from examples/emp_benchmark/emp-readme-install.patch rename to examples/gc/emp_benchmark/emp-readme-install.patch diff --git a/examples/emp_benchmark/run.sh b/examples/gc/emp_benchmark/run.sh similarity index 100% rename from examples/emp_benchmark/run.sh rename to examples/gc/emp_benchmark/run.sh