[C#] Update auto-generated bindings to LDK 0.0.123
[ldk-java] / c_sharp / src / org / ldk / structs / HtlcBasepoint.cs
index 5738f99a5552bc46303565d246de9ecca1be8ebf..67690bf6fd610c5033dc1af6318b35bab44bd417 100644 (file)
@@ -51,7 +51,7 @@ public class HtlcBasepoint : CommonBase {
         * Two objects with NULL inner values will be considered "equal" here.
         */
        public bool eq(org.ldk.structs.HtlcBasepoint b) {
-               bool ret = bindings.HtlcBasepoint_eq(this.ptr, b == null ? 0 : b.ptr);
+               bool ret = bindings.HtlcBasepoint_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 HtlcBasepoint : CommonBase {
                return ret_conv;
        }
 
+       /**
+        * Derives the \"tweak\" used in calculate [`HtlcKey::from_basepoint`].\n\n[`HtlcKey::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.HtlcBasepoint_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 HtlcBasepoint object into a byte array which can be read by HtlcBasepoint_read
         */