Re: Sample code for AES-128-SIV

Viktor Dukhovni <[email protected]>
Newsgroups gmane.comp.encryption.openssl.user
Message-ID <[email protected]>
On Wed, Mar 12, 2025 at 07:59:16PM -0700, Hal Murray wrote:

> I'm looking for some sample code that uses AES-128-SIV
> 
> I've found ./test/recipes/30-test_evp_data/evpciph_aes_siv.txt
> which has a collection of test vectors.

    $ git grep -nC1 evpciph_aes_siv -- test
    test/recipes/30-test_evp.t-171-push @defltfiles, qw(evpciph_aes_gcm_siv.txt) unless $no_siv;
    test/recipes/30-test_evp.t:172:push @defltfiles, qw(evpciph_aes_siv.txt) unless $no_siv;
    test/recipes/30-test_evp.t-173-push @defltfiles, qw(evpkdf_argon2.txt) unless $no_argon2;

> How does that file get into one of the 30-test_evp tests?
> I was expecting something like 30-test_evp_data.t to
> show up in the make test run, but I don't see it.

    $ git grep -nC3 defltfiles -- test | tail -n7
    test/recipes/30-test_evp.t-189-}
    test/recipes/30-test_evp.t-190-
    test/recipes/30-test_evp.t-191-my $conf = srctop_file("test", $defaultcnf);
    test/recipes/30-test_evp.t:192:foreach my $f ( @defltfiles ) {
    test/recipes/30-test_evp.t-193-    ok(run(test(["evp_test",
    test/recipes/30-test_evp.t-194-                 "-config", $conf,
    test/recipes/30-test_evp.t-195-                 data_file("$f")])),

Therefore, given also:

    test/recipes/30-test_evp.t:39:my $defaultcnf = $no_legacy ? 'default.cnf' : 'default-and-legacy.cnf';

The test is:

    $ ./util/wrap.pl ./test/evp_test -config test/default.cnf \
        test/recipes/30-test_evp_data/evpciph_aes_siv.txt 2>&1 |
        grep -E 'ok |RUNNING' | uniq -c
          6     # RUNNING TEST FOR CIPHER AES-128-SIV
          1     # RUNNING TEST FOR CIPHER AES-192-SIV
          1     # RUNNING TEST FOR CIPHER AES-256-SIV
        148     # RUNNING TEST FOR CIPHER AES-128-SIV
        147     # RUNNING TEST FOR CIPHER AES-192-SIV
        147     # RUNNING TEST FOR CIPHER AES-256-SIV
          1     ok 1 - iteration 1
          1 ok 1 - run_file_tests

-- 
    Viktor.

-- 
You received this message because you are subscribed to the Google Groups "openssl-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openssl-users+unsubscribe-MCmKBN63+Bmbup2nOX2J7Q@public.gmane.org
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/Z9JRDzqklsAeCv23%40chardros.imrryr.org.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.