osu-crypto / libPSI

A repository for private set intersection.
Other
168 stars 47 forks source link

Is it possible to achieve the conversion between string and block #20

Closed L-coder148 closed 2 years ago

L-coder148 commented 3 years ago

Is it possible to achieve the conversion between String and block, the string might be a meaningful sentence like "I am Alice" or "yes".

ladnir commented 3 years ago

Hash the string to a block. RandomOracle can do this.

L-coder148 commented 3 years ago

Thanks for your early reply,I want to send the vector ss ,but there was an error. I saw the function inChannel.h, but I still can not deal with it.

        std::vector<std::string> ss(2);
        ss.push_back("I am Alice");
        ss.push_back("I am Alice");

        auto routine = [&](u64 t)
        {
            chl0.asyncSend(ss);
        };

image

ladnir commented 3 years ago

Channel can only send vector of basic data types. Basically if you can use memcpy. string is not a basic data type.

Join all your strings and send one big string.