To speed up Join Market integration into Fully Noded, I am converting the python PoDLE commitment code into Swift.
Amazing explaination of the code's objective --
https://reyify.com/blog/poodle
Where this code will be used --
https://github.com/Fonta1n3/FullyNoded/pull/191
Reference implementation in Python --
https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/717d3145c517ca3475cc7a6fa65619f69f9a2f5c/jmclient/jmclient/podle.py#L87
Swift Crypto Library for SHA256 --
https://github.com/apple/swift-crypto
Square root extraction modulo a prime --
https://en.wikipedia.org/wiki/Quadratic_residue#Prime_or_prime_power_modulus
Data types used --
https://developer.apple.com/documentation/foundation/data
https://attaswift.github.io/BigInt/Structs/BigInt.html
Helpful Swift Guide --
https://www.codecademy.com/learn/learn-swift/modules/learn-swift-conditionals/cheatsheet