I am passing 64 byte public keys into my solidity function as two 32 byte parts, high 32 bytes and low 32 bytes. How do I combine them back to a 64 byte value in Solidity (cost efficiently)? Looping and adding byte by byte would be quite expensive, but I suspect there should be a solution that involves loading values into memory and reading them from there using assembly, but so far I can't figure out how to.
function generateAddress(bytes32 pubKeyHigh, bytes32 pubKeyLow) returns (address) {
bytes pubKey = ..... combine pubKeyHigh and pubKeyLow .....
return address(keccak256(pubKey));
}