~ubuntu-branches/ubuntu/wily/afnix/wily

« back to all changes in this revision

Viewing changes to src/mod/sec/tst/SEC0005.als

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2011-03-16 21:31:18 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110316213118-gk4k3ez3e5d2huna
Tags: 2.0.0-1
* QA upload.
* New upstream release
* Debian source format is 3.0 (quilt)
* Fix debhelper-but-no-misc-depends
* Fix ancient-standards-version
* Fix package-contains-linda-override
* debhelper compatibility is 7
* Fix dh-clean-k-is-deprecated

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ---------------------------------------------------------------------------
 
2
# - SEC0005.als                                                             -
 
3
# - afnix:sec module test unit                                              -
 
4
# ---------------------------------------------------------------------------
 
5
# - This program is free software;  you can redistribute it  and/or  modify -
 
6
# - it provided that this copyright notice is kept intact.                  -
 
7
# -                                                                         -
 
8
# - This program  is  distributed in  the hope  that it will be useful, but -
 
9
# - without  any  warranty;  without  even   the   implied    warranty   of -
 
10
# - merchantability or fitness for a particular purpose.  In no event shall -
 
11
# - the copyright holder be liable for any  direct, indirect, incidental or -
 
12
# - special damages arising in any way out of the use of this software.     -
 
13
# ---------------------------------------------------------------------------
 
14
# - copyright (c) 1999-2011 amaury darsch                                   -
 
15
# ---------------------------------------------------------------------------
 
16
 
 
17
# @info   kdf test unit
 
18
# @author amaury darsch
 
19
 
 
20
# get the module
 
21
interp:library "afnix-sec"
 
22
 
 
23
# ISO/SEC 18033-2 KDF1 test vector
 
24
# SHA-1 KEYLEN=128
 
25
trans ostr (+
 
26
  "032E45326FA859A72EC235ACFF929B15D1372E30B207255F0611B8F785D76437"
 
27
  "4152E0AC009E509E7BA30CD2F1778E113B64E135CF4E2292C75EFE5288EDFDA4")
 
28
 
 
29
trans dkey-1 (+
 
30
  "5F8DE105B5E96B2E490DDECBD147DD1DEF7E3B8E0E6A26EB7B956CCB8B3BDC1C"
 
31
  "A975BC57C3989E8FBAD31A224655D800C46954840FF32052CDF0D640562BDFAD")
 
32
trans dkey-2 (+
 
33
  "FA263CFCCF3C52B29F2AF4A1869959BC77F854CF15BD7A25192985A842DBFF8E"
 
34
  "13EFEE5B7E7E55BBE4D389647C686A9A9AB3FB889B2D7767D3837EEA4E0A2F04")
 
35
trans dkey (+ dkey-1 dkey-2)
 
36
 
 
37
trans  md (afnix:sec:Sha1)
 
38
trans  kd (afnix:sec:Kdf1 md 128)
 
39
assert dkey (kd:derive ostr)
 
40
 
 
41
# ISO/SEC 18033-2 KDF1 test vector
 
42
# SHA-256 RLEN=20 KEYLEN=128
 
43
 
 
44
trans dkey-1 (+
 
45
  "09E2DECF2A6E1666C2F6071FF4298305E2643FD510A2403DB42A8743CB989DE8"
 
46
  "6E668D168CBE604611AC179F819A3D18412E9EB45668F2923C087C12FEE0C5A0")
 
47
trans dkey-2 (+
 
48
  "D2A8AA70185401FBBD99379EC76C663E875A60B4AACB1319FA11C3365A8B79A4"
 
49
  "4669F26FB555C80391847B05ECA1CB5CF8C2D531448D33FBACA19F6410EE1FCB")
 
50
trans dkey (+ dkey-1 dkey-2)
 
51
 
 
52
trans  md (afnix:sec:Sha256 20)
 
53
trans  kd (afnix:sec:Kdf1 md 128)
 
54
assert dkey (kd:derive ostr)
 
55
 
 
56
# ISO/SEC 18033-2 KDF2 test vector
 
57
# SHA-1 KEYLEN=128
 
58
 
 
59
trans dkey-1 (+
 
60
  "0E6A26EB7B956CCB8B3BDC1CA975BC57C3989E8FBAD31A224655D800C4695484"
 
61
  "0FF32052CDF0D640562BDFADFA263CFCCF3C52B29F2AF4A1869959BC77F854CF")
 
62
trans dkey-2 (+
 
63
  "15BD7A25192985A842DBFF8E13EFEE5B7E7E55BBE4D389647C686A9A9AB3FB88"
 
64
  "9B2D7767D3837EEA4E0A2F04B53CA8F50FB31225C1BE2D0126C8C7A4753B0807")
 
65
trans dkey (+ dkey-1 dkey-2)
 
66
 
 
67
trans  md (afnix:sec:Sha1)
 
68
trans  kd (afnix:sec:Kdf2 md 128)
 
69
assert dkey (kd:derive ostr)
 
70
 
 
71
# ISO/SEC 18033-2 KDF2 test vector
 
72
# SHA-256 RLEN=20 KEYLEN=128
 
73
 
 
74
trans dkey-1 (+
 
75
  "10A2403DB42A8743CB989DE86E668D168CBE604611AC179F819A3D18412E9EB4"
 
76
  "5668F2923C087C12FEE0C5A0D2A8AA70185401FBBD99379EC76C663E875A60B4")
 
77
trans dkey-2 (+
 
78
  "AACB1319FA11C3365A8B79A44669F26FB555C80391847B05ECA1CB5CF8C2D531"
 
79
  "448D33FBACA19F6410EE1FCB260892670E0814C348664F6A7248AAF998A3ACC6")
 
80
trans dkey (+ dkey-1 dkey-2)
 
81
 
 
82
trans  md (afnix:sec:Sha256 20)
 
83
trans  kd (afnix:sec:Kdf2 md 128)
 
84
assert dkey (kd:derive ostr)