Skip to content

Commit

Permalink
Bump liboqs version to v0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Antrapol committed Apr 16, 2024
1 parent b677841 commit b8b3ae7
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@

*.log
*.bak
.DS_Store
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

FROM --platform=linux/x86_64 ubuntu:jammy

RUN apt-get update && apt-get install -y git curl build-essential software-properties-common gnupg2

RUN apt-add-repository -y ppa:rael-gc/rvm && apt-get update && apt-get install -y rvm
RUN /bin/bash -l -c ". /usr/share/rvm/scripts/rvm && rvm install ruby-3.2.1"

WORKDIR /opt

CMD ["/bin/bash","--login"]
Binary file added native/linux/x86_64/liboqs.so.0.10.0
Binary file not shown.
Binary file removed native/linux/x86_64/liboqs.so.0.9.0
Binary file not shown.
Binary file added native/macos/.DS_Store
Binary file not shown.
Binary file added native/macos/arm64/liboqs.0.10.0.dylib
Binary file not shown.
Binary file removed native/windows/x64/liboqs.dll
Binary file not shown.
74 changes: 37 additions & 37 deletions spec/oqs_sig_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

RSpec.describe Roqs do

it 'SIG algorithms' do
it 'runs test for all supported liboqs SIG algorithms' do
algos = Roqs::SIG.supported_signature_algo
expect(algos).not_to be_nil

Expand Down Expand Up @@ -61,52 +61,52 @@

end

it 'KAZ' do
#it 'KAZ' do

al = "KAZ-SIGN"
# al = "KAZ-SIGN"

begin
puts "Testing PQ signing algo #{al}"
# begin
# puts "Testing PQ signing algo #{al}"

sig = Roqs::SIG.new(al)
pubKey, privKey = sig.genkeypair
expect(pubKey).not_to be_nil
expect(privKey).not_to be_nil
# sig = Roqs::SIG.new(al)
# pubKey, privKey = sig.genkeypair
# expect(pubKey).not_to be_nil
# expect(privKey).not_to be_nil

puts "public key : #{pubKey}"
puts "private key : #{privKey}"
# puts "public key : #{pubKey}"
# puts "private key : #{privKey}"

loop do

#message = SecureRandom.bytes(rand(50000...80000))
message = "message for signing"
# loop do
#
# #message = SecureRandom.bytes(rand(50000...80000))
# message = "message for signing"

Benchmark.bm(8) do |b|
b.report("sign : ") { @sign = sig.sign(message, privKey) }
expect(@sign).not_to be_nil
b.report("Verify : ") { @res = sig.verify(message, @sign, pubKey) }
end
# Benchmark.bm(8) do |b|
# b.report("sign : ") { @sign = sig.sign(message, privKey) }
# expect(@sign).not_to be_nil
# b.report("Verify : ") { @res = sig.verify(message, @sign, pubKey) }
# end

expect(@res).to be true

expect(sig.verify("whatever", @sign, pubKey)).to be false
# expect(@res).to be true
#
# expect(sig.verify("whatever", @sign, pubKey)).to be false

puts "\nAlgo : #{al}"
puts "Public key size : #{pubKey.size} bytes"
#puts "Private key size : #{privKey.size} bytes"
puts "Signature input size : #{message.length} bytes"
puts "Signature output : #{@sign.length}\n"
# puts "\nAlgo : #{al}"
# puts "Public key size : #{pubKey.size} bytes"
# #puts "Private key size : #{privKey.size} bytes"
# puts "Signature input size : #{message.length} bytes"
# puts "Signature output : #{@sign.length}\n"

end
# end


sig.free(pubKey)
sig.free(privKey)
sig.cleanup
# sig.free(pubKey)
# sig.free(privKey)
# sig.cleanup

rescue Exception => ex
STDERR.puts "Algo '#{al}' getting error result"
STDERR.puts ex.message
end
end
# rescue Exception => ex
# STDERR.puts "Algo '#{al}' getting error result"
# STDERR.puts ex.message
# end
#end
end

0 comments on commit b8b3ae7

Please sign in to comment.