2017-02-21 00:18:57 +01:00
|
|
|
# cryptodev
|
2017-02-21 00:25:34 +01:00
|
|
|
Implementation in go of AES-CBC using cryptodev.
|
|
|
|
|
|
|
|
Installation and Usage
|
|
|
|
----------------------
|
|
|
|
This package can be installed with the go get command:
|
|
|
|
|
|
|
|
$ go get github.com/stacktic/cryptodev
|
|
|
|
|
|
|
|
To use this package, you only need to replace crypto/aes with github.com/stacktic/cryptodev/aes in your import.
|
|
|
|
|
|
|
|
Performance
|
|
|
|
-----------
|
|
|
|
AES-CBC from Go source:
|
|
|
|
|
|
|
|
$ go test -bench CBC crypto/cipher
|
|
|
|
BenchmarkAESCBCEncrypt1K-2 20000 66981 ns/op 15.29 MB/s
|
|
|
|
BenchmarkAESCBCDecrypt1K-2 20000 65053 ns/op 15.74 MB/s
|
|
|
|
PASS
|
|
|
|
ok crypto/cipher 3.993s
|
|
|
|
|
|
|
|
AES-CBC with cryptodev:
|
|
|
|
|
|
|
|
$ go test -bench CBC github.com/stacktic/cryptodev/cipher
|
|
|
|
BenchmarkAESCBCEncrypt1K-2 100000 20015 ns/op 51.16 MB/s
|
|
|
|
BenchmarkAESCBCDecrypt1K-2 100000 19832 ns/op 51.63 MB/s
|