Conversation

I'm working on a reference implementation for the crypto protocol in my thesis 😂 so far I've implemented ElGamal encryption and Pedersen commitments over a quadratic residue group, and have written a basic server that can store commitments sent by users
1
1
💛! What you don't see is the solid two hours I spent today wondering why everything decrypted to 1, until I realised I was taking the modulus by the incorrect of the two prime numbers in the system...
1
Arrgh sounds like the months I spent trying to figure out why my polymorphic identity function wouldn't type check, when I'd messed up my variable binding implementation.
1
I've gotten into a bit of a pickle with Rust's type checker... my Elem struct has a reference to the Group it's from, and then an ElGamal struct has a reference to both a Group and an Elem. The problem is: when I create a Group in the new() function, I can't take an Elem...
1
... because the Group still belongs to new() and not the about-to-be-created ElGamal :'( not sure how to resolve it, I've worked around it by cloning a value but that's not very satisfying
1
Hmmmm interesting! Sometimes cloning is a good idea (sometimes folks get too hungup on not doing so), but there might be a better way. If you want me to look over it anytime - sometimes this stuff can be hard to explain without context - I'd be more than happy to help!
1
Replying to
Cheers! I'll shoot you a message when I've got a spare minute. I've tried to fit in reference counting but not had much success. I'd like to avoid clones because that's going to be a clone on every group operation which I suspect will eat up a lot of time.
1
It'd be about 20 bytes each, realistically, though. I guess the exponentiation and multiplication would probably end up being a lot slower. Even just aesthetically though I feel like there has to be a nicer solution!