MCPcopy Create free account
hub / github.com/crewjam/saml / appendPadding

Function appendPadding

xmlenc/cbc.go:168–173  ·  view source on GitHub ↗
(buf []byte, blockSize int)

Source from the content-addressed store, hash-verified

166}
167
168func appendPadding(buf []byte, blockSize int) []byte {
169 paddingBytes := blockSize - (len(buf) % blockSize)
170 padding := make([]byte, paddingBytes)
171 padding[len(padding)-1] = byte(paddingBytes)
172 return append(buf, padding...)
173}
174
175func stripPadding(buf []byte) ([]byte, error) {
176 if len(buf) < 1 {

Callers 2

EncryptMethod · 0.85
EncryptMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected