~mdw
/
catacomb-perl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Key mangling, and elliptic curves.
[catacomb-perl]
/
algorithms.xs
diff --git
a/algorithms.xs
b/algorithms.xs
index
95e77b1
..
6001d9d
100644
(file)
--- a/
algorithms.xs
+++ b/
algorithms.xs
@@
-1,6
+1,6
@@
# ---?---
#
# ---?---
#
-# $Id
: algorithms.xs,v 1.2 2004/04/08 01:36:21 mdw Exp
$
+# $Id$
#
# Interface to crypto algorithms
#
#
# Interface to crypto algorithms
#
@@
-33,16
+33,8
@@
gccipher *
find(me, name)
SV *me
char *name
find(me, name)
SV *me
char *name
- PREINIT:
- const gccipher **cc;
- CODE:
- RETVAL = 0;
- for (cc = ciphertab; *cc; cc++) {
- if (strcmp((*cc)->name, name) == 0) {
- RETVAL = (gccipher *)*cc;
- break;
- }
- }
+ CODE:
+ RETVAL = (gccipher *)gcipher_byname(name);
OUTPUT:
RETVAL
OUTPUT:
RETVAL
@@
-50,11
+42,11
@@
SV *
list(me)
SV *me
PREINIT:
list(me)
SV *me
PREINIT:
- const gccipher **cc;
+ const gccipher *
const
*cc;
SV *sv;
PPCODE:
SV *sv;
PPCODE:
- for (cc = ciphertab; *cc; cc++)
- XPUSHs(RET(*cc, "Catacomb::CipherClass"));
+ for (cc =
g
ciphertab; *cc; cc++)
+ XPUSHs(RET(
(gccipher *)
*cc, "Catacomb::CipherClass"));
keysize *
keysz(cc)
keysize *
keysz(cc)
@@
-175,16
+167,8
@@
gchash *
find(me, name)
SV *me
char *name
find(me, name)
SV *me
char *name
- PREINIT:
- const gchash **hc;
- CODE:
- RETVAL = 0;
- for (hc = hashtab; *hc; hc++) {
- if (strcmp((*hc)->name, name) == 0) {
- RETVAL = (gchash *)*hc;
- break;
- }
- }
+ CODE:
+ RETVAL = (gchash *)ghash_byname(name);
OUTPUT:
RETVAL
OUTPUT:
RETVAL
@@
-192,11
+176,11
@@
SV *
list(me)
SV *me
PREINIT:
list(me)
SV *me
PREINIT:
- const gchash **hc;
+ const gchash *
const
*hc;
SV *sv;
PPCODE:
SV *sv;
PPCODE:
- for (hc = hashtab; *hc; hc++)
- XPUSHs(RET(*hc, "Catacomb::HashClass"));
+ for (hc =
g
hashtab; *hc; hc++)
+ XPUSHs(RET(
(gchash *)
*hc, "Catacomb::HashClass"));
size_t
hashsz(hc)
size_t
hashsz(hc)
@@
-276,16
+260,8
@@
gcMAC *
find(me, name)
SV *me
char *name
find(me, name)
SV *me
char *name
- PREINIT:
- const gcMAC **mc;
- CODE:
- RETVAL = 0;
- for (mc = mactab; *mc; mc++) {
- if (strcmp((*mc)->name, name) == 0) {
- RETVAL = (gcMAC *)*mc;
- break;
- }
- }
+ CODE:
+ RETVAL = (gcMAC *)gmac_byname(name);
OUTPUT:
RETVAL
OUTPUT:
RETVAL
@@
-293,11
+269,11
@@
SV *
list(me)
SV *me
PREINIT:
list(me)
SV *me
PREINIT:
- const gcMAC **mc;
+ const gcMAC *
const
*mc;
SV *sv;
PPCODE:
SV *sv;
PPCODE:
- for (mc = mactab; *mc; mc++)
- XPUSHs(RET(*mc, "Catacomb::MACClass"));
+ for (mc =
g
mactab; *mc; mc++)
+ XPUSHs(RET(
(gcMAC *)
*mc, "Catacomb::MACClass"));
size_t
hashsz(mc)
size_t
hashsz(mc)