You've already gotten some good advice.
The first issue is whether there was any other trauma associated with the original injury. Other fractures or internal injuries (pneumothorax from rib puncture of the lung, for example) would set very different time frames on recovery and return to diving.
Assuming there was no other injury, the second issue is how the rib fracture was diagnosed. If it was a displaced fracture that was visible on chest x-ray, it probably deserves the same respect as any other fracture -- which means at least six weeks to heal. If it was a painful rib, but no fracture was seen on x-ray, it may simply have been a crack or even a subluxation, and you may be completely good to go when pain free.
It's important to understand the risks of diving too soon with a rib fracture, because the big one is lung puncture from sharp rib fragments, and if that occurs underwater, it could result in a lethal complication. This is most likely with displaced rib fractures from significant trauma -- big falls, auto accidents, etc. The fact that you are pain free with normal motion and with breathing and coughing suggests that the rib ends are knitted enough to be stable, so this complication is unlikely. But it is still a life-threatening risk, so if you decide to dive before the time suggested, you need to understand the risks you are therefore willing to undertake.
The physician who diagnosed and treated you at the time of your original injury will be much more able to give you good guidance than I am.