test/micro/org/openjdk/bench/javax/crypto/small/CipherBench.java
author ihse
Tue, 22 Oct 2019 09:51:52 +0200
branchihse-cflags-rewrite-branch
changeset 58736 e878a0b7cff0
parent 53124 a22e41395bfa
permissions -rw-r--r--
Add doubunder on solaris in two places.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
53124
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
     1
/*
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
     2
 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
     4
 *
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
     7
 * published by the Free Software Foundation.
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
     8
 *
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    13
 * accompanied this code).
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    14
 *
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    18
 *
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    21
 * questions.
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    22
 */
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    23
package org.openjdk.bench.javax.crypto.small;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    24
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    25
import org.openjdk.jmh.annotations.Benchmark;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    26
import org.openjdk.jmh.annotations.Param;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    27
import org.openjdk.jmh.annotations.Setup;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    28
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    29
import javax.crypto.*;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    30
import javax.crypto.spec.*;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    31
import java.security.*;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    32
import java.security.spec.*;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    33
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    34
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    35
public abstract class CipherBench extends
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    36
    org.openjdk.bench.javax.crypto.full.CipherBench {
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    37
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    38
    public static class GCM extends
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    39
        org.openjdk.bench.javax.crypto.full.CipherBench.GCM {
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    40
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    41
        @Param({"AES"})
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    42
        private String permutation;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    43
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    44
        @Param({"GCM"})
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    45
        private String mode;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    46
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    47
        @Param({"NoPadding"})
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    48
        private String padding;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    49
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    50
        @Param({"128"})
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    51
        private int keyLength;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    52
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    53
        @Param({"" + 16 * 1024})
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    54
        private int dataSize;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    55
    }
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    56
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    57
    public static class ChaCha20Poly1305 extends
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    58
        org.openjdk.bench.javax.crypto.full.CipherBench.ChaCha20Poly1305 {
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    59
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    60
        @Param({"ChaCha20-Poly1305"})
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    61
        private String permutation;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    62
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    63
        @Param({"None"})
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    64
        private String mode;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    65
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    66
        @Param({"NoPadding"})
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    67
        private String padding;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    68
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    69
        @Param({"256"})
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    70
        private int keyLength;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    71
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    72
        @Param({"" + 16 * 1024})
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    73
        private int dataSize;
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    74
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    75
    }
a22e41395bfa 8215643: Microbenchmarks for KeyAgreement and Cipher
apetcher
parents:
diff changeset
    76
}