Open jfphilbin opened 8 years ago
Interesting.
Here is the Bouncy Castle source: https://github.com/bcgit/bc-java/blob/master/core/src/main/java/org/bouncycastle/crypto/modes/GCMBlockCipher.java
It'd be a first for me too, but I'll try to take a look at it asap to see if I can make something of it.
Seen from the Bouncy Castle unit tests for GCM, there are several different "multipliers" that specify the mode of operation. Seems like that will complicate the matter :)
Hi @stevenroose
I suggest creating Junit (or whatever) tests for BC with different inputs, printing the outputs and then move those tests to Dart. Then try migrating the code from Java to Dart, then run the tests, then debug as much as you can until all works :-D.
Something that helps is printing the intermediate state of the algorithm in java and dart and compare them. Usually errors come from loop to loop because you leave some pointer with a bad value, or things like that...
May the luck be with you ;-P
@izaera Thanks for the suggestion. For now, I have a thesis to finish by the end of August, so I'll have my hands full, but I really want to give this a shot thereafter.
@stevenroose Good look with the thesis, then :-)
Any chance of getting GCM implemented. I'm using Dart to build a medical imaging management system, which is a follow on to one we built in Java. As I'm sure you know, GCM has some nice properties for performance on large objects. Medical imaging studies are large from 512k (1 image) to > 1GB for CT or MRI. If GCM is not in the cards can you suggest another one-pass AES block cipher. I would be willing to create a Pull Request, if you could point me at the right Bouncy Castle sources.