[C#] Update auto-generated bindings to LDK 0.0.123
[ldk-java] / c_sharp / src / org / ldk / structs / DelayedPaymentBasepoint.cs
index 20166c7a9c63197613c22fa6a52a42a1bb1e74a9..fdb116064ade865f187a7d989afe2e911499da53 100644 (file)
@@ -51,7 +51,7 @@ public class DelayedPaymentBasepoint : CommonBase {
         * Two objects with NULL inner values will be considered "equal" here.
         */
        public bool eq(org.ldk.structs.DelayedPaymentBasepoint b) {
-               bool ret = bindings.DelayedPaymentBasepoint_eq(this.ptr, b == null ? 0 : b.ptr);
+               bool ret = bindings.DelayedPaymentBasepoint_eq(this.ptr, b.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(b);
                if (this != null) { this.ptrs_to.AddLast(b); };
@@ -103,6 +103,18 @@ public class DelayedPaymentBasepoint : CommonBase {
                return ret_conv;
        }
 
+       /**
+        * Derives the \"tweak\" used in calculate [`DelayedPaymentKey::from_basepoint`].\n\n[`DelayedPaymentKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
+        */
+       public byte[] derive_add_tweak(byte[] per_commitment_point) {
+               long ret = bindings.DelayedPaymentBasepoint_derive_add_tweak(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33)));
+               GC.KeepAlive(this);
+               GC.KeepAlive(per_commitment_point);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+               return ret_conv;
+       }
+
        /**
         * Serialize the DelayedPaymentBasepoint object into a byte array which can be read by DelayedPaymentBasepoint_read
         */