The growing number of distributed energy resources (DER), such as energy storage systems and renewable energy systems in the electric power systems, and the combination with the cutting-edge information and communication technologies create possibilities for DER owners to participate in the electricity market. Recently, the concept of peer-to-peer (P2P) energy trading has been proposed to achieve more reliable and efficient power system operation. The introduction of blockchain technology in P2P energy trading enabled secure transactions between users and prosumers using smart contracts. However, the sensitive data about transactions and participants, including the distribution system operator (DSO), become available to the nodes of the blockchain, causing privacy issues. This issue has been addressed by a great amount of research. Recent major progress in P2P energy trading systems combined with a blockchain is that the bid values are encrypted using functional encryption (FE), and the peer matching process is performed on the encrypted bids. Its protocol uses a method that encodes integers into vectors and a procedure that compares the encrypted vectors on a ciphertext domain. However, the comparison is not efficient in terms of the range of bid values as the amount of computation increases linearly according to the size of the range of possible integers. This work addresses this issue by proposing a novel bid encoding algorithm named dual binary encoding, which significantly reduces the amount of computation down to the square of the logarithm of the range size. In addition, we propose a practical rebidding mechanism for the remaining amount, when the amounts stated by the two matched peers are not equal. We verify the feasibility of the proposed method by implementing a private Ethereum blockchain network and a virtual energy trade testbed.