I'm trying to run the Using Homomorphic Encryption example from the announcement blog post in a playground and am running into an Ambiguous use of 'decrypt(using:)' error on the line
let decrypted = try ciphertext.decrypt(using: secretKey)
as well as a (possible downstream) error Cannot infer contextual base in reference to member 'coefficient' on the line just below:
let decoded: [UInt64] = try decrypted.decode(format: .coefficient)
I'm guessing the example is missing some qualification on the decrypt call's return type but I can't quite figure out what I'd put there to help the compiler. It's not Bfv<UInt64>.CoeffPlaintext by the looks of it.
Am I missing something obvious or is the example out of date perhaps?
let decrypted: Bfv<UInt64>.CoeffPlaintext = try ciphertext.decrypt(using: secretKey)
nor
let decrypted = try ciphertext.decrypt(using: secretKey) as Bfv<UInt64>.CoeffPlaintext
help to resolve the ambiguity. Is there another way to force the correct overload that I could try?
I'll try sticking it in a test as well, this was just the easiest way to try this. (And it usually works quite reliably, I do this routinely for packages I'm trying out).
I've heard you talk about it on the podcast (of which I am a regular listener—thanks for doing it!), and wish I had as good of a general experience with them as you do. I really liked playgrounds from 2014 to about 2018, used them daily, and wish they would be considered as worthy of support as they seemed to be back then.
I love to hear that someone's listening in on our ramblings, thank you
I suspect part of it is that I've learned to step around the problems with playgrounds over the years. There's always the ritual of closing and reopening them when dependencies aren't building as well as trimming down code but on the whole I'm still able to get quite far with playgrounds.
One of the main things I do to make them more stable is move chunks of code into files in Sources. It gives better compiler errors (sometimes it's the only way to get compiler errors) and it'll run much faster.