diff options
Diffstat (limited to 'chip/g/dcrypto/p256.c')
-rw-r--r-- | chip/g/dcrypto/p256.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chip/g/dcrypto/p256.c b/chip/g/dcrypto/p256.c index 18ff5eb07f..ab60c91cdc 100644 --- a/chip/g/dcrypto/p256.c +++ b/chip/g/dcrypto/p256.c @@ -16,14 +16,14 @@ static const p256_int p256_one = P256_ONE; int DCRYPTO_p256_key_from_bytes(p256_int *x, p256_int *y, p256_int *d, const uint8_t key_bytes[P256_NBYTES]) { - int result; p256_int key; p256_from_bin(key_bytes, &key); if (p256_cmp(&SECP256r1_nMin2, &key) < 0) return 0; p256_add(&key, &p256_one, d); - result = dcrypto_p256_base_point_mul(d, x, y); dcrypto_memset(&key, 0, sizeof(key)); - return result; + if (x == NULL || y == NULL) + return 1; + return dcrypto_p256_base_point_mul(d, x, y); } |