summaryrefslogtreecommitdiff
path: root/tests/exslt/crypto/crypt.1.xsl
diff options
context:
space:
mode:
authorMyoungJune Park <mj2004.park@samsung.com>2016-06-28 19:02:02 -0700
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2016-06-28 19:02:02 -0700
commit9f437f121e0a3f95f2f73a2fb94129df473ce6c7 (patch)
treebe58f256e24304bccfdc6329d96567dcd6b8d877 /tests/exslt/crypto/crypt.1.xsl
parent925059ca6aa063c9640e82ad4f40be2e38959aa8 (diff)
parent0f3d43b0708f1e7a1a1826b2e4d310c86f086078 (diff)
downloadlibxslt-9f437f121e0a3f95f2f73a2fb94129df473ce6c7.tar.gz
libxslt-9f437f121e0a3f95f2f73a2fb94129df473ce6c7.tar.bz2
libxslt-9f437f121e0a3f95f2f73a2fb94129df473ce6c7.zip
Merge "Rebase for libxslt-1.1.29" into tizen_base
Diffstat (limited to 'tests/exslt/crypto/crypt.1.xsl')
-rw-r--r--tests/exslt/crypto/crypt.1.xsl32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/exslt/crypto/crypt.1.xsl b/tests/exslt/crypto/crypt.1.xsl
new file mode 100644
index 00000000..f986943a
--- /dev/null
+++ b/tests/exslt/crypto/crypt.1.xsl
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:crypto="http://exslt.org/crypto"
+ exclude-result-prefixes="crypto"
+ version="1.0">
+
+ <xsl:output indent="yes"/>
+
+ <xsl:template match="test-cases">
+ <test-results>
+ <xsl:apply-templates select="test-case"/>
+ </test-results>
+ </xsl:template>
+
+ <xsl:template match="test-case">
+ <xsl:variable name="ciphertext" select="crypto:rc4_encrypt(key, data)"/>
+ <xsl:variable name="plaintext" select="crypto:rc4_decrypt(key, $ciphertext)"/>
+ <test-result>
+ <ciphertext>
+ <xsl:value-of select="$ciphertext"/>
+ </ciphertext>
+ <match>
+ <xsl:choose>
+ <xsl:when test="$plaintext = data">OK</xsl:when>
+ <xsl:otherwise>FAIL</xsl:otherwise>
+ </xsl:choose>
+ </match>
+ </test-result>
+ </xsl:template>
+
+</xsl:stylesheet>