pike.git/
lib/
modules/
Crypto.pmod/
SHA384.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
2011-12-20
2011-12-20 17:27:05 by Henrik Grubbström (Grubba) <grubba@grubba.org>
5e22061138c9230df7b80dc9be1ed559905c8d6e (
27
lines) (+
27
/-
0
)
[
Show
|
Annotate
]
Branch:
7.9
Crypto.SHA{1,256,384,512}: Added SHA384 and SHA512. Updated ASN.1 ids from RFC
4055
.
1:
+
#pike __REAL_VERSION__
+
#pragma strict_types
-
+
//! SHA384 is another hash function specified by NIST, intended as a
+
//! replacement for @[SHA1], generating larger digests. It outputs hash
+
//! values of 384 bits, or 48 octets.
+
+
#if constant(Nettle) && constant(Nettle.SHA384_Info)
+
+
// NOTE: Depends on the order of INIT invocations.
+
inherit Nettle.SHA384_Info;
+
inherit .Hash;
+
+
.HashState `()() { return Nettle.SHA384_State(); }
+
+
// id-sha384
+
// FROM RFC 4055 {
+
// joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101)
+
// csor(3) nistalgorithm(4) hashalgs(2) 2
+
// }
+
//
+
// Standards.ASN1.Types.Identifier(2,16,840,1,101,3,4,2,2)->get_der();
+
string asn1_id() { return "`\206H\1e\3\4\2\2"; }
+
+
#else
+
constant this_program_does_not_exist=1;
+
#endif
Newline at end of file added.