tink-crypto / tink-objc

Obj-C implementation of Tink
https://developers.google.com/tink
Apache License 2.0
11 stars 2 forks source link

Link cpp library with swift #7

Open 24Lathiya opened 2 years ago

24Lathiya commented 2 years ago

I would like to link the Tink cpp library with the swift code. I want to use Streaming AEAD in swift which does not support Obj-C. If anyone has an idea please let me know. Thanks in advance.

tholenst commented 1 year ago

Do you plan to build the Tink CPP library?

Edit: You will have to build the CPP library yourself as we don't provide binary artifacts for CPP at the moment.

We do this with Bazel (and we recently fixed ObjC so it actually compiles everything directly).

tholenst commented 1 year ago

Please reopen this if this is still an issue. AFAICT this should be possible.

24Lathiya commented 10 months ago

Streaming AEAD is not supported in the objective-c language.

I've tried the steps below, but I'm not getting any results.

Extract the Tink source code after downloading it.

Change path in terminal : cd /Users/WsTushar/Downloads/tink-master/cc bazel build -c opt --ios_multi_cpus=armv7,arm64 --xcode_version=15.1 --ios_sdk_version=17.2 //:mac

@tholenst can you please provide brief information about how to do with Bazel commands?

tholenst commented 10 months ago

I'm unfortunately not very familiar with Objective C, so it is difficult for me.

However, you should be able to consider our objective C library as an example: it wraps around C++ and you could do the same. Let's consider an example:

1) To create a Mac in objective C, people use the function at https://github.com/tink-crypto/tink-objc/blob/main/Tink/TINKMacConfig.h#L49, resp. https://github.com/tink-crypto/tink-objc/blob/main/Tink/mac/TINKMacFactory.mm#L35

2) The BUILD.bazel file looks like this: https://github.com/tink-crypto/tink-objc/blob/main/Tink/BUILD.bazel#L535

3) For this, we set up the WORKSPACE using Tink: https://github.com/tink-crypto/tink-objc/blob/main/WORKSPACE#L8C1-L14C1

Does this help?

24Lathiya commented 10 months ago

I think if objective-c library will support Streaming AEAD functionalities then it will be more appreciable.

tholenst commented 10 months ago

Unfortunately, we simply do not have the possibility of adding StreamingAEAD to Tink Objective C at the moment.

StreamingAEAD is a difficult primitive, and designing a good API for it requires a lot of language specific knowledge which we don't have at the moment. I personally am not even willing to reviewe a proposal, since my knowledge of Objective C is just too limited.

24Lathiya commented 8 months ago

@tholenst @morambro Thanks for your reply. I wish StreamingAEAD functionality will be added soon in Tink Objective C.

24Lathiya commented 8 months ago

@tholenst @morambro Are there any other ways to get Streaming AEAD methods in iOS?