Cryptopp 5.6.0 rev 477 ported to psp

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Cryptopp 5.6.0 rev 477 ported to psp

Post by coolkehon »

used jojojaris makefile and modified to port cryptopp
I posted it in another thread but here is the official

Code: Select all

#makfile originally by jojojaris
#but modified to port cryptopp 5.6.0 rev 447 by coolkehon
#hm makefile looks strangly familiar I've used this somewhere before

PREFIX=$(shell psp-config –psp-prefix)

PREFIX=/usr/local/pspdev/psp



TARGET_LIB = libcryptopp.a

SRCS = $(wildcard *.cpp)

ifeq ($(SRCS),)				# workaround wildcard function bug in GNU Make 3.77

SRCS = $(shell echo *.cpp)

endif

#pre objects so that they can be removed

PRE_OBJS = $(SRCS:.cpp=.o)
#here to remove the test objects from library
TESTOBJS = bench.o bench2.o test.o validat1.o validat2.o validat3.o adhoc.o datatest.o regtest.o fipsalgt.o dlltest.o
OBJS = $(filter-out $(TESTOBJS),$(PRE_OBJS))



INCDIR =

CFLAGS = -O2 -G0 -Wall \
   -DIS_LITTLE_ENDIAN #fixed this here because the psp is Little Endian

CXXFLAGS = $(CFLAGS)

ASFLAGS = $(CFLAGS)



LIBDIR =

#LDFLAGS = -flat_namespace -undefined suppress -m

LDFLAGS =

LIBS=-lstdc++



PSPSDK=$(shell psp-config --pspsdk-path)

include $(PSPSDK)/lib/build.mak



install:

	mkdir -p $(PREFIX)/include/cryptopp

	cp *.h $(PREFIX)/include/cryptopp

	cp *.a $(PREFIX)/lib

tell:

	echo $(PREFIX)
Last edited by coolkehon on Wed Nov 18, 2009 9:49 am, edited 1 time in total.
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

Again
My name is
jojojoris
NOT
jojojaris or jojojarais etc

Code: Select all

int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

jojojoris wrote:Again
My name is
jojojoris
NOT
jojojaris or jojojarais etc
xD hilarious.

Nice port!
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

jojojoris wrote:Again
My name is
jojojoris
NOT
jojojaris or jojojarais etc
mo jo jojo ris
that is so confusing to remember especially since i always spell it wrong
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

I found a bug. I fixed it too.
When I created a hash using SHA512 it didn't work correctly. The hash didn't match on my computer and there was no reason for it. It took a while to figure out but I looked in the config.h file for cryptopp 5.5.2 and realized that IS_LITTLE_ENDIAN was not defined. when compiling you need to add -DIS_LITTLE_ENDIAN to your CFLAGS.

jojojaris could you add that to your makefile since 5.5.2 was your version.

Also the Cryptopp::Socket class doesn't work

As for cryptopp 5.6.0 there is another bug. When I connect to wifi and try to use regular sockets (not the class) it will not connect to wifi. I'm not sure if it's not loading the modules or what but I used jojojaris' EasyConnect class and it failed at the connect stage.

there are most likely more things to be check in the config but the -DIS_LITTLE_ENDIAN fixed my problem and I don't know of any other's at the moment except for maybe the one about berkely sockets being available
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

seems i lost my crypto++ files.

I don't know what's wrong with my EasyConnect class. It works for me and i never had any problems. (i guess you are not using PSP_HEAP_SIZE_MAX() becous that won't let other modules load)

And you still spell my nickname WRONG!!!

jojojoris and not jojojaris

Code: Select all

int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

hm sorry about the nick though i had it this time :P

if you want i can email you a copy of your cryptopp 5.5.2.
Also it's the cryptopp 5.6.0 that i ported that doesn't work with EasyConnect not the EasyConnect not working. I don't know why but it just doesn't work. It worked with 5.5.2 but not cryptopp 5.6.0. Probably something with the config.h in cryptopp

and I have PSP_HEAP_SIZE_MAX(); defined

bye jojojoris
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

well...don't use
PSP_HEAP_SIZE_MAX();
use
PSP_HEAP_SIZE_KB(-2048); //Leave 2MB for other modules

But you spelled my nickname right :D

Code: Select all

int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
Post Reply