Conv from UTF-8 to ASCII

`file *.c` to see file types (ASCII or UTF-8), convert UTF-8 (with BOM) to ASCII

```sh
sed '1s/^\xEF\xBB\xBF//'  sm4.c | iconv -f UTF-8 -t ASCII//TRANSLIT > temp.c
mv temp.c sm4.c
```
This commit is contained in:
Zhi Guan
2024-05-25 18:06:16 +08:00
parent 2117196cac
commit d719ee4862
19 changed files with 26 additions and 29 deletions

View File

@@ -386,8 +386,7 @@ int sm2_z256_print(FILE *fp, int ind, int fmt, const char *label, const sm2_z256
const uint64_t SM2_Z256_P[4] = {
0xffffffffffffffff, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffeffffffff,
};
// 注意这里 SM2_Z256_P[0] SM2_Z256_P[2] 是特殊值,在汇编中可以根据这个特殊值做特定的实现
// TODO: SM2_Z256_P[0] and SM2_Z256_P[2] are special values (fff...f), use this to optimize the ASM code
const uint64_t *sm2_z256_prime(void) {
@@ -969,7 +968,7 @@ void sm2_z256_modn_exp(sm2_z256_t r, const sm2_z256_t a, const sm2_z256_t e)
const uint64_t SM2_Z256_N_MINUS_TWO[4] = {
0x53bbf40939d54121, 0x7203df6b21c6052b, 0xffffffffffffffff, 0xfffffffeffffffff,
};
// exp都是从高位开始的如果都是1的话那么就是都要平方和乘
// TODO: use the special form of SM2_Z256_N_MINUS_TWO[2, 3]
void sm2_z256_modn_mont_inv(sm2_z256_t r, const sm2_z256_t a)
{
@@ -1266,7 +1265,7 @@ void sm2_z256_point_add(SM2_Z256_POINT *r, const SM2_Z256_POINT *a, const SM2_Z2
in1infty = is_zero(in1infty);
in2infty = is_zero(in2infty);
// 这里很明显有极好的并行性
// TODO: can we parallel on the following code?
sm2_z256_modp_mont_sqr(Z2sqr, in2_z); /* Z2^2 */
sm2_z256_modp_mont_sqr(Z1sqr, in1_z); /* Z1^2 */