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

support num-bigint-dig crates ? #74

Open
CrayfishGo opened this issue Dec 14, 2023 · 0 comments
Open

support num-bigint-dig crates ? #74

CrayfishGo opened this issue Dec 14, 2023 · 0 comments

Comments

@CrayfishGo
Copy link

I used num-bigint-dig instead of num-bigint

In my Cargo.toml

num-bigint = { version = "0.8.1", features = ["i128", "u64_digit"], default-features = false, package = "num-bigint-dig" }

Below is my code

    let cipher = encrypt(data, public_key);
    let x = BigUint::from_bytes_be(&cipher[0..32]);
    let y = BigUint::from_bytes_be(&cipher[32..64]);
    let sm3 = &cipher[64..96];
    let secret = &cipher[96..];
    yasna::construct_der(|writer| {
        writer.write_sequence(|writer| {
            writer.next().write_biguint(&x);
            writer.next().write_biguint(&y);
            writer.next().write_bytes(&sm3);
            writer.next().write_bytes(&secret);
        });
    })

But the method write_biguint dose not support num-bigint-dig::BigUnit.

So How to make it work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant