Rename the field and scalar modules

Suggested by @kubkon
This commit is contained in:
Frank Denis 2020-08-14 16:45:03 +02:00 committed by Andrew Kelley
parent c483bf4f97
commit dd8f7b396c
5 changed files with 7 additions and 7 deletions

View File

@ -63,8 +63,8 @@ test "crypto" {
_ = @import("crypto/25519/curve25519.zig"); _ = @import("crypto/25519/curve25519.zig");
_ = @import("crypto/25519/ed25519.zig"); _ = @import("crypto/25519/ed25519.zig");
_ = @import("crypto/25519/edwards25519.zig"); _ = @import("crypto/25519/edwards25519.zig");
_ = @import("crypto/25519/field25519.zig"); _ = @import("crypto/25519/field.zig");
_ = @import("crypto/25519/scalar25519.zig"); _ = @import("crypto/25519/scalar.zig");
_ = @import("crypto/25519/x25519.zig"); _ = @import("crypto/25519/x25519.zig");
_ = @import("crypto/25519/ristretto255.zig"); _ = @import("crypto/25519/ristretto255.zig");
} }

View File

@ -3,9 +3,9 @@ const std = @import("std");
/// Group operations over Curve25519. /// Group operations over Curve25519.
pub const Curve25519 = struct { pub const Curve25519 = struct {
/// The underlying prime field. /// The underlying prime field.
pub const Fe = @import("field25519.zig").Fe; pub const Fe = @import("field.zig").Fe;
/// Field arithmetic mod the order of the main subgroup. /// Field arithmetic mod the order of the main subgroup.
pub const scalar = @import("scalar25519.zig"); pub const scalar = @import("scalar.zig");
x: Fe, x: Fe,

View File

@ -4,9 +4,9 @@ const fmt = std.fmt;
/// Group operations over Edwards25519. /// Group operations over Edwards25519.
pub const Edwards25519 = struct { pub const Edwards25519 = struct {
/// The underlying prime field. /// The underlying prime field.
pub const Fe = @import("field25519.zig").Fe; pub const Fe = @import("field.zig").Fe;
/// Field arithmetic mod the order of the main subgroup. /// Field arithmetic mod the order of the main subgroup.
pub const scalar = @import("scalar25519.zig"); pub const scalar = @import("scalar.zig");
x: Fe, x: Fe,
y: Fe, y: Fe,

View File

@ -174,7 +174,7 @@ test "non-canonical scalar25519" {
std.testing.expectError(error.NonCanonical, rejectNonCanonical(too_targe)); std.testing.expectError(error.NonCanonical, rejectNonCanonical(too_targe));
} }
test "mulAdd overflow check" { test "scalar25519 mulAdd overflow check" {
const a: [32]u8 = [_]u8{0xff} ** 32; const a: [32]u8 = [_]u8{0xff} ** 32;
const b: [32]u8 = [_]u8{0xff} ** 32; const b: [32]u8 = [_]u8{0xff} ** 32;
const c: [32]u8 = [_]u8{0xff} ** 32; const c: [32]u8 = [_]u8{0xff} ** 32;