diff --git a/lib/std/crypto/pcurves/common.zig b/lib/std/crypto/pcurves/common.zig index 5a979fe3e5..098f112e14 100644 --- a/lib/std/crypto/pcurves/common.zig +++ b/lib/std/crypto/pcurves/common.zig @@ -43,7 +43,7 @@ pub fn Field(comptime params: FieldParams) type { pub const zero: Fe = Fe{ .limbs = mem.zeroes(Limbs) }; /// One. - pub const one = comptime one: { + pub const one = one: { var fe: Fe = undefined; fiat.setOne(&fe.limbs); break :one fe; diff --git a/lib/std/crypto/pcurves/p256.zig b/lib/std/crypto/pcurves/p256.zig index 0b1c584fa9..c2948e38d8 100644 --- a/lib/std/crypto/pcurves/p256.zig +++ b/lib/std/crypto/pcurves/p256.zig @@ -30,8 +30,8 @@ pub const P256 = struct { /// The P256 base point. pub const basePoint = P256{ - .x = try Fe.fromInt(48439561293906451759052585252797914202762949526041747995844080717082404635286), - .y = try Fe.fromInt(36134250956749795798585127919587881956611106672985015071877198253568414405109), + .x = Fe.fromInt(48439561293906451759052585252797914202762949526041747995844080717082404635286) catch unreachable, + .y = Fe.fromInt(36134250956749795798585127919587881956611106672985015071877198253568414405109) catch unreachable, .z = Fe.one, .is_base = true, }; @@ -39,7 +39,7 @@ pub const P256 = struct { /// The P256 neutral element. pub const identityElement = P256{ .x = Fe.zero, .y = Fe.one, .z = Fe.zero }; - pub const B = try Fe.fromInt(41058363725152142129326129780047268409114441015993725554835256314039467401291); + pub const B = Fe.fromInt(41058363725152142129326129780047268409114441015993725554835256314039467401291) catch unreachable; /// Reject the neutral element. pub fn rejectIdentity(p: P256) IdentityElementError!void { diff --git a/lib/std/x/net/tcp.zig b/lib/std/x/net/tcp.zig index a4cc4a288c..7763ae0c9e 100644 --- a/lib/std/x/net/tcp.zig +++ b/lib/std/x/net/tcp.zig @@ -49,7 +49,7 @@ pub const Connection = struct { }; /// Possible domains that a TCP client/listener may operate over. -pub const Domain = extern enum(u16) { +pub const Domain = enum(u16) { ip = os.AF_INET, ipv6 = os.AF_INET6, }; diff --git a/lib/std/x/os/net.zig b/lib/std/x/os/net.zig index a8d9f095d3..1250e326cc 100644 --- a/lib/std/x/os/net.zig +++ b/lib/std/x/os/net.zig @@ -343,7 +343,7 @@ pub const IPv6 = extern struct { opts: fmt.FormatOptions, writer: anytype, ) !void { - comptime const specifier = &[_]u8{if (layout.len == 0) 'x' else switch (layout[0]) { + const specifier = comptime &[_]u8{if (layout.len == 0) 'x' else switch (layout[0]) { 'x', 'X' => |specifier| specifier, 's' => 'x', 'S' => 'X',