mirror of
https://github.com/ziglang/zig.git
synced 2025-12-16 19:23:08 +00:00
Change indexing variable types for crypto functions
This commit is contained in:
parent
2659ac01be
commit
1f3ed5cf27
@ -4,11 +4,11 @@ const endian = @import("../endian.zig");
|
|||||||
const debug = @import("../debug/index.zig");
|
const debug = @import("../debug/index.zig");
|
||||||
|
|
||||||
const RoundParam = struct {
|
const RoundParam = struct {
|
||||||
a: u32, b: u32, c: u32, d: u32,
|
a: usize, b: usize, c: usize, d: usize,
|
||||||
k: u32, s: u32, t: u32
|
k: usize, s: u32, t: u32
|
||||||
};
|
};
|
||||||
|
|
||||||
fn Rp(a: u32, b: u32, c: u32, d: u32, k: u32, s: u5, t: u32) -> RoundParam {
|
fn Rp(a: usize, b: usize, c: usize, d: usize, k: usize, s: u32, t: u32) -> RoundParam {
|
||||||
return RoundParam { .a = a, .b = b, .c = c, .d = d, .k = k, .s = s, .t = t };
|
return RoundParam { .a = a, .b = b, .c = c, .d = d, .k = k, .s = s, .t = t };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,10 +6,10 @@ const debug = @import("../debug/index.zig");
|
|||||||
pub const u160 = @IntType(false, 160);
|
pub const u160 = @IntType(false, 160);
|
||||||
|
|
||||||
const RoundParam = struct {
|
const RoundParam = struct {
|
||||||
a: u32, b: u32, c: u32, d: u32, e: u32, i: u32,
|
a: usize, b: usize, c: usize, d: usize, e: usize, i: u32,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn Rp(a: u32, b: u32, c: u32, d: u32, e: u32, i: u32) -> RoundParam {
|
fn Rp(a: usize, b: usize, c: usize, d: usize, e: usize, i: u32) -> RoundParam {
|
||||||
return RoundParam { .a = a, .b = b, .c = c, .d = d, .e = e, .i = i };
|
return RoundParam { .a = a, .b = b, .c = c, .d = d, .e = e, .i = i };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,11 +7,11 @@ const debug = @import("../debug/index.zig");
|
|||||||
// Sha224 + Sha256
|
// Sha224 + Sha256
|
||||||
|
|
||||||
const RoundParam256 = struct {
|
const RoundParam256 = struct {
|
||||||
a: u32, b: u32, c: u32, d: u32, e: u32, f: u32, g: u32, h: u32,
|
a: usize, b: usize, c: usize, d: usize, e: usize, f: usize, g: usize, h: usize,
|
||||||
i: u32, k: u32,
|
i: usize, k: u32,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn Rp256(a: u32, b: u32, c: u32, d: u32, e: u32, f: u32, g: u32, h: u32, i: u32, k: u32) -> RoundParam256 {
|
fn Rp256(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize, g: usize, h: usize, i: usize, k: u32) -> RoundParam256 {
|
||||||
return RoundParam256 { .a = a, .b = b, .c = c, .d = d, .e = e, .f = f, .g = g, .h = h, .i = i, .k = k };
|
return RoundParam256 { .a = a, .b = b, .c = c, .d = d, .e = e, .f = f, .g = g, .h = h, .i = i, .k = k };
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ const Sha2Params32 = struct {
|
|||||||
iv5: u32,
|
iv5: u32,
|
||||||
iv6: u32,
|
iv6: u32,
|
||||||
iv7: u32,
|
iv7: u32,
|
||||||
out_len: u32,
|
out_len: usize,
|
||||||
};
|
};
|
||||||
|
|
||||||
const Sha224Params = Sha2Params32 {
|
const Sha224Params = Sha2Params32 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user