aboutsummaryrefslogtreecommitdiff
path: root/p448_solinas_64.c
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2019-01-30 23:04:35 -0500
committerGravatar Jason Gross <jasongross9@gmail.com>2019-02-02 18:22:15 -0500
commit6fbafbb3a90a5491103e0044042bfc726b9eab7b (patch)
treeb7a733d1d46937b142a82f4e4010a50cda468a28 /p448_solinas_64.c
parent496271f86e9dc6df1b23a189d6b8fd2a82db33aa (diff)
Address code review comments to improve docstrings
Diffstat (limited to 'p448_solinas_64.c')
-rw-r--r--p448_solinas_64.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/p448_solinas_64.c b/p448_solinas_64.c
index edf5fceb4..16dbbfe89 100644
--- a/p448_solinas_64.c
+++ b/p448_solinas_64.c
@@ -17,7 +17,7 @@ typedef unsigned __int128 fiat_p448_uint128;
/*
- * The function fiat_p448_addcarryx_u56 is an add with carry.
+ * The function fiat_p448_addcarryx_u56 is an addition with carry.
* out1 = (arg1 + arg2 + arg3) mod 2^56
* ∧ out2 = ⌊(arg1 + arg2 + arg3) / 2^56⌋
* Input Bounds:
@@ -37,7 +37,7 @@ static void fiat_p448_addcarryx_u56(uint64_t* out1, fiat_p448_uint1* out2, fiat_
}
/*
- * The function fiat_p448_subborrowx_u56 is a sub with borrow.
+ * The function fiat_p448_subborrowx_u56 is a subtraction with borrow.
* out1 = (-arg1 + arg2 + -arg3) mod 2^56
* ∧ out2 = -⌊(-arg1 + arg2 + -arg3) / 2^56⌋
* Input Bounds:
@@ -74,7 +74,7 @@ static void fiat_p448_cmovznz_u64(uint64_t* out1, fiat_p448_uint1 arg1, uint64_t
}
/*
- * The function fiat_p448_carry_mul does stuff.
+ * The function fiat_p448_carry_mul multiplies two field elements and reduces the result.
* eval out1 mod m = (eval arg1 * eval arg2) mod m
* Input Bounds:
* arg1: [[0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb]]
@@ -238,7 +238,7 @@ static void fiat_p448_carry_mul(uint64_t out1[8], const uint64_t arg1[8], const
}
/*
- * The function fiat_p448_carry_square does stuff.
+ * The function fiat_p448_carry_square squares a field element and reduces the result.
* eval out1 mod m = (eval arg1 * eval arg1) mod m
* Input Bounds:
* arg1: [[0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb]]
@@ -380,7 +380,7 @@ static void fiat_p448_carry_square(uint64_t out1[8], const uint64_t arg1[8]) {
}
/*
- * The function fiat_p448_carry does stuff.
+ * The function fiat_p448_carry reduces a field element.
* eval out1 mod m = eval arg1 mod m
* Input Bounds:
* arg1: [[0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb], [0x0 ~> 0x34ccccccccccccb]]
@@ -421,7 +421,7 @@ static void fiat_p448_carry(uint64_t out1[8], const uint64_t arg1[8]) {
}
/*
- * The function fiat_p448_add does stuff.
+ * The function fiat_p448_add adds two field elements.
* eval out1 mod m = (eval arg1 + eval arg2) mod m
* Input Bounds:
* arg1: [[0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999]]
@@ -449,7 +449,7 @@ static void fiat_p448_add(uint64_t out1[8], const uint64_t arg1[8], const uint64
}
/*
- * The function fiat_p448_sub does stuff.
+ * The function fiat_p448_sub subtracts two field elements.
* eval out1 mod m = (eval arg1 - eval arg2) mod m
* Input Bounds:
* arg1: [[0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999]]
@@ -477,7 +477,7 @@ static void fiat_p448_sub(uint64_t out1[8], const uint64_t arg1[8], const uint64
}
/*
- * The function fiat_p448_opp does stuff.
+ * The function fiat_p448_opp negates a field element.
* eval out1 mod m = -eval arg1 mod m
* Input Bounds:
* arg1: [[0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999]]
@@ -541,7 +541,7 @@ static void fiat_p448_selectznz(uint64_t out1[8], fiat_p448_uint1 arg1, const ui
}
/*
- * The function fiat_p448_to_bytes does stuff.
+ * The function fiat_p448_to_bytes serializes a field element to bytes in little-endian order.
* out1 = map (λ x, ⌊(eval arg1 mod m) mod 2^(8 * (x + 1)) / 2^(8 * x)⌋) [0..55]
* Input Bounds:
* arg1: [[0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999], [0x0 ~> 0x119999999999999]]
@@ -761,7 +761,7 @@ static void fiat_p448_to_bytes(uint8_t out1[56], const uint64_t arg1[8]) {
}
/*
- * The function fiat_p448_from_bytes does stuff.
+ * The function fiat_p448_from_bytes deserializes a field element from bytes in little-endian order.
* eval out1 mod m = bytes_eval arg1 mod m
* Input Bounds:
* arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]]