diff options
-rw-r--r-- | networking/tls_sp_c32.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/networking/tls_sp_c32.c b/networking/tls_sp_c32.c index b3f7888f5..3291b553c 100644 --- a/networking/tls_sp_c32.c +++ b/networking/tls_sp_c32.c | |||
@@ -865,6 +865,8 @@ static int sp_256_mul_add_8(sp_digit* r /*, const sp_digit* a, sp_digit b*/) | |||
865 | } | 865 | } |
866 | 866 | ||
867 | /* Reduce the number back to 256 bits using Montgomery reduction. | 867 | /* Reduce the number back to 256 bits using Montgomery reduction. |
868 | * Note: the result is NOT guaranteed to be less than p256_mod! | ||
869 | * (it is only guaranteed to fit into 256 bits). | ||
868 | * | 870 | * |
869 | * a Double-wide number to reduce in place. | 871 | * a Double-wide number to reduce in place. |
870 | * m The single precision number representing the modulus. | 872 | * m The single precision number representing the modulus. |
@@ -1276,7 +1278,7 @@ static void sp_256_ecc_mulmod_8(sp_point* r, const sp_point* g, const sp_digit* | |||
1276 | if (map) | 1278 | if (map) |
1277 | sp_256_map_8(r, &t[0]); | 1279 | sp_256_map_8(r, &t[0]); |
1278 | else | 1280 | else |
1279 | memcpy(r, &t[0], sizeof(sp_point)); | 1281 | *r = t[0]; /* struct copy */ |
1280 | 1282 | ||
1281 | memset(t, 0, sizeof(t)); //paranoia | 1283 | memset(t, 0, sizeof(t)); //paranoia |
1282 | } | 1284 | } |