authorgravatar for kristoffer@rymdkoloni.seKristoffer <kristoffer@rymdkoloni.se> 2026-01-05 14:00:03+00:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-06 23:28:01+01:00
log9c55776d259a4c29bd292a690f37678cecd62fda
treeecacf827b2af7de0e76bcbe18e052c70650071c2
parentb5df5391aa46585a4b4773603c246abde1757a00

std.crypto: mem.trimLeft -> mem.trimStart


1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/crypto/ecdsa.zig+2-2
...@@ -135,8 +135,8 @@ pub fn Ecdsa(comptime Curve: type, comptime Hash: type) type {...@@ -135,8 +135,8 @@ pub fn Ecdsa(comptime Curve: type, comptime Hash: type) type {
135 /// The function returns a slice, that can be shorter than der_encoded_length_max.135 /// The function returns a slice, that can be shorter than der_encoded_length_max.
136 pub fn toDer(sig: Signature, buf: *[der_encoded_length_max]u8) []u8 {136 pub fn toDer(sig: Signature, buf: *[der_encoded_length_max]u8) []u8 {
137 var w: std.Io.Writer = .fixed(buf);137 var w: std.Io.Writer = .fixed(buf);
138 const sig_r = mem.trimLeft(u8, &sig.r, &.{0});138 const sig_r = mem.trimStart(u8, &sig.r, &.{0});
139 const sig_s = mem.trimLeft(u8, &sig.s, &.{0});139 const sig_s = mem.trimStart(u8, &sig.s, &.{0});
140 const r_len = @as(u8, @intCast(sig_r.len + (sig_r[0] >> 7)));140 const r_len = @as(u8, @intCast(sig_r.len + (sig_r[0] >> 7)));
141 const s_len = @as(u8, @intCast(sig_s.len + (sig_s[0] >> 7)));141 const s_len = @as(u8, @intCast(sig_s.len + (sig_s[0] >> 7)));
142 const seq_len = @as(u8, @intCast(2 + r_len + 2 + s_len));142 const seq_len = @as(u8, @intCast(2 + r_len + 2 + s_len));