Welcome to the CHICKEN Scheme pasting service

rsa-encrypt-128 added by mario-goulart on Wed Oct 19 20:30:59 2011

(define rsa-encrypt-128
  (let ((%rsa-encrypt
         (foreign-lambda int "rsa_encrypt" c-string c-string int scheme-pointer)))
    (lambda (msg privkey)
      (let* ((out (make-string 128))
             (ret (%rsa-encrypt msg privkey (string-length msg) out)))
        (if (>= ret 0)
            out
            (error 'rsa-encript
                   (case ret
                     ((-1) "BIO creation error (BIO_new_mem_buf)")
                     ((-2) "Error reading RSA private key from BIO")
                     ((-3) "Encrypt error (RSA_private_encrypt)")
                     (else "Unknown error")
                     )))))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which egg implements a Scheme to JavaScript compiler?
Visually impaired? Let me spell it for you (wav file) download WAV