Added macro that indicates presence of the time callback feature. Also added C++...
[BearSSL] / T0 / CodeElementUIntUInt.cs
index 3d4ee33..6f94de5 100644 (file)
@@ -34,16 +34,26 @@ class CodeElementUIntUInt : CodeElement {
                this.val2 = val2;
        }
 
                this.val2 = val2;
        }
 
+       /* obsolete
        internal override int Length {
                get {
                        return Encode7EUnsigned(val1, null)
                                + Encode7EUnsigned(val2, null);
                }
        }
        internal override int Length {
                get {
                        return Encode7EUnsigned(val1, null)
                                + Encode7EUnsigned(val2, null);
                }
        }
+       */
 
 
-       internal override int Encode(BlobWriter bw)
+       internal override int GetLength(bool oneByteCode)
        {
        {
-               int len = Encode7EUnsigned(val1, bw);
+               return (oneByteCode ? 1 : Encode7EUnsigned(val1, null))
+                       + Encode7EUnsigned(val2, null);
+       }
+
+       internal override int Encode(BlobWriter bw, bool oneByteCode)
+       {
+               int len = oneByteCode
+                       ? EncodeOneByte(val1, bw)
+                       : Encode7EUnsigned(val1, bw);
                len += Encode7EUnsigned(val2, bw);
                return len;
        }
                len += Encode7EUnsigned(val2, bw);
                return len;
        }