]> Git Repo - secp256k1.git/commitdiff
Add check that restrict pointers don't alias with all parameters.
authorRussell O'Connor <[email protected]>
Fri, 6 Jul 2018 11:26:57 +0000 (07:26 -0400)
committerRussell O'Connor <[email protected]>
Fri, 6 Jul 2018 12:40:34 +0000 (08:40 -0400)
src/field_10x26_impl.h
src/field_5x52_impl.h
src/field_5x52_int128_impl.h

index 94f8132fc8e62bd3276c14d4ab910378a430d388..57613576d89de0416353a6443bd379a20ead72e1 100644 (file)
@@ -1069,6 +1069,7 @@ static void secp256k1_fe_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp2
     secp256k1_fe_verify(a);
     secp256k1_fe_verify(b);
     VERIFY_CHECK(r != b);
+    VERIFY_CHECK(a != b);
 #endif
     secp256k1_fe_mul_inner(r->n, a->n, b->n);
 #ifdef VERIFY
index 957c61b01451a0f09ee6499db45c0745180da3b4..60112b7e09f263c10efc9024ea43a40da56d17f6 100644 (file)
@@ -422,6 +422,7 @@ static void secp256k1_fe_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp2
     secp256k1_fe_verify(a);
     secp256k1_fe_verify(b);
     VERIFY_CHECK(r != b);
+    VERIFY_CHECK(a != b);
 #endif
     secp256k1_fe_mul_inner(r->n, a->n, b->n);
 #ifdef VERIFY
index 95a0d1791c0557fe65995c96acb26a1a1bae36cf..16f2caca7dead9e534094983e196eef775c5f2de 100644 (file)
@@ -32,6 +32,7 @@ SECP256K1_INLINE static void secp256k1_fe_mul_inner(uint64_t *r, const uint64_t
     VERIFY_BITS(b[3], 56);
     VERIFY_BITS(b[4], 52);
     VERIFY_CHECK(r != b);
+    VERIFY_CHECK(a != b);
 
     /*  [... a b c] is a shorthand for ... + a<<104 + b<<52 + c<<0 mod n.
      *  px is a shorthand for sum(a[i]*b[x-i], i=0..x).
This page took 0.028715 seconds and 4 git commands to generate.