mirror of
https://github.com/BitskiCo/jwk-rs
synced 2024-11-24 21:09:22 +00:00
Upgrade p256
This commit is contained in:
parent
b63f50a488
commit
49fd7f57c4
@ -15,7 +15,7 @@ bitflags = "1.2"
|
|||||||
generic-array = "0.14"
|
generic-array = "0.14"
|
||||||
jsonwebtoken = { version = "8.0", optional = true }
|
jsonwebtoken = { version = "8.0", optional = true }
|
||||||
num-bigint = { version = "0.4", optional = true }
|
num-bigint = { version = "0.4", optional = true }
|
||||||
p256 = { version = "0.9", optional = true, features = ["arithmetic"] }
|
p256 = { version = "0.10", optional = true, features = ["arithmetic"] }
|
||||||
rand = { version = "0.8", optional = true }
|
rand = { version = "0.8", optional = true }
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
@ -417,7 +417,7 @@ impl Key {
|
|||||||
let sk = elliptic_curve::SecretKey::random(&mut rand::thread_rng());
|
let sk = elliptic_curve::SecretKey::random(&mut rand::thread_rng());
|
||||||
let sk_scalar = p256::Scalar::from(&sk);
|
let sk_scalar = p256::Scalar::from(&sk);
|
||||||
|
|
||||||
let pk = p256::ProjectivePoint::generator() * sk_scalar;
|
let pk = p256::ProjectivePoint::GENERATOR * sk_scalar;
|
||||||
let pk_bytes = &pk
|
let pk_bytes = &pk
|
||||||
.to_affine()
|
.to_affine()
|
||||||
.to_encoded_point(false /* compress */)
|
.to_encoded_point(false /* compress */)
|
||||||
|
Loading…
Reference in New Issue
Block a user