tls: P256: do not open-code copying of struct variables
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/networking/tls_sp_c32.c b/networking/tls_sp_c32.c
index b3f7888..3291b55 100644
--- a/networking/tls_sp_c32.c
+++ b/networking/tls_sp_c32.c
@@ -865,6 +865,8 @@
}
/* Reduce the number back to 256 bits using Montgomery reduction.
+ * Note: the result is NOT guaranteed to be less than p256_mod!
+ * (it is only guaranteed to fit into 256 bits).
*
* a Double-wide number to reduce in place.
* m The single precision number representing the modulus.
@@ -1276,7 +1278,7 @@
if (map)
sp_256_map_8(r, &t[0]);
else
- memcpy(r, &t[0], sizeof(sp_point));
+ *r = t[0]; /* struct copy */
memset(t, 0, sizeof(t)); //paranoia
}