Skip to content

Commit 1ddbe26

Browse files
committed
improve naming
1 parent 755aca6 commit 1ddbe26

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

Modules/hmacmodule.c

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,77 +14,89 @@
1414
#define Py_hmac_md5_block_size 64
1515
#define Py_hmac_md5_digest_size 16
1616
#define Py_hmac_md5_update_func NULL
17-
#define Py_hmac_md5_digest_func Hacl_HMAC_compute_md5
17+
#define Py_hmac_md5_digest_func NULL
18+
#define Py_hmac_md5_compute_func Hacl_HMAC_compute_md5
1819

1920
/* SHA-1 family */
2021
// HACL_HID = sha1
2122
#define Py_hmac_sha1_block_size 64
2223
#define Py_hmac_sha1_digest_size 20
2324
#define Py_hmac_sha1_update_func NULL
24-
#define Py_hmac_sha1_digest_func Hacl_HMAC_compute_sha1
25+
#define Py_hmac_sha1_digest_func NULL
26+
#define Py_hmac_sha1_compute_func Hacl_HMAC_compute_sha1
2527

2628
/* SHA-2 family */
2729
// HACL_HID = sha2_224
2830
#define Py_hmac_sha2_224_block_size 64
2931
#define Py_hmac_sha2_224_digest_size 28
3032
#define Py_hmac_sha2_224_update_func NULL
31-
#define Py_hmac_sha2_224_digest_func Hacl_HMAC_compute_sha2_224
33+
#define Py_hmac_sha2_224_digest_func NULL
34+
#define Py_hmac_sha2_224_compute_func Hacl_HMAC_compute_sha2_224
3235

3336
// HACL_HID = sha2_256
3437
#define Py_hmac_sha2_256_block_size 64
3538
#define Py_hmac_sha2_256_digest_size 32
3639
#define Py_hmac_sha2_256_update_func NULL
37-
#define Py_hmac_sha2_256_digest_func Hacl_HMAC_compute_sha2_256
40+
#define Py_hmac_sha2_256_digest_func NULL
41+
#define Py_hmac_sha2_256_compute_func Hacl_HMAC_compute_sha2_256
3842

3943
// HACL_HID = sha2_384
4044
#define Py_hmac_sha2_384_block_size 128
4145
#define Py_hmac_sha2_384_digest_size 48
4246
#define Py_hmac_sha2_384_update_func NULL
43-
#define Py_hmac_sha2_384_digest_func Hacl_HMAC_compute_sha2_384
47+
#define Py_hmac_sha2_384_digest_func NULL
48+
#define Py_hmac_sha2_384_compute_func Hacl_HMAC_compute_sha2_384
4449

4550
// HACL_HID = sha2_512
4651
#define Py_hmac_sha2_512_block_size 128
4752
#define Py_hmac_sha2_512_digest_size 64
4853
#define Py_hmac_sha2_512_update_func NULL
49-
#define Py_hmac_sha2_512_digest_func Hacl_HMAC_compute_sha2_512
54+
#define Py_hmac_sha2_512_digest_func NULL
55+
#define Py_hmac_sha2_512_compute_func Hacl_HMAC_compute_sha2_512
5056

5157
/* SHA-3 family */
5258
// HACL_HID = sha3_224
5359
#define Py_hmac_sha3_224_block_size 144
5460
#define Py_hmac_sha3_224_digest_size 28
5561
#define Py_hmac_sha3_224_update_func NULL
56-
#define Py_hmac_sha3_224_digest_func Hacl_HMAC_compute_sha3_224
62+
#define Py_hmac_sha3_224_digest_func NULL
63+
#define Py_hmac_sha3_224_compute_func Hacl_HMAC_compute_sha3_224
5764

5865
// HACL_HID = sha3_256
5966
#define Py_hmac_sha3_256_block_size 136
6067
#define Py_hmac_sha3_256_digest_size 32
6168
#define Py_hmac_sha3_256_update_func NULL
62-
#define Py_hmac_sha3_256_digest_func Hacl_HMAC_compute_sha3_256
69+
#define Py_hmac_sha3_256_digest_func NULL
70+
#define Py_hmac_sha3_256_compute_func Hacl_HMAC_compute_sha3_256
6371

6472
// HACL_HID = sha3_384
6573
#define Py_hmac_sha3_384_block_size 104
6674
#define Py_hmac_sha3_384_digest_size 48
6775
#define Py_hmac_sha3_384_update_func NULL
68-
#define Py_hmac_sha3_384_digest_func Hacl_HMAC_compute_sha3_384
76+
#define Py_hmac_sha3_384_digest_func NULL
77+
#define Py_hmac_sha3_384_compute_func Hacl_HMAC_compute_sha3_384
6978

7079
// HACL_HID = sha3_512
7180
#define Py_hmac_sha3_512_block_size 72
7281
#define Py_hmac_sha3_512_digest_size 64
7382
#define Py_hmac_sha3_512_update_func NULL
74-
#define Py_hmac_sha3_512_digest_func Hacl_HMAC_compute_sha3_512
83+
#define Py_hmac_sha3_512_digest_func NULL
84+
#define Py_hmac_sha3_512_compute_func Hacl_HMAC_compute_sha3_512
7585

7686
/* Blake family */
7787
// HACL_HID = blake2s_32
7888
#define Py_hmac_blake2s_32_block_size 64
7989
#define Py_hmac_blake2s_32_digest_size 32
8090
#define Py_hmac_blake2s_32_update_func NULL
81-
#define Py_hmac_blake2s_32_digest_func Hacl_HMAC_compute_blake2s_32
91+
#define Py_hmac_blake2s_32_digest_func NULL
92+
#define Py_hmac_blake2s_32_compute_func Hacl_HMAC_compute_blake2s_32
8293

8394
// HACL_HID = blake2b_32
8495
#define Py_hmac_blake2b_32_block_size 128
8596
#define Py_hmac_blake2b_32_digest_size 64
8697
#define Py_hmac_blake2b_32_update_func NULL
87-
#define Py_hmac_blake2b_32_digest_func Hacl_HMAC_compute_blake2b_32
98+
#define Py_hmac_blake2b_32_digest_func NULL
99+
#define Py_hmac_blake2b_32_compute_func Hacl_HMAC_compute_blake2b_32
88100

89101
#define Py_hmac_hash_max_digest_size 64
90102

@@ -126,7 +138,7 @@ has_uint32_t_buffer_length(const Py_buffer *buffer)
126138
return NULL; \
127139
} \
128140
uint8_t out[Py_hmac_## HACL_HID ##_digest_size]; \
129-
Py_hmac_## HACL_HID ##_digest_func( \
141+
Py_hmac_## HACL_HID ##_compute_func( \
130142
out, \
131143
(uint8_t *)keyview.buf, (uint32_t)keyview.len, \
132144
(uint8_t *)msgview.buf, (uint32_t)msgview.len \

0 commit comments

Comments
 (0)