Updated to net9.0

This commit is contained in:
Hondacrx
2025-06-08 18:24:11 -04:00
parent f5f5de1c86
commit d99305d96a
9 changed files with 17 additions and 11 deletions
@@ -262,10 +262,7 @@ namespace Framework.Cryptography.Ed25519
// Leading zero bytes get encoded as leading `1` characters
int leadingZeroCount = input.TakeWhile(c => c == '1').Count();
var leadingZeros = Enumerable.Repeat((byte)0, leadingZeroCount);
var bytesWithoutLeadingZeros =
intData.ToByteArray()
.Reverse()// to big endian
.SkipWhile(b => b == 0);//strip sign byte
var bytesWithoutLeadingZeros = intData.ToByteArray(true, true);
var result = leadingZeros.Concat(bytesWithoutLeadingZeros).ToArray();
return result;
}