update p256 to 0.13.0 (#273)

* Update p256 requirement from 0.12.0 to 0.13.0

Updates the requirements on [p256](https://github.com/RustCrypto/elliptic-curves) to permit the latest version.
- [Release notes](https://github.com/RustCrypto/elliptic-curves/releases)
- [Commits](https://github.com/RustCrypto/elliptic-curves/compare/primeorder/v0.12.0...p256/v0.13.0)

---
updated-dependencies:
- dependency-name: p256
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* update p256 to 0.13.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
Conrado Gouvea 2023-03-10 21:59:49 -03:00 committed by GitHub
parent 41fec092a6
commit 7c8553bf10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ description = "A Schnorr signature scheme over the NIST P-256 curve that support
features = ["nightly"]
[dependencies]
p256 = { version = "0.12.0", features = ["hash2curve"] }
p256 = { version = "0.13.0", features = ["hash2curve"] }
frost-core = { path = "../frost-core", features = ["test-impl"] }
rand_core = "0.6"
sha2 = "0.10.2"

View File

@ -91,7 +91,7 @@ impl Group for P256Group {
type Serialization = [u8; 33];
fn cofactor() -> <Self::Field as Field>::Scalar {
Scalar::one()
Scalar::ONE
}
fn identity() -> Self::Element {
@ -104,7 +104,7 @@ impl Group for P256Group {
fn serialize(element: &Self::Element) -> Self::Serialization {
let mut fixed_serialized = [0; 33];
let serialized_point = element.to_affine().to_encoded_point(true);
let serialized_point = element.to_encoded_point(true);
let serialized = serialized_point.as_bytes();
// Sanity check; either it takes all bytes or a single byte (identity).
assert!(serialized.len() == fixed_serialized.len() || serialized.len() == 1);
@ -151,7 +151,7 @@ fn hash_to_array(inputs: &[&[u8]]) -> [u8; 32] {
fn hash_to_scalar(domain: &[u8], msg: &[u8]) -> Scalar {
let mut u = [P256ScalarField::zero()];
hash_to_field::<ExpandMsgXmd<Sha256>, Scalar>(&[msg], domain, &mut u)
hash_to_field::<ExpandMsgXmd<Sha256>, Scalar>(&[msg], &[domain], &mut u)
.expect("should never return error according to error cases described in ExpandMsgXmd");
u[0]
}