Should cryptography be solely or partially reliant on CommonCrypto/libcrypto/the platform's preferred library? And if so, how are algorithms outside of the platform's support treated?
Does cryptography need to be implemented in Swift or C, or is this decided on a case-by-case basis?
I think that some algorithms should rely on hardware accelerated chips such as AES-NI. Therefore, the implementation should be either written using the platform's preferred library.
I believe that other tools, such as MD5 and the SHA series of hashes should be written in Swift so that we can provide a good set of APIs without many any performance sacrifice that the C interop or wrapper may have.
The world is still full of old technology. Do "ancient" algorithms such as MD4 be implemented in this project either now or later down the line?
I think that these algorithms should be supported, although we may consider adding them to an "DeprecatedCrypto" namespace to prevent people from using these without understanding that they're old and unsafe.
Should the API work with pointers, (Contiguous)Arrays, Collections, Strings or a combination of these?
I think that, unlike CryptoSwift, the raw APIs should be written using pointers. This is a huge game changer when it comes to performance as I have proven with a few of my PRs and own cryptographic implementations as found in the older Vapor Crypto project.
This does not mean that I believe the other types should be excluded. CryptoSwift provides a really nice and useful API for common cryptographic use cases. Therefore the implementation should, in my opinion, be closer to a C library. But the public APIs that CryptoSwift exposes are really good.
Would the API support common representations of information such as hexadecimal and Base64?
Seeing that Base64 is very common when using encryption, I think so. Although I don't have a strong opinion on this.
Does an algorithm such as a hash function be a struct or a class ?
Definitely a struct. First of all there's an obvious performance difference. And aside from that, classes could be shared between multiple threads and cause trouble when trying to reuse the same class for a hash. This could be problematic to the unaware programmer.
What kind of features should be implemented and which should not. Why do you think so?
I think for the current scope, the goal should be to implement cryptographic primitives. This way there are fewer subjective decisions to be made and the scope is well defined.