Presentation is loading. Please wait.

Presentation is loading. Please wait.

2D Coordinates

Similar presentations


Presentation on theme: "2D Coordinates "β€” Presentation transcript:

1 2D Coordinates π‘₯ π‘Ž , 𝑦 π‘Ž , π‘₯ 𝑏 , 𝑦 𝑏 represent coordinates of two locations Each coordinate is an 𝑙-bit unsigned number π‘₯ π‘Ž = π‘₯ π‘Žπ‘™ … π‘₯ π‘Ž2 π‘₯ π‘Ž1 𝑦 π‘Ž = 𝑦 π‘Žπ‘™ … 𝑦 π‘Ž2 𝑦 π‘Ž1 π‘₯ 𝑏 = π‘₯ 𝑏𝑙 … π‘₯ 𝑏2 π‘₯ 𝑏1 𝑦 𝑏 = 𝑦 𝑏𝑙 … 𝑦 𝑏2 𝑦 𝑏1 π‘€π‘Žπ‘›β„Žπ‘Žπ‘‘π‘‘π‘Žπ‘› π·π‘–π‘ π‘‘π‘Žπ‘›π‘π‘’ = π‘₯ 𝑏 βˆ’ π‘₯ π‘Ž + 𝑦 𝑏 βˆ’ 𝑦 π‘Ž

2 Calculating Absolute Difference
π‘₯ π‘Žπ‘™ π‘₯ 𝑏𝑙 π‘₯ π‘Ž2 π‘₯𝑏2 π‘₯ π‘Ž1 π‘₯𝑏1 SUB block is composed of 𝑙 1-bit subtractors [Kolesnikov ’09] Each 1-bit subtractor is composed of 4 XOR gates, 1 AND gate Note: π‘₯ 𝑙+1 equals complement of carryout bit from 𝑙 π‘‘β„Ž 1-bit subtractor INV block is composed of 𝑙 XOR gates π‘₯ 𝑙 … π‘₯ 2 π‘₯ 1 = π‘₯ 𝑏 βˆ’ π‘₯ π‘Ž βˆ’ π‘₯ 𝑙+1 π‘†π‘ˆπ΅ π‘₯ 𝑙+1 π‘₯ 𝑙 π‘₯ 2 π‘₯ 1 𝐼𝑁𝑉 π‘₯ 𝑙 π‘₯ 2 π‘₯ 1

3 Calculating Absolute Difference
π‘₯ π‘Žπ‘™ π‘₯ 𝑏𝑙 π‘₯ π‘Ž2 π‘₯𝑏2 π‘₯ π‘Ž1 π‘₯𝑏1 𝑦 π‘Žπ‘™ 𝑦 𝑏𝑙 𝑦 π‘Ž2 𝑦𝑏2 𝑦 π‘Ž1 𝑦𝑏1 π‘†π‘ˆπ΅ π‘†π‘ˆπ΅ π‘₯ 𝑙+1 π‘₯ 𝑙 π‘₯ 2 π‘₯ 1 𝑦 𝑙+1 𝑦 𝑙 𝑦 2 𝑦 1 𝐼𝑁𝑉 𝐼𝑁𝑉 π‘₯ 𝑙 π‘₯ 2 π‘₯ 1 𝑦 𝑙 𝑦 2 𝑦 1 π‘₯ 𝑙 … π‘₯ 2 π‘₯ 1 = π‘₯ 𝑏 βˆ’ π‘₯ π‘Ž βˆ’ π‘₯ 𝑙+1 𝑦 𝑙 … 𝑦 2 𝑦 1 = 𝑦 𝑏 βˆ’ 𝑦 π‘Ž βˆ’ 𝑦 𝑙+1

4 Calculating Manhattan Distance
π‘₯ 𝑙 𝑦𝑙 π‘₯ 2 𝑦2 π‘₯ 1 𝑦1 ADD block is composed of 𝑙 1-bit adders [Kolesnikov ’09] Each 1-bit adder is composed of 4 XOR gates, 1 AND gate INC block is composed of 𝑙 half adder (HA) blocks, and 1 XOR gate Each HA is composed of 1 XOR gate, 1 AND gate 𝐴𝐷𝐷 π‘₯ 𝑙+1 𝑑 𝑙+1 𝑑 𝑙 𝑑 2 𝑑 1 𝐼𝑁𝐢 𝐻𝐴 𝐻𝐴 𝐻𝐴 𝑦 𝑙+1 𝑑 𝑙+1 𝑑 𝑙 𝑑 2 𝑑 1 π‘€π‘Žπ‘›β„Žπ‘Žπ‘‘π‘‘π‘Žπ‘› π·π‘–π‘ π‘‘π‘Žπ‘›π‘π‘’= 𝑑 𝑙+1 𝑑 𝑙 … 𝑑 2 𝑑 1

5 Manhattan Distance Calculation
Circuit Size Manhattan Distance Manhattan Distance Calculation Block #XOR gates #AND gates π‘†π‘ˆπ΅ 4𝑙 𝑙 𝐼𝑁𝑉 𝐴𝐷𝐷 𝐼𝑁𝐢 𝑙+1 Total 15𝑙+1 Example: Coordinates are 𝑙=16-bit numbers. Manhattan distance calculation circuit has 241 XOR, 64 AND gates.

6 Minimum Value and Minimum Index [Kolesnikov ’09]
𝑒 𝑣 𝑖 𝑒 𝑖𝑣 Need to find minimum of two numbers 𝑒,𝑣 𝑖 𝑒 , 𝑖 𝑣 denote indices for 𝑒,𝑣 CMP block is composed of π‘š 1-bit comparators, where π‘š= 𝑒 = 𝑣 Each 1-bit comparator is composed of 3 XOR gates, 1 AND gate MUX block is composed of 2𝑛 XOR gates, 𝑛 AND gates, where 𝑛 denotes the length of operands 𝑛=π‘š for MUX on left 𝑛=| 𝑖 𝑒 |= 𝑖 𝑣 for MUX on right 𝐢𝑀𝑃 π‘€π‘ˆπ‘‹ π‘€π‘ˆπ‘‹ 𝑀𝐼𝑁 π‘šπ‘–π‘› 𝑒,𝑣 𝑖 π‘šπ‘–π‘› 𝑒,𝑣

7 Minimum Value and Minimum Index [Kolesnikov ’09]
𝐷 1 𝐷 2 𝑖 𝐷 1 𝑖 𝐷 2 𝐷 3 𝐷 4 𝑖 𝐷 3 𝑖 𝐷 4 𝑀𝐼𝑁 𝑀𝐼𝑁 π‘šπ‘–π‘› 𝐷 1 , 𝐷 2 𝑖 π‘šπ‘–π‘› 𝐷 1 , 𝐷 2 π‘šπ‘–π‘› 𝐷 3 , 𝐷 4 𝑖 π‘šπ‘–π‘› 𝐷 3 , 𝐷 4 𝑀𝐼𝑁 π‘šπ‘–π‘› 𝐷 1 , 𝐷 2 , 𝐷 3 , 𝐷 4 𝑖 π‘šπ‘–π‘› 𝐷 1 , 𝐷 2 , 𝐷 3 , 𝐷 4 Tree of MIN blocks can find both minimum value, minimum index

8 1 Minimum Value/Index Block
Circuit Size 1 Min Value/Index Block Mobile client needs to determine closest location among 𝐿 different locations 𝐿 Locations may be indexed using 𝐿 𝑖𝑛𝑑 bits. For example, 𝐿 𝑖𝑛𝑑 = π‘™π‘œπ‘” 2 𝐿 bits (assume that 𝐿 is a power of 2). π‘€π‘Žπ‘›β„Žπ‘Žπ‘‘π‘‘π‘Žπ‘› π·π‘–π‘ π‘‘π‘Žπ‘›π‘π‘’ = 𝑙+1 bits 1 Minimum Value/Index Block Block #XOR gates #AND gates 𝐢𝑀𝑃 3(𝑙+1) (𝑙+1) π‘€π‘ˆ 𝑋 π‘šπ‘–π‘› 2(𝑙+1) π‘€π‘ˆ 𝑋 𝑖𝑛𝑑𝑒π‘₯ 2 𝐿 𝑖𝑛𝑑 𝐿 𝑖𝑛𝑑 Total 5 𝑙+1 +2 𝐿 𝑖𝑛𝑑 2 𝑙+1 + 𝐿 𝑖𝑛𝑑

9 Tree of Minimum Value/Index Blocks Manhattan Distance to L locations
Circuit Size Tree of Min Blocks and Manhattan Distance to L locations There are (πΏβˆ’1) Min blocks in the tree. Tree of Minimum Value/Index Blocks #XOR gates #AND gates 5 𝑙+1 +2 𝐿 𝑖𝑛𝑑 Γ— πΏβˆ’1 2 𝑙+1 + 𝐿 𝑖𝑛𝑑 Γ— πΏβˆ’1 Manhattan Distance to L locations #XOR gates #AND gates 15𝑙+1 ×𝐿 4𝑙×𝐿

10 Closest Location and its Manhattan Distance
Complete Circuit Size Closest Location and its Manhattan Distance Closest Location and its Manhattan Distance #XOR gates #AND gates 5 𝑙+1 +2 𝐿 𝑖𝑛𝑑 Γ— πΏβˆ’1 + 15𝑙+1 ×𝐿 2 𝑙+1 + 𝐿 𝑖𝑛𝑑 Γ— πΏβˆ’1 + 4𝑙×𝐿 Example: Length of each coordinate, 𝑙=16-bits Number of locations, 𝐿=8 Index length, 𝐿 𝑖𝑛𝑑 = log 2 𝐿=3 -bits Complete circuit has 2565 XOR gates, 771 AND gates.

11 Privacy Preserving Application: Closest Bank/ATM Location
Example: Compute the location of closest Chase or Wells Fargo ATM in Salt Lake City in a privacy preserving manner Mobile client’s private input: Coordinates representing intersection of two streets (e.g., 800 East 100 South) Question: What remains secret in our privacy preserving application? Mobile client's location The computed ATM location closest to the client The computed distance to the closest ATM The secret is revealed only if evaluator colludes with all servers

12 ATM Locations Consider the area of Salt Lake City, UT that lies between: Main street (represents 0 East street) 1300 East street South Temple street (represents 0 South street) 800 South Street ATM Locations Bank Location Chase 201 South 0 East 185 South 100 East 376 East 400 South 531 East 400 South Wells Fargo 299 South 0 East 381 East 300 South 79 South 0 East 778 South 0 East 570 South 700 East 235 South 1300 East Area contains 13 * 8 = 104 blocks Area contains 4 Chase bank ATM, 6 Wells Fargo bank ATM locations. Thus 𝐿=4+6=10 𝑙=max⁑( log , log )=11 bits sufficient to represent any East or South coordinate Any ATM location may be identified using 𝐿 𝑖𝑛𝑑 =2𝑙=22 bits A Tree of (πΏβˆ’1)=9 Min blocks can find the ATM location closest to mobile client Source:

13 Closest Bank ATM Location, Distance
Circuit Size for Closest ATM & Distance Closest Bank ATM Location, Distance #XOR gates #AND gates 5 𝑙+1 +4𝑙 Γ— πΏβˆ’1 + 15𝑙+1 ×𝐿 =2596 2 𝑙+1 +2𝑙 Γ— πΏβˆ’1 + 4𝑙×𝐿 =854

14 Server-Side Cost to Construct Garbled Circuit for Closest ATM
To compute the closest ATM and distance, servers exchange 126 GB of information, when 𝑛=4, for example, while constructing the garbled circuit Demonstrates feasibility of real-world privacy preserving computations!

15 Client-Side Cost to determine
the Closest ATM client-side cost grows much slowly with number of parties, in comparison to server-side cost! Client sends seed values, and the coordinates of an intersection to the cloud servers Public ATM locations are assumed to be hard-coded in the garbled circuit. i.e., client does not transmit ATM locations to the servers To preserve location privacy, client exchanges very small amount of information with servers; less than 60 kilo bits, with 𝑛=4 servers, for example

16 Alternative/Direct Method to Calculate Manhattan Distance
Backup Slides Alternative/Direct Method to Calculate Manhattan Distance

17 Minimum and Maximum Value Block
Maximum and Minimum Value [Huang’12] 𝑒 𝑣 Need to find both maximum and minimum of two numbers 𝑒,𝑣 Let 𝑙= 𝑒 = 𝑣 CMP block is composed of 𝑙 1-bit comparators Each 1-bit comparator is composed of 3 XOR gates, 1 AND gate 𝑀𝐴𝑋_𝑀𝐼𝑁 𝐢𝑀𝑃 𝐢𝑂𝑁𝐷_π‘†π‘Šπ΄π‘ƒ π‘šπ‘Žπ‘₯ 𝑒,𝑣 π‘šπ‘–π‘› 𝑒,𝑣 COND_SWAP block is composed of 3𝑙 XOR gates, 𝑙 AND gates Minimum and Maximum Value Block Block #XOR gates #AND gates 𝐢𝑀𝑃 3𝑙 𝑙 𝐢𝑂𝑁𝐷_π‘†π‘Šπ΄π‘ƒ Total 6𝑙 2𝑙

18 Manhattan Distance using 𝑀𝐴𝑋_𝑀𝐼𝑁 block
π‘₯ π‘Ž π‘₯ 𝑏 𝑦 π‘Ž 𝑦 𝑏 Manhattan Distance Block #XOR gates #AND gates 𝑀𝐴𝑋_𝑀𝐼𝑁 6𝑙 2𝑙 π‘†π‘ˆπ΅ 4𝑙 𝑙 𝐴𝐷𝐷 Total 24𝑙 7𝑙 𝑀𝐴𝑋_𝑀𝐼𝑁 𝑀𝐴𝑋_𝑀𝐼𝑁 π‘₯ π‘Ž π‘₯ 𝑏 𝑦 π‘Ž 𝑦 𝑏 π‘†π‘ˆπ΅ π‘†π‘ˆπ΅ π‘₯ π‘Ž βˆ’ π‘₯ 𝑏 𝑦 π‘Ž βˆ’ 𝑦 𝑏 𝐴𝐷𝐷 π‘₯ π‘Ž βˆ’ π‘₯ 𝑏 + 𝑦 π‘Ž βˆ’ 𝑦 𝑏 Note: π‘₯ π‘Ž β‰₯ π‘₯ 𝑏 ; 𝑦 π‘Ž β‰₯ 𝑦 𝑏 Calculation of Manhattan distance using 𝑀𝐴𝑋_𝑀𝐼𝑁 block requires 24𝑙 𝑋𝑂𝑅, 7𝑙 𝐴𝑁𝐷 π‘”π‘Žπ‘‘π‘’π‘  Note: calculation shown in slide# 5 that uses 2 INV blocks & 1 INC block is more optimal, since it only requires (15𝑙+1) 𝑋𝑂𝑅, 4𝑙 𝐴𝑁𝐷 π‘”π‘Žπ‘‘π‘’π‘ 


Download ppt "2D Coordinates "

Similar presentations


Ads by Google