Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
a7dbe024
F
fsharp
项目概览
dotNET Platform
/
fsharp
12 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a7dbe024
编写于
10月 06, 2014
作者:
J
jackpappas
提交者:
latkin
10月 31, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use literals and mutable variables instead of ref cells for better performance.
上级
4f6c0d81
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
43 deletion
+41
-43
src/absil/il.fs
src/absil/il.fs
+41
-43
未找到文件。
src/absil/il.fs
浏览文件 @
a7dbe024
...
...
@@ -197,15 +197,15 @@ let b3 n = ((n >>> 24) &&& 0xFF)
module
SHA1
=
let
inline
(>>>&)
(
x
:
int
)
(
y
:
int
)
=
int32
(
uint32
x
>>>
y
)
let
f
(
t
,
b
,
c
,
d
)
=
if
t
<
20
then
(
b
&&&
c
)
|||
((~~~
b
)
&&&
d
)
else
if
t
<
40
then
b
^^^
c
^^^
d
else
if
t
<
60
then
(
b
&&&
c
)
|||
(
b
&&&
d
)
|||
(
c
&&&
d
)
else
b
^^^
c
^^^
d
if
t
<
20
then
(
b
&&&
c
)
|||
((~~~
b
)
&&&
d
)
elif
t
<
40
then
b
^^^
c
^^^
d
elif
t
<
60
then
(
b
&&&
c
)
|||
(
b
&&&
d
)
|||
(
c
&&&
d
)
else
b
^^^
c
^^^
d
let
k0to19
=
0x5A827999
let
k20to39
=
0x6ED9EBA1
let
k40to59
=
0x8F1BBCDC
let
k60to79
=
0xCA62C1D6
let
[<
Literal
>]
k0to19
=
0x5A827999
let
[<
Literal
>]
k20to39
=
0x6ED9EBA1
let
[<
Literal
>]
k40to59
=
0x8F1BBCDC
let
[<
Literal
>]
k60to79
=
0xCA62C1D6
let
k
t
=
if
t
<
20
then
k0to19
...
...
@@ -222,7 +222,7 @@ module SHA1 =
let
rot_left32
x
n
=
(
x
<<<
n
)
|||
(
x
>>>&
(
32
-
n
))
let
sha_eof
sha
=
sha
.
eof
let
inline
sha_eof
sha
=
sha
.
eof
(* padding and length (in bits!) recorded at end *)
let
sha_after_eof
sha
=
...
...
@@ -259,43 +259,41 @@ module SHA1 =
let
res
=
(
b0
<<<
24
)
|||
(
b1
<<<
16
)
|||
(
b2
<<<
8
)
|||
b3
res
let
sha1_hash
sha
=
let
h0
=
ref
0x67452301
let
h1
=
ref
0xEFCDAB89
let
h2
=
ref
0x98BADCFE
let
h3
=
ref
0x10325476
let
h4
=
ref
0xC3D2E1F0
let
a
=
ref
0
let
b
=
ref
0
let
c
=
ref
0
let
d
=
ref
0
let
e
=
ref
0
let
mutable
h0
=
0x67452301
let
mutable
h1
=
0xEFCDAB89
let
mutable
h2
=
0x98BADCFE
let
mutable
h3
=
0x10325476
let
mutable
h4
=
0xC3D2E1F0
let
mutable
a
=
0
let
mutable
b
=
0
let
mutable
c
=
0
let
mutable
d
=
0
let
mutable
e
=
0
let
w
=
Array
.
create
80
0x00
while
(
not
(
sha_eof
sha
))
do
for
i
=
0
to
15
do
w
.[
i
]
<-
sha_read32
sha
for
t
=
16
to
79
do
w
.[
t
]
<-
rot_left32
(
w
.[
t
-
3
]
^^^
w
.[
t
-
8
]
^^^
w
.[
t
-
14
]
^^^
w
.[
t
-
16
])
1
;
a
:=
!
h0
;
b
:=
!
h1
;
c
:=
!
h2
;
d
:=
!
h3
;
e
:=
!
h4
;
for
t
=
0
to
79
do
let
temp
=
(
rot_left32
!
a
5
)
+
f
(
t
,!
b
,!
c
,!
d
)
+
!
e
+
w
.[
t
]
+
k
(
t
)
e
:=
!
d
;
d
:=
!
c
;
c
:=
rot_left32
!
b
30
;
b
:=
!
a
;
a
:=
temp
;
h0
:=
!
h0
+
!
a
;
h1
:=
!
h1
+
!
b
;
h2
:=
!
h2
+
!
c
;
h3
:=
!
h3
+
!
d
;
h4
:=
!
h4
+
!
e
done
;
(!
h0
,!
h1
,!
h2
,!
h3
,!
h4
)
for
i
=
0
to
15
do
w
.[
i
]
<-
sha_read32
sha
for
t
=
16
to
79
do
w
.[
t
]
<-
rot_left32
(
w
.[
t
-
3
]
^^^
w
.[
t
-
8
]
^^^
w
.[
t
-
14
]
^^^
w
.[
t
-
16
])
1
a
<-
h0
b
<-
h1
c
<-
h2
d
<-
h3
e
<-
h4
for
t
=
0
to
79
do
let
temp
=
(
rot_left32
a
5
)
+
f
(
t
,
b
,
c
,
d
)
+
e
+
w
.[
t
]
+
k
(
t
)
e
<-
d
d
<-
c
c
<-
rot_left32
b
30
b
<-
a
a
<-
temp
h0
<-
h0
+
a
h1
<-
h1
+
b
h2
<-
h2
+
c
h3
<-
h3
+
d
h4
<-
h4
+
e
h0
,
h1
,
h2
,
h3
,
h4
let
sha1HashBytes
s
=
let
(_
h0
,_
h1
,_
h2
,
h3
,
h4
)
=
sha1_hash
{
stream
=
SHABytes
s
;
pos
=
0
;
eof
=
false
}
// the result of the SHA algorithm is stored in registers 3 and 4
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录