Git Product home page Git Product logo

class's Introduction

Class

Rust library for building IQC: cryptography based on class groups (Cl) of imaginary quadratic orders.

Background

Cls are easy to generate. Their most interesting and useful property is that finding the group order is considered hard. In recent years we see more and more cryptographic primitives instantiated using Cls. We recommend [6,7,8] to learn more about Cls in practice.

Group Element Representation

Group Element can be represented as (a,b,c) or (a,b,ฮ”) triple (correspond to BinaryQF and ABDeltaTriple structures respectively). We also support compression from the paper (see BinaryQFCompressed structure).

Primitives

Contributions for implementing new primitives or improving existing ones are welcome. See open issues first. Existing primitives can be found in the primitives folder :

  1. PoE: Proof of exponantiation: The prover can efficiently convince a verifier that a large exponentiation was done correctly. Statement is (x,u,w), verifier accept if w = u^x.

  2. Polynomial commitment: The following algorithms are implemented ([1] subsection 4.2 and 4.3):

    • Setup: generate public parameters
    • Commit: commit to a polynomial
    • Open: open and verify a commitment
    • Encode: stand alone code to encode a polynomial as an integer
    • Decode: converts integer to a unique polynomial
    • Eval_prover: NI proof that y = f(z) for a committed polynomial f()
    • Eval_verify: NI verifier for eval_proof.
  3. VDF: Verifiable Delay Function. Based on Wesolowski protocol [4,5]. The following interface is implemented. The same setup can be used for multiple proofs. time(Eval) >> time(Verify):

    • Setup: generate public key
    • Eval: using the public key generate a vdf statement (y,pi)
    • Verify: verify the statement using the public key
  4. Encryption scheme: Linearly homomorphic encryption scheme and a ZK proof. interface includes: Keygen, Encrypt, Decrypt, Prove, Verify. The encryption scheme is taken from [2] Theorem 2. The zero knowledge proof is a non interactive version of the proof given in [3] figure 8. The proof Statement includes a public elliptic curve point Q = xG and proves that a given ciphertext is encrypts x. The ZK proof has another, experimental variant. This construcction is in use in 2P-ECDSA. To make to proof more efficient we use the LCM trick. see dl_cl_lcm.rs.

Build

Use Cargo build.

PARI build

The library uses bindings to PARI c library. Running Cargo build for the first time will take PARI from the depend folder and install it on the machine. It was tested on MacOS and Linux. If you encounter a problem with installation of PARI, please open an issue and try to install it manually. Bindings are generated automatically on the fly which might slow down the build procces by a few seconds.

Test

Tests in rust are multi-thearded if possible. However, PARI configuration supports a single thread. Therefore to make sure all tests run with defined behaviour please use cargo test -- --test-threads=1.

Usage

We use tests to demonstrate correctness of each primitive: At the end of each primitive .rs file there is a test to show the correct usage of the primitive. There is usually one test or more to show soundness of the implementation, i.e. not knowing a witness will fail a PoK. For all tests we assume 128bit security (conservatively translates into 1600bit Discriminant).

Security

Security assumptions can differ between primitives and are discussed in the relevant papers. They should be understood well before using any primitive. The code is not audited and we did not attempted to make it constant time. Do not use this library in production system.

Contact

Feel free to reach out or join ZenGo X Telegram for discussions on code and research.

Hall of Fame

We would like to thank Fabien Laguillaumie, Guilhem Castagnos, Ida Tucker, Claudio Orlandi and Ben Fisch for their support and on-going help. We extend our gratitude to CoBloX research lab and Lloyd Fournier for contributing code, making this library more secure and fast.

References

[1] https://eprint.iacr.org/2019/1229.pdf

[2] https://eprint.iacr.org/2018/791.pdf

[3] https://eprint.iacr.org/2019/503.pdf

[4] https://eprint.iacr.org/2018/623.pdf

[5] https://eprint.iacr.org/2018/712.pdf

[6] Book: Binary quadratic forms: An algorithmic approach

[7] https://www.michaelstraka.com/posts/classgroups

[8] https://github.com/Chia-Network/vdf-competition/blob/master/classgroups.pdf

class's People

Contributors

amanusk avatar elichai avatar haoyuathz avatar knarz avatar leontiadzen avatar llfourn avatar omershlo avatar tmpfs 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  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

class's Issues

Create a a utility module

There are many utilities function in the library and the encryption primitive. Might make the code more clean to put them all in a single place.

optimize compose and reduce

based on remark from reviewers:

It seems to us that you are using some unoptimized functions for composition and reduction that we wrote mainly for experimenting. For example the reduce function in https://github.com/KZen-networks/class-groups/blob/master/src/lib.rs outputs the reduction matrix which is not needed for the encryption scheme. Using directly the gmul pari C function will probably be more efficient to compute composition of two forms followed by a reduction.

Basically - gmul should be used directly in compose function

Memory management : pari_init

At the moment, pari_init is called with constant 1Mb of stack memory for each function that requires the binding to class group function.

optimize 1: remove pari_init when unnecessary
optimize 2: minimize allocated stack size
optimize 3: Make the stack size dynamic based on inputs.

Build fails [Linux]

When building on Linux, the build fails:

error[E0428]: the name `FP_NAN` is defined multiple times
    --> /home/amanusk/rust/class-groups/target/debug/build/class_group-ada77e612876b7ac/out/bindings.rs:8839:1
     |
448  | pub const FP_NAN: u32 = 0;
     | -------------------------- previous definition of the value `FP_NAN` here
...
8839 | pub const FP_NAN: _bindgen_ty_13 = 0;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_NAN` redefined here
     |
     = note: `FP_NAN` must be defined only once in the value namespace of this module

error[E0428]: the name `FP_INFINITE` is defined multiple times
    --> /home/amanusk/rust/class-groups/target/debug/build/class_group-ada77e612876b7ac/out/bindings.rs:8840:1
     |
449  | pub const FP_INFINITE: u32 = 1;
     | ------------------------------- previous definition of the value `FP_INFINITE` here
...
8840 | pub const FP_INFINITE: _bindgen_ty_13 = 1;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_INFINITE` redefined here
     |
     = note: `FP_INFINITE` must be defined only once in the value namespace of this module

error[E0428]: the name `FP_ZERO` is defined multiple times
    --> /home/amanusk/rust/class-groups/target/debug/build/class_group-ada77e612876b7ac/out/bindings.rs:8841:1
     |
450  | pub const FP_ZERO: u32 = 2;
     | --------------------------- previous definition of the value `FP_ZERO` here
...
8841 | pub const FP_ZERO: _bindgen_ty_13 = 2;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_ZERO` redefined here
     |
     = note: `FP_ZERO` must be defined only once in the value namespace of this module

error[E0428]: the name `FP_SUBNORMAL` is defined multiple times
    --> /home/amanusk/rust/class-groups/target/debug/build/class_group-ada77e612876b7ac/out/bindings.rs:8842:1
     |
451  | pub const FP_SUBNORMAL: u32 = 3;
     | -------------------------------- previous definition of the value `FP_SUBNORMAL` here
...
8842 | pub const FP_SUBNORMAL: _bindgen_ty_13 = 3;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_SUBNORMAL` redefined here
     |
     = note: `FP_SUBNORMAL` must be defined only once in the value namespace of this module

error[E0428]: the name `FP_NORMAL` is defined multiple times
    --> /home/amanusk/rust/class-groups/target/debug/build/class_group-ada77e612876b7ac/out/bindings.rs:8843:1
     |
452  | pub const FP_NORMAL: u32 = 4;
     | ----------------------------- previous definition of the value `FP_NORMAL` here
...
8843 | pub const FP_NORMAL: _bindgen_ty_13 = 4;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_NORMAL` redefined here
     |
     = note: `FP_NORMAL` must be defined only once in the value namespace of this module

Seems that bindgen is generating some duplicate bindings then fails to build.

I was able to build by updating build.rs to this:
https://github.com/amanusk/class-groups/blob/fix-duplicate-bindings/build.rs
Need to make sure this does not break anything

Adjust for configurable security

Cryptanalysis of class groups is evolving. There should be a simple way for a consumer of the library to configure the required security level of each protocol. Usually this is a risky parameter to expose however in the specific case here it is wise because it might be that some user will want to be more conservative than others or that some new result will require a quick change.

Perhaps a feature is the best way to do it.

Improve build process

Currently the build.rs file will re-install pari library each time we cargo build. This is taking very long time and unnecessary if pari is already installed.
Find a way to change build.rs to check if pari is already installed and if it does - skip installation.

Putting class into dependencies

Hi, I would like to use the class library in my program, so I put the line in Cargo.toml under [dependencies]:

class = { git = "https://github.com/ZenGo-X/class", tag = "v0.5.2"}

However, it returns a error:

error: no matching package named `class` found
location searched: https://github.com/ZenGo-X/class?tag=v0.5.2

May I ask for a kind suggestion to what I did?

Thank you very much!

Eliminate Pari compose

At the moment the library is using binding to c library pari to compose two quadratic forms. It is required to implement composition native in rust and use it instead.

Test results are causing errors

Description:
Running the tests seems to cause occasional errors. Some times the tests pass succesfully (as in the first example) and sometimes end with various errors, which seem related to PARI memory management.

System: Ubuntu 16.04
How to reproduce: cargo test --lib

Each run result is separated by -------------------------------------

test primitives::tests::test_encryption ... ok

test result: ok. 116 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

----------------------------------------------------------


test tests::test_qf_to_pari_qf_to_qf ... ok
  ***   non-existent component: index > 13846213593583687105  ***   Error in the PARI system. End of program.
error: test failed, to rerun pass '--lib'


----------------------------------------------------------

test tests::test_qf_to_pari_qf_to_qf ... ok
  ***   the PARI stack overflows !
  current stack size: 10000000 (9.537 Mbytes)
  [hint] set 'parisizemax' to a non-zero value in your GPRC
  ***   Error in the PARI system. End of program.
error: test failed, to rerun pass '--lib'

---------------------------------------------------------

*** Error in `/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8': double free or corruption (!prev): 0x00007f1fa8016c60 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f1fad0ce7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f1fad0d737a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f1fad0db53c]
/home/amanusk/.local/lib/libpari-gmp.so.6(initprimetable+0x52)[0x7f1fae54cda2]
/home/amanusk/.local/lib/libpari-gmp.so.6(pari_init_primes+0x9)[0x7f1fae54d8c9]
/home/amanusk/.local/lib/libpari-gmp.so.6(pari_init_opts+0x3e8)[0x7f1fae5608a8]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(+0xa54a7)[0x55fb485344a7]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(+0xa29e6)[0x55fb485319e6]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(+0xa953a)[0x55fb4853853a]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(+0x3297e)[0x55fb484c197e]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(+0xb4aaf)[0x55fb48543aaf]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(__rust_maybe_catch_panic+0x1a)[0x55fb485a269a]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(+0xcefce)[0x55fb4855dfce]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(+0xaa365)[0x55fb48539365]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(+0xae515)[0x55fb4853d515]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(__rust_maybe_catch_panic+0x1a)[0x55fb485a269a]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(+0xaea82)[0x55fb4853da82]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(+0x1060cf)[0x55fb485950cf]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8(+0x112dd0)[0x55fb485a1dd0]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f1fad63e6ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f1fad15e41d]
======= Memory map: ========
55fb4848f000-55fb485f6000 r-xp 00000000 08:01 808940                     /home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8
55fb487f5000-55fb4880b000 r--p 00166000 08:01 808940                     /home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8
55fb4880b000-55fb4880c000 rw-p 0017c000 08:01 808940                     /home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8
55fb499b9000-55fb499da000 rw-p 00000000 00:00 0                          [heap]
7f1f98000000-7f1f98021000 rw-p 00000000 00:00 0 
7f1f98021000-7f1f9c000000 ---p 00000000 00:00 0 
7f1f9dd2b000-7f1f9f9c9000 rw-p 00000000 00:00 0 
7f1f9f9c9000-7f1f9f9d4000 r-xp 00000000 08:01 5376190                    /lib/x86_64-linux-gnu/libnss_files-2.23.so
7f1f9f9d4000-7f1f9fbd3000 ---p 0000b000 08:01 5376190                    /lib/x86_64-linux-gnu/libnss_files-2.23.so
7f1f9fbd3000-7f1f9fbd4000 r--p 0000a000 08:01 5376190                    /lib/x86_64-linux-gnu/libnss_files-2.23.so
7f1f9fbd4000-7f1f9fbd5000 rw-p 0000b000 08:01 5376190                    /lib/x86_64-linux-gnu/libnss_files-2.23.so
7f1f9fbd5000-7f1f9fbdb000 rw-p 00000000 00:00 0 
7f1f9fbdb000-7f1f9fbe6000 r-xp 00000000 08:01 5376178                    /lib/x86_64-linux-gnu/libnss_nis-2.23.so
7f1f9fbe6000-7f1f9fde5000 ---p 0000b000 08:01 5376178                    /lib/x86_64-linux-gnu/libnss_nis-2.23.so
7f1f9fde5000-7f1f9fde6000 r--p 0000a000 08:01 5376178                    /lib/x86_64-linux-gnu/libnss_nis-2.23.so
7f1f9fde6000-7f1f9fde7000 rw-p 0000b000 08:01 5376178                    /lib/x86_64-linux-gnu/libnss_nis-2.23.so
7f1f9fde7000-7f1f9fdfd000 r-xp 00000000 08:01 5376188                    /lib/x86_64-linux-gnu/libnsl-2.23.so
7f1f9fdfd000-7f1f9fffc000 ---p 00016000 08:01 5376188                    /lib/x86_64-linux-gnu/libnsl-2.23.so
7f1f9fffc000-7f1f9fffd000 r--p 00015000 08:01 5376188                    /lib/x86_64-linux-gnu/libnsl-2.23.so
7f1f9fffd000-7f1f9fffe000 rw-p 00016000 08:01 5376188                    /lib/x86_64-linux-gnu/libnsl-2.23.so
7f1f9fffe000-7f1fa0000000 rw-p 00000000 00:00 0 
7f1fa0000000-7f1fa0021000 rw-p 00000000 00:00 0 
7f1fa0021000-7f1fa4000000 ---p 00000000 00:00 0 
7f1fa4000000-7f1fa4028000 rw-p 00000000 00:00 0 
7f1fa4028000-7f1fa8000000 ---p 00000000 00:00 0 
7f1fa8000000-7f1fa8029000 rw-p 00000000 00:00 0 
7f1fa8029000-7f1fac000000 ---p 00000000 00:00 0 
7f1fac0bf000-7f1fac140000 rw-p 00000000 00:00 0 
7f1fac140000-7f1fac148000 r-xp 00000000 08:01 5376255                    /lib/x86_64-linux-gnu/libnss_compat-2.23.so
7f1fac148000-7f1fac347000 ---p 00008000 08:01 5376255                    /lib/x86_64-linux-gnu/libnss_compat-2.23.so
7f1fac347000-7f1fac348000 r--p 00007000 08:01 5376255                    /lib/x86_64-linux-gnu/libnss_compat-2.23.so
7f1fac348000-7f1fac349000 rw-p 00008000 08:01 5376255                    /lib/x86_64-linux-gnu/libnss_compat-2.23.so
7f1fac349000-7f1fac34a000 ---p 00000000 00:00 0 
7f1fac34a000-7f1fac54a000 rw-p 00000000 00:00 0 
7f1fac54a000-7f1fac54b000 ---p 00000000 00:00 0 
7f1fac54b000-7f1fac74b000 rw-p 00000000 00:00 0 
7f1fac74b000-7f1fac74c000 ---p 00000000 00:00 0 
7f1fac74c000-7f1fac94c000 rw-p 00000000 00:00 0 
7f1fac94c000-7f1fac94d000 ---p 00000000 00:00 0 
7f1fac94d000-7f1facb4d000 rw-p 00000000 00:00 0
7f1facb4d000-7f1facb4e000 ---p 00000000 00:00 0
7f1facb4e000-7f1facd4e000 rw-p 00000000 00:00 0
7f1facd4e000-7f1face56000 r-xp 00000000 08:01 5376462                    /lib/x86_64-linux-gnu/libm-2.23.so
7f1face56000-7f1fad055000 ---p 00108000 08:01 5376462                    /lib/x86_64-linux-gnu/libm-2.23.so
7f1fad055000-7f1fad056000 r--p 00107000 08:01 5376462                    /lib/x86_64-linux-gnu/libm-2.23.so
7f1fad056000-7f1fad057000 rw-p 00108000 08:01 5376462                    /lib/x86_64-linux-gnu/libm-2.23.so
7f1fad057000-7f1fad217000 r-xp 00000000 08:01 5376208                    /lib/x86_64-linux-gnu/libc-2.23.so
7f1fad217000-7f1fad417000 ---p 001c0000 08:01 5376208                    /lib/x86_64-linux-gnu/libc-2.23.so
7f1fad417000-7f1fad41b000 r--p 001c0000 08:01 5376208                    /lib/x86_64-linux-gnu/libc-2.23.so
7f1fad41b000-7f1fad41d000 rw-p 001c4000 08:01 5376208                    /lib/x86_64-linux-gnu/libc-2.23.so
7f1fad41d000-7f1fad421000 rw-p 00000000 00:00 0
7f1fad421000-7f1fad437000 r-xp 00000000 08:01 5378575                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f1fad437000-7f1fad636000 ---p 00016000 08:01 5378575                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f1fad636000-7f1fad637000 rw-p 00015000 08:01 5378575                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f1fad637000-7f1fad64f000 r-xp 00000000 08:01 5376173                    /lib/x86_64-linux-gnu/libpthread-2.23.so
7f1fad64f000-7f1fad84e000 ---p 00018000 08:01 5376173                    /lib/x86_64-linux-gnu/libpthread-2.23.so
7f1fad84e000-7f1fad84f000 r--p 00017000 08:01 5376173                    /lib/x86_64-linux-gnu/libpthread-2.23.so
7f1fad84f000-7f1fad850000 rw-p 00018000 08:01 5376173                    /lib/x86_64-linux-gnu/libpthread-2.23.so
7f1fad850000-7f1fad854000 rw-p 00000000 00:00 0
7f1fad854000-7f1fad85b000 r-xp 00000000 08:01 5376158                    /lib/x86_64-linux-gnu/librt-2.23.so
7f1fad85b000-7f1fada5a000 ---p 00007000 08:01 5376158                    /lib/x86_64-linux-gnu/librt-2.23.so
7f1fada5a000-7f1fada5b000 r--p 00006000 08:01 5376158                    /lib/x86_64-linux-gnu/librt-2.23.so
7f1fada5b000-7f1fada5c000 rw-p 00007000 08:01 5376158                    /lib/x86_64-linux-gnu/librt-2.23.so
7f1fada5c000-7f1fada5f000 r-xp 00000000 08:01 5376163                    /lib/x86_64-linux-gnu/libdl-2.23.so
7f1fada5f000-7f1fadc5e000 ---p 00003000 08:01 5376163                    /lib/x86_64-linux-gnu/libdl-2.23.so
7f1fadc5e000-7f1fadc5f000 r--p 00002000 08:01 5376163                    /lib/x86_64-linux-gnu/libdl-2.23.so
7f1fadc5f000-7f1fadc60000 rw-p 00003000 08:01 5376163                    /lib/x86_64-linux-gnu/libdl-2.23.so
7f1fadc60000-7f1fadcdf000 r-xp 00000000 08:01 3154632                    /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7f1fadcdf000-7f1fadede000 ---p 0007f000 08:01 3154632                    /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7f1fadede000-7f1fadedf000 r--p 0007e000 08:01 3154632                    /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7f1fadedf000-7f1fadee0000 rw-p 0007f000 08:01 3154632                    /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7f1fadee0000-7f1fae757000 r-xp 00000000 08:01 808789                     /home/amanusk/.local/lib/libpari-gmp.so.2.11.2
7f1fae757000-7f1fae957000 ---p 00877000 08:01 808789                     /home/amanusk/.local/lib/libpari-gmp.so.2.11.2
7f1fae957000-7f1fae959000 r--p 00877000 08:01 808789                     /home/amanusk/.local/lib/libpari-gmp.so.2.11.2
7f1fae959000-7f1fae985000 rw-p 00879000 08:01 808789                     /home/amanusk/.local/lib/libpari-gmp.so.2.11.2
7f1fae985000-7f1fae9a4000 rw-p 00000000 00:00 0
7f1fae9a4000-7f1fae9ca000 r-xp 00000000 08:01 5376165                    /lib/x86_64-linux-gnu/ld-2.23.so
7f1faea10000-7f1faeb99000 rw-p 00000000 00:00 0
7f1faebbe000-7f1faebc2000 rw-p 00000000 00:00 0
7f1faebc3000-7f1faebc9000 rw-p 00000000 00:00 0
7f1faebc9000-7f1faebca000 r--p 00025000 08:01 5376165                    /lib/x86_64-linux-gnu/ld-2.23.so
7f1faebca000-7f1faebcb000 rw-p 00026000 08:01 5376165                    /lib/x86_64-linux-gnu/ld-2.23.so
7f1faebcb000-7f1faebcc000 rw-p 00000000 00:00 0
7fff8945c000-7fff8947e000 rw-p 00000000 00:00 0                          [stack]
7fff894ce000-7fff894d1000 r--p 00000000 00:00 0                          [vvar]
7fff894d1000-7fff894d3000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
error: process didn't exit successfully: `/home/amanusk/rust/class-groups/target/debug/deps/class_group-9746dfa0336483d8` (signal: 6, SIGABRT: process abort signal)

BigInt to GEN: add support for variable size BigInt

bn_to_gen is a function that takes gmp bigint and transform it into pari native type GEN. Currently The max size fo the BigInt is around 1000bits. We need to change this function to support all sized of bigints.

build error

Compiling class_group v0.1.4 (/home/kigawas/class-groups)
error: failed to run custom build command for `class_group v0.1.4 (/home/kigawas/class-groups)`

Caused by:
  process didn't exit successfully: `/home/kigawas/class-groups/target/debug/build/class_group-92000dd62ca4c66a/build-script-build` (exit code: 101)
--- stderr
wrapper.h:2:10: fatal error: 'pari/pari.h' file not found
wrapper.h:2:10: fatal error: 'pari/pari.h' file not found, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', src/libcore/result.rs:1084:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

ubuntu 18.04, llvm 8

Eliminate Pari Primeform

At the moment the library is using binding to c library pari to compute Primeform. It is required to implement Primeform native in rust and use it instead. Buchmann, J. and Vollmer, U. (2007). Binary quadratic forms: An algorithmic approach. page 41 provides the algorithm

Expend supported OSs and distributions

class-groups lib has been tested on MacOS and specific linux distro.
Please test it with your OS and let us know if it works or what kind of errors you are getting.

Missing License

Hi,

I noticed that this repository does not contain a license (except the third-party pari code). Would you consider adding a license file stating under which conditions this code may be used?

(Since you depend on PARI which is published under the GNU GPL v2, I would assume that this library counts as derived work and, therefore, must also be published under the GPL. I am not a license expert though.)

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.