summaryrefslogtreecommitdiff
path: root/security/nss/cmd/bltest
diff options
context:
space:
mode:
Diffstat (limited to 'security/nss/cmd/bltest')
-rw-r--r--security/nss/cmd/bltest/blapitest.c138
-rw-r--r--security/nss/cmd/bltest/tests/sha256/ciphertext01
-rw-r--r--security/nss/cmd/bltest/tests/sha256/ciphertext11
-rw-r--r--security/nss/cmd/bltest/tests/sha256/numtests1
-rw-r--r--security/nss/cmd/bltest/tests/sha256/plaintext01
-rw-r--r--security/nss/cmd/bltest/tests/sha256/plaintext11
-rw-r--r--security/nss/cmd/bltest/tests/sha384/ciphertext01
-rw-r--r--security/nss/cmd/bltest/tests/sha384/ciphertext11
-rw-r--r--security/nss/cmd/bltest/tests/sha384/numtests1
-rw-r--r--security/nss/cmd/bltest/tests/sha384/plaintext01
-rw-r--r--security/nss/cmd/bltest/tests/sha384/plaintext11
-rw-r--r--security/nss/cmd/bltest/tests/sha512/ciphertext02
-rw-r--r--security/nss/cmd/bltest/tests/sha512/ciphertext12
-rw-r--r--security/nss/cmd/bltest/tests/sha512/numtests1
-rw-r--r--security/nss/cmd/bltest/tests/sha512/plaintext01
-rw-r--r--security/nss/cmd/bltest/tests/sha512/plaintext11
16 files changed, 0 insertions, 155 deletions
diff --git a/security/nss/cmd/bltest/blapitest.c b/security/nss/cmd/bltest/blapitest.c
index b3000b257..dfb511986 100644
--- a/security/nss/cmd/bltest/blapitest.c
+++ b/security/nss/cmd/bltest/blapitest.c
@@ -1256,123 +1256,6 @@ finish:
}
SECStatus
-SHA256_restart(unsigned char *dest, const unsigned char *src, uint32 src_length)
-{
- SECStatus rv = SECSuccess;
- SHA256Context *cx, *cx_cpy;
- unsigned char *cxbytes;
- unsigned int len;
- unsigned int i, quarter;
- cx = SHA256_NewContext();
- SHA256_Begin(cx);
- /* divide message by 4, restarting 3 times */
- quarter = (src_length + 3)/ 4;
- for (i=0; i < 4 && src_length > 0; i++) {
- SHA256_Update(cx, src + i*quarter, PR_MIN(quarter, src_length));
- len = SHA256_FlattenSize(cx);
- cxbytes = PORT_Alloc(len);
- SHA256_Flatten(cx, cxbytes);
- cx_cpy = SHA256_Resurrect(cxbytes, NULL);
- if (!cx_cpy) {
- PR_fprintf(PR_STDERR, "%s: SHA256_Resurrect failed!\n", progName);
- rv = SECFailure;
- goto finish;
- }
- rv = PORT_Memcmp(cx, cx_cpy, len);
- if (rv) {
- SHA256_DestroyContext(cx_cpy, PR_TRUE);
- PR_fprintf(PR_STDERR, "%s: SHA256_restart failed!\n", progName);
- goto finish;
- }
- SHA256_DestroyContext(cx_cpy, PR_TRUE);
- PORT_Free(cxbytes);
- src_length -= quarter;
- }
- SHA256_End(cx, dest, &len, MD5_LENGTH);
-finish:
- SHA256_DestroyContext(cx, PR_TRUE);
- return rv;
-}
-
-SECStatus
-SHA384_restart(unsigned char *dest, const unsigned char *src, uint32 src_length)
-{
- SECStatus rv = SECSuccess;
- SHA384Context *cx, *cx_cpy;
- unsigned char *cxbytes;
- unsigned int len;
- unsigned int i, quarter;
- cx = SHA384_NewContext();
- SHA384_Begin(cx);
- /* divide message by 4, restarting 3 times */
- quarter = (src_length + 3)/ 4;
- for (i=0; i < 4 && src_length > 0; i++) {
- SHA384_Update(cx, src + i*quarter, PR_MIN(quarter, src_length));
- len = SHA384_FlattenSize(cx);
- cxbytes = PORT_Alloc(len);
- SHA384_Flatten(cx, cxbytes);
- cx_cpy = SHA384_Resurrect(cxbytes, NULL);
- if (!cx_cpy) {
- PR_fprintf(PR_STDERR, "%s: SHA384_Resurrect failed!\n", progName);
- rv = SECFailure;
- goto finish;
- }
- rv = PORT_Memcmp(cx, cx_cpy, len);
- if (rv) {
- SHA384_DestroyContext(cx_cpy, PR_TRUE);
- PR_fprintf(PR_STDERR, "%s: SHA384_restart failed!\n", progName);
- goto finish;
- }
- SHA384_DestroyContext(cx_cpy, PR_TRUE);
- PORT_Free(cxbytes);
- src_length -= quarter;
- }
- SHA384_End(cx, dest, &len, MD5_LENGTH);
-finish:
- SHA384_DestroyContext(cx, PR_TRUE);
- return rv;
-}
-
-SECStatus
-SHA512_restart(unsigned char *dest, const unsigned char *src, uint32 src_length)
-{
- SECStatus rv = SECSuccess;
- SHA512Context *cx, *cx_cpy;
- unsigned char *cxbytes;
- unsigned int len;
- unsigned int i, quarter;
- cx = SHA512_NewContext();
- SHA512_Begin(cx);
- /* divide message by 4, restarting 3 times */
- quarter = (src_length + 3)/ 4;
- for (i=0; i < 4 && src_length > 0; i++) {
- SHA512_Update(cx, src + i*quarter, PR_MIN(quarter, src_length));
- len = SHA512_FlattenSize(cx);
- cxbytes = PORT_Alloc(len);
- SHA512_Flatten(cx, cxbytes);
- cx_cpy = SHA512_Resurrect(cxbytes, NULL);
- if (!cx_cpy) {
- PR_fprintf(PR_STDERR, "%s: SHA512_Resurrect failed!\n", progName);
- rv = SECFailure;
- goto finish;
- }
- rv = PORT_Memcmp(cx, cx_cpy, len);
- if (rv) {
- SHA512_DestroyContext(cx_cpy, PR_TRUE);
- PR_fprintf(PR_STDERR, "%s: SHA512_restart failed!\n", progName);
- goto finish;
- }
- SHA512_DestroyContext(cx_cpy, PR_TRUE);
- PORT_Free(cxbytes);
- src_length -= quarter;
- }
- SHA512_End(cx, dest, &len, MD5_LENGTH);
-finish:
- SHA512_DestroyContext(cx, PR_TRUE);
- return rv;
-}
-
-SECStatus
pubkeyInitKey(bltestCipherInfo *cipherInfo, PRFileDesc *file,
int keysize, int exponent)
{
@@ -1488,29 +1371,8 @@ cipherInit(bltestCipherInfo *cipherInfo, PRBool encrypt)
return SECSuccess;
break;
case bltestSHA256:
- restart = cipherInfo->params.hash.restart;
- SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,
- SHA256_LENGTH);
- cipherInfo->cipher.hashCipher = (restart) ? SHA256_restart
- : SHA256_HashBuf;
- return SECSuccess;
- break;
case bltestSHA384:
- restart = cipherInfo->params.hash.restart;
- SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,
- SHA384_LENGTH);
- cipherInfo->cipher.hashCipher = (restart) ? SHA384_restart
- : SHA384_HashBuf;
- return SECSuccess;
- break;
case bltestSHA512:
- restart = cipherInfo->params.hash.restart;
- SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,
- SHA512_LENGTH);
- cipherInfo->cipher.hashCipher = (restart) ? SHA512_restart
- : SHA512_HashBuf;
- return SECSuccess;
- break;
default:
return SECFailure;
}
diff --git a/security/nss/cmd/bltest/tests/sha256/ciphertext0 b/security/nss/cmd/bltest/tests/sha256/ciphertext0
deleted file mode 100644
index 07e2ff14f..000000000
--- a/security/nss/cmd/bltest/tests/sha256/ciphertext0
+++ /dev/null
@@ -1 +0,0 @@
-ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=
diff --git a/security/nss/cmd/bltest/tests/sha256/ciphertext1 b/security/nss/cmd/bltest/tests/sha256/ciphertext1
deleted file mode 100644
index 2ab6e1da5..000000000
--- a/security/nss/cmd/bltest/tests/sha256/ciphertext1
+++ /dev/null
@@ -1 +0,0 @@
-JI1qYdIGOLjlwCaTDD5gOaM85Flk/yFn9uzt1BnbBsE=
diff --git a/security/nss/cmd/bltest/tests/sha256/numtests b/security/nss/cmd/bltest/tests/sha256/numtests
deleted file mode 100644
index 0cfbf0888..000000000
--- a/security/nss/cmd/bltest/tests/sha256/numtests
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/security/nss/cmd/bltest/tests/sha256/plaintext0 b/security/nss/cmd/bltest/tests/sha256/plaintext0
deleted file mode 100644
index 8baef1b4a..000000000
--- a/security/nss/cmd/bltest/tests/sha256/plaintext0
+++ /dev/null
@@ -1 +0,0 @@
-abc
diff --git a/security/nss/cmd/bltest/tests/sha256/plaintext1 b/security/nss/cmd/bltest/tests/sha256/plaintext1
deleted file mode 100644
index afb5dce5d..000000000
--- a/security/nss/cmd/bltest/tests/sha256/plaintext1
+++ /dev/null
@@ -1 +0,0 @@
-abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq
diff --git a/security/nss/cmd/bltest/tests/sha384/ciphertext0 b/security/nss/cmd/bltest/tests/sha384/ciphertext0
deleted file mode 100644
index c94f91e22..000000000
--- a/security/nss/cmd/bltest/tests/sha384/ciphertext0
+++ /dev/null
@@ -1 +0,0 @@
-ywB1P0WjXou1oD1pmsZQBycsMqsO3tFjGotgWkP/W+2AhgcroefMI1i67KE0yCWn
diff --git a/security/nss/cmd/bltest/tests/sha384/ciphertext1 b/security/nss/cmd/bltest/tests/sha384/ciphertext1
deleted file mode 100644
index 833f06d84..000000000
--- a/security/nss/cmd/bltest/tests/sha384/ciphertext1
+++ /dev/null
@@ -1 +0,0 @@
-CTMMM/cRR+g9GS/Hgs0bR1MRGxc7OwXSL6CAhuOw9xL8x8caVX4tuWbD6fqRdGA5
diff --git a/security/nss/cmd/bltest/tests/sha384/numtests b/security/nss/cmd/bltest/tests/sha384/numtests
deleted file mode 100644
index 0cfbf0888..000000000
--- a/security/nss/cmd/bltest/tests/sha384/numtests
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/security/nss/cmd/bltest/tests/sha384/plaintext0 b/security/nss/cmd/bltest/tests/sha384/plaintext0
deleted file mode 100644
index 8baef1b4a..000000000
--- a/security/nss/cmd/bltest/tests/sha384/plaintext0
+++ /dev/null
@@ -1 +0,0 @@
-abc
diff --git a/security/nss/cmd/bltest/tests/sha384/plaintext1 b/security/nss/cmd/bltest/tests/sha384/plaintext1
deleted file mode 100644
index 94fcc2b29..000000000
--- a/security/nss/cmd/bltest/tests/sha384/plaintext1
+++ /dev/null
@@ -1 +0,0 @@
-abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu
diff --git a/security/nss/cmd/bltest/tests/sha512/ciphertext0 b/security/nss/cmd/bltest/tests/sha512/ciphertext0
deleted file mode 100644
index 8b626e237..000000000
--- a/security/nss/cmd/bltest/tests/sha512/ciphertext0
+++ /dev/null
@@ -1,2 +0,0 @@
-3a81oZNherrMQXNJriBBMRLm+k6JqX6iCp7u5ktV05ohkpkqJ0/BqDa6PCOj/uu9
-RU1EI2Q86A4qmslPpUyknw==
diff --git a/security/nss/cmd/bltest/tests/sha512/ciphertext1 b/security/nss/cmd/bltest/tests/sha512/ciphertext1
deleted file mode 100644
index c02d1752d..000000000
--- a/security/nss/cmd/bltest/tests/sha512/ciphertext1
+++ /dev/null
@@ -1,2 +0,0 @@
-jpWbddrjE9qM9PcoFPwUP493ecbrn3+hcpmurbaIkBhQHSieSQD35DMbmd7EtUM6
-x9Mp7rbdJlReluVbh0vpCQ==
diff --git a/security/nss/cmd/bltest/tests/sha512/numtests b/security/nss/cmd/bltest/tests/sha512/numtests
deleted file mode 100644
index 0cfbf0888..000000000
--- a/security/nss/cmd/bltest/tests/sha512/numtests
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/security/nss/cmd/bltest/tests/sha512/plaintext0 b/security/nss/cmd/bltest/tests/sha512/plaintext0
deleted file mode 100644
index 8baef1b4a..000000000
--- a/security/nss/cmd/bltest/tests/sha512/plaintext0
+++ /dev/null
@@ -1 +0,0 @@
-abc
diff --git a/security/nss/cmd/bltest/tests/sha512/plaintext1 b/security/nss/cmd/bltest/tests/sha512/plaintext1
deleted file mode 100644
index 94fcc2b29..000000000
--- a/security/nss/cmd/bltest/tests/sha512/plaintext1
+++ /dev/null
@@ -1 +0,0 @@
-abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu