Closed vbakke closed 6 years ago
Having the padding counting relative to -1, was not such a good idea after all.
It is now changed to count relative to the max value of the smaller unit (i.e. 243 for tryte5.) This will work for regardless of the data type, and should work dynamically for any conversion of trits.
Previously, removing 1 unit, was encoded as 255, now it is 244. Previously, removing 2 unit, was encoded as 254, now it is 245.
The only problem is that it break any previously encryption in vbakke/tryte-encrypt. I do not believe anyone has done so yet, but I you have it will work, by using vbakke/trytes v1.2.0.
The algorithm for the padding 255 byte fails if it is not a byte (uint8).