MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / RemovePKCSPadding

Function RemovePKCSPadding

crypto/cipher.go:42–50  ·  view source on GitHub ↗

RemovePKCSPadding removes padding from data that was added with addPKCSPadding.

(src []byte)

Source from the content-addressed store, hash-verified

40
41// RemovePKCSPadding removes padding from data that was added with addPKCSPadding.
42func RemovePKCSPadding(src []byte) ([]byte, error) {
43 length := len(src)
44 padLength := int(src[length-1])
45 if padLength > aes.BlockSize || length < aes.BlockSize {
46 return nil, errInvalidPadding
47 }
48
49 return src[:length-padLength], nil
50}
51
52// EncryptAndSign (inputPublicKey, inData) MAIN PROCEDURE:
53// 1. newPrivateKey, newPubKey := genSecp256k1Keypair()

Callers 5

DecryptFunction · 0.92
DecryptWithPasswordFunction · 0.92
GetBPFromDNSSeedMethod · 0.92
TestCipheringErrorsFunction · 0.85
TestAddPKCSPaddingFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestCipheringErrorsFunction · 0.68
TestAddPKCSPaddingFunction · 0.68