Lines 20-26
Link Here
|
20 |
|
20 |
|
21 |
#include <erl_driver.h> |
21 |
#include <erl_driver.h> |
22 |
#include <openssl/sha.h> |
22 |
#include <openssl/sha.h> |
23 |
#include <openssl/md2.h> |
23 |
#include <openssl/mdc2.h> |
24 |
|
24 |
|
25 |
static ErlDrvData sha_drv_start(ErlDrvPort port, char *buf) |
25 |
static ErlDrvData sha_drv_start(ErlDrvPort port, char *buf) |
26 |
{ |
26 |
{ |
Lines 37-45
Link Here
|
37 |
|
37 |
|
38 |
switch (command) { |
38 |
switch (command) { |
39 |
case 2: |
39 |
case 2: |
40 |
rlen = MD2_DIGEST_LENGTH; |
40 |
rlen = MDC2_DIGEST_LENGTH; |
41 |
b = driver_alloc_binary(rlen); |
41 |
b = driver_alloc_binary(rlen); |
42 |
if (b) MD2((unsigned char*)buf, len, (unsigned char*)b->orig_bytes); |
42 |
if (b) MDC2((unsigned char*)buf, len, (unsigned char*)b->orig_bytes); |
43 |
break; |
43 |
break; |
44 |
case 224: |
44 |
case 224: |
45 |
rlen = SHA224_DIGEST_LENGTH; |
45 |
rlen = SHA224_DIGEST_LENGTH; |