Skip to content

Commit 974b57d

Browse files
committed
clean-up
1 parent 4dcbfb2 commit 974b57d

File tree

4 files changed

+4
-44
lines changed

4 files changed

+4
-44
lines changed

src/Qubic.Core/Qubic.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- NuGet Package Metadata -->
1010
<PackageId>Qubic.Core</PackageId>
11-
<Version>1.0.0</Version>
11+
<Version>1.1.0</Version>
1212
<Authors>Qubic.NET Contributors</Authors>
1313
<Description>Core domain models and abstractions for the Qubic network</Description>
1414
<PackageTags>qubic;blockchain;cryptocurrency</PackageTags>
@@ -27,7 +27,7 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Qubic.Crypto" Version="1.1.0" />
30+
<PackageReference Include="Qubic.Crypto" Version="1.1.1" />
3131
</ItemGroup>
3232

3333
</Project>

src/Qubic.Crypto/IQubicCrypt.cs

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Linq;
32

43
namespace Qubic.Crypto;
54

@@ -49,7 +48,7 @@ public interface IQubicCrypt
4948
string GetIdentityFromPublicKey(byte[] publicKey);
5049

5150
/// <summary>
52-
/// Converts bytes to human-readable format (shifted hex using a-p).
51+
/// Converts 32-byte data to human-readable lowercase identity format (60 chars).
5352
/// </summary>
5453
string GetHumanReadableBytes(byte[] data);
5554

@@ -68,35 +67,6 @@ public interface IQubicCrypt
6867
/// </summary>
6968
bool Verify(byte[] publicKey, byte[] message, byte[] signature);
7069

71-
/// <summary>
72-
/// Converts shifted hex string (a-p) to bytes.
73-
/// </summary>
74-
byte[] ShiftedHexToBytes(string hex)
75-
{
76-
const int HEX_CHARS_PER_BYTE = 2;
77-
const int HEX_BASE = 16;
78-
const string SHIFTED_HEX_CHARS = "abcdefghijklmnop";
79-
const string HEX_CHARS = "0123456789abcdef";
80-
81-
hex = hex.ToLower();
82-
83-
if (hex.Length % HEX_CHARS_PER_BYTE != 0)
84-
{
85-
hex = "a" + hex;
86-
}
87-
88-
byte[] bytes = new byte[hex.Length / HEX_CHARS_PER_BYTE];
89-
90-
for (int i = 0, c = 0; c < hex.Length; c += HEX_CHARS_PER_BYTE)
91-
{
92-
string hexChunk = hex.Substring(c, HEX_CHARS_PER_BYTE);
93-
string processedHex = new string(hexChunk.Select(ch => HEX_CHARS[SHIFTED_HEX_CHARS.IndexOf(ch)]).ToArray());
94-
bytes[i++] = Convert.ToByte(processedHex, HEX_BASE);
95-
}
96-
97-
return bytes;
98-
}
99-
10070
/// <summary>
10171
/// Converts human-readable string (e.g., txid) to digest bytes.
10272
/// </summary>

src/Qubic.Crypto/Qubic.Crypto.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- NuGet Package Metadata -->
99
<PackageId>Qubic.Crypto</PackageId>
10-
<Version>1.1.0</Version>
10+
<Version>1.1.1</Version>
1111
<Authors>j0et0m</Authors>
1212
<Company>Qubic</Company>
1313
<Description>Pure C#/.NET implementation of Qubic cryptographic primitives: K12 (KangarooTwelve) hashing, FourQ elliptic curve, SchnorrQ signatures, and ECDH key exchange. Zero external dependencies.</Description>

tests/Qubic.Crypto.Tests/QubicCryptTests.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,6 @@ public void HumanReadable_RoundTrip()
209209
Assert.Equal(publicKey, recovered);
210210
}
211211

212-
[Fact]
213-
public void ShiftedHexToBytes_Works()
214-
{
215-
var hex = "aabpklpp";
216-
217-
var result = _crypt.ShiftedHexToBytes(hex);
218-
219-
Assert.Equal(new byte[] { 0x00, 0x1F, 0xAB, 0xFF }, result);
220-
}
221-
222212
[Fact]
223213
public void Verify_QubicNetworkSignedPacket()
224214
{

0 commit comments

Comments
 (0)