mirror of
https://github.com/emmansun/gmsm.git
synced 2025-10-14 07:10:45 +08:00
internal/sm2ec: fix test case
This commit is contained in:
parent
c38a157a88
commit
d46ceed0e8
@ -21,8 +21,9 @@ func TestP256BigToLittle(t *testing.T) {
|
|||||||
// 检查每个 limb 是否为小端解包
|
// 检查每个 limb 是否为小端解包
|
||||||
for i := 0; i < 4; i++ {
|
for i := 0; i < 4; i++ {
|
||||||
expected := binary.BigEndian.Uint64(in[i*8 : (i+1)*8])
|
expected := binary.BigEndian.Uint64(in[i*8 : (i+1)*8])
|
||||||
if out[i] != expected {
|
k := 3 - i // 逆序存储
|
||||||
t.Errorf("limb %d: got 0x%x, want 0x%x", i, out[i], expected)
|
if out[k] != expected {
|
||||||
|
t.Errorf("limb %d: got 0x%x, want 0x%x", k, out[k], expected)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user