Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
287620f5
Kaydet (Commit)
287620f5
authored
Eyl 24, 2001
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #463421: speed up md5 module with real memcpy/set.
üst
bb77e680
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
28 deletions
+4
-28
md5c.c
Modules/md5c.c
+4
-28
No files found.
Modules/md5c.c
Dosyayı görüntüle @
287620f5
...
@@ -48,8 +48,6 @@ documentation and/or software.
...
@@ -48,8 +48,6 @@ documentation and/or software.
static
void
MD5Transform
(
UINT4
[
4
],
unsigned
char
[
64
]);
static
void
MD5Transform
(
UINT4
[
4
],
unsigned
char
[
64
]);
static
void
Encode
(
unsigned
char
*
,
UINT4
*
,
unsigned
int
);
static
void
Encode
(
unsigned
char
*
,
UINT4
*
,
unsigned
int
);
static
void
Decode
(
UINT4
*
,
unsigned
char
*
,
unsigned
int
);
static
void
Decode
(
UINT4
*
,
unsigned
char
*
,
unsigned
int
);
static
void
MD5_memcpy
(
POINTER
,
POINTER
,
unsigned
int
);
static
void
MD5_memset
(
POINTER
,
int
,
unsigned
int
);
static
unsigned
char
PADDING
[
64
]
=
{
static
unsigned
char
PADDING
[
64
]
=
{
0x80
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0x80
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
...
@@ -126,7 +124,7 @@ MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen)
...
@@ -126,7 +124,7 @@ MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen)
/* Transform as many times as possible. */
/* Transform as many times as possible. */
if
(
inputLen
>=
partLen
)
{
if
(
inputLen
>=
partLen
)
{
MD5_
memcpy
((
POINTER
)
&
context
->
buffer
[
index
],
(
POINTER
)
input
,
partLen
);
memcpy
((
POINTER
)
&
context
->
buffer
[
index
],
(
POINTER
)
input
,
partLen
);
MD5Transform
(
context
->
state
,
context
->
buffer
);
MD5Transform
(
context
->
state
,
context
->
buffer
);
for
(
i
=
partLen
;
i
+
63
<
inputLen
;
i
+=
64
)
for
(
i
=
partLen
;
i
+
63
<
inputLen
;
i
+=
64
)
...
@@ -138,7 +136,7 @@ MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen)
...
@@ -138,7 +136,7 @@ MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen)
i
=
0
;
i
=
0
;
/* Buffer remaining input */
/* Buffer remaining input */
MD5_
memcpy
((
POINTER
)
&
context
->
buffer
[
index
],
memcpy
((
POINTER
)
&
context
->
buffer
[
index
],
(
POINTER
)
&
input
[
i
],
inputLen
-
i
);
(
POINTER
)
&
input
[
i
],
inputLen
-
i
);
}
}
...
@@ -166,7 +164,7 @@ MD5Final(unsigned char digest[16], MD5_CTX *context)
...
@@ -166,7 +164,7 @@ MD5Final(unsigned char digest[16], MD5_CTX *context)
Encode
(
digest
,
context
->
state
,
16
);
Encode
(
digest
,
context
->
state
,
16
);
/* Zeroize sensitive information. */
/* Zeroize sensitive information. */
MD5_
memset
((
POINTER
)
context
,
0
,
sizeof
(
*
context
));
memset
((
POINTER
)
context
,
0
,
sizeof
(
*
context
));
}
}
...
@@ -256,7 +254,7 @@ MD5Transform(UINT4 state[4], unsigned char block[64])
...
@@ -256,7 +254,7 @@ MD5Transform(UINT4 state[4], unsigned char block[64])
state
[
3
]
+=
d
;
state
[
3
]
+=
d
;
/* Zeroize sensitive information. */
/* Zeroize sensitive information. */
MD5_
memset
((
POINTER
)
x
,
0
,
sizeof
(
x
));
memset
((
POINTER
)
x
,
0
,
sizeof
(
x
));
}
}
...
@@ -290,25 +288,3 @@ Decode(UINT4 *output, unsigned char *input, unsigned int len)
...
@@ -290,25 +288,3 @@ Decode(UINT4 *output, unsigned char *input, unsigned int len)
(((
UINT4
)
input
[
j
+
2
])
<<
16
)
|
(((
UINT4
)
input
[
j
+
3
])
<<
24
);
(((
UINT4
)
input
[
j
+
2
])
<<
16
)
|
(((
UINT4
)
input
[
j
+
3
])
<<
24
);
}
}
}
}
/* Note: Replace "for loop" with standard memcpy if possible. */
static
void
MD5_memcpy
(
POINTER
output
,
POINTER
input
,
unsigned
int
len
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
len
;
i
++
)
output
[
i
]
=
input
[
i
];
}
/* Note: Replace "for loop" with standard memset if possible. */
static
void
MD5_memset
(
POINTER
output
,
int
value
,
unsigned
int
len
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
len
;
i
++
)
((
char
*
)
output
)[
i
]
=
(
char
)
value
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment