* Naming
* If this is not some OpenPGP standard I follow rule that `DES` should be
upper case as it is abreviation and `Triple` should be camel-case as it
is normal word hence `TripleDES`
* rename `errors2` -> `errorsPGP`
* long lines
* https://github.com/golang/go/wiki/CodeReviewComments#line-length
* I bit improved long lines based on my folding
* reuse type in definition if possible i.e. `a string, b string, c string` -> `a,b,c string`
* `if long_statetent(); err!=nil {` -> `long_statement;↵ if err!=nil {`
* spaces around operators (e.g. `a + b` -> `a+b`)
* removing empty lines on start and end of scope
* comments
* on all exported functions
* start with function name
* import:
* order in alphabet
* separate native, golang.org/x/ and our libs
|
||
|---|---|---|
| armor | ||
| constants | ||
| crypto | ||
| dist/Android | ||
| internal | ||
| models | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| build.sh | ||
| Changelog.md | ||
| glide.lock | ||
| glide.yaml | ||
| notes.txt | ||
| README.md | ||
GopenPGP Wrapper Library
Download/Install
Manually git clone the repository into $GOPATH/src/github.com/ProtonMail/go-pm-crypto.
This library is meant to be used together with https://github.com/ProtonMail/crypto.
Using with Go Mobile
Setup Go Mobile and build/bind the source code:
Go Mobile repo: https://github.com/golang/mobile
Go Mobile wiki: https://github.com/golang/go/wiki/Mobile
-
Install Go:
brew install go -
Install Gomobile:
go get -u golang.org/x/mobile/cmd/gomobile -
Install Gobind:
go install golang.org/x/mobile/cmd/gobind -
Install Android SDK and NDK using Android Studio
-
Set env:
export ANDROID_HOME="/AndroidSDK"(path to your SDK) -
Init gomobile:
gomobile init -ndk /AndroidSDK/ndk-bundle/(path to your NDK) -
Build examples:
gomobile build -target=android #or iosBind examples:
gomobile bind -target ios -o frameworks/name.framework
gomobile bind -target androidThe bind will create framework for iOS and jar&aar files for Android (x86_64 and ARM).
Other notes
This project uses glide to setup vendors.
Interfacing between Go and Swift: https://medium.com/@matryer/tutorial-calling-go-code-from-swift-on-ios-and-vice-versa-with-gomobile-7925620c17a4.
If you use build.sh, you may need to modify the paths in it.