Fix trait ambiguity in SealedScalar trait impl
The FieldExt and SealedScalar traits have a method with the same name, and the latter's is implemented for pallas::Scalar as a call to the former's implementation. However, FieldExt was not in scope. In debug mode, Rust was calling SealedScalar's method recursively, causing a stack overflow. However in release mode, Rust was able to find the FieldExt method fine (and does not appear to just be optimizing out the code, as the result is valid). To ensure this does not occur, we now explicitly use the FieldExt method implementation.
This commit is contained in:
parent
0627048eba
commit
b91559345c
|
@ -49,7 +49,7 @@ impl super::Binding for Binding {}
|
||||||
|
|
||||||
impl private::SealedScalar for pallas::Scalar {
|
impl private::SealedScalar for pallas::Scalar {
|
||||||
fn from_bytes_wide(bytes: &[u8; 64]) -> Self {
|
fn from_bytes_wide(bytes: &[u8; 64]) -> Self {
|
||||||
pallas::Scalar::from_bytes_wide(bytes)
|
<pallas::Scalar as pasta_curves::arithmetic::FieldExt>::from_bytes_wide(bytes)
|
||||||
}
|
}
|
||||||
fn from_raw(val: [u64; 4]) -> Self {
|
fn from_raw(val: [u64; 4]) -> Self {
|
||||||
pallas::Scalar::from_raw(val)
|
pallas::Scalar::from_raw(val)
|
||||||
|
|
Loading…
Reference in New Issue