Browse Source

Add a comment for future possible optimization

Ian Goldberg 1 year ago
parent
commit
39a5066ab3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Enclave/OblivAlgs/ORExpand.tcc

+ 4 - 0
Enclave/OblivAlgs/ORExpand.tcc

@@ -19,6 +19,10 @@ static inline void mid_oswap(unsigned char *buf, uint32_t *dest,
     uint32_t destb = dest[b];
     uint8_t swap_flag = ((mid <= desta) & (desta < hi))
         | ((lo <= destb) & (destb < mid));
+    // The next line could be optimized with some inline assembly, since
+    // we've already loaded desta and destb, so we could obliviously
+    // swap those registers, and then non-obliviously write them back
+    // out to dest[a] and dest[b].
     oswap_buffer<OSWAP_4>((unsigned char *)(dest+a),
         (unsigned char *)(dest+b), 4, swap_flag);
     oswap_buffer<oswap_style>(buf+a*block_size, buf+b*block_size,