]> Git Repo - secp256k1.git/blobdiff - src/field_10x26_impl.h
Try to not leave secret data on the stack or heap.
[secp256k1.git] / src / field_10x26_impl.h
index 734116697fb977781e650634467f2475e192c55e..4818131818e69d14c233e21513d18a11672cc8fe 100644 (file)
@@ -92,6 +92,16 @@ int static inline secp256k1_fe_is_odd(const secp256k1_fe_t *a) {
     return a->n[0] & 1;
 }
 
+void static inline secp256k1_fe_clear(secp256k1_fe_t *a) {
+#ifdef VERIFY
+    a->normalized = 0;
+    a->magnitude = 0;
+#endif
+    for (int i=0; i<10; i++) {
+        a->n[i] = 0;
+    }
+}
+
 // TODO: not constant time!
 int static inline secp256k1_fe_equal(const secp256k1_fe_t *a, const secp256k1_fe_t *b) {
 #ifdef VERIFY
This page took 0.019629 seconds and 4 git commands to generate.