Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sm-crypto

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sm-crypto - npm Package Compare versions

Comparing version 0.3.8 to 0.3.9

5

CHANGELOG.md

@@ -0,1 +1,6 @@

## 0.3.9
* 补充 sm4 解密时的 padding 判断
## 0.3.8

@@ -2,0 +7,0 @@

2

package.json
{
"name": "sm-crypto",
"version": "0.3.8",
"version": "0.3.9",
"description": "sm-crypto",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -329,4 +329,8 @@ /* eslint-disable no-bitwise, no-mixed-operators, complexity */

if ((padding === 'pkcs#5' || padding === 'pkcs#7') && cryptFlag === DECRYPT) {
const paddingCount = outArray[outArray.length - 1]
outArray.splice(outArray.length - paddingCount, paddingCount)
const len = outArray.length
const paddingCount = outArray[len - 1]
for (let i = 1; i <= paddingCount; i++) {
if (outArray[len - i] !== paddingCount) throw new Error('padding is invalid')
}
outArray.splice(len - paddingCount, paddingCount)
}

@@ -333,0 +337,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc