Sha256: d790dce39189abbf6a7268939da1454b275d80559cca69edf812da4d4ddcee67

Contents?: true

Size: 795 Bytes

Versions: 100

Compression:

Stored size: 795 Bytes

Contents

# -*- encoding: utf-8 -*-

require_relative 'common'
require 'hexapdf/encryption/ruby_aes'
require 'hexapdf/encryption/fast_aes'

describe HexaPDF::Encryption::RubyAES do
  include AESEncryptionTests

  before do
    @algorithm_class = HexaPDF::Encryption::RubyAES
  end

  it "is compatible with the OpenSSL based FastAES implementation" do
    sample = Random.new.bytes(1024)
    key = Random.new.bytes(16)
    iv = Random.new.bytes(16)
    assert_equal(sample, HexaPDF::Encryption::FastAES.new(key, iv, :encrypt).
                 process(HexaPDF::Encryption::RubyAES.new(key, iv, :decrypt).process(sample)))
    assert_equal(sample, HexaPDF::Encryption::FastAES.new(key, iv, :decrypt).
                 process(HexaPDF::Encryption::RubyAES.new(key, iv, :encrypt).process(sample)))
  end
end

Version data entries

100 entries across 100 versions & 1 rubygems

Version Path
hexapdf-1.2.0 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-1.1.1 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-1.1.0 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-1.0.3 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-1.0.2 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-1.0.1 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-1.0.0 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.47.0 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.46.0 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.45.0 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.44.0 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.41.0 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.40.0 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.39.1 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.39.0 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.38.0 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.37.2 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.37.1 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.37.0 test/hexapdf/encryption/test_ruby_aes.rb
hexapdf-0.36.0 test/hexapdf/encryption/test_ruby_aes.rb