Would a question asking primarily for sample code (to be studied for comprehension, and possibly reused), rather than for a working program or library, be on-topic?
On the one hand, asking for sample code for an interface or algorithm is more like asking for a tutorial about that interface or a reference book about that algorithm. This isn't what we do here.
On the other hand, that sample code is supposed to accomplish some task (implement an algorithm, or whatever). So it is software for a particular purpose, which is what this site is about. There just happens to be a requirement that the software's source code be available and illustrative.
I'm trying to understand the basic scheme of deniable encryption (…). Is there any source code example (c/c++) on trapdoor permutation or hardcore predicate that I can use as reference? Both are implemented in deniable encryption. Also, is there any source code example on deniable encryption (for reference)?