Algorithm 1: Carpooling matching scheme based on BF-PSI

Input: Q M P i , S M V i , δ S M V i

Output: Result = “successful matching” or “failed matching”

1: I n P i , V i =

2: if | T 3 T S M V i | < ψ t then

3: R i verifies the reputation certificate and signature of V i

4: if equation (11) and (12) hold then

5: R i matches the starting position and destination of the V i and P i

6: if equation (13) holds then

7: R i verifies whether V i meets P i ’s multi-faceted trust needs

8: if all the T V V i ( I 1 ) ~ T V V i ( I 7 ) > χ m n then

9: V i meets P i ’s multi-faceted trust needs

10: end if

11: end if

12: end if

13: end if

14: for p { m , , n } then

15: if mem_test { B f V i , r 2 , x p } then

16: I n P i , V i = I n P i , V i { x p }

17: end if

18: end for

19: if I n P i , V i and P S P i are the same then

20: Result = “successful matching”

21: else

22: Result = “failed matching”

23: end if