Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros for C and Java bindings. #327

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0f2b08c
WIP: Add macros; Add prepare_* functions to other platforms; Add gene…
theosirian Nov 10, 2022
1bb4037
Fix didkit calls in swift bindings
theosirian Nov 12, 2022
95dca91
Fix swift tests and dummy method caller
theosirian Nov 12, 2022
bbbca87
Add ios.stamp to main test target in Makefile
theosirian Dec 7, 2022
c24360a
Revert toml formatting changes
sbihel Dec 14, 2022
812c620
Fixes for ssi v0.5 release
cobward Jan 23, 2023
edf1fda
Remove build.sh
cobward Jan 23, 2023
da864a6
gitignore .cargo/
cobward Jan 23, 2023
f365ec4
Adjusted makefile to explicitly use the nightly build when necessary,…
CharlesShuller Feb 3, 2023
2829752
Add context loading functions; Change functions to expect optional co…
theosirian Feb 13, 2023
6aa6719
Update c tests
theosirian Feb 15, 2023
64284c2
Update JSON-LD errors in error enum
theosirian Apr 24, 2023
d7e70af
Remove dependency on macros package from c api (#352)
CharlesShuller May 15, 2023
401ec50
Footgun fix. (#353)
todd-spruceid May 16, 2023
ec59c54
Add default context loader (nil) to calls that require it in didkit s…
CharlesShuller May 17, 2023
e409b4a
4579767343 -- Feat/bump flutter ffi version (#355)
CharlesShuller Jun 2, 2023
32bf74a
Merge branch 'main' into feat/macro-prepare-secp
sbihel Jul 7, 2023
7905588
Remove jni macros
sbihel Jul 12, 2023
d3b2ff4
Fix jni code and java version target
sbihel Jul 14, 2023
03833a9
Use stable flutter in CI
sbihel Jul 17, 2023
04bc04c
Fix flutter version in example
sbihel Jul 17, 2023
5fc6abf
Revert changes to android cargo config
sbihel Jul 17, 2023
13cbaad
Fix indent changes
sbihel Jul 24, 2023
4fb66e1
Updated gradle (#365)
CharlesShuller Sep 5, 2023
0e9b18d
Configure flutter package to work with gradle 8 (#387)
CharlesShuller Jun 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ jobs:
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'dev'
cache: true
channel: 'stable'

- name: Opt out of Dart/Flutter analytics
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
Cargo.lock
__pycache__/
*~
3 changes: 3 additions & 0 deletions cli/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ pub enum KeyGenerateCmd {
Secp256k1,
/// Generate and output a P-256 keypair in JWK format
Secp256r1,
/// Generate and output a P-384 keypair in JWK format
Secp384r1,
}

#[derive(Args)]
Expand Down Expand Up @@ -104,6 +106,7 @@ pub async fn generate(cmd: KeyGenerateCmd) -> Result<()> {
KeyGenerateCmd::Ed25519 => JWK::generate_ed25519().unwrap(),
KeyGenerateCmd::Secp256k1 => JWK::generate_secp256k1().unwrap(),
KeyGenerateCmd::Secp256r1 => JWK::generate_p256().unwrap(),
KeyGenerateCmd::Secp384r1 => JWK::generate_p384().unwrap(),
};
let jwk_str = serde_json::to_string(&jwk).unwrap();
println!("{jwk_str}");
Expand Down
2 changes: 1 addition & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include = [
]

[features]
default = ["w3c", "ed25519", "rsa", "ripemd-160", "eip", "tezos"]
default = ["w3c", "ed25519", "rsa", "ripemd-160", "eip", "tezos", "secp256r1", "secp384r1"]

w3c = ["ssi/w3c", "secp256r1", "secp256k1"]
secp256k1 = ["ssi/secp256k1", "did-method-key/secp256k1"]
Expand Down
12 changes: 7 additions & 5 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ endif

ifeq ($(OS_NAME),darwin)
LIB_NAME=libdidkit.dylib
else
else
LIB_NAME=libdidkit.so
endif

.PHONY: test
test: $(TARGET)/test/c.stamp \
$(TARGET)/test/java.stamp \
$(TARGET)/test/android.stamp \
$(TARGET)/test/ios.stamp \
$(TARGET)/test/flutter.stamp \
$(TARGET)/test/wasm.stamp

Expand Down Expand Up @@ -61,10 +62,10 @@ $(TARGET)/test/java.stamp: \
touch $@

$(TARGET)/jvm/%.class: java/main/%.java | $(TARGET)/jvm
javac $^ -d $(TARGET)/jvm -cp java/main -source 1.7 -target 1.7
javac $^ -d $(TARGET)/jvm -cp java/main -source 1.8 -target 1.8

$(TARGET)/jvm/%.class: java/test/%.java | $(TARGET)/jvm
javac $^ -d $(TARGET)/jvm -cp java/main -source 1.7 -target 1.7
javac $^ -d $(TARGET)/jvm -cp java/main -source 1.8 -target 1.8

$(TARGET)/com_spruceid_DIDKit.h: java/main/com/spruceid/DIDKit.java
javac -h $(TARGET) $<
Expand Down Expand Up @@ -97,8 +98,9 @@ $(TARGET)/test/android.stamp: $(TARGET)/didkit.jar $(ANDROID_LIBS) | $(TARGET)/t

$(TARGET)/%/release/libdidkit.so: $(RUST_SRC)
PATH=$(TOOLCHAIN)/bin:"$(PATH)" \
cargo build --lib --release --target $*
$(TOOLCHAIN)/bin/llvm-strip $@
cargo ndk --target $* build --lib --release
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm not sure about this?

# cargo build --lib --release --target $*
# $(TOOLCHAIN)/bin/llvm-strip $@

## iOS

Expand Down
Binary file modified lib/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions lib/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Aug 05 13:57:57 BRT 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading