You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-07 17:03:01 +03:00
Bump Rust dependencies
This commit is contained in:
@@ -306,7 +306,7 @@ impl From<EcPrivateParameters> for super::public_parameters::EcPublicParameters
|
||||
mod ec_impls {
|
||||
use elliptic_curve::{
|
||||
sec1::{Coordinates, FromEncodedPoint, ModulusSize, ToEncodedPoint},
|
||||
AffinePoint, Curve, FieldSize, SecretKey,
|
||||
AffinePoint, Curve, SecretKey,
|
||||
};
|
||||
|
||||
use super::{super::JwkEcCurve, EcPrivateParameters};
|
||||
@@ -328,15 +328,15 @@ mod ec_impls {
|
||||
type Error = elliptic_curve::Error;
|
||||
|
||||
fn try_from(value: &EcPrivateParameters) -> Result<Self, Self::Error> {
|
||||
SecretKey::from_be_bytes(&value.d)
|
||||
SecretKey::from_slice(&value.d)
|
||||
}
|
||||
}
|
||||
|
||||
impl<C> From<SecretKey<C>> for EcPrivateParameters
|
||||
where
|
||||
C: Curve + elliptic_curve::ProjectiveArithmetic + JwkEcCurve,
|
||||
C: elliptic_curve::CurveArithmetic + JwkEcCurve,
|
||||
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
|
||||
FieldSize<C>: ModulusSize,
|
||||
C::FieldBytesSize: ModulusSize,
|
||||
{
|
||||
fn from(key: SecretKey<C>) -> Self {
|
||||
(&key).into()
|
||||
@@ -345,16 +345,16 @@ mod ec_impls {
|
||||
|
||||
impl<C> From<&SecretKey<C>> for EcPrivateParameters
|
||||
where
|
||||
C: Curve + elliptic_curve::ProjectiveArithmetic + JwkEcCurve,
|
||||
C: elliptic_curve::CurveArithmetic + JwkEcCurve,
|
||||
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
|
||||
FieldSize<C>: ModulusSize,
|
||||
C::FieldBytesSize: ModulusSize,
|
||||
{
|
||||
fn from(key: &SecretKey<C>) -> Self {
|
||||
let point = key.public_key().to_encoded_point(false);
|
||||
let Coordinates::Uncompressed { x, y } = point.coordinates() else {
|
||||
unreachable!()
|
||||
};
|
||||
let d = key.to_be_bytes();
|
||||
let d = key.to_bytes();
|
||||
EcPrivateParameters {
|
||||
crv: C::CRV,
|
||||
x: x.to_vec(),
|
||||
|
@@ -235,26 +235,26 @@ mod ec_impls {
|
||||
use ecdsa::EncodedPoint;
|
||||
use elliptic_curve::{
|
||||
sec1::{Coordinates, FromEncodedPoint, ModulusSize, ToEncodedPoint},
|
||||
AffinePoint, Curve, FieldBytes, FieldSize, PublicKey,
|
||||
AffinePoint, FieldBytes, PublicKey,
|
||||
};
|
||||
|
||||
use super::{super::JwkEcCurve, EcPublicParameters, JsonWebKeyPublicParameters};
|
||||
|
||||
impl<C> TryFrom<&EcPublicParameters> for PublicKey<C>
|
||||
where
|
||||
C: Curve + elliptic_curve::ProjectiveArithmetic,
|
||||
C: elliptic_curve::CurveArithmetic,
|
||||
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
|
||||
FieldSize<C>: ModulusSize,
|
||||
C::FieldBytesSize: ModulusSize + Unsigned,
|
||||
{
|
||||
type Error = elliptic_curve::Error;
|
||||
fn try_from(value: &EcPublicParameters) -> Result<Self, Self::Error> {
|
||||
let x = value
|
||||
.x
|
||||
.get(..FieldSize::<C>::USIZE)
|
||||
.get(..C::FieldBytesSize::USIZE)
|
||||
.ok_or(elliptic_curve::Error)?;
|
||||
let y = value
|
||||
.y
|
||||
.get(..FieldSize::<C>::USIZE)
|
||||
.get(..C::FieldBytesSize::USIZE)
|
||||
.ok_or(elliptic_curve::Error)?;
|
||||
|
||||
let x = FieldBytes::<C>::from_slice(x);
|
||||
@@ -267,9 +267,9 @@ mod ec_impls {
|
||||
|
||||
impl<C> From<PublicKey<C>> for JsonWebKeyPublicParameters
|
||||
where
|
||||
C: Curve + elliptic_curve::ProjectiveArithmetic + JwkEcCurve,
|
||||
C: elliptic_curve::CurveArithmetic + JwkEcCurve,
|
||||
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
|
||||
FieldSize<C>: ModulusSize,
|
||||
C::FieldBytesSize: ModulusSize,
|
||||
{
|
||||
fn from(key: PublicKey<C>) -> Self {
|
||||
(&key).into()
|
||||
@@ -278,9 +278,9 @@ mod ec_impls {
|
||||
|
||||
impl<C> From<&PublicKey<C>> for JsonWebKeyPublicParameters
|
||||
where
|
||||
C: Curve + elliptic_curve::ProjectiveArithmetic + JwkEcCurve,
|
||||
C: elliptic_curve::CurveArithmetic + JwkEcCurve,
|
||||
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
|
||||
FieldSize<C>: ModulusSize,
|
||||
C::FieldBytesSize: ModulusSize,
|
||||
{
|
||||
fn from(key: &PublicKey<C>) -> Self {
|
||||
Self::Ec(key.into())
|
||||
@@ -289,9 +289,9 @@ mod ec_impls {
|
||||
|
||||
impl<C> From<PublicKey<C>> for EcPublicParameters
|
||||
where
|
||||
C: Curve + elliptic_curve::ProjectiveArithmetic + JwkEcCurve,
|
||||
C: elliptic_curve::CurveArithmetic + JwkEcCurve,
|
||||
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
|
||||
FieldSize<C>: ModulusSize,
|
||||
C::FieldBytesSize: ModulusSize,
|
||||
{
|
||||
fn from(key: PublicKey<C>) -> Self {
|
||||
(&key).into()
|
||||
@@ -300,9 +300,9 @@ mod ec_impls {
|
||||
|
||||
impl<C> From<&PublicKey<C>> for EcPublicParameters
|
||||
where
|
||||
C: Curve + elliptic_curve::ProjectiveArithmetic + JwkEcCurve,
|
||||
C: elliptic_curve::CurveArithmetic + JwkEcCurve,
|
||||
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
|
||||
FieldSize<C>: ModulusSize,
|
||||
C::FieldBytesSize: ModulusSize,
|
||||
{
|
||||
fn from(key: &PublicKey<C>) -> Self {
|
||||
let point = key.to_encoded_point(false);
|
||||
|
Reference in New Issue
Block a user