MCPcopy Index your code
hub / github.com/apache/devlake / PKCS7UnPadding

Function PKCS7UnPadding

backend/core/plugin/plugin_utils.go:89–99  ·  view source on GitHub ↗

PKCS7UnPadding PKCS7 unPadding

(origData []byte)

Source from the content-addressed store, hash-verified

87
88// PKCS7UnPadding PKCS7 unPadding
89func PKCS7UnPadding(origData []byte) []byte {
90 length := len(origData)
91 if length == 0 {
92 return nil
93 }
94 unpadding := int(origData[length-1])
95 if unpadding >= length {
96 return nil
97 }
98 return origData[:(length - unpadding)]
99}
100
101// AesEncrypt AES encryption, CBC
102func AesEncrypt(origData, key []byte) ([]byte, errors.Error) {

Callers 1

AesDecryptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected