-
Notifications
You must be signed in to change notification settings - Fork 68
/
Rakefile
27 lines (21 loc) · 652 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.test_files = FileList["test/**/*_test.rb"]
t.warning = false # for carrierwave and shrine
end
task default: :test
task :benchmark do
require "benchmark/ips"
require "lockbox"
require "rbnacl"
key = Lockbox.generate_key
value = "secret" * 5
aes_gcm = Lockbox.new(key: key, algorithm: "aes-gcm")
xsalsa20 = Lockbox.new(key: key, algorithm: "xsalsa20")
Benchmark.ips do |x|
x.report("aes-gcm") { aes_gcm.decrypt(aes_gcm.encrypt(value)) }
x.report("xsalsa20") { xsalsa20.decrypt(xsalsa20.encrypt(value)) }
end
end