Code Monkey home page Code Monkey logo

zkgroup's Introduction

ZKGroup has moved to libsignal, under the crate name zkgroup, at version 0.9.0.

zkgroup's People

Contributors

cbrune-signal avatar dennisameling avatar ehrenkret-signal avatar gdg-signal avatar imperiopolis avatar indutny-signal avatar jim-signal avatar jimio-signal avatar jrose-signal avatar trevp-signal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zkgroup's Issues

Can't compile native library since V0.8.0

signal-cli requires the native libzkgroup.so, so to create a distribution for Raspberry (armv7l) I typically do

git clone [email protected]:signalapp/zkgroup.git
cd zkgroup/ffi/java
make

This worked fine with all 0.7.x version, but with every branch starting from 0.8.x I'm getting an error:

....
Compiling cfg-if v1.0.0
thread 'rustc' panicked at 'called Result::unwrap() on an Err value: "Provided allocation has wrong size for slot count 65536"', compiler/rustc_metadata/src/rmeta/decoder.rs:263:29

Any idea how to fix this?

Compiling on raspberry pi fails

Just checked out latest master and I was not able to compile on my Raspberry Pi (raspbian):

$ make libzkgroup
[...]
  Downloaded syn v1.0.16              
  Downloaded unicode-xid v0.2.0                 
   Compiling proc-macro2 v1.0.9
   Compiling unicode-xid v0.2.0                                                
   Compiling typenum v1.11.2                                         
   Compiling libc v0.2.67
   Compiling syn v1.0.16
   Compiling byteorder v1.3.4
   Compiling getrandom v0.1.14
   Compiling serde v1.0.106  
   Compiling byte-tools v0.3.1
   Compiling same-file v1.0.6
   Compiling version_check v0.9.1
   Compiling memchr v2.3.3 
   Compiling cfg-if v0.1.10
   Compiling subtle v1.0.0    
   Compiling void v1.0.2      
   Compiling opaque-debug v0.2.3
   Compiling log v0.4.8 
   Compiling subtle v2.2.2 
   Compiling either v1.5.3            
   Compiling zeroize v1.1.0
   Compiling fake-simd v0.1.2
   Compiling ascii v0.9.3         
error[E0658]: use of unstable library feature 'alloc': this library is unlikely to be stabilized in its current form or name (see issue #27783)                                                                                              
   --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/zeroize-1.1.0/src/lib.rs:209:1
    |                           
209 | extern crate alloc;  
    | ^^^^^^^^^^^^^^^^^^^
                       
   Compiling cesu8 v1.1.0
   Compiling jni-sys v0.3.0  
error: aborting due to previous error
                         
For more information about this error, try `rustc --explain E0658`.
error: Could not compile `zeroize`.
warning: build failed, waiting for other jobs to finish...
error: build failed      
make: *** [Makefile:41: libzkgroup] Error 101
2 pi@matrixpi:~/zkgroup$

'RUSTFLAGS' is not recognized as an internal or external command,

When trying to compile on windows with "C:\Program Files (x86)\GnuWin32\bin\make.exe" libzkgroup I get this:

RUSTFLAGS='-C link-arg=-s' cargo build --release
'RUSTFLAGS' is not recognized as an internal or external command,
operable program or batch file.
make: *** [libzkgroup] Fout 1

How do I fix that?

All FFI symbols are included in all targets

Currently, all FFI interfaces source from the same dynamic library. This means that all FFI symbols are exposed to all targets.

To facilitate this, zkgroup/rust/Cargo.toml includes a crate-type statement:

crate-type = [ "staticlib", "cdylib", "rlib"]

This also implies that any other consumer of zkgroup will build all three library types, which is a bit of a waste for (pure) Rust consumers. It also always pulls in JNI as dependency, which is a waste on non-Android/Java devices.

I would like to propose the following:

  • Create one crate for every FFI
  • Get rid of the ffi module in zkgroup, only exposing a pure-Rust interface.
  • Get rid of the crate-type in the main library, instead exposing the crate-type only in the FFI crates.

This should leave us with a clean Rust-only main library, exposing the naughty FFI-bits in their respective crates.

What do you think about this proposal? I am willing to implement this, if I have a high probability of it getting merged. Otherwise, I probably have to create a very lame fork that comments out the crate-type :'-)

Can't compile because `crypto-mac` = "^0.7" is missing

Apparently, the crypto-mac crate version 0.7 is now missing from crates.io and it prevents from compiling any project depending on zkgroup.

The real dependency is poksho but it doesn't seem maintained nor secure (as said in their readme)

Do you have any idea on what to do?

Here is my cargo command output :

user@linux [~/signal/test] $ cargo build
    Blocking waiting for file lock on package cache
    Updating crates.io index
    Updating git repository `https://github.com/whisperfish/libsignal-service-rs`
    Updating git repository `https://github.com/signalapp/libsignal-client`
    Updating git repository `https://github.com/signalapp/zkgroup`
    Updating git repository `https://github.com/signalapp/curve25519-dalek.git`
    Updating git repository `https://github.com/signalapp/curve25519-dalek.git`
    Updating git repository `https://github.com/signalapp/poksho.git`
error: failed to select a version for the requirement `crypto-mac = "^0.7"`
candidate versions found which didn't match: 0.11.1, 0.11.0, 0.10.1, ...
location searched: crates.io index
required by package `hmac v0.7.1`
    ... which is depended on by `poksho v0.7.0 (https://github.com/signalapp/poksho.git?tag=v0.7.0#8bb8c61c)`
    ... which is depended on by `zkgroup v0.7.3 (https://github.com/signalapp/zkgroup?tag=v0.7.3#197c382e)`
    ... which is depended on by `libsignal-service v0.1.0 (https://github.com/whisperfish/libsignal-service-rs#7d6fce5f)`
    ... which is depended on by `libsignal-service-hyper v0.1.0 (https://github.com/whisperfish/libsignal-service-rs#7d6fce5f)`
    ... which is depended on by `presage v0.1.0 (/home/user/signal/presage)`
    ... which is depended on by `test v0.1.0 (/home/user/signal/test)`

Compilation failed on M1 MacBook

Platform

M1 MacBook

Steps to reproduce

Compile the library:
make libzkgroup

Error message

RUSTFLAGS='-C link-arg=-s' cargo build --release
info: syncing channel updates for '1.41.1-aarch64-apple-darwin'
info: latest update on 2020-02-27, rust version 1.41.1 (f3e1a954d 2020-02-24)
error: target 'aarch64-apple-darwin' not found in channel.  Perhaps check https://doc.rust-lang.org/nightly/rustc/platform-support.html for available targets
make: *** [libzkgroup] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.