diff options
author | rsiddharth <s@ricketyspace.net> | 2020-12-09 20:02:39 -0500 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2020-12-09 20:02:39 -0500 |
commit | 5d9cd625fef67d7a6ec751147028c12f938dfdb7 (patch) | |
tree | db624f96c211db2539da22ea126d91ac38e29af7 /lib/blocks.go | |
parent | dc6cca42113ea7e9a292175e1704061d742014dd (diff) |
lib/blocks: add Pkcs7PaddingUndo
Diffstat (limited to 'lib/blocks.go')
-rw-r--r-- | lib/blocks.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/blocks.go b/lib/blocks.go index 452766b..0645fab 100644 --- a/lib/blocks.go +++ b/lib/blocks.go @@ -96,3 +96,8 @@ func Pkcs7Padding(in []byte, k int) []byte { } return in } + +// Removes PKCS#7 Padding from input `in` +func Pkcs7PaddingUndo(in []byte) []byte { + return in[0:(len(in) - int(in[len(in)-1]))] +} |