@@ -143,15 +143,10 @@ func Decrypt(raw []byte, opt *Options) (packageBuf []byte, err error) {
143
143
if err != nil || mechanism == "extensible" {
144
144
return
145
145
}
146
- switch mechanism {
147
- case "agile" :
146
+ if mechanism == "agile" {
148
147
return agileDecrypt (encryptionInfoBuf , encryptedPackageBuf , opt )
149
- case "standard" :
150
- return standardDecrypt (encryptionInfoBuf , encryptedPackageBuf , opt )
151
- default :
152
- err = ErrUnsupportedEncryptMechanism
153
148
}
154
- return
149
+ return standardDecrypt ( encryptionInfoBuf , encryptedPackageBuf , opt )
155
150
}
156
151
157
152
// Encrypt API encrypt data with the password.
@@ -1112,7 +1107,7 @@ func (c *cfb) writeDirectoryEntry(propertyCount, customSectID, size int) []byte
1112
1107
return storage .stream
1113
1108
}
1114
1109
1115
- // writeMSAT provides a function to write compound file sector allocation
1110
+ // writeMSAT provides a function to write compound file master sector allocation
1116
1111
// table.
1117
1112
func (c * cfb ) writeMSAT (MSATBlocks , SATBlocks int , MSAT []int ) []int {
1118
1113
if MSATBlocks > 0 {
@@ -1129,19 +1124,19 @@ func (c *cfb) writeMSAT(MSATBlocks, SATBlocks int, MSAT []int) []int {
1129
1124
}
1130
1125
MSAT = append (MSAT , - 1 )
1131
1126
}
1132
- } else {
1133
- for i := 0 ; i < 109 ; i ++ {
1134
- if i < SATBlocks {
1135
- MSAT = append (MSAT , i )
1136
- continue
1137
- }
1138
- MSAT = append (MSAT , - 1 )
1127
+ return MSAT
1128
+ }
1129
+ for i := 0 ; i < 109 ; i ++ {
1130
+ if i < SATBlocks {
1131
+ MSAT = append (MSAT , i )
1132
+ continue
1139
1133
}
1134
+ MSAT = append (MSAT , - 1 )
1140
1135
}
1141
1136
return MSAT
1142
1137
}
1143
1138
1144
- // writeSAT provides a function to write compound file master sector allocation
1139
+ // writeSAT provides a function to write compound file sector allocation
1145
1140
// table.
1146
1141
func (c * cfb ) writeSAT (MSATBlocks , SATBlocks , SSATBlocks , directoryBlocks , fileBlocks , streamBlocks int , SAT []int ) (int , []int ) {
1147
1142
var blocks int
0 commit comments